https://github.com/JuliaLang/julia

sort by:
Revision Author Date Message Commit Date
f2bcb6e Factor out voidpointer array type. 12 March 2021, 16:48:49 UTC
0c2fb63 RFC: Add a hook for detecting task switches. Certain libraries are configured using global or thread-local state instead of passing handles to every function. CUDA, for example, has a `cudaSetDevice` function that binds a device to the current thread for all future API calls. This is at odds with Julia's task-based concurrency, which presents an execution environment that's local to the current task (e.g., in the case of CUDA, using a different device). This PR adds a hook mechanism that can be used to detect task switches, and synchronize Julia's task-local environment with the library's global or thread-local state. 12 March 2021, 16:11:32 UTC
d234931 Allow CartesianIndices with Bool argument (#39962) Follow up to the problem discussed in https://github.com/JuliaLang/julia/pull/31829#issuecomment-793030999. I came to the conclusion that `CartesianIndices((true,))` should be allowed as in this context `true` represents a dimension length not an index. 12 March 2021, 03:37:27 UTC
bf05fd1 doc: fix OurRational example for current gcd behavior (#39935) 12 March 2021, 03:18:46 UTC
135d7a0 Complex{<:OurRational} instead of Complex{OurRational} (#39934) 12 March 2021, 03:16:07 UTC
901d270 Support missing values in fpsort! (#27817) Use the fast algorithm for floating point even in the presence of missing values, adapting existing code to handle NaN. After sorting NaN and missing at the end, a second pass is made over these to put missing after NaN. 11 March 2021, 20:08:52 UTC
93b89b9 reduce precompile() failure severity to a warning (#39905) Many users (including Base) are calling `@assert`, despite that this is not what assert should be used to mark, for many reasons. This happened to also reveal a small number of errors, so also detect those (for fixing later). Refs: https://github.com/JuliaLang/julia/commit/c0f9666d0b94b213c7ff9e64a7b4e5268aa0e18b#commitcomment-47782674 11 March 2021, 19:36:57 UTC
3276c11 Restore StackOverflow error message for repeated frames (#39930) Fixes backtrace printing to display the number of times a frame is repeated, if there is a frame that's duplicated several times. ```julia julia> function foo() foo() end foo (generic function with 1 method) julia> foo() ERROR: StackOverflowError: Stacktrace: [1] foo() (repeats 79984 times) @ Main ./REPL[16]:1 ``` Fixes #37587. Co-authored-by: Nathan Daly <nhdaly@gmail.com> 11 March 2021, 18:20:02 UTC
53f328d inference: allows conditional object to propagate constraint multiple times (#39936) Currently we always `widenconditional` conditional var state, which makes us unable to propagate constraints from conditional object multiple times: ```julia @test Base.return_types((Union{Nothing,Int},)) do a b = a === nothing c = b ? 0 : a # c::Int d = !b ? a : 0 # d::Int ideally, but Union{Int,Nothing} c, d end == Any[Tuple{Int,Int}] # fail ``` This PR keeps conditional var state when the update is came from a conditional branching, and allows a conditional object to propagate constraint multiple times as far as the subject of condition doesn't change. AFAIU this is safe because the update from conditional branching doesn't change the condition itself. 11 March 2021, 16:42:22 UTC
bb5a013 Add a missing at-test (#39979) 11 March 2021, 02:38:52 UTC
caf10d7 Implement OpaqueClosure return type narrowing (#39917) Allows the optimizer to rewrite the return type parameter of the OpaqueClosure based on inference results of the partially specialized (i.e. specialized on the closure environment, but not on the argument types of the opaque closure). This helps by forcing an inference barrier to occur if the PartialOpaque-ness information gets lost, causing a re-infer with at least the rt information we have from inference. 10 March 2021, 22:45:58 UTC
abde2f1 Fix wrong := REPL documentation (#39975) 10 March 2021, 22:37:15 UTC
1f21f2d inference: enable constant propagation for union-split signatures (#39305) The inference precision of certain functions really relies on constant propagation, but currently constant prop' won't happen when a call signature is union split and so sometimes inference ends up looser return type: e.g. ```julia julia> Base.return_types((Union{Tuple{Int,Nothing},Tuple{Int,Missing}},)) do t a, b = t a # I expected a::Int, but a::Union{Missing,Nothing,Int} end |> first Union{Missing, Nothing, Int64} ``` This PR: - enables constant prop' for each union signatures, by calling `abstract_call_method_with_const_args` just after each `abstract_call_method` - refactor `abstract_call_method_with_const_args` into two separate parts, 1.) heuristics to decide whether to do constant prop', 2.) try constant propagation The added test cases will should showcase the cases where the inference result could be improved by that. --- I've not seen notable regression in latency with this PR. Here is a sample benchmark of the impact of this PR on latency, from which I guess this PR is acceptable ? > build time: master (caeacef) ```bash Sysimage built. Summary: Total ─────── 61.615938 seconds Base: ─────── 26.575732 seconds 43.1313% Stdlibs: ──── 35.038024 seconds 56.8652% JULIA usr/lib/julia/sys-o.a Generating REPL precompile statements... 30/30 Executing precompile statements... 1378/1378 Precompilation complete. Summary: Total ─────── 116.417013 seconds Generation ── 81.077365 seconds 69.6439% Execution ─── 35.339648 seconds 30.3561% LINK usr/lib/julia/sys.dylib ``` > build time: this PR ```bash Stdlibs total ──── 34.077962 seconds Sysimage built. Summary: Total ─────── 61.804573 seconds Base: ─────── 27.724077 seconds 44.8576% Stdlibs: ──── 34.077962 seconds 55.1383% JULIA usr/lib/julia/sys-o.a Generating REPL precompile statements... 30/30 Executing precompile statements... 1362/1362 Precompilation complete. Summary: Total ─────── 111.262672 seconds Generation ── 83.535305 seconds 75.0794% Execution ─── 27.727367 seconds 24.9206% LINK usr/lib/julia/sys.dylib ``` > first time to plot: master (caeacef) ```julia julia> using Plots; @time plot(rand(10,3)) 3.614168 seconds (5.47 M allocations: 324.564 MiB, 5.73% gc time, 53.02% compilation time) ``` > first time to plot: this PR ```julia julia> using Plots; @time plot(rand(10,3)) 3.557919 seconds (5.53 M allocations: 328.812 MiB, 2.89% gc time, 51.94% compilation time) ``` --- - fixes #37610 - some part of this code was taken from #37637 - this PR is originally supposed to be alternative and more generalized version of #39296 10 March 2021, 20:25:29 UTC
f8125c0 Export mmap from Mmap (#39816) Currently, one needs `Mmap.mmap`, which is unnecessarily redundant. 10 March 2021, 19:39:58 UTC
bc14059 ignore manifest of stdlibs (#39898) 10 March 2021, 18:57:37 UTC
f3c66b3 Don't make assumptions on the relationship of nargs and sig.parameters (#39971) We've been slowly cleaning up instances of this. OpaqueClosures can mess with this assumption now and in the future more compact tuple types might as well. 10 March 2021, 18:21:36 UTC
b2d66c9 Add Pkg checksums that should have been included in #39931 (#39969) 10 March 2021, 09:03:56 UTC
b4c79e7 Merge pull request #39956 from JuliaLang/jn/broken-makefiles fix missing dependency links in Makefiles 09 March 2021, 21:03:31 UTC
275d3de allow quoted ssa values and slots in ast (#39965) This should probably be allowed, since it is often useful to put a `QuoteNode` containing arbitrary Julia objects into an AST. Since it's quoted, I don't see any reason to disallow `SSAValue`s and `SlotNumber`s here. 09 March 2021, 20:49:15 UTC
913f79d fix behavior of JULIA_EXCLUSIVE to agree with documentation (#39961) 09 March 2021, 20:47:50 UTC
9dc9c2d fix #39948, stack overflow due to free typevar during `jl_type_intersection2` (#39959) 09 March 2021, 20:45:47 UTC
c950f90 refactor BasicBlock counting (#39945) 09 March 2021, 20:37:43 UTC
d9149b5 improve type stabilities where `_methods_by_ftype` is used (#39937) 09 March 2021, 20:36:31 UTC
cc66025 fix #39895, crash from deserialized closure using the shared method table (#39916) 09 March 2021, 20:31:05 UTC
a5628bf choosetests: add a couple missing tests (#39837) and fix test/filesystem.jl 09 March 2021, 16:11:51 UTC
faa3d41 Faster AbstractArray hashing with a static hash seed (#39950) Previously, the `object_id` lookup for `hash(AbstractArray, h)` dominated the hashing time for `AbstractArray`: ``` julia> using StaticArrays, BenchmarkTools julia> a = @SVector [1,2,3,4,5]; julia> @btime hash($a, UInt(0)) 77.935 ns (0 allocations: 0 bytes) 0xdeb6d0657a261f74 julia> @btime hash(AbstractArray, UInt(0)) 58.643 ns (0 allocations: 0 bytes) 0xc03f1dbe32103a9e ``` This replaces the hash of the objectid with a static randomly-generated number. Now: ``` julia> @btime hash($a, UInt(0)) 18.580 ns (0 allocations: 0 bytes) 0x5e77b8bf73067ebd ``` and for a random `Float64` vector ``` julia> @btime hash($a, UInt(0)) 29.031 ns (0 allocations: 0 bytes) 0x9a574d69612587eb ``` Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr> 09 March 2021, 06:37:13 UTC
cdc34f7 build,uninstall: avoid removing directories in usr This can cause a race if we happen to be trying to install something else in the same directory we just removed. Very unlikely, but unnecessary to remove them anyways (and generally was already broken for Yggdrasil-provided binaries). 09 March 2021, 01:42:23 UTC
2d2f7ac build: fix missing dependency links in Makefiles 09 March 2021, 01:42:20 UTC
970edc7 Merge pull request #39540 from JuliaLang/jn/39508 fix internal IR corruption from use of a global 08 March 2021, 19:18:24 UTC
26d887e REPL: try to coalesce updates (#39538) When input is arriving too fast, delay computing and rendering the full screen until a short delay after typing stops. 08 March 2021, 19:17:41 UTC
a01d7f3 Merge pull request #39524 from JuliaLang/jn/25997 regex: enable safe handling of invalid UTF-8 by default 08 March 2021, 19:17:13 UTC
86387a8 Improve (no)specialization in print_matrix (#39194) It makes sense to extract the axes before we lose inferrability of the vector or matrix being printed. Hence this delays application of `@nospecialize`. However, it also standardizes the row/column indices and reduces specialization in `alignment`. Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com> 08 March 2021, 14:09:33 UTC
6fb3558 Range indexing: error with scalar bool index like all other arrays (#31829) 08 March 2021, 08:46:40 UTC
5fab42a Bump Pkg on master (#39931) This should include the recent `is_stdlib()` fixes. Short commit log: ``` 7a9d9654 (HEAD -> master, origin/master, origin/HEAD) [ext/HSG]: Store next release _and_ latest nightly (#2418) 7b870924 [ext/HSG]: Enable generating historical stdlibs on macOS (#2417) 5d496193 Update Project.toml feada149 only use the stdlib version cache if a custom version is given to the resolver bae808dc Fix Markdown table formatting (#2416) 6e8b6214 Update docstrings for io kwargs, some io kwarg fixes, update stdlib list (#2402) c2e3879e Mark the "STDLIBS_BY_VERSION up-to-date" test as broken (#2409) ``` 06 March 2021, 16:33:09 UTC
efa7e4e improve inferrabilities in Test module (#39761) * improve inferrabilities in `Test` module 06 March 2021, 11:06:17 UTC
22f84e7 Reorganize code to keep code as IRCode slightly longer (#39885) This moved the primary place where IRCode gets converted into CodeInfo into the transform_result_for_cache call, which is a sensible place for it to be since the primary reason we need to convert back to IRCode is to make it acceptable for storing in the global cache. The reason we might want to not perform the conversion, is that the conversion is slightly lossy, because it drops stmtinfo. However, in Cthulhu, I would like to keep the statement info around such that Cthulhu can present it to the user, even in optimized code (i.e. where inlining decided not to inline, I would still like Cthulhu to be able to introspect inference's original annotations). This change makes that possible. In an ideal world, we wouldn't have to do this at all for uncached code, but of course both code_typed and typeinf_ext do look at the code, even if it is uncached. Unfortunately, at the moment we don't really have a good way to indicate whether or not the code will be looked at, so there is a fallback path that always does the conversion if we decided not to do the caching. Some future refactoring can save some additional time here. 06 March 2021, 03:19:37 UTC
bf0364b Faster dot product for sparse matrices and dense vectors (#39889) 05 March 2021, 21:15:33 UTC
6cea0d2 Fixed a typo. (#39914) 05 March 2021, 18:06:09 UTC
e49567f Turn on inference for OpaqueClosure (#39681) This turns on inference for `PartialOpaque` callees (but no optimization/inlining yet and also no dynamic dispatch to the optimized implementations). Because of the current design and some fixes getting pulled into previous PRs, I believe this is all that remains to be done on the inference front. In particular, we specialize the OpaqueClosure methods on the tuple formed by the tuple type of the environment (at inference time) and the argument tuples. This is a bit of an odd method specialization, but it seems like inference is just fine with it in general. In the fullness of time, we may want to store the specializations differently to give more freedom to partial optimizations, but that would require being able to re-enter inference later, which is currently not possible. 05 March 2021, 00:50:06 UTC
d0d378e [Filesystem]: `rm(;force=true)` should ignore `readdir()` errors (#39906) 04 March 2021, 23:58:49 UTC
e2e13ca Remove unused code introduced in the LBT PR (#39908) * Remove unused code. 04 March 2021, 21:55:57 UTC
b7b0a63 allow trailing dims in inplace broadcast (#39859) * RFC: allow trailing dims in inplace broadcast This allows inplace broadcasting into arrays that contain less dimensions than the lhs, as long as the trailing dimensions all have length one. This seems more consistent to me with how we handle trailing dimensions in other places. * try dropping trailing dims upon indexing also test 2-dimensional destinations Co-authored-by: Matt Bauman <mbauman@gmail.com> 04 March 2021, 17:52:26 UTC
3d0b60d Merge pull request #39768 from wsmoses/copysign Use copysign LLVM intrinsic rather than bithack ourselves 04 March 2021, 14:53:08 UTC
502c039 Added reference to @inbounds in the entry for --check-bounds (#39897) Added explicit reference to `@inbounds` in the entry for `--check-bounds`, this is consistent with `--inline`, `--polly` and `--math-mode`. 03 March 2021, 15:15:38 UTC
21762f2 spzeros tuple construction (#39886) 03 March 2021, 10:37:13 UTC
79d7683 Darwin/ARM64: Fix jl_throw_in_ctx (#39894) Fixes incorrect SIGFPE handling causing crashes during the numbers test. 03 March 2021, 05:40:32 UTC
c0f9666 Canonicalize IR to disallow mutable GlobalRef in value position (#39893) Generally we assume parameters can be duplicated without seeing side-effects. That is not entirely true of mutable globals and multi-threading. Refs: #36450 Fixes: #39508 03 March 2021, 01:05:07 UTC
0988fcf Add new LLVM patches for Aarch64 issues (#39891) Fixes #39818 Fixes #39820 Fixes #39823 02 March 2021, 22:30:42 UTC
bd5105e optimizer: be careful to always handle temporarily invalid ops These ops are not actually legal (they're semantically invalid), but we temporarily use them to carry information between passes which needs to then remove them correctly. Fixes #39508 02 March 2021, 22:26:26 UTC
05e6650 check for NULL handle in `_fd` (#39879) In this case the object is in an invalid state, but it at least allows printing the object so you can see that. 02 March 2021, 21:46:50 UTC
49387b2 add Type to kwargs internal argument (#39593) Fixes #39419 02 March 2021, 21:03:52 UTC
de7d695 docs: mention `outer` in the section on keywords (#39861) * docs: mention `outer` in the section on keywords * Update doc/src/base/base.md Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> * Update doc/src/base/base.md * Update doc/src/base/base.md Co-authored-by: Simeon Schaub <simeondavidschaub99@gmail.com> 02 March 2021, 20:56:19 UTC
72777b7 fix #39698 by disabling the unnecessary Vararg var bounds error (#39875) 02 March 2021, 19:21:01 UTC
cf077be Refactor InliningState (#39881) We recently dropped the method table from this and we can get rid of one of the cache references now too, since we're now passing that info in the stmtinfo. Also factor out the inlining policy into a separate option to the inliner to make it easier for downstream projects like Diffractor and Cthulhu to override it without playing cache games (which is now harder, since one of the caches is gone). 02 March 2021, 17:17:59 UTC
9e783bb llvm-alloc-opt: handle dead code better (#39801) In some cases (particularly after removing a phi node), we might end up in a circumstance where it appears statically that we would use a slot for both a ref and bits. Avoid generating malformed IR in this case. In the future, this situation could also possibly happen if we walked through phi nodes and attempted to merge the contents (with great care). 02 March 2021, 17:03:47 UTC
4f36351 AbstractInterpreter: minor refactors of builtin call interfaces (#39883) This commit pushes bail out logic of `apply` and `invoke` into their own `abstract_(apply|invoke)` functions. This refactor allows external consumers to focus on overloading `abstract_(apply|invoke)` rather than overloading both `abstract_call_known` and `abstract_(apply|invoke)`. 02 March 2021, 15:54:29 UTC
2ee8a39 [build] Bump libblastrampoline to v3.0.2 (#39880) * [build] Bump libblastrampoline to v3.0.2 * [deps/refresh_checksums] Pass `FC_VERSION` to disable "no `gfortran`" check when checksumming 02 March 2021, 13:32:27 UTC
c62ee62 Bump Documenter to 0.26.3 (#39882) 02 March 2021, 07:20:36 UTC
3356b45 Fix typo in julia.h (#39884) indicies -> indices 02 March 2021, 07:20:08 UTC
5e7aaa6 [BugReporting] pass `ARGS` through properly (#39839) When calling `make_interactive_report()`, we really need to pass in `ARGS` as well, otherwise it always starts an interactive session. This commit, in combination with `--` allows the user to run an `rr` session while still passing arguments to the child `julia` process via: ``` julia --bug-report=rr -- --project test/runtests.jl ``` 02 March 2021, 02:22:37 UTC
3ff44ea Merge pull request #39792 from JuliaLang/kf/inlinemtable Remove inlining's dependence on method table lookups 02 March 2021, 00:18:10 UTC
f166b20 Fix case of inlining UnionSplit with a single applicable method 01 March 2021, 19:42:29 UTC
7e345f9 Remove method_table from inlining state This is now no longer used. A use case for external consumers was to re-run another pass of inlining, but that is better addressed by a separate pass that simply sets the appropriate info. 01 March 2021, 18:22:52 UTC
bbad43e Allow inlining of code for big pure results In some cases we can statically compute the result of a pure call, but we refuse to inline it into the IR because it would be too big. In these cases, we'd still like to be able to do regular inlining, so augment MethodResult pure to forward the call info for such calls rather than relying on inlining to recompute the method match. 01 March 2021, 18:22:52 UTC
6cbb3c0 Add statement info for invoke Removes another dependence of inlining on the method table and has the nice side benefit of allowing external consumers like Cthulhu to reason about `invoke`. 01 March 2021, 18:22:52 UTC
7e5edad Add special case inliner for TypeVar Rather than relying on inlining to perform a method lookup. 01 March 2021, 18:22:52 UTC
3d22421 fix #29100, make `fieldnames` constant-fold-able (#39832) 01 March 2021, 18:18:51 UTC
621ee2a LinearAlgebra: Add test "matrix x matrix with negative stride". (#39849) (Made while looking at #39836, which is matrix x vector. Matrix x matrix with negative stride is fine as it is, because it uses the Julia implementation of matrix multiplication.) 01 March 2021, 16:53:01 UTC
8b6e861 docs: document use of `begin` as index (#39860) And clarify that it's not just for arrays. 01 March 2021, 15:06:35 UTC
ff4d3db Fix typo in arrayops.jl (#39867) assigment -> assignment 01 March 2021, 15:05:05 UTC
e784dd0 Specialize LinearAlgebra.BLAS.dot for strided vectors of floats. (#39751) 28 February 2021, 18:59:22 UTC
c79309b cmdlineargs test: on 32-bit systems, impose a constant upper limit on the number of threads (#39854) 28 February 2021, 06:48:02 UTC
f2b5b6e Correct `invoke` call syntax in NEWS.md (#39847) 27 February 2021, 20:54:34 UTC
7367dcd Bump libblastrampoline to v3.0.1 (#39846) This version of LBT no longer tries to `dlclose()` old BLAS libraries, which should help with the segfaults during `MKL.jl` tests. 27 February 2021, 14:38:11 UTC
2cf1f34 Add SuiteSparse checksums (#39843) 27 February 2021, 02:35:35 UTC
bcc0ea1 [LinearAlgebra] Add `libblas` and `liblapack` bindings in again (#39845) Some packages use these; rather than create unnecesary package churn, let's just define them again and add a note that serious applications should use the much richer detail available from `BLAS.get_config()`. 27 February 2021, 02:34:54 UTC
9ca31f7 fix #39804, ABI handling of structs with String references (#39821) 26 February 2021, 21:48:17 UTC
76698ea Add \ for Sym/Tri/Bi/Diagonal and support non-commutative numbers (#39701) Co-authored-by: Daniel Karrasch <daniel.karrasch@posteo.de> 26 February 2021, 14:19:05 UTC
567f4bc worlds test: generate needed MethodInstance (#39830) Closes #39828 26 February 2021, 13:04:55 UTC
fb500b0 Update Downloads.jl to fix download hanging, fixes #39789. (#39833) $ git log --pretty=oneline --abbrev=commit 2b4bed9..6bb8306 6bb83068bd796c4890baaeb39628ff79a4979374 Stop the grace timer iff adding first handle (fix #99) (#102) af6864d8872247faf2a402d6b2baca5cb74ab96e fix ssh_key_pass bug (fix #91) (#100) 26 February 2021, 12:21:08 UTC
eca3e86 LinearAlgebra._generic_matmul! : Avoid division by zero for tile_size. (#39790) 26 February 2021, 08:32:12 UTC
b39d697 Merge pull request #38905 from aviatesk/backprop2 inference: inter-procedural conditional constraint back-propagation 26 February 2021, 05:30:52 UTC
936e84f add basic overview of when to use type declarations (#39812) 25 February 2021, 22:37:21 UTC
a3eda19 Allow kwarg in function composition (#39147) 25 February 2021, 21:09:27 UTC
dc81980 [WIP] Use libblastrampoline to forward to a user-defined BLAS at runtime (#39455) 25 February 2021, 20:36:16 UTC
95a34a9 clarify non-scalar indexed assignment (#39788) Ref: #39725 Co-authored-by: Nicholas Bauer <nicholasbauer@outlook.com> 25 February 2021, 17:35:54 UTC
6968e47 equiv_typedef: don't reject equivalence just for gensyms (#39778) This fixes the following: ``` julia> struct Symmetric{T,S<:AbstractMatrix{<:T}} <: AbstractMatrix{T} data::S uplo::Char end julia> struct Symmetric{T,S<:AbstractMatrix{<:T}} <: AbstractMatrix{T} data::S uplo::Char end ERROR: invalid redefinition of constant Symmetric ``` `Core._equiv_typedef` returns false which ends up triggering the error. 25 February 2021, 17:07:56 UTC
a12d0ff make copy correctly handle 0-dimensional SubArray (#39809) * make copy correctly handle 0-dimensional SubArray The current definition of `copy` for `SubArray` [here](https://github.com/JuliaLang/julia/blob/master/base/subarray.jl#L70) has the following consequence: ``` julia> x = [1] 1-element Array{Int64,1}: 1 julia> y = @view x[1] 0-dimensional view(::Array{Int64,1}, 1) with eltype Int64: 1 julia> copy(y) 1 ``` which is inconsistent with the contract for `copy` that promises to produce an array when array is copied, e.g.: ``` julia> x = fill(1) 0-dimensional Array{Int64,0}: 1 julia> copy(x) 0-dimensional Array{Int64,0}: 1 ``` 25 February 2021, 11:27:16 UTC
442f727 Bump `p7zip_jll` to get coddesigned `7z` binary (#39805) Without this, Pkg extraction commands fail on Apple Silicon 24 February 2021, 12:31:25 UTC
5256375 Make ReadOnlyError on PROT_NONE consistent (#39803) This replaces #36625. Essentially the question is what should reading from PROT_NONE memory do. At the moment we throw ReadOnlyMemoryError on Linux and pass through the segfault on Windows/Mac. It's not super clear what the right answer is, though it would be nice to be consistent. After some discussion, it seemed that not throwing ReadOnlyMemoryError on Linux was probably the better consistency direction for two reasons: 1. Getting a ReadOnlyMemoryError is confusing if the failing operation is a read. We could of course rename the error, but that would be a bigger breaking change. 2. The purpose of this exception is to protect people who accidentally try to write to mmap'ed memory that they don't have write permissions to. It was never intended to become a general memory access error exception, so it seems prudent to restrict it as much as possible. To make this happen, there is some platform specific code here to read the memory error register out of the signal context. Decoding this register is shared code between the operating systems, but the register itself is in an OS-specifc location in the signal frame. I have implemented the retrieval code for all our CI'ed platforms. Other users will get an appropriate `#warning` (similar to other code in this file) and can fill in the necessary code at their leisure. A new test in test/misc.jl will indicate whether or not the check is correct. 24 February 2021, 12:30:50 UTC
e32e94e Merge pull request #39719 from JuliaLang/sf/codesigned_libraries 24 February 2021, 05:09:13 UTC
36e7e8a tweaks for inter-procedural constraint back-prop' note that the changes for `isnothing` and `ismissing` aren't necessary, but they reduce the number of method definitions for good reason; the less the number of methods they have, the better we can back-propagate type constraints, because even after a package defines their own new methods for them we can keep to use our `InterConditional` logic as far as far as the number of methods is [≤3](https://github.com/JuliaLang/julia/blob/5c6e21edbfd8f0c7d16ea01c91d1c75c30d4eaa1/base/compiler/types.jl#L119) 24 February 2021, 02:33:12 UTC
cf634a8 inference: callsite conditional argument type refinement - within a callee (i.e. `typeinf_local`), we widen conditional return type if it doesn't refine input argument type (for better cache) - within a caller (i.e. `abstract_call_gf_by_type`), we re-form a conditional if needed, which allows us to choose a propagation target more appropriately this commit implements the "pick up" logic within a caller (i.e. within `abstract_call_gf_by_type`), which allows us to choose a constraint more appropriately, and now the `Meta.isexpr` case is fixed. Still there is a limitation of multiple conditional constraint back-propagation; the following broken test case will explain the future work. ```julia is_int_and_int(a, b) = isa(a, Int) && isa(b, Int) @test_broken Base.return_types((Any,Any)) do a, b is_int_and_int(a, b) && return a, b # (a::Int, b::Int) ideally, but (a::Any, b::Int) 0, 0 end == Any[Tuple{Int,Int}] ``` 24 February 2021, 02:33:07 UTC
9be2edb inference: inter-procedural conditional constraint back-propagation This PR propagates `Conditional`s inter-procedurally when a `Conditional` at return site imposes a constraint on the call arguments. When inference exits local frame and the return type is annotated as `Conditional`, it will be converted into `InterConditional` object, which is implemented in `Core` and can be directly put into the global cache. Finally after going back to caller frame, `InterConditional` will be re-converted into `Conditional` in the context of the caller frame. ## improvements So now some simple "is-wrapper" functions will propagate its constraint as expected, e.g.: ```julia isaint(a) = isa(a, Int) @test Base.return_types((Any,)) do a isaint(a) && return a # a::Int return 0 end == Any[Int] isaint2(::Any) = false isaint2(::Int) = true @test Base.return_types((Any,)) do a isaint2(a) && return a # a::Int return 0 end == Any[Int] function isa_int_or_float64(a) isa(a, Int) && return true isa(a, Float64) && return true return false end @test Base.return_types((Any,)) do a isa_int_or_float64(a) && return a # a::Union{Float64,Int} 0 end == Any[Union{Float64,Int}] ``` (and now we don't need something like #38636) ## benchmarks A compile time comparison: > on the current master (82d79ce18f88923c14d322b70699da43a72e6b32) ``` Sysimage built. Summary: Total ─────── 55.295376 seconds Base: ─────── 23.359226 seconds 42.2444% Stdlibs: ──── 31.934773 seconds 57.7531% JULIA usr/lib/julia/sys-o.a Generating REPL precompile statements... 29/29 Executing precompile statements... 1283/1283 Precompilation complete. Summary: Total ─────── 91.129162 seconds Generation ── 68.800937 seconds 75.4983% Execution ─── 22.328225 seconds 24.5017% LINK usr/lib/julia/sys.dylib ``` > on this PR (37e279bce7136e48f159811641b68143412c3881) ``` Sysimage built. Summary: Total ─────── 51.694730 seconds Base: ─────── 21.943914 seconds 42.449% Stdlibs: ──── 29.748987 seconds 57.5474% JULIA usr/lib/julia/sys-o.a Generating REPL precompile statements... 29/29 Executing precompile statements... 1357/1357 Precompilation complete. Summary: Total ─────── 88.956226 seconds Generation ── 67.077710 seconds 75.4053% Execution ─── 21.878515 seconds 24.5947% LINK usr/lib/julia/sys.dylib ``` Here is a sample code that benefits from this PR: ```julia function summer(ary) r = 0 for a in ary if ispositive(a) r += a end end r end ispositive(a) = isa(a, Int) && a > 0 ary = Any[] for _ in 1:100_000 if rand(Bool) push!(ary, rand(-100:100)) elseif rand(Bool) push!(ary, rand('a':'z')) else push!(ary, nothing) end end using BenchmarkTools @btime summer($(ary)) ``` > on the current master (82d79ce18f88923c14d322b70699da43a72e6b32) ``` ❯ julia summer.jl 1.214 ms (24923 allocations: 389.42 KiB) ``` > on this PR (37e279bce7136e48f159811641b68143412c3881) ``` ❯ julia summer.jl 421.223 μs (0 allocations: 0 bytes) ``` ## caveats Within the `Conditional`/`InterConditional` framework, only a single constraint can be back-propagated inter-procedurally. This PR implements a naive heuristic to "pick up" a constraint to be propagated when a return type is a boolean. The heuristic may fail to select an "interesting" constraint in some cases. For example, we may expect `::Expr` constraint to be imposed on the first argument of `Meta.isexpr`, but the current heuristic ends up picking up a constraint on the second argument (i.e. `ex.head === head`). ```julia isexpr(@nospecialize(ex), head::Symbol) = isa(ex, Expr) && ex.head === head @test_broken Base.return_types((Any,)) do x Meta.isexpr(x, :call) && return x # x::Expr, ideally return nothing end == Any[Union{Nothing,Expr}] ``` I think We can get rid of this limitation by extending `Conditional` and `InterConditional` so that they can convey multiple constraints, but I'd like to leave this as a future work. --- - closes #38636 - closes #37342 24 February 2021, 02:29:01 UTC
83f3be9 Add imaging_mode to jl_create_native (#38642) 24 February 2021, 01:11:30 UTC
db1c340 Flip OpenBLAS aarch64 to ILP64, update checksums 23 February 2021, 23:47:17 UTC
b1c0631 Bump PCRE2, include SLJIT `mprotect()` patch 23 February 2021, 22:44:14 UTC
7aba050 [build] Mass-update JLL versions to get codesigned libraries on Darwin On Apple Silicon, we need ad-hoc code signatures on all libraries. This mass rebuild of the dependencies provides signed versions of all libraries on both `x86_64-apple-darwin` and `aarch64-apple-darwin` 23 February 2021, 22:44:14 UTC
8e949d6 specialize copyto! and multiplication by numbers for Q from qr (#39533) * specialize copyto! and multiplication by numbers for Q from qr This fixes two performance bugs reported in https://github.com/JuliaLang/julia/issues/38972 and https://github.com/JuliaLang/julia/issues/38972 (multiplication of `Q` from `qr` by a `Diagonal` or `UniformScaling`). In particular, it improves the performance of generating random orthogonal matrices as described in https://discourse.julialang.org/t/random-orthogonal-matrices/9779/7. * fix typo in new qr tests * resolve mehod ambiguity of copyto! 23 February 2021, 14:30:47 UTC
3230aef Sync Pkg with Pkg master branch (#39770) 23 February 2021, 09:04:16 UTC
back to top