https://github.com/JuliaLang/julia

sort by:
Revision Author Date Message Commit Date
038c2bb Support TATAS-like usage in `islocked` and `trylock` spec (#44820) 05 April 2022, 04:16:52 UTC
e9150a1 add `@nospecialize` annotations for Returns (#44853) 05 April 2022, 02:40:23 UTC
7a61fc0 fix `getglobal_nothrow` (#44855) 05 April 2022, 02:21:08 UTC
f8f83da Fix leftover indentation TODOs (#44854) 04 April 2022, 23:32:45 UTC
81e7cfc [Zlib_jll] Update to v1.2.12+3 (#44810) Note: this is the first build of the real upstream version 1.2.12 which was released a few days ago. 04 April 2022, 20:11:25 UTC
2f9e3a5 faster `_log_ext` (#44717) * faster _log_ext * test subnormal^float 04 April 2022, 15:46:54 UTC
0c9f130 Instrument AllocOpt (#44577) 04 April 2022, 14:43:45 UTC
51271e0 Detect multiple concurent writes to Dict + remove dead code (#44778) Thanks to #38180, the removed code seems to be dead because no finalizers should be used anymore to modify dictionaries (it was dangerous). Furthermore, it may help users to detect illegal concurrent writes, since it doesn't recurse and have new error message. There should be no, or even a positive, performance effect. 04 April 2022, 04:17:56 UTC
209aad1 restore MSVC support to julia.h file (#44842) Put back a few lines that were removed by PR $42703 because they are required to successfully embed Julia with MSVC. 04 April 2022, 03:57:30 UTC
62dd14e Fix #42929 (#44838) 03 April 2022, 04:15:13 UTC
f84b49a Stricter tests in int.jl (#44522) * Stricter tests in int.jl * More tests for coverage. 03 April 2022, 03:05:44 UTC
5dfd6c9 Add radix sort (#44230) * Add radix sort 03 April 2022, 02:26:38 UTC
41c2c7c graphemes(s, m:n) substring slicing (#44266) * graphemes(s, m:n) substring slicing * variable naming * whoops * consolidate tests * empty-range test * note complexity * Update stdlib/Unicode/src/Unicode.jl Co-authored-by: Sebastian Stock <42280794+sostock@users.noreply.github.com> * news fix Co-authored-by: Sebastian Stock <42280794+sostock@users.noreply.github.com> 02 April 2022, 21:27:09 UTC
daa2101 Delete trailing whitespace (#44836) 02 April 2022, 18:10:08 UTC
8823058 improve str macro doc help (#39110) * improve str macro doc help * add string macro search result 02 April 2022, 17:17:25 UTC
020c2de clarification of export list (#44744) * clarification of export list Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com> 02 April 2022, 14:51:09 UTC
567ae8c Seperate `LinearAlgebra.axp(b)y!` and `BLAS.axp(b)y!`. (#44758) * Seperate `LinearAlgebra.axpy!` and `BLAS.axpy!` * Make more `dot` based on `BLAS`. * Doc fix. 02 April 2022, 14:13:18 UTC
5916faf Tests for bad arguments to at-threads (#30937) 02 April 2022, 12:17:59 UTC
dbe41d4 Fix implicit binding import for aliased bindings (#44827) `b->name` is used to lookup in `b->owner`, not `var`. 02 April 2022, 09:39:38 UTC
78d9dd0 add new `:total_may_throw` utility setting for `@assume_effects` (#44775) This setting is particularly useful since it allows the compiler to evaluate a call of the applied method when all the call arguments are fully known, no matter if the call results in an error or not. This commit also adds some more explanations on the difference between `@pure` and `@assume_effects`. 01 April 2022, 22:39:36 UTC
4422a1d Migrate codegen to operate on orc::ThreadSafeModule (#44440) * Move to TSModule, round 2 * Pass in modules to codegen * Rename jl_create_datalayout * Get unlocked modules once * Pass along module data layout and target more frequently * Remove jl_get_ee_context * Add note about context locks 01 April 2022, 22:02:52 UTC
48ae154 Fix typo in documentation (#44831) 01 April 2022, 18:24:52 UTC
081ae64 Mark as `inline` functions implemented in `src/serialize.h` (#44739) * Mark as `inline` functions implemented in `src/serialize.h` Also, remove duplicate definitions from `src/staticdata.c` and include `serialize.h` in there. 01 April 2022, 17:59:06 UTC
05340a8 fix typo in line 38 in tuple.jl (#44817) 01 April 2022, 15:53:26 UTC
20d29f4 Added Pluto.jl to Browser workflow in docs (#44683) * Added Pluto.jl to Browser workflow Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com> 01 April 2022, 13:28:42 UTC
cf649a7 effects: replaces usages of `ALWAYS_FALSE` with `TRISTATE_UNKNOWN` (#44808) Although they are basically equivalent in the current implementation, it would be more correct conceptually if we propagate `TRISTATE_UNKNOWN` instead of `ALWAYS_TRUE`, as it is hard or impossible to derive a global conclusion from a local analysis on each statement in most places. This commit also adds a docstring that simply explains the design of the effect analysis. 01 April 2022, 04:54:43 UTC
3888176 follow up #44786, fix `findsup` to return correct `overlayed` value (#44804) 01 April 2022, 01:01:45 UTC
70406c9 Makefile wildcard globs only work at end (#34879) This implements the same logic in the choosetests.jl. Co-authored-by: Jameson Nash <vtjnash@gmail.com> 31 March 2022, 23:45:01 UTC
ef835ac abs2(::Number) fallback (#44110) 31 March 2022, 21:01:10 UTC
3c08483 Silence all warnings when building with GCC on Linux (#44350) * Silence all warnings when building with GCC on Linux * Replace `#warning` with `#pragma message` The former causes a compiler warning with Clang about it being a language extension, which then causes an error if building with `-Werror`. * Silence warning about unused variable when doing a non-debug build * Initialise another variable which can be detected as uninitialised * Fix more warnings introduced by recent changes 31 March 2022, 17:53:38 UTC
66c95f3 Fix typo in a docstring (#44806) 31 March 2022, 15:24:46 UTC
82ce311 effects: add reflection utility for the new effect analysis (#44785) This commit adds new reflection utility named `Base.infer_effects` that works in the same way as `Base.return_types` but returns inferred effects instead. It would be helpful to test that certain method call has an expected effects. For example, we can now remove `Base.@pure` annotation from the definition of `BroadcastStyle(a::A, b::B) where {A<:AbstractArrayStyle{M},B<:AbstractArrayStyle{N}} where {M,N}` and checks it's still eligible for concrete evaluation like this (see <https://github.com/JuliaLang/julia/pull/44776#discussion_r836756190> for the context): ```julia julia> import Base.Broadcast: AbstractArrayStyle, DefaultArrayStyle, Unknown julia> function BroadcastStyle(a::A, b::B) where {A<:AbstractArrayStyle{M},B<:AbstractArrayStyle{N}} where {M,N} if Base.typename(A) === Base.typename(B) return A(Val(max(M, N))) end return Unknown() end BroadcastStyle (generic function with 1 method) julia> # test that the above definition is eligible for concrete evaluation @test Base.infer_effects(BroadcastStyle, (DefaultArrayStyle{1},DefaultArrayStyle{2},)) |> Core.Compiler.is_total_or_error Test Passed ``` Co-authored-by: Takafumi Arakaki <aka.tkf@gmail.com> 31 March 2022, 07:28:03 UTC
3f23c45 Propagate `TMPDIR` in `Distributed` tests (#44799) On our macOS CI systems, `TMPDIR` is set to a special path (not `/tmp`) and the CI processes are not allowed to write into `/tmp`. This causes this `Distributed` test to fail, as it loses the special `TMPDIR` setting. This explicitly sets `TMPDIR` to ensure that it propagates correctly. 30 March 2022, 19:57:52 UTC
516a404 Merge pull request #44798 from JuliaLang/kf/bugpoint Make julia bootstrap bugpointable 30 March 2022, 19:52:19 UTC
dab3019 LICENSE.md: update copyright years (#44802) 30 March 2022, 14:23:14 UTC
dcc0efe RFC: Rework `copy_oftype` a bit (#44756) 30 March 2022, 13:50:08 UTC
967b974 Restrict `size(::AbstractQ)` to concrete types (#44751) 30 March 2022, 13:47:58 UTC
bad450f Change type of donotdelete intrinsics (#44793) 30 March 2022, 11:52:04 UTC
3e1ae47 optimizer: inline abstract union-split callsite (#44512) Currently the optimizer handles abstract callsite only when there is a single dispatch candidate (in most cases), and so inlining and static-dispatch are prohibited when the callsite is union-split (in other word, union-split happens only when all the dispatch candidates are concrete). However, there are certain patterns of code (most notably our Julia-level compiler code) that inherently need to deal with abstract callsite. The following example is taken from `Core.Compiler` utility: ```julia julia> @inline isType(@nospecialize t) = isa(t, DataType) && t.name === Type.body.name isType (generic function with 1 method) julia> code_typed((Any,)) do x # abstract, but no union-split, successful inlining isType(x) end |> only CodeInfo( 1 ─ %1 = (x isa Main.DataType)::Bool └── goto #3 if not %1 2 ─ %3 = π (x, DataType) │ %4 = Base.getfield(%3, :name)::Core.TypeName │ %5 = Base.getfield(Type{T}, :name)::Core.TypeName │ %6 = (%4 === %5)::Bool └── goto #4 3 ─ goto #4 4 ┄ %9 = φ (#2 => %6, #3 => false)::Bool └── return %9 ) => Bool julia> code_typed((Union{Type,Nothing},)) do x # abstract, union-split, unsuccessful inlining isType(x) end |> only CodeInfo( 1 ─ %1 = (isa)(x, Nothing)::Bool └── goto #3 if not %1 2 ─ goto #4 3 ─ %4 = Main.isType(x)::Bool └── goto #4 4 ┄ %6 = φ (#2 => false, #3 => %4)::Bool └── return %6 ) => Bool ``` (note that this is a limitation of the inlining algorithm, and so any user-provided hints like callsite inlining annotation doesn't help here) This commit enables inlining and static dispatch for abstract union-split callsite. The core idea here is that we can simulate our dispatch semantics by generating `isa` checks in order of the specialities of dispatch candidates: ```julia julia> code_typed((Union{Type,Nothing},)) do x # union-split, unsuccessful inlining isType(x) end |> only CodeInfo( 1 ─ %1 = (isa)(x, Nothing)::Bool └── goto #3 if not %1 2 ─ goto #9 3 ─ %4 = (isa)(x, Type)::Bool └── goto #8 if not %4 4 ─ %6 = π (x, Type) │ %7 = (%6 isa Main.DataType)::Bool └── goto #6 if not %7 5 ─ %9 = π (%6, DataType) │ %10 = Base.getfield(%9, :name)::Core.TypeName │ %11 = Base.getfield(Type{T}, :name)::Core.TypeName │ %12 = (%10 === %11)::Bool └── goto #7 6 ─ goto #7 7 ┄ %15 = φ (#5 => %12, #6 => false)::Bool └── goto #9 8 ─ Core.throw(ErrorException("fatal error in type inference (type bound)"))::Union{} └── unreachable 9 ┄ %19 = φ (#2 => false, #7 => %15)::Bool └── return %19 ) => Bool ``` Inlining/static-dispatch of abstract union-split callsite will improve the performance in such situations (and so this commit will improve the latency of our JIT compilation). Especially, this commit helps us avoid excessive specializations of `Core.Compiler` code by statically-resolving `@nospecialize`d callsites, and as the result, the # of precompiled statements is now reduced from `2005` ([`master`](f782430c5b)) to `1912` (this commit). And also, as a side effect, the implementation of our inlining algorithm gets much simplified now since we no longer need the previous special handlings for abstract callsites. One possible drawback would be increased code size. This change seems to certainly increase the size of sysimage, but I think these numbers are in an acceptable range: > [`master`](f782430c5b) ``` ❯ du -shk usr/lib/julia/* 17604 usr/lib/julia/corecompiler.ji 194072 usr/lib/julia/sys-o.a 169424 usr/lib/julia/sys.dylib 23784 usr/lib/julia/sys.dylib.dSYM 103772 usr/lib/julia/sys.ji ``` > this commit ``` ❯ du -shk usr/lib/julia/* 17512 usr/lib/julia/corecompiler.ji 195588 usr/lib/julia/sys-o.a 170908 usr/lib/julia/sys.dylib 23776 usr/lib/julia/sys.dylib.dSYM 105360 usr/lib/julia/sys.ji ``` 30 March 2022, 11:46:45 UTC
f782430 effects: change the `overlayed::Bool` property to `nonoverlayed::Bool` (#44786) The current naming of `overlayed` is a bit confusing since `overlayed === true`, which is the conservative default value, actually means "it _may_ be overlayed" while `overlayed === false` means "this is absolutely not overlayed". I think it should be named as `nonoverlayed`, and then a query name like `is_nonoverlayed` would be more sensible than the alternative `is_overlayed`, which actually should be something like `can_be_overlayed`. 30 March 2022, 11:12:11 UTC
18a2031 improve return-type reflections of opaque closure (#44743) 30 March 2022, 10:43:28 UTC
54be1ce Fix static show for Base.Colon (#44726) As noted in 44635, we current static show `Base.Colon()` as `Base.Any`, which is very confusing. Try to improve the situation by only using the special function printing if the binding actually matches the value we're trying to print. 30 March 2022, 05:48:54 UTC
7c2edc5 Remove some frivolous (p)*jl types (#44469) 30 March 2022, 04:05:36 UTC
1b3435b Make multiversioning bugpoint robust Bugpoint can introduce IR forms that would cause multiversioning to fail and that julia should never emit. However, if we actually crash on those, then bugpoint will get confused. To work around this, add a "bugpoint" mode to multiversioning where it accepts somewhat corrupted IR and tries to do something reasonable. This mode is not enabled from julia internally, but is enabled when run through the external pass interface. Of course the result of a bugpoint reduction won't be a loadable system image as a result, but bugpoint already is basically guaranteed to generate a non-loadable image, so that isn't an issue (since bugpoint is for debugging the compiler itself). 30 March 2022, 03:07:00 UTC
926f18f Register dump_native=true versions of passes for opt The pass pipeline for dump_native=true (which is used when building the sysimage) is slightly different than the JIT pipeline, which can affect behavior. Expose versions of the julia passes with dump_native=true set, to make it easy to reproduce LLVM issues using `opt`. 30 March 2022, 03:06:49 UTC
f562ad0 Initialize jl_page_size when not calling julia_init. (#44699) If we load libjulia-codegen directly, e.g. from opt or llc, we don't call julia_init but init_llvm. Co-authored-by: Keno Fischer <keno@juliacomputing.com> 30 March 2022, 03:06:31 UTC
8e12f70 fix potential error within `multiq_sift_down` (#44788) This commit fixes the following error possibility: ``` julia> using JET julia> @report_call println(nothing) ═════ 1 possible error found ═════ ┌ @ coreio.jl:4 Base.println(Core.tuple(Base.stdout), xs...) │┌ @ strings/io.jl:75 Base.print(Core.tuple(io), xs, Core.tuple("\n")...) ││┌ @ strings/io.jl:43 Base.lock(io) │││┌ @ show.jl:334 Base.lock(Base.getproperty(io, :io)) ││││┌ @ stream.jl:283 Base.lock(Base.getproperty(s, :lock)) │││││┌ @ lock.jl:103 slowlock(rl) ││││││┌ @ lock.jl:112 Base.wait(c) │││││││┌ @ condition.jl:124 = Base.wait() ││││││││┌ @ task.jl:940 Base.poptask(W) │││││││││┌ @ task.jl:929 task = Base.trypoptask(W) ││││││││││┌ @ task.jl:923 Base.Partr.multiq_deletemin() │││││││││││┌ @ partr.jl:162 Base.Partr.multiq_sift_down(heap, Base.Partr.Int32(1)) ││││││││││││┌ @ partr.jl:55 Base.Partr.multiq_sift_down(heap, child) │││││││││││││ no matching method found for call signature (Tuple{typeof(Base.Partr.multiq_sift_down), Base.Partr.taskheap, UInt32}): Base.Partr.multiq_sift_down(heap::Base.Partr.taskheap, child::UInt32) ││││││││││││└─────────────── ``` 30 March 2022, 00:38:23 UTC
4115686 fix `tuple_tfunc` on `Union` containing `Type{...}` (#44725) fix #44705 30 March 2022, 00:27:41 UTC
4b58679 Fewer warnings in 'make clean' in clean directory (#44450) * Fewer warnings in 'make clean' in clean directory * Don't ignore exit code for 'rm -rf' 30 March 2022, 00:16:31 UTC
bbdd5d7 Increase codegen thread safety (#44454) * Increase thread safety/constify various globals * Remove some static 29 March 2022, 21:19:37 UTC
c2cec7a remove dead code since #42586 [NFC] (#44782) 29 March 2022, 20:53:17 UTC
ff0e25c Remove trailing \ from last line of macros (#44669) 29 March 2022, 19:58:28 UTC
7df454b profile: fix async deadlock (#44781) Acquiring this lock in many implementations could result in deadlock, even with an existing reader. Add a TLS check for reentry before, instead of relying on the implementation specifics, to avoid any issues. 29 March 2022, 18:55:47 UTC
03af781 Fix performance issue with diagonal multiplication (#44651) 29 March 2022, 15:44:31 UTC
1a7355b fix `===` when encountering null pointer (#44749) 29 March 2022, 14:01:32 UTC
e2ea152 Allow pushing to vector after 3-arg ldiv! (#43510) Co-authored-by: Daniel Karrasch <daniel.karrasch@posteo.de> 29 March 2022, 07:35:02 UTC
f86b4ef fix #44732, propagate effects of a thrown concrete call correctly (#44762) 29 March 2022, 06:53:13 UTC
c919811 Update index.md (#44737) It appears UpperTriangular/UnitUpperTriangular/LowerTriangular/UnitLowerTriangular does indeed have optimized methods for logdet so I added it to the column for "Other functions with optimized methods" in the Elementary operations table. 28 March 2022, 22:57:12 UTC
0deb28a optimize the new setglobal! function (#44753) * add missing gc root for typed global assignment The codegen declares this is callee rooted (since we do not usually alllocate), but we might call jl_isa now, which could. The annotations on this function previously were incorrect. * test: make exports of modules check ignore Main Main exports everything, so it is not useful to include in this test. Refs: https://github.com/JuliaLang/julia/issues/44740 * codegen: optimize setglobal like assignment Fixes some atomic ordering issues also where we were ignoring the argument. Uses the new builtin where we could. But also fixes some cases where we would allocate the global binding at the wrong time (which is a globally visible side-effect of compilation), or might throw from inside codegen accidentally there instead. 28 March 2022, 21:36:42 UTC
9d35089 inference: implement missing effects propagation from `abstract_invoke` (#44764) Fix #44763 28 March 2022, 21:11:38 UTC
56d4e0a doc: note that views works on strings too (#44241) 28 March 2022, 21:04:34 UTC
5f6df76 🤖 Bump the SparseArrays stdlib from aa51c9b to 96820d3 (#44731) Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 28 March 2022, 21:02:19 UTC
897c3cf Merge pull request #44721 from JuliaLang/jn/partr-scale partr: add dynamic scaling and optimize code 28 March 2022, 19:38:46 UTC
9112135 errors: fix handling of `.op` in lowering (#44770) Discovered while running the syntax tests with lines 25-28 of `jlfrontend.scm` commented out. Turned out we didn't handle `.op` correctly in neither `check-dotop` nor in `deparse`. This meant we just got `error: malformed expression` instead of an actually useful error message. 28 March 2022, 19:35:10 UTC
d7782de Pass around effects during cacheing (#44777) 28 March 2022, 19:34:45 UTC
89a613b optimizer: eliminate more `isdefined` checks (#44755) Follows up #44708 -- in that PR I missed the most obvious optimization opportunity, i.e. we can safely eliminate `isdefined` checks when all fields are defined at allocation site. This change allows us to eliminate capturing closure constructions when the body and callsite of capture closure is available within a optimized frame, e.g.: ```julia function abmult(r::Int, x0) if r < 0 r = -r end f = x -> x * r return @inline f(x0) end ``` ```diff diff --git a/_master.jl b/_pr.jl index ea06d865b75..c38f221090f 100644 --- a/_master.jl +++ b/_pr.jl @@ -1,24 +1,19 @@ julia> @code_typed abmult(-3, 3) CodeInfo( -1 ── %1 = Core.Box::Type{Core.Box} -│ %2 = %new(%1, r@_2)::Core.Box -│ %3 = Core.isdefined(%2, :contents)::Bool -└─── goto #3 if not %3 +1 ── goto #3 if not true 2 ── goto #4 3 ── $(Expr(:throw_undef_if_not, :r, false))::Any -4 ┄─ %7 = (r@_2 < 0)::Any -└─── goto #9 if not %7 -5 ── %9 = Core.isdefined(%2, :contents)::Bool -└─── goto #7 if not %9 +4 ┄─ %4 = (r@_2 < 0)::Any +└─── goto #9 if not %4 +5 ── goto #7 if not true 6 ── goto #8 7 ── $(Expr(:throw_undef_if_not, :r, false))::Any -8 ┄─ %13 = -r@_2::Any -9 ┄─ %14 = φ (#4 => r@_2, #8 => %13)::Any -│ %15 = Core.isdefined(%2, :contents)::Bool -└─── goto #11 if not %15 +8 ┄─ %9 = -r@_2::Any +9 ┄─ %10 = φ (#4 => r@_2, #8 => %9)::Any +└─── goto #11 if not true 10 ─ goto #12 11 ─ $(Expr(:throw_undef_if_not, :r, false))::Any -12 ┄ %19 = (x0 * %14)::Any +12 ┄ %14 = (x0 * %10)::Any └─── goto #13 -13 ─ return %19 +13 ─ return %14 ) => Any ``` 28 March 2022, 03:30:01 UTC
b297cc4 [Random] Document `default_rng` and remove references to `GLOBAL_RNG` (#44733) * [Random] Document `default_rng` and remove references to `GLOBAL_RNG` * [Random] Remove last references to `GLOBAL_RNG` in `seed!` docstring While the method does use `GLOBAL_RNG` by default, that's an implementation detail, and it eventually uses `default_rng()` internally. 27 March 2022, 22:31:06 UTC
19eb307 fix oc lowering with return type annotations (#44727) fixes #44723 Co-authored-by: Takafumi Arakaki <aka.tkf@gmail.com> 27 March 2022, 06:05:55 UTC
9d31f6a 🤖 Bump the Downloads stdlib from 2a21b15 to a7a0346 (#44738) Co-authored-by: Dilum Aluthge <dilum@aluthge.com> 26 March 2022, 20:08:07 UTC
ba977fa Eliminate trailing whitespace (#44760) 26 March 2022, 20:07:11 UTC
9b21691 Fix eltype determination in `det` (#44582) Co-authored-by: Andreas Noack <andreas@noack.dk> 26 March 2022, 08:45:34 UTC
5dc6155 Use correct variable for threads auto (#44747) --threads=auto uses jl_effective_threads to determine the number of threads to use, so make sure the tests do too, otherwise this test will fail on our new cpu-restricted runners. 25 March 2022, 22:39:02 UTC
ea82910 Avoid copy in getindex(::AbstractQ, ...) (#44729) 25 March 2022, 20:14:50 UTC
68e2969 Recover 1.7's behavior (#44736) Fix #44734. 25 March 2022, 08:15:18 UTC
b449ea5 optimizer: switch to more general data structure of `SSADefUse` (#44730) Now `(du::SSADefUse).uses` field can contain arbitrary "usages" to be eliminated. This structure might be helpful for implementing array SROA, for example. Also slightly tweaks the implementation of `ccall` preserve elimination. 25 March 2022, 02:26:41 UTC
6ce817b build: allow `Make.user` to tweak bootstrap debug level (#44728) The `-g1` option for bootstrapping is especially useful to get Julia-level stacktrace in a case when some hard-to-debug error happened inside `Core.Compiler`. Now we can define to enable it locally without modification on Make.inc: > Make.user ``` BOOTSTRAP_DEBUG_LEVEL=1 ``` 24 March 2022, 16:15:46 UTC
424785a Add missing gc root in codegen (#44724) In #44635, we observe that occasionally a call to `view(::SubArray, ::Colon, ...)` dispatches to the wrong function. The post-inlining IR is in relevant part: ``` │ │ %8 = (isa)(I, Tuple{Colon, UnitRange{Int64}, SubArray{Int64, 2, UnitRange{Int64}, Tuple{Matrix{Int64}}, false}})::Bool └───│ goto #3 if not %8 2 ──│ %10 = π (I, Tuple{Colon, UnitRange{Int64}, SubArray{Int64, 2, UnitRange{Int64}, Tuple{Matrix{Int64}}, false}}) │ │ @ indices.jl:324 within `to_indices` @ multidimensional.jl:859 │ │┌ @ multidimensional.jl:864 within `uncolon` │ ││┌ @ indices.jl:351 within `Slice` @ indices.jl:351 │ │││ %11 = %new(Base.Slice{Base.OneTo{Int64}}, %7)::Base.Slice{Base.OneTo{Int64}} │ │└└ │ │┌ @ essentials.jl:251 within `tail` │ ││ %12 = Core.getfield(%10, 2)::UnitRange{Int64} │ ││ %13 = Core.getfield(%10, 3)::SubArray{Int64, 2, UnitRange{Int64}, Tuple{Matrix{Int64}}, false} │ │└ │ │ @ indices.jl:324 within `to_indices` └───│ goto #5 │ @ indices.jl:324 within `to_indices` @ indices.jl:333 │┌ @ tuple.jl:29 within `getindex` 3 ──││ %15 = Base.getfield(I, 1, true)::Function │ │└ │ │ invoke Base.to_index(A::SubArray{Int64, 3, Array{Int64, 3}, Tuple{Vector{Int64}, Base.Slice{Base.OneTo{Int64}}, UnitRange{Int64}}, false}, %15::Function)::Union{} ``` Here we expect the `isa` at `%8` to always be [1]. However, we seemingly observe the result that the branch is not taken and we instead end up in the fallback `to_index`, which (correctly) complains that the colon should have been dereferenced to an index. After some investigation of the relevant rr trace, what turns out to happen here is that the va tuple we compute in codegen gets garbage collected before the call to `emit_isa`, causing a use-after-free read, which happens to make `emit_isa` think that the isa condition is impossible, causing it to fold the branch away. The fix is to simply add the relevant GC root. It's a bit unfortunate that this wasn't caught by the GC verifier. It would have in principle been capable of doing so, but it is currently disabled for C++ sources. It would be worth revisiting this in the future to see if it can't be made to work. Fixes #44635. [1] The specialization heuristics decided to widen `Colon` to `Function`, which doesn't make much sense here, but regardless, it shouldn't crash. 24 March 2022, 14:13:25 UTC
7189c81 Clarify documentation of global variables, fixes #44695 (#44709) 24 March 2022, 09:15:11 UTC
2099987 Make `Matrix` cntr work for structured matrices for `zero(T) !isa T` (#44707) 24 March 2022, 09:09:05 UTC
e0c5e96 optimizer: eliminate `isdefined` in `sroa_mutables!` (#44708) This commit implements a simple optimization within `sroa_mutables!` to eliminate `isdefined` call by checking load-forwardability of the field. This optimization may be especially useful to eliminate extra allocation of `Core.Box` involved with a capturing closure, e.g.: ```julia julia> callit(f, args...) = f(args...); julia> function isdefined_elim() local arr::Vector{Any} callit() do arr = Any[] end return arr end; julia> code_typed(isdefined_elim) ``` ```diff diff --git a/_master.jl b/_pr.jl index 3aa40ba20e5..11eccf65f32 100644 --- a/_master.jl +++ b/_pr.jl @@ -1,15 +1,8 @@ 1-element Vector{Any}: CodeInfo( -1 ─ %1 = Core.Box::Type{Core.Box} -│ %2 = %new(%1)::Core.Box -│ %3 = $(Expr(:foreigncall, :(:jl_alloc_array_1d), Vector{Any}, svec(Any, Int64), 0, :(:ccall), Vector{Any}, 0, 0))::Vector{Any} -│ Core.setfield!(%2, :contents, %3)::Vector{Any} -│ %5 = Core.isdefined(%2, :contents)::Bool -└── goto #3 if not %5 -2 ─ goto #4 -3 ─ $(Expr(:throw_undef_if_not, :arr, false))::Any -4 ┄ %9 = Core.getfield(%2, :contents)::Any -│ Core.typeassert(%9, Vector{Any})::Vector{Any} -│ %11 = π (%9, Vector{Any}) -└── return %11 +1 ─ %1 = $(Expr(:foreigncall, :(:jl_alloc_array_1d), Vector{Any}, svec(Any, Int64), 0, :(:ccall), Vector{Any}, 0, 0))::Vector{Any} +└── goto #3 if not true +2 ─ goto #4 +3 ─ $(Expr(:throw_undef_if_not, :arr, false))::Any +4 ┄ return %1 ) => Vector{Any} ``` 24 March 2022, 03:00:39 UTC
c503611 refactor SROA test cases (#44706) Mostly adapted from #43888. Should be more robust and cover more cases. 23 March 2022, 23:56:09 UTC
0c32aa7 partr: add dynamic scaling and optimize 23 March 2022, 22:59:05 UTC
023f996 partr: fix performance trap from #44653 See issue https://github.com/JuliaLang/julia/issues/44720 23 March 2022, 22:56:54 UTC
6e0772a rename InvasiveLinkedList to IntrusiveLinkedList NFC, but a better name 23 March 2022, 20:06:56 UTC
a5fe945 ccall: add support for automatic llvmcall mangling (#44697) Sometimes the mangling changes by version, or is unclear, so we allow that to auto-upgrade here. Code from llvm-alloc-opt.cpp. Fix #44694 23 March 2022, 17:20:13 UTC
6366f40 port partr multiq to julia (#44653) Direct translation, not necessarily fully idiomatic. In preparation for future improvements. 23 March 2022, 17:19:33 UTC
62e0729 avoid using `@sync_add` on remotecalls (#44671) * avoid using `@sync_add` on remotecalls It seems like @sync_add adds the Futures to a queue (Channel) for @sync, which in turn calls wait() for all the futures synchronously. Not only that is slightly detrimental for network operations (latencies add up), but in case of Distributed the call to wait() may actually cause some compilation on remote processes, which is also wait()ed for. In result, some operations took a great amount of "serial" processing time if executed on many workers at once. For me, this closes #44645. The major change can be illustrated as follows: First add some workers: ``` using Distributed addprocs(10) ``` and then trigger something that, for example, causes package imports on the workers: ``` using SomeTinyPackage ``` In my case (importing UnicodePlots on 10 workers), this improves the loading time over 10 workers from ~11s to ~5.5s. This is a far bigger issue when worker count gets high. The time of the processing on each worker is usually around 0.3s, so triggering this problem even on a relatively small cluster (64 workers) causes a really annoying delay, and running `@everywhere` for the first time on reasonable clusters (I tested with 1024 workers, see #44645) usually takes more than 5 minutes. Which sucks. Anyway, on 64 workers this reduces the "first import" time from ~30s to ~6s, and on 1024 workers this seems to reduce the time from over 5 minutes (I didn't bother to measure that precisely now, sorry) to ~11s. Related issues: - Probably fixes #39291. - #42156 is a kinda complementary -- it removes the most painful source of slowness (the 0.3s precompilation on the workers), but the fact that the wait()ing is serial remains a problem if the network latencies are high. May help with #38931 Co-authored-by: Valentin Churavy <vchuravy@users.noreply.github.com> 23 March 2022, 10:14:15 UTC
d655402 doc: fix typo in interface manual section (#44703) 23 March 2022, 08:50:37 UTC
fc9c280 Fix performance bug for `*` with `AbstractQ` (#44615) 22 March 2022, 20:44:56 UTC
b91dd02 Merge pull request #44641 from JuliaLang/jn/44614 types: fix layout issues for Tuple 22 March 2022, 19:03:16 UTC
e9ba166 types: fix layout issues for Tuple Fix #44614 22 March 2022, 14:26:59 UTC
99bdd00 make fieldtype computation stable/pure 22 March 2022, 14:26:59 UTC
95da0d8 Add system info to start of testsuite. Profile: don't spawn profile listener on windows (#44639) 22 March 2022, 14:03:13 UTC
d3698a8 add doc string for `uppercase(::AbstractChar)` and friends (#44351) 22 March 2022, 13:33:47 UTC
7cde4be inference: override `InterConditional` result with `Const` carefully (#44668) I found that a tricky thing can happen when constant inference derives `Const`-result while non-constant inference has derived (non-constant) `InterConditional` result beforehand. In such a case, currently we discard the result with constant inference (since `!(Const ⊑ InterConditional)`), but we can achieve more accuracy by not discarding that `Const`-information, e.g.: ```julia julia> iszero_simple(x) = x === 0 iszero_simple (generic function with 1 method) julia> @test Base.return_types() do iszero_simple(0) ? nothing : missing end |> only === Nothing Test Passed ``` 22 March 2022, 02:44:08 UTC
cf999af Also trigger breakpoint on testset error (#44652) Ref https://github.com/JuliaLang/julia/issues/44635#issuecomment-1070807587 21 March 2022, 21:23:54 UTC
32b1305 More flexible test affinity setting (#44677) * More flexibly test affinity setting When running on a machine with `cpusets` applied, we are unable to assign CPU affinity to CPUs 1 and 2; we may be locked to CPUs 9-16, for example. So we must inspect what our current cpumask is, and from that select CPUs that we can safely assign affinity to in our tests. * Import `uv_thread_getaffinity` from `print_process_affinity.jl` * Call `uv_thread_getaffinity` only if `AFFINITY_SUPPORTED` * Fix a syntax error Co-authored-by: Takafumi Arakaki <aka.tkf@gmail.com> 21 March 2022, 20:33:24 UTC
1eae65b syntax: deparse function end (#44630) 21 March 2022, 19:56:25 UTC
28f58e7 doc: recommend `@spawn` over `@async` (#44667) 21 March 2022, 18:18:11 UTC
a6187ea Fallback implementation of sizehint! for AbstractDict (#44687) Fixes #44686 + additional haslength check + docs that sizehint! returns the collection. 21 March 2022, 18:17:43 UTC
back to top