Skip to content

DO NOT MERGE: v1.12 branch for comparison to master #202

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

Draft
wants to merge 357 commits into
base: master
Choose a base branch
from

Conversation

nickrobinson251
Copy link
Member

@nickrobinson251 nickrobinson251 commented Jan 15, 2025

@nickrobinson251 nickrobinson251 force-pushed the v1.12.0-DEV+RAI branch 4 times, most recently from 966538b to 9da665d Compare January 29, 2025 13:01
@DelveCI DelveCI force-pushed the v1.12.0-DEV+RAI branch 7 times, most recently from 1cff7d7 to 1e6e20d Compare February 7, 2025 00:28
@DelveCI DelveCI force-pushed the v1.12.0-DEV+RAI branch 5 times, most recently from 02e0f68 to 35024c5 Compare February 18, 2025 00:28
@DelveCI DelveCI force-pushed the v1.12.0-DEV+RAI branch 4 times, most recently from fb189dc to 7e4f1cb Compare February 27, 2025 00:29
@DelveCI DelveCI force-pushed the v1.12.0-DEV+RAI branch 3 times, most recently from 7eb4dc1 to d4a2432 Compare March 9, 2025 00:27
nsajko and others added 5 commits March 20, 2025 21:49
…it on (JuliaLang#57585)

Reduces the number of invalidations from 512 to 505 on running this
code:

```julia
struct I <: Integer end
Base.Int(::I) = 7
```

(cherry picked from commit a97137e)
…aLang#57633)

Making the closure capture a `SimpleVector` instead of a type should
improve type stability. Also deduplicated some common subexpressions
while at it.

(cherry picked from commit 885b1cd)
…7721)

Make this function `--trim` compatible.

(cherry picked from commit 8edc2b3)
The alignment of a nested object (in C layouts) is not affected by the
alignment of its parent container when computing a field offset (as if
it will be allocated at address 0). This can be strongly
counter-intuitive (as it implies it should add padding where it does not
seem to provide value to the user), but this is required to match the C
standard. It also permits users to write custom allocators which happen
to provide alignment in excess of that which codegen may assume is
guaranteed, and get the behavioral characteristics they intended to
specify (without resorting to computing explicit padding).

Addresses
JuliaLang#57713 (comment)

(cherry picked from commit c9008ff)
…57734)

This makes `LazyLibraryPath` eligible for const-prop, which is important
so that we can inline/infer `string(::LazyLibraryPath)` at compile-time
if the argument is a (global) `const`.

Otherwise, this code is not infer-able without something like
TypedCallable to make the interface requirements explicit.

(cherry picked from commit 3f4eda6)
topolarity and others added 7 commits June 5, 2025 17:10
On my system, this saves ~500 ms when loading CairoMakie (and all
dependent packages)

(cherry picked from commit bf725f1)
DRY code somewhat by consolidating builtin declarations to use a table
or macro definition to auto-generate the required reflection metadata.
Mostly NFC, but does include a couple bugfixes caused by the consistency
this enforces. Adding a new `Builtin` is now simply a matter of
declaring it in `builtin_proto.h` and defining it in `builtins.c` and
any relevant declarations are handled automatically.

(cherry picked from commit 907b201)
After the bindings change, there is quite a lot of garbage in here now
at runtime (it does not de-duplicate entries added for bindings), so
attempt to do a bit of that during serialization.

Re-landing part of JuliaLang#58078

(cherry picked from commit 3ea60d2)
Instead of hiding the fragments of the method table in each TypeName, make one
variable `Core.GlobalMethods` with access to all methods. The need to split
them early for performance apparently had been long past since kwargs and
constructors were already using a single table and cache anyways. Some new
concepts introduced here:

 - A single Method can now be added to multiple functions. So instead of using
   eval in a for loop, we could define it just once (see example below).
 - Several fields (`max_args`, `name`, and `backedges`) were moved from
   MethodTable to their TypeName.
 - TypeName currently has a (user-modifiable) field called `singletonname`. If
   set to something other than `name`, it may be used for pretty printing of a
   singleton object using its "canonical" (unmangled) name, particularly for
   `function`.
 - `Core.Builtin` method table entries are even more normal now, with valid
   `sig` fields, and special logic to specifically prevent adding methods which
   would become ambiguous with them (as that would violate the tfuncs we have
   for them).
 - `Core.GlobalMethods` is a `Base.Experimental.@MethodTable GlobalMethods`.
 - Each `MethodTable` contains a separate `MethodCache` object for managing
   fast dispatch lookups. We may want to use this for the `Method` field
   containing the `invokes` list so that lookups there get more of the same
   optimizations as global calls.
 - Methods could be put into any number of different MethodTables (or none).
   The `Method.primary_world` field is intended to reflect whether it is
   currently put into the GlobalMethods table, and what world to use in the
   GlobalMethods table for running its generator, and otherwise is meaningless.
 - The lock for TypeName backedges is a single global lock now, in
   `Core.GlobalMethods.mc`.
 - The `backedges` in TypeName are stored on the "top-most" typename in the
   hierarchy, to enable efficient lookup (although we might want to consider
   replacing this entirely with a TypeMap). The "top-most" typename is the
   typename of the type closest to Any, after union-splitting, which doesn't
   have an intersection with Builtin (so Function and Any by implication
   continue to not require scanning for missing backedges since it is not
   permitted to add a Method applicable to all functions).
 - Support for having backedges from experimental method tables was removed
   since it was unsound and had been already replaced with staticdata.jl
   several months ago.
 - Documentation lookup for `IncludeInto` is fixed (previously attached only to
   `Main.include` instead of all `include` functions).

