-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Backports for 1.12.0-rc1 #58655
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
base: release-1.12
Are you sure you want to change the base?
Backports for 1.12.0-rc1 #58655
Conversation
This code was checking for the old edge type (`MethodInstance`) instead of the new one (`CodeInstance`), causing duplicate non-invoke edges to accumulate in our `backedges`. (cherry picked from commit cf875c1)
Since the caller CodeInstance is always part of the identity that we are de-duplicating on, this makes the linear scan much faster than it is in `gf.c` (cherry picked from commit 366a224)
…Table` These are restored in their entirety by staticdata.jl, so there's no need to serialize them. Dropping them has the additional advantage of making it unnecessary to de-duplicate edges in `gf.c` (cherry picked from commit 5c66152)
On my system, this saves ~500 ms when loading CairoMakie (and all dependent packages) (cherry picked from commit bf725f1)
(cherry picked from commit 7525568)
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)
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 #57560 (cherry picked from commit 1735d8f)
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 #58097 Addresses post-review comment #57213 (comment), so this is already tested against by existing logic (cherry picked from commit 965d007)
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 #58278 --------- Co-authored-by: Christian Guinard <[email protected]> (cherry picked from commit 7cb88d6)
(cherry picked from commit f5e983e)
(cherry picked from commit 347fb7c)
This makes two changes to the backdate-warning-turned-error (#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 #58648 (cherry picked from commit d2cc061)
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)
Manage a single dictionary (keyed by TypeName) instead of scattering this info into each TypeName scattered across the system. This makes it much easier to scan the whole table when required and to split it up better, so that all kwcalls and all constructors don't end up stuck into just one table. While not enormous (or even the largest) just using the REPL and Pkg, they are clearly larger than intended for a linear scan: ``` julia> length(Type.body.name.backedges) 1024 julia> length(typeof(Core.kwcall).name.backedges) 196 julia> length(typeof(convert).name.backedges) 1510 ``` (cherry picked from commit 1c26f43)
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)
(cherry picked from commit 8567a3a)
Gonna try the packages timing out in isolation @nanosoldier |
The package evaluation job you requested has completed - possible new issues were detected. Report summary✖ Packages that failed19 packages failed only on the current version.
1 packages failed on the previous version too. ✔ Packages that passed tests11 packages passed tests on the previous version too. ➖ Packages that were skipped altogether1 packages were skipped only on the current version.
1 packages were skipped on the previous version too. |
Manual backport of #58586 . Co-authored-by: Sukera <[email protected]>
Backported PRs:
Compiler._verify_trim_world_age
for better printing #58407jl_get_global
#58540FieldError
#58507setprecision
method #58586Need manual backport:
@main
for juliac executable entry point #57588Contains multiple commits, manual intervention needed:
CodeInstance
to post-optimization step #58343@invokelatest
performance regression #58582Non-merged PRs with backport label:
in
forCartesianIndex
ranges #58616--trace-compile
#58535transcode
: prevent Windows sysimage invalidation #58038@nospecialize
forstring_index_err
#57604maxthreadid
fromThreads
#57490