Backports for 1.13.0-rc2#61728
Open
KristofferC wants to merge 27 commits into
Open
Conversation
#61643) Stdlib: LinearAlgebra URL: https://github.com/JuliaLang/LinearAlgebra.jl.git Stdlib branch: release-1.13 Julia branch: backports-release-1.13 Old commit: 4786452 New commit: 0cfd355 Julia version: 1.13.0-beta3 LinearAlgebra version: 1.13.0 Bump invoked by: @dkarrasch Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaLang/LinearAlgebra.jl@4786452...0cfd355 ``` $ git log --oneline 4786452..0cfd355 0cfd355 Backports to release v1.13 (#1577) 7e750f1 Run CI on v1.13 378f7aa Use `matprod_dest` mechanism consistently in triangular mul 064bc47 Backports to 1.13 (#1528) e6086d4 Fix promotion in triangular linalg with mixed BLASFloats (#1561) 8c78509 docs: use current function signatures in @docs blocks (#1566) dedcea0 matrix multiplication: delete unused functions `matmul2x2`, `matmul3x3` (#1564) b1714dc resolve test ambiguities with Base (#1568) 1e08891 Generalize zero in Givens algorithm (#1562) aa870fe Avoid construction in convert (#1556) eebb473 Add ::Tuple assertion in fzero to prevent invalidation cascade (#1553) 096ff7a make 3-arg `*` run by BLAS in real/complex mixed cases (#1552) 9add3c6 Limit adj/trans `diagview` to matrices (#1550) 2e2da7b Fix `Matrix(::HessenbergQ)` and multiplication for empty matrices (#1546) 707fed4 Optimize `copytrito!(B, A, 'L')` (#1541) c4152b8 Added note to BLAS.[g|s]et_num_threads about Apple Accelerate not supporting it (#1195) 8068002 Added CHANGELOG.md for LinearAlgebra.jl (#1532) 27769a6 use muladd in generic_syrk (#1559) cdee36a In-place multiplication of `Diagonal` with OffsetMatrix should throw (#1526) ``` Co-authored-by: dkarrasch <26658441+dkarrasch@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps [actions/github-script](https://github.com/actions/github-script) from 8.0.0 to 9.0.0. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](actions/github-script@ed59741...3a2844b) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [julia-actions/setup-julia](https://github.com/julia-actions/setup-julia) from 2.7.0 to 3.0.1. - [Release notes](https://github.com/julia-actions/setup-julia/releases) - [Commits](julia-actions/setup-julia@4c0cb0f...f6f565d) --- updated-dependencies: - dependency-name: julia-actions/setup-julia dependency-version: 3.0.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 9a6eac9)
Change the anonymous function name for `if @generated` to use the module counter. Using `gensy` (`gensym()`) for anonymous module-level names is generally avoided in lowering, since it makes the anonymized names susceptible to changes to unrelated execution / lowering in other modules etc. (in the same process), but it seems that we missed this usage. Required for #61577, since JuliaLowering cannot guarantee `gensym()` parity with flisp (only module counter parity). (cherry picked from commit b936235)
Also add helper functions so the supported layout forms are explicit at each use site. Co-authored-by: Codex <codex@openai.com> This PR used to also contain the fix for oscar-system/GAP.jl#1366 but I got that merged separately via PR #61517 --- Off-topic, but: I am actually somewhat amazed by the AI here: while I discovered the source of the bug myself, and the fix was clear, I wondered if I could let the AI write the test for me... and then also thought that some enums for the `fielddesc_type` values would be good... I ended up *not* telling it about the specific crash; instead I just asked it to introduce the enum and adjust the code to use it; and to check for spots that are not handling all `fielddesc_type`. That's it. I thought I'd follow this up with telling it what to fix and to add a test case. But actually it one-shotted it, discovered the crash in `summarysize` and created a test case. *I did not tell it there is a crash. Co-authored-by: Codex <codex@openai.com> (cherry picked from commit 908d825)
When merging overlay and base method match results in `findall(sig,
::OverlayMethodTable)`, base methods whose signature is fully covered by
any of matching overlay methods' signatures are now filtered out.
Previously, both the overlay and base methods with the same signature
appeared in the results. This caused type inference to union their
return types even though the overlay should take dispatch priority.
While this is a general inference correctness improvement that makes
inference's emulation of overlay method selection at runtime more
"correct", it might be worth explaining the concrete need that motivates
this change:
Currently, inference for code like `[(x::Vector{Vector{Int}})...;]`
unexpectedly infers `Union{Vector{Int},Vector{Any}}` instead of
`Vector{Int}`, causing type instability isseus as reported in
aviatesk/JET.jl#413.
The root cause of this type instability is the existence of the fallback
method `vcat() = Any[]`.
To fix this, I initially attempted to remove the `vcat()` method
(#47628), but that turned out to be a considerably
breaking change, so I concluded it was not viable to proceed in that
direction as of Julia v1 time.
I also considered alternative approaches: 1.) changing the lowering of
`[x...;]` to produce a primitive for `vcat` that would allow inference
to work correctly in such cases, and 2.) adding a typed required 1st
argument to other `vcat` methods so that dispatch to `vcat()` would not
be considered — but both of those also proved impractical for various
reasons (primarily because the complexity they introduce is too high).
Removing the fallback method definitions for `vcat()` and `hcat()`
themselves would be the simplest and most elegant fix, but that would
have to wait for the release of Julia v2.
Therefore, rather than fixing this type instability on the Julia base
side, I believe the least invasive solution is to define, on the JET
side:
```julia
@overlay JET_METHOD_TABLE Base.vcat() = error()
```
so that, during JET's abstract interpretation, the method match that
could produce the `Vector{Any}` possibility is effectively ignored. And
this commit is required for that to actually work.
(cherry picked from commit 3181c36)
Fix missing `(JL_STREAM*)` cast for `jl_safe_static_show` in `gc_assert_parent_validity` in gc-stock.c, which caused an incompatible pointer type error. Fix stale initializer in gc-debug.c: the `always_full` field was removed from `jl_gc_debug_env_t` in #58713 but the corresponding `0` in the initializer was not removed, causing excess-elements-in-scalar warnings. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> (cherry picked from commit 435b97e)
fixes #60304, #61440, #61441 the old approach was a little "clever" in this map-twice approach to first make an array of `Ref` and then fill those results. I imagine the intention was to use all the `map` specializations to keep the same output type whenever possible. but `collect_similar` can also do this and avoids the bugs arising for arrays where `x[i] !== x[i]`. also there were several paths in the mutating `asyncmap!` that were completely non-functional and some other drive-by cleanups. co-developed with Opus 4.6 (cherry picked from commit ea8d7b9)
(cherry picked from commit 361fd38)
Even without `reassoc` and with identical optimization flags, `contract` alone is enough to see divergent floating-point results from identical code so IEEE mode must not set it. This change means that `muladd` never fuses under `--math-mode=ieee` which is consistent with the existing semantics (fuse when possible, but no guarantees) (cherry picked from commit 13c2c70)
8137d6e to
0dc9d62
Compare
DilumAluthge
reviewed
May 6, 2026
Member
DilumAluthge
left a comment
There was a problem hiding this comment.
[CI changes are fine, just updating the commit hashes of some external actions.]
…#61835) Stdlib: SparseArrays URL: https://github.com/JuliaSparse/SparseArrays.jl.git Stdlib branch: release-1.13 Julia branch: backports-release-1.13 Old commit: 9d08bb3 New commit: 0ecfa6f Julia version: 1.13.0-beta3 SparseArrays version: 1.13.0 Bump invoked by: @dkarrasch Powered by: [BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl) Diff: JuliaSparse/SparseArrays.jl@9d08bb3...0ecfa6f ``` $ git log --oneline 9d08bb3..0ecfa6f 0ecfa6f Backports to release-1.13 (#717) 7a78eb0 fix 3-argument dot (#715) ``` Co-authored-by: dkarrasch <26658441+dkarrasch@users.noreply.github.com>
LazyLibrary is not supported yet by `--trim`. We have plans to support it in 1.14 via TypedCallable or upcoming AbstractLibrary changes (both expected within ~1 mo.), but for now to avoid this regression on 1.13 we have to revert these changes. Generated by Claude.
(cherry picked from commit 18aa237)
As far as I could tell we never added documentation to these debug tools, partly explaining why they keep bit-rooting. Document the debugging tools enabled by building Julia with `WITH_GC_DEBUG_ENV=1`, including the `JULIA_GC_ALLOC_POOL`, `JULIA_GC_ALLOC_OTHER`, `JULIA_GC_ALLOC_PRINT`, and `JULIA_GC_WAIT_FOR_DEBUGGER` environment variables, the `GC_VERIFY` write-barrier verifier, and tips for debugging write-barrier violations using GDB, ASLR disabling, and `rr` record-replay. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> (cherry picked from commit 5f9e892)
Both `OverrideStackAlignment` and `getStackProtectorGuard` are ModuleFlags and should already be copied over, but `m->setStackProtectorGuard(source->getStackProtectorGuard());` will set the stack-protector flag to be the empty string. Instead, we can copy the flags over from the source and then if they are missing, initialize them to the expected ones. (cherry picked from commit 9958ed3)
`gc_scrub_range` (active under `WITH_GC_DEBUG_ENV`) conservatively marks any pool object it finds on a task stack by setting `pg->has_marked = 1` and `tag->bits.gc = GC_MARKED`. It does not account for the pool's bump-pointer allocation frontier (`pool->newpages`): slots at or beyond this boundary are unconditionally treated as garbage by `gc_sweep_page` regardless of their GC bits (the `(char*)v >= lim_newpages` check). When every slot on such a page falls past the frontier, `freedall` stays 1 and `assert(!freedall)` fires. The mismatch was introduced by PR #50137 (June 2023), which switched the pool allocator to a bump-pointer scheme and added the `lim_newpages` guard in sweep, without updating `gc_scrub_range` to match. Fix: relax the assertion to permit `freedall=1` when `lim_newpages` is before the end of the page (i.e., this is the currently-active bump-pointer page). That is precisely the case where `gc_scrub` can set `has_marked=1` while the sweep legitimately finds no live objects. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> (cherry picked from commit 065c369)
fixes JuliaArrays/StaticArrays.jl#1282 test case minimized by codex (cherry picked from commit 90e7065)
Fixes #61805 It seems that the problem is that our `foldr_impl` is passing a non-reversed iterator to `_xfadjoint`, and then doing the actual final reduction on a reversed iterator. This is normally fine, but it interacts incorrectly with `FlatteningRF` which does a sub-reduction inside each reducing step: ```julia @inline function (op::FlatteningRF)(acc, x) op′, itr′ = _xfadjoint(op.rf, x) return _foldl_impl(op′, acc, itr′) end ``` and this sub-reduction is not reversed when it gets hit during `foldr`, resulting in the weird reduction order shown in the linked issue: ```julia julia> foldr(Iterators.flatten([["a","b"],["c","d"]])) do l, r @info "" l r l * r end ┌ Info: │ l = "d" └ r = "c" ┌ Info: │ l = "a" └ r = "dc" ┌ Info: │ l = "b" └ r = "adc" "badc" ``` This PR changes around the location of the `_reverse_iter` so that the sub-reductions are also reversed: ```julia julia> foldr(Iterators.flatten([["a","b"],["c","d"]])) do l, r @info "" l r l * r end ┌ Info: │ l = "c" └ r = "d" ┌ Info: │ l = "b" └ r = "cd" ┌ Info: │ l = "a" └ r = "bcd" "abcd" ``` --------- Co-authored-by: Andy Dienes <51664769+adienes@users.noreply.github.com> Co-authored-by: Matt Bauman <mbauman@juliahub.com> (cherry picked from commit ccd0279)
When a struct is redefined, we first check whether the new definition is in fact identical to the old definition, and if so we just reuse the old type. Revise leans pretty heavily on this behavior, as signature extraction relies (in corner cases) on struct definition. As identified in #61789, the equivalence check failed for self-referential `struct`s ```julia struct R x next::R end ``` The fix is fairly straightforward: before comparing equivalence with `equiv_field_types`, ensure that type-substitution occurs throughout the struct definition. Fixes #61789 This pull request was written with the assistance of generative AI (Claude Code, Opus 4.7). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> (cherry picked from commit 3d6bb83)
fixes #61870, closes #61871 ```julia julia> using BenchmarkTools julia> function my_zero_inbounds!(A::Matrix{Float64}) for i in eachindex(A) @inbounds A[i] = 0.0 end return A end my_zero_inbounds! (generic function with 1 method) julia> function my_zero!(A::Matrix{Float64}) for i in eachindex(A) A[i] = 0.0 end return A end my_zero! (generic function with 1 method) julia> @benchmark my_zero_inbounds!(X) setup=X=rand(1000, 1000) BenchmarkTools.Trial: 10000 samples with 1 evaluation per sample. Range (min … max): 27.083 μs … 226.500 μs ┊ GC (min … max): 0.00% … 0.00% Time (median): 32.750 μs ┊ GC (median): 0.00% Time (mean ± σ): 41.400 μs ± 15.265 μs ┊ GC (mean ± σ): 0.00% ± 0.00% ▅▆██▇▅▃▂▁▁ ▇ ▂ ▂▃▂ ▁ ▂▅▅▅▄▃▂▁▂▁▁▃▁▁▁▂▂▂▁▁ ▁ ▁ ▃▂ ▂ ██████████▇████████▇█▇▇▇▆██████████████████████▇███████▇▆▇█▆ █ 27.1 μs Histogram: log(frequency) by time 82.8 μs < Memory estimate: 0 bytes, allocs estimate: 0. julia> @benchmark my_zero!(X) setup=X=rand(1000, 1000) BenchmarkTools.Trial: 10000 samples with 1 evaluation per sample. Range (min … max): 27.125 μs … 156.000 μs ┊ GC (min … max): 0.00% … 0.00% Time (median): 30.167 μs ┊ GC (median): 0.00% Time (mean ± σ): 33.619 μs ± 5.419 μs ┊ GC (mean ± σ): 0.00% ± 0.00% █▇ ▂ ▂▃▃▄▂▂████▃▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▃▃▃▃▂▃▅▇▇█▄▂▂▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▂ 27.1 μs Histogram: frequency by time 45.8 μs < Memory estimate: 0 bytes, allocs estimate: 0. ``` previously the non-inbounds one was slower ```julia julia> @benchmark my_zero!(X) setup=X=rand(1000, 1000) BenchmarkTools.Trial: 10000 samples with 1 evaluation per sample. Range (min … max): 55.250 μs … 1.088 ms ┊ GC (min … max): 0.00% … 0.00% Time (median): 63.250 μs ┊ GC (median): 0.00% Time (mean ± σ): 67.430 μs ± 15.484 μs ┊ GC (mean ± σ): 0.00% ± 0.00% ▄ ▁▁▆▅▁ █▆▃▄▃▂▂▂▂▁▁▁▁▁▅▁▂▂▁▁▂▃▁▁ ▂▃▂▁ ▂ ███████▇▇▇███████████████████████████▇▇▇▆▆▆▆▅▅▆▇▇█████▇█▇▇▇ █ 55.2 μs Histogram: log(frequency) by time 98.4 μs < Memory estimate: 0 bytes, allocs estimate: 0. ``` (cherry picked from commit 8bb4ad6)
Co-authored-by: Cody Tapscott <84105208+topolarity@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backported PRs:
gensyin anonymous generator name #61582fielddesc_typevalues by named constants #61411asyncmapto use plain buffers instead ofRef#61445--math-mode=ieeehandling formuladd_float#61708broadcastvararg method #61776foldrandIterators.flatten#61806_typebody!#61794memset-table loops #61873max_methods=1for!=,>,>=to 1 #61880Need manual backport:
emit_static_rootsfor "allroots" case #60656features_disforImageTargetinloadingdebug #61622.github/workflows/PrAssignee.yml#61695Contains multiple commits, manual intervention needed:
Non-merged PRs with backport label:
map(f, ::BitArray...)#61895inline_cost_threshold == typemax(Int)#60121