Skip to content

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Aug 19, 2025

Backported PRs:

Need manual backport:

Contains multiple commits, manual intervention needed:

Non-merged PRs with backport label:

@KristofferC KristofferC added the release Release management and versioning. label Aug 19, 2025
@ViralBShah
Copy link
Member

Should this be rc2?

@KristofferC KristofferC changed the title Backports for 1.12-rc1 Backports for 1.12-rc2 Aug 19, 2025
@KristofferC
Copy link
Member Author

Yes, (I think this is the third time I make this mistake now...)

@KristofferC
Copy link
Member Author

REPL tests seem to consistently hang on mac.

@KristofferC
Copy link
Member Author

Works fine locally though

~/julia1.12 backports-release-1.12* 5m 26s
❯ make test-REPL
Whitespace check found no issues.
/bin/sh: line 1: 35117 Abort trap: 6           /Users/kc/julia1.12/usr/tools/libwhich -p libcrypto.dylib 2> /dev/null
/bin/sh: line 1: 35119 Abort trap: 6           /Users/kc/julia1.12/usr/tools/libwhich -p libssl.dylib 2> /dev/null
    JULIA test/REPL
Running parallel tests with:
  getpid() = 36788
  nworkers() = 1
  nthreads(:interactive) = 1
  nthreads(:default) = 1
  Sys.CPU_THREADS = 10
  Sys.total_memory() = 24.000 GiB
  Sys.free_memory() = 144.953 MiB

Test  (Worker) | Time (s) | GC (s) | GC % | Alloc (MB) | RSS (MB)
REPL       (1) |        started at 2025-09-02T08:03:07.990
REPL       (1) |    23.06 |   0.38 |  1.6 |    3559.61 |   801.88

Test Summary: | Pass  Broken  Total   Time
  Overall     | 1973       5   1978  23.8s
    SUCCESS

@KristofferC
Copy link
Member Author

KristofferC commented Sep 2, 2025

REPL tests passed on 18f42dc but fails on the first commit on this branch. So either the issue is with that commit or something else changed with the buildkite setup I guess.

Edit: Tried rebasing on release-1.12.

vtjnash and others added 20 commits September 2, 2025 08:15
This still sort of errored correctly anyways (after breakage added from
PR #56499), but that behavior should not be relied upon optimizations
not breaking it when this is providing incorrect info to the compiler.

Fix #57459

(cherry picked from commit a5abb6f)
…m)` (#59343)

The issue is that JET reported that in `libgfortran_version(p).major`
the first arg of `getproperty` could be `nothing`. This is already
checked in the previous line, but in a way that the compiler cannot
remember until that call. Putting it into a variable should fix that.

It would be great if this could get backported to at least 1.12 (1.10
and 1.11 would also be great), since that is where people try to use JET
for their packages, and this reduces the Base noise in the output.
The fields of `StringIndexError` are abstractly typed, so there's no
reason to specialize on a concrete type. The change seems like
it could prevent some invalidation on loading user code.

---------

Co-authored-by: Shuhei Kadowaki <[email protected]>
Fixes #59272. This code was originally introduced in
e7efe42. The design of the binding
partitions underwent several changes, so I'm not fully sure if it was
correct at the time, but regardless, it was rendered incorrect by
60a9f69.
In the new design, even a change to the value of a binding (not just its
visibility) can affect the
resolution outcome, so a full re-resolution is always required.

Fix identified by Claude (in one of several rollouts). Correct fix among
them identified by me.
Actual change/test by me.
It's important for this measurement to include indirect compilation (not
just "self" time), since the `--trace-compile` log only reports
compilation triggers / entrypoints (not all compiled code).

(cherry picked from commit 888c2c3)
[The "parsing" section of the "eval" dev docs
page](https://docs.julialang.org/en/v1/devdocs/eval/#dev-parsing) was
not updated when JuliaSyntax.jl was adopted in 1.10. This updates the
text to reflect that it is the default parser and briefly mentions how
to switch back.

(cherry picked from commit ec27274)
)

Fixes #59326.

Change the logic that decides not to specialize a function parameter
based on whether or not the supplied argument is a Function, and that
function is not used, so that it will still work if the SpecType is a
Union{Function,Nothing} or any other union that contains a Function.

The logic is changed from a hardcoded rule of `type_i == Function ||
type_i == Any || type_i == Base.Callable` to `type_i >: Function`.

This covers all of the above cases, but also includes custom
`Union{Function, T}` such as `Union{Function, Nothing}`.

---------

Co-authored-by: Nick Robinson <[email protected]>
Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 9612115)
…59329)

We already save some memory here by deleting the `jl_native_code_desc_t`
after
we're done serializing the combined module, but some data in the
module's
`LLVM::Context` lives on until the end of the scope in
`jl_dump_native_impl`.
Once we're done with the module, move the lock and `ThreadSafeContext`
so the
reference count drops to zero.

A crude measurement shows that when compiling the Base sysimage, about 3
GiB is
in use. Deleting the `jl_native_code_desc_t` (as before) saves about 600
MiB,
and cleaning up the context saves an additional ~500 MiB.

(cherry picked from commit ceeb661)
The `@__artifact_str` macro was updated in
#55707.

```julia-repl
# Before
julia> @time import ZeroMQ_jll
  0.119653 seconds (313.44 k allocations: 16.855 MiB, 79.48% compilation time)

