Skip to content

Backports for julia 1.11.6 #58224

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

Merged
merged 46 commits into from
Jul 2, 2025
Merged

Backports for julia 1.11.6 #58224

merged 46 commits into from
Jul 2, 2025

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Apr 25, 2025

Backported PRs:

Need manual backport:

Contains multiple commits, manual intervention needed:

Non-merged PRs with backport label:

nsajko and others added 5 commits April 25, 2025 11:34
Also changed the check to compare against the tuple argument, instead of
against the method static parameter for the tuple length. Should be
better when the length isn't known at compile time.

Fixes #58085

(cherry picked from commit b265dba)
and avoid eager UnionAll unwrapping to hit more fast path.
close #58129 (test passed locally)
close #56350 (MWE returns `Tuple{Any, Any, Vararg}` now.)

(cherry picked from commit 334c316)
…lls (#58200)

`op` should not be `inbounds`-ed here

the test case I added might technically be an illegal (or at least bad)
use of `@propagate_inbounds` in case anyone has a suggestion for a more
natural test case, but nonetheless it demonstrates getting a
`BoundsError` instead of a segfault (worse) or incorrect / junk data
(more worse), both of which happen on master

(cherry picked from commit bdab032)
@KristofferC KristofferC added the release Release management and versioning. label Apr 25, 2025
benlorenz and others added 24 commits April 28, 2025 17:50
(Fix removal of globals with addrspaces in removeAddrspaces (#58322))
Closes #57376
Closes #34037

- Adds a lock in `SimpleLogger` and `ConsoleLogger` for use on maxlog
tracking and stream writes to improve threadsafety.
Closely similar to #54497

- Turns the internal `_min_enabled_level` into a `Threads.Atomic`. There
are [some direct
interactions](https://juliahub.com/ui/Search?type=code&q=_min_enabled_level&w=true)
to this internal in the ecosystem, but they should still work
```
julia> Base.CoreLogging._min_enabled_level[] = Logging.Info+1
LogLevel(1)
```

- Brings tests over from #57448

Performance seems highly similar:

### Master
```
julia> @time for i in 1:10000
          @info "foo" maxlog=10000000
       end
[ Info: foo
...
  0.481446 seconds (1.33 M allocations: 89.226 MiB, 0.49% gc time)
```

### This PR
```
  0.477235 seconds (1.31 M allocations: 79.002 MiB, 1.77% gc time)
```

(cherry picked from commit 9af9650)
Fix the subtyping hang found in
#58115 (comment)

(cherry picked from commit c9ad04d)
This does not fix the underlying issue that can occur here which is a
collision of build_ids.lo between modules in IR decompression. Fixing
that requires a somewhat significant overhaul to the serialization of IR
(probably using the module identity as a key). This does mean we use a
lot more of the bits available here so it makes collisions a lot less
likely( they were already extremely rare) but hrtime does tend to only
use the lower bits of a 64 bit integer and this will hopefully add some
more randomness and make this even less likely

(cherry picked from commit 7157407)
This dodges the issue on my machine, let's see if it works for everyone.

(cherry picked from commit dda37f9)
It turns out that there are two path types in applescript, and I had mixed two of them in my previous patch.  Annoyingly, things seemed to work when editing locally, unsure why.

(cherry picked from commit c759aa9)
When this API was added, this function inlined, which is important,
because the API relies on the allocation of the `Ref` being elided. At
some point (I went back to 1.8) this regressed. For example, it is
currently responsible for substantially all non-Expr allocations in
JuliaParser. Before (parsing all of Base with JuliaParser):
```
│     Memory estimate: 76.93 MiB, allocs estimate: 719922.
```
After:
```
│     Memory estimate: 53.31 MiB, allocs estimate: 156.
```

Also add a test to make sure this doesn't regress again.

(cherry picked from commit d6294ba)
Fixes #53430

```julia
julia> a = rand(100,100); b = similar(a); av = view(a, axes(a)...); bv = view(b, axes(b)...); bv2 = view(b, UnitRange.(axes(b))...);

julia> @Btime copyto!($bv2, $av); # slow, indices are UnitRanges
  12.352 μs (0 allocations: 0 bytes) # master, v"1.13.0-DEV.745"
  1.662 μs (0 allocations: 0 bytes) # this PR

julia> @Btime copyto!($bv, $av); # reference
  1.733 μs (0 allocations: 0 bytes)
```
The performances become comparable after this PR.

I've also renamed the second `I` to `Itail`, as the two variables
represent different quantities.

(cherry picked from commit 36a4616)
Makes more types survive `jl_static_show` unambiguously:
- Symbols
- Symbols printed in the `:var"foo"` form use raw string escaping,
fixing `:var"a\b"`, `:var"a\\"`, `:var"$a"`, etc.
  - Symbols that require parens use parens (`:(=)`, ...)
- Signed integers: Except for `Int`, signed integers print like
`Int8(1)`.
- Floats: floats are printed in a naive but reversible (TODO: double
check) way. `Inf(16|32|)` and `NaN(16|32|)` are printed, and
`Float16`/`Float32` print the type (`Float32(1.5)`). `Float64`s are
printed with a trailing `.0` if it is necessary to disambiguate from
`Int`.

Fixes #52677,
#58484 (comment),
#58484 (comment),
and the specific case mentioned in #58484. Improves the situation for
round-trip (inexhaustive list):
- Non-canonical NaNs
- BFloat16
- User-defined primitive types. This one is tricky, because they can
have a size different from any type we have literals for.

(cherry picked from commit b03ef6b)
#58435)

This is caused because for LLVMs sake we have to say that the oddly
typed field is smaller than it actually is. (I wonder if we could
represent it as an iN field in a struct and have it work but the result
would be the same for now)

Fix #58434, fix #49318, close #49362.

---------

Co-authored-by: Mosè Giordano <[email protected]>
Co-authored-by: Sukera <[email protected]>
(cherry picked from commit 1b0b028)
stevengj and others added 16 commits June 25, 2025 14:05
Update command line option formatting.

(cherry picked from commit 8c28ac6)
Is struct not a hard scope?

```jl
julia> b = 1
       struct Tester
           tester
           Tester(tester) = new(tester)
           b = 2
           Tester() = new(b)
       end
       b
1
```

(cherry picked from commit 522624c)
…e_dispatch` (#58011)

Matches `@time` `@profile` etc.

(cherry picked from commit 1117df6)
This was just intended to be a constant and we have binary Float64
constants

(cherry picked from commit f3474b5)
I've created an [Install](https://julialang.org/install/) page separate
from the [Downloads](https://julialang.org/downloads/) page on the
website. This updates various references to point to the correct pages.

(cherry picked from commit 48660a6)
`Base.get_extension` and `Dates.format` both appear in the manual and
should therefore be `public` symbols according to
[51335](#51335 (comment)).

They appear in the manual
[here](https://docs.julialang.org/en/v1/base/base/#Base.get_extension)
and

[here](https://docs.julialang.org/en/v1/stdlib/Dates/#Dates.format-Tuple%7BTimeType,%20AbstractString%7D).

Please also consider back porting this to version 1.12

(cherry picked from commit 963eaa7)
This allows constructors like `Tuple{Type{Vector{Foo}},
UndefInitializer, Tuple{Int}}` to precompile as usual

Appears to have a minimal effect on the stdlib pkgimages:
```julia
--- before.txt  2025-05-23 08:36:20.171870043 -0400
+++ after.txt   2025-05-22 14:48:49.003869097 -0400
@@ -47,7 +47,7 @@
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
  20K ../julia/usr/share/julia/compiled/v1.13/Logging/pkgimage.so
 3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
-3.5M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
+3.6M ../julia/usr/share/julia/compiled/v1.13/Markdown/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
 184K ../julia/usr/share/julia/compiled/v1.13/Mmap/pkgimage.so
  28K ../julia/usr/share/julia/compiled/v1.13/MozillaCACerts_jll/pkgimage.so
```

Resolves #58497.

(cherry picked from commit f8ece05)
Small follow-up to #58512

(cherry picked from commit 36bd3ad)
@KristofferC
Copy link
Member Author

Unicode                                           (6) |         failed at 2025-06-25T23:02:51.748
Test Failed at /cache/build/tester-amdci5-14/julialang/julia-release-1-dot-11/julia-32ac370b68/share/julia/stdlib/v1.11/Unicode/test/runtests.jl:288
  Expression: #= /cache/build/tester-amdci5-14/julialang/julia-release-1-dot-11/julia-32ac370b68/share/julia/stdlib/v1.11/Unicode/test/runtests.jl:288 =# @allocated(length(graphemes("äöüx"))) == 0
   Evaluated: 16 == 0

👀

@KristofferC
Copy link
Member Author

KristofferC commented Jun 26, 2025

@Keno, do you think the allocation test failure above is related to #58674?

Edit: ok lol, I hadn't notice that that PR was the one that actually added the test.

@KristofferC
Copy link
Member Author

@nanosoldier runtests()

@nanosoldier
Copy link
Collaborator

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

Report summary

❗ Packages that crashed

18 packages crashed on the previous version too.

✖ Packages that failed

47 packages failed only on the current version.

  • Illegal method overwrites during precompilation: 1 packages
  • Package has test failures: 3 packages
  • Package tests unexpectedly errored: 5 packages
  • Tests became inactive: 4 packages
  • Test duration exceeded the time limit: 33 packages
  • Test log exceeded the size limit: 1 packages

2961 packages failed on the previous version too.

✔ Packages that passed tests

34 packages passed tests only on the current version.

  • Other: 34 packages

6350 packages passed tests on the previous version too.

➖ Packages that were skipped altogether

1300 packages were skipped on the previous version too.

@KristofferC
Copy link
Member Author

@nanosoldier runtests(["Logging2", "NumericalAlgorithms", "OptimalControlProblems", "LinearMaps", "ParaReal", "Adapode", "UCX", "InferenceObjects", "ClusteringGA", "LazyAlgebra", "YFinance", "LaTeXCompilers", "Geomorphometry", "MultiCDF", "OMEinsum", "PlantRayTracer", "MCMCDiagnosticTools", "CTDirect", "MatrixLMnet", "BioMart", "TensorInference", "Strided", "StateSpaceDynamics", "DECAES", "OnlinePCA", "PlutoStaticHTML", "BlockTensorKit", "NonconvexMultistart", "JudiLing", "CompressiveLearning", "DIVAnd", "Walrus", "ILMPostProcessing", "AcousticsToolbox", "DynamicalSystems", "FiniteStateProjection", "SIAN", "GeometricFlux", "SynapseElife", "SmoothPeriodicStatsModels", "ReactionDiffusion", "QuadraticProgramNetworks", "CDGRNs", "BloqadeODE", "NTNk", "DecisionFocusedLearningBenchmarks"])

@nanosoldier
Copy link
Collaborator

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

Report summary

✖ Packages that failed

7 packages failed only on the current version.

  • Package tests unexpectedly errored: 2 packages
  • Tests became inactive: 1 packages
  • Test duration exceeded the time limit: 4 packages

5 packages failed on the previous version too.

✔ Packages that passed tests

3 packages passed tests only on the current version.

  • Other: 3 packages

31 packages passed tests on the previous version too.

@KristofferC KristofferC merged commit 5be4692 into release-1.11 Jul 2, 2025
7 checks passed
@KristofferC KristofferC deleted the backports-release-1.11 branch July 2, 2025 19:33
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.