Example: given this existing code in base/operators:

    for op in (:+, :*, :&, :|, :xor, :min, :max, :kron)
        @eval begin
            ($op)(a, b, c, xs...) = (@inline; afoldl($op, ($op)(($op)(a,b),c), xs...))
        end
    end

It could now instead be equivalently written as:

    let ops = Union{typeof(+), typeof(*), typeof(&), typeof(|), typeof(xor), typeof(min), typeof(max), typeof(kron)}
        (op::ops)(a, b, c, xs...) = (@inline; afoldl(op, (op)((op)(a,b),c), xs...))
    end

Fixes JuliaLang#57560

(cherry picked from commit 1735d8f)
Missed updates from early designs in JuliaLang#58131.

Fix JuliaLang#58557

(cherry picked from commit 8ce50a0)
Introduce a new `jl_get_global_value` to do the new world-aware
behavior, while preserving the old behavior for `jl_get_global`. Choose
between `jl_get_global`, `jl_get_global_value`, and
`jl_eval_global_var`, depending on what behavior is required. Also take
this opportunity to fix some data race mistakes introduced by bindings
(relaxed loads of jl_world_counter outside of assert) and lacking type
asserts / unnecessary globals in precompile code.

Fix JuliaLang#58097
Addresses post-review comment
JuliaLang#57213 (comment), so
this is already tested against by existing logic

(cherry picked from commit 965d007)
@DelveCI DelveCI force-pushed the v1.12.0-DEV+RAI branch from 84a5cac to b1a4854 Compare June 6, 2025 00:33
fingolfin and others added 21 commits June 6, 2025 20:39
The A15 was detected as M2; added codenames for easier future updates.

Sources:
- https://asahilinux.org/docs/hw/soc/soc-codenames/#socs
-
https://github.com/apple-oss-distributions/xnu/blob/main/osfmk/arm/cpuid.h
-
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AArch64/AArch64Processors.td#L428

Missing:
- the M4 Pro and Max are missing (because they are missing from Apple's
`cpuid.h`)

Resolves JuliaLang#58278

---------

Co-authored-by: Christian Guinard <[email protected]>
(cherry picked from commit 7cb88d6)
Specifically, content in an `__init__` block is handled by secret
duplicate precompile logic, and any content generated by it was
previously not eligible to be included into cache files.

Fix JuliaLang#58449

(cherry picked from commit 2e158a4)
This makes two changes to the backdate-warning-turned-error (JuliaLang#58266):
1. Fix a bug where the error would only trigger the first time. We do
only want to print once per process, but of course, we do want to error
every time if enabled.
2. If we are in speculative execution context (generators and
speculatively run functions during inference), always use the
UndefVarError. Effects from these functions are not supposed to be
observable, and it's very confusing if the printed warning goes away
when depwarns are enabled. This is marginally more breaking, but the
burden is on generated function authors (which already have to be
world-age aware and are somewhat more regularly broken) and is
consistent with other things that are stronger errors in pure context.

Fixes JuliaLang#58648

(cherry picked from commit d2cc061)
Update branch info to `release-1.12`, so that we can bump the SparseArrays.jl stdlib.
…s from packages succeed. TODO: remove this once alpha/beta is released

# Conflicts:
#	VERSION

# Conflicts:
#	VERSION

# Conflicts:
#	VERSION

# Conflicts:
#	VERSION
Prevent transparent huge pages (THP) overallocating pysical memory.

Co-authored-by: Adnan Alhomssi <[email protected]>
Prepend `[signal (X) ]thread (Y) ` to each backtrace line that is
displayed.

Co-authored-by: Diogo Netto <[email protected]>
@DelveCI DelveCI force-pushed the v1.12.0-DEV+RAI branch from b1a4854 to ed9d641 Compare June 7, 2025 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.