Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backports for Julia 1.10.8 #56653

Open
wants to merge 20 commits into
base: release-1.10
Choose a base branch
from
Open

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Nov 22, 2024

Backported PRs:

Need manual backport:

Contains multiple commits, manual intervention needed:

Non-merged PRs with backport label:

jishnub and others added 3 commits November 22, 2024 11:01
)

The `(::Diagonal) + (::Symmetric)` and analogous methods were
specialized in #35333 to return a
`Symmetric`, but these only work if the `Diagonal` is also symmetric.
This typically holds for arrays of numbers, but may not hold for
block-diagonal and other types for which symmetry isn't guaranteed. This
PR restricts the methods to arrays of `Number`s.

Fixes, e.g.:
```julia
julia> using StaticArrays, LinearAlgebra

julia> D = Diagonal(fill(SMatrix{2,2}(1:4), 2))
2×2 Diagonal{SMatrix{2, 2, Int64, 4}, Vector{SMatrix{2, 2, Int64, 4}}}:
 [1 3; 2 4]      ⋅
     ⋅       [1 3; 2 4]

julia> S = Symmetric(D)
2×2 Symmetric{AbstractMatrix, Diagonal{SMatrix{2, 2, Int64, 4}, Vector{SMatrix{2, 2, Int64, 4}}}}:
 [1 3; 3 4]      ⋅
     ⋅       [1 3; 3 4]

julia> S + D
2×2 Symmetric{AbstractMatrix, Diagonal{SMatrix{2, 2, Int64, 4}, Vector{SMatrix{2, 2, Int64, 4}}}}:
 [2 6; 6 8]      ⋅
     ⋅       [2 6; 6 8]

julia> S[1,1] + D[1,1]
2×2 SMatrix{2, 2, Int64, 4} with indices SOneTo(2)×SOneTo(2):
 2  6
 5  8

julia> (S + D)[1,1] == S[1,1] + D[1,1]
false
```
After this,
```julia
julia> S + D
2×2 Matrix{AbstractMatrix{Int64}}:
 [2 6; 5 8]  [0 0; 0 0]
 [0 0; 0 0]  [2 6; 5 8]
```

Even with `Number`s as elements, there might be an issue with `NaN`s
along the diagonal as `!issymmetric(NaN)`, but that may be a different
PR.

(cherry picked from commit 197295c)
This PR is a potential fix for #54833.

## Description
The function
https://github.com/JuliaLang/julia/blob/2a06376c18afd7ec875335070743dcebcd85dee7/stdlib/LinearAlgebra/src/triangular.jl#L2220
computes $\boldsymbol{A}^{\dfrac{1}{2^s}} - \boldsymbol{I}$ for a
real-valued $2\times 2$ matrix $\boldsymbol{A}$ using Algorithm 5.1 in
[R1]. However, the algorithm in [R1] as well as the above function do
not handle the case $s=0.$ This fix extends the function to compute
$\boldsymbol{A}^{\dfrac{1}{2^s}} - \boldsymbol{I} \Bigg|_{s=0} =
\boldsymbol{A} - \boldsymbol{I}.$

## Checklist
- [X] Fix code: `stdlib\LinearAlgebra\src\triangular.jl` in function
`_sqrt_pow_diag_block_2x2!(A, A0, s)`.
- [X] Add test case: `stdlib\LinearAlgebra\test\triangular.jl`.
- [X] Update `NEWS.md`.
- [X] Testing and self review.

|  Tag  | Reference |
| --- | --- |
| <nobr>[R1]</nobr> | Al-Mohy, Awad H. and Higham, Nicholas J. "Improved
Inverse Scaling and Squaring Algorithms for the Matrix Logarithm", 2011,
url: https://eprints.maths.manchester.ac.uk/1687/1/paper11.pdf |

---------

Co-authored-by: Daniel Karrasch <[email protected]>
Co-authored-by: Oscar Smith <[email protected]>
(cherry picked from commit 2cdfe06)
@KristofferC KristofferC added the release Release management and versioning. label Nov 22, 2024
@christiangnrd
Copy link
Contributor

JuliaLang/Pkg.jl#4093

@topolarity
Copy link
Member

JuliaLang/Pkg.jl#4093

And a follow-up to that backport: #56666

DilumAluthgeBot and others added 2 commits November 24, 2024 09:19
…09f49 (#56669)

Co-authored-by: Dilum Aluthge <[email protected]>
fix preferential Manifest.toml naming (#3731)
…56666)

It is possible for an extension `ExtAB` to be loadable by one of its
triggers, e.g. if `A` loads `B`. However, this loading is not supposed
to happen during pre-compilation of `A`.

Getting this wrong means disagreeing with the scheduled pre-compile jobs
(`A` is not scheduled to depend on or generate a cache file for `ExtAB`
but accidentally attempts both) and leads to confusing errors about
missing cache files.

We used to cover up this bad behavior w/ an erroneous cycle warning
(fixed by #55910), but now we need to be sure this works.
@topolarity
Copy link
Member

This pass was assuming that the post-dominator of all finalizer uses
exists as a real BB in the CFG.
@topolarity topolarity force-pushed the backports-release-1.10 branch from d11f572 to 64f8634 Compare December 3, 2024 02:08
aviatesk and others added 5 commits December 3, 2024 20:04
Fixes #56782
Fix `exp(reinterpret(Float64, 0x7ffbb14880000000))` returning non-NaN
value. This should have minimal performance impact since it's already in
the fallback branch.

(cherry picked from commit 19e06d3)
@christiangnrd

This comment was marked as resolved.

@IanButterworth
Copy link
Member

Looks like your branch is old. Says 1.10.6

@christiangnrd
Copy link
Contributor

I think this branch was created before the commit to change the version to 1.10.7 was merged https://github.com/JuliaLang/julia/blob/39cfea14d5224138e980ab7a7a0c551325e249e8/VERSION

IanButterworth and others added 6 commits December 24, 2024 21:02
Fixes #56726 added the changes that were suggested. fixing the mistake.

---------

Co-authored-by: Max Horn <[email protected]>
Co-authored-by: Chengyu Han <[email protected]>
(cherry picked from commit fc9e7c4)
…56842)

Fix #56841.

Currently the documentation states that keys(dict) and values(dict)
iterate in the same order. But it is not stated whether this is the same
order as that used by pairs(dict), or when looping, for (k,v) in dict.

This PR makes this guarantee explicit.

(cherry picked from commit 796d823)
#55886 accidentally created a new function
`Base.MathConstants.rationalize` instead of extending
`Base.rationalize`, which is the reason why `Base.rationalize(Int, π)`
isn’t constant-folded in Julia 1.10 and 1.11:

```
julia> @Btime rationalize(Int,π);
  1.837 ns (0 allocations: 0 bytes)      # v1.9: constant-folded
  88.416 μs (412 allocations: 15.00 KiB) # v1.10: not constant-folded
```

This PR fixes that. It should probably be backported to 1.10 and 1.11.

(cherry picked from commit d3c26b7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Release management and versioning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.