# After
julia> @time import ZeroMQ_jll
  0.024658 seconds (22.61 k allocations: 1.830 MiB)
```

(cherry picked from commit d28a587)
…59363)

Use a separate inference_start and compilation_start, where
compilation_start does not do anything special for reentrancy.

Here is an example which has a quick-to-compile nested dynamic dispatch,
but that nested function runs for a long time:
```julia
./julia --startup=no --trace-compile=stderr --trace-compile-timing -e '
  Base.@assume_effects :foldable function nested1(x)
      sum(collect(x for _ in 1:1000_000_000))
  end
  f1(x) = nested1(sizeof(x)) + x
  f1(2)'
#=   12.7 ms =# precompile(Tuple{typeof(Main.nested1), Int64})
#= 3809.3 ms =# precompile(Tuple{typeof(Main.f1), Int64})
```
This fixes a small issue introduced here:
https://github.com/JuliaLang/julia/pull/59220/files#r2292021838

(cherry picked from commit be59100)
…59367)

The only method of the `__require_prelocked` function in `Base` gets
compiled with bad inference for two variables, `path` and `reasons`,
which get pessimistically boxed (and inferred as `Any`), even though
both of them are only assigned to once across both the method and the
closure within (neither is assigned to within the closure).

My guess for what causes this would be either of these, or the
combination:

* (mis)use of GOTO

* `try`-`catch`

The least demanding way to work around the issue is adding a `let`
around the closure, as advised in the Performance tips. That is what
this change does.

This change should fix several bad inference results within method
instances such as `__require_prelocked(::PkgId, ::Nothing)` and
`__require_prelocked(::PkgId, ::String)`. Consequently, the sysimage
should become less vulnerable to invalidation happening when loading
certain packages.

(cherry picked from commit 547f858)
…byte pointer (#59395)

On 32 bit machines, for an atomic of size 9 to 11 bytes, the result fits
in the 16 byte pool, but only with a maximum write of 12 bytes (there is
1 byte reserved for the `success` plus 4 for the type tag, leaving 11
bytes for the data). This was accidentally doing a 16 byte write
instead, which could smash the type tag field (usually will NULL) of the
next object. Not sure how to test, since just noticed this while reading
the code.

(cherry picked from commit bbd491a)
The FAQ for Julia v1.12 and master still contains a paragraph that
explains how to work around the impossibility to redefine a type in a
REPL session. This paragraph is now obsolete thanks to #57253 so I
propose to simply remove it.

(cherry picked from commit 0c1fab4)
@KristofferC KristofferC force-pushed the backports-release-1.12 branch from 43460a1 to 3a9511e Compare September 2, 2025 06:15
@KristofferC KristofferC added the DO NOT MERGE Do not merge this PR! label Sep 3, 2025
@KristofferC
Copy link
Member Author

Seems like it hangs after

      From worker 2:	FINISHED TESTSET Check symbols previously not shown by REPL.doc_completions()

doesnt say that much though

@KristofferC
Copy link
Member Author

Now the REPL test did not hang all of a sudden. Is it flaky... Maybe has nothing to do with any commit in here?

Zentrik and others added 2 commits September 4, 2025 09:13
…58238)

`_aligned_msize` is now declared in mingw64's crt
(mingw-w64/mingw-w64@b40e24a)
as `_CRTIMP size_t __cdecl _aligned_msize(void *_Memory,size_t
_Alignment,size_t _Offset);`. Renamed our version to prevent the
conflict

(cherry picked from commit 2270fcd)
@KristofferC KristofferC force-pushed the backports-release-1.12 branch 2 times, most recently from 25e4158 to e437a5a Compare September 4, 2025 08:05
This is an alternative to #59161, attempting to fix the same observed CI
behavior. I don't think #59161 is the best way to fix it, as the point
of these tests is to make sure that REPL completions looks up the PATH
internally. Calling the path update function explicitly defeats that
somewhat. The extra synchronization here to make this deterministic is
messy, but I do think it makes the test closer to real-world usage.

The core attempted fix here is to move the read of the PATH_ locals
inside `maybe_spawn_cache_PATH` into the locked region. If they are not
under the lock, they could be unconditionally overwritten by a second
call to this function, causing issues in the state machine. I do not
know whether this is the cause of the observed CI hangs, but it's worth
fixing anyway.

(cherry picked from commit 9a16119)
@KristofferC
Copy link
Member Author

Omg yes, green CI 😭

@KristofferC KristofferC merged commit 261dc4a into release-1.12 Sep 5, 2025
7 of 8 checks passed
@KristofferC KristofferC deleted the backports-release-1.12 branch September 5, 2025 20:03
@timholy
Copy link
Member

timholy commented Sep 6, 2025

Yay! Been looking forward to this one, thanks for pushing this over the line.

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.