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

[pull] master from JuliaLang:master #68

Open
wants to merge 5,775 commits into
base: master
Choose a base branch
from
Open

[pull] master from JuliaLang:master #68

wants to merge 5,775 commits into from

Conversation

pull[bot]
Copy link

@pull pull bot commented Mar 17, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@google-cla
Copy link

google-cla bot commented Mar 17, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

@pull pull bot added the ⤵️ pull label Mar 17, 2022
Keno and others added 28 commits June 9, 2024 01:06
`PartialOpaque` is a powerful mechanism to recover some amount of
identity from opaque closure for inlining and other optimizations.
However, there are two downsides:
1. It causes additional inference work, which is unnecessary if you
already know that you don't want the identity-based optimization.
2. We (currently) disallow :new_opaque_closure in code returned from
generated functions, because we cannot ensure that the identity of any
resulting PartialOpaque will be stable. This somewhat defeats the
purpose of having the opaque closure be, well, opaque.

This PR adds an additional argument to `new_opaque_closure` that decides
whether or not inference is allowed to form `PartialOpaque` for this
`:new_opaque_closure`. If not, it is also permitted to run during
precompile.
Whether or not a guard page is in effect is an implementation detail and
consumers of the `malloc_stack` API should not have to worry about that.
In particular, if a stack of a certain size is requested, a stack of that
size should be delivered, and not be reduced on some systems because we
park a guard page in that range.

This also helps consumers of the gcext API implementing stack scanning
(i.e., GAP.jl), as it does not have to worry about running into those
guard pages anymore.
Not sure why we're not using it, but we probably should.
These are often badly inferred, e.g. in:
```julia
julia> @report_opt 2//2
┌ Warning: skipping (::Base.var"#show_bound#661")(io::IO, b) @ Base show.jl:2777 to avoid parsing too much code
└ @ Revise ~/.julia/packages/Revise/bAgL0/src/packagedef.jl:1092
┌ Warning: skipping (::Base.var"#show_bound#661")(io::IO, b) @ Base show.jl:2777 to avoid parsing too much code
└ @ Revise ~/.julia/packages/Revise/bAgL0/src/packagedef.jl:1092
═════ 32 possible errors found ═════
┌ //(n::Int64, d::Int64) @ Base ./rational.jl:84
│┌ Rational(n::Int64, d::Int64) @ Base ./rational.jl:48
││┌ Rational{Int64}(num::Int64, den::Int64) @ Base ./rational.jl:32
│││┌ __throw_rational_argerror_zero(T::Type{Int64}) @ Base ./rational.jl:30
││││┌ string(::String, ::Type{Int64}, ::String, ::Type{Int64}, ::String) @ Base ./strings/io.jl:189
│││││┌ print_to_string(::String, ::Type{Int64}, ::String, ::Type{Int64}, ::String) @ Base ./strings/io.jl:148
││││││┌ print(io::IOBuffer, x::DataType) @ Base ./strings/io.jl:35
│││││││┌ show(io::IOBuffer, x::DataType) @ Base ./show.jl:970
││││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:975
│││││││││┌ show_typealias(io::IOBuffer, x::Type) @ Base ./show.jl:810
││││││││││┌ make_typealias(x::Type) @ Base ./show.jl:620
│││││││││││┌ modulesof!(s::Set{Module}, x::Type) @ Base ./show.jl:595
││││││││││││ runtime dispatch detected: Base.modulesof!(s::Set{Module}, %20::Any)::Any
│││││││││││└────────────────────
│││││││││││┌ modulesof!(s::Set{Module}, x::Type) @ Base ./show.jl:596
││││││││││││ runtime dispatch detected: Base.modulesof!(s::Set{Module}, %34::Any)::Any
│││││││││││└────────────────────
│││││││││││┌ modulesof!(s::Set{Module}, x::TypeVar) @ Base ./show.jl:589
││││││││││││ runtime dispatch detected: Base.modulesof!(s::Set{Module}, %1::Any)::Set{Module}
│││││││││││└────────────────────
│││││││││┌ show_typealias(io::IOBuffer, x::Type) @ Base ./show.jl:813
││││││││││┌ show_typealias(io::IOBuffer, name::GlobalRef, x::Type, env::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:760
│││││││││││┌ show_typeparams(io::IOContext{IOBuffer}, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:724
││││││││││││┌ show(io::IOContext{IOBuffer}, tv::TypeVar) @ Base ./show.jl:2788
│││││││││││││┌ (::Base.var"#show_bound#661")(io::IOContext{IOBuffer}, b::Any) @ Base ./show.jl:2780
││││││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, b::Any)::Any
│││││││││││││└────────────────────
│││││││││││┌ show_typeparams(io::IOContext{IOBuffer}, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:719
││││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %252::Any)::Any
│││││││││││└────────────────────
│││││││││││┌ show_typeparams(io::IOContext{IOBuffer}, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:722
││││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %313::Any)::Any
│││││││││││└────────────────────
│││││││││││┌ show_typeparams(io::IOContext{IOBuffer}, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:727
││││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %191::Any)::Any
│││││││││││└────────────────────
││││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:978
│││││││││┌ show_datatype(io::IOBuffer, x::DataType) @ Base ./show.jl:1094
││││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1097
│││││││││││┌ maybe_kws_nt(x::DataType) @ Base ./show.jl:1085
││││││││││││ runtime dispatch detected: eltype(%76::DataType)::Any
│││││││││││└────────────────────
││││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1186
│││││││││││┌ show_typeparams(io::IOBuffer, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:724
││││││││││││┌ show(io::IOBuffer, tv::TypeVar) @ Base ./show.jl:2788
│││││││││││││┌ (::Base.var"#show_bound#661")(io::IOBuffer, b::Any) @ Base ./show.jl:2780
││││││││││││││ runtime dispatch detected: show(io::IOBuffer, b::Any)::Any
│││││││││││││└────────────────────
│││││││││││┌ show_typeparams(io::IOBuffer, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:719
││││││││││││ runtime dispatch detected: show(io::IOBuffer, %250::Any)::Any
│││││││││││└────────────────────
│││││││││││┌ show_typeparams(io::IOBuffer, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:722
││││││││││││ runtime dispatch detected: show(io::IOBuffer, %310::Any)::Any
│││││││││││└────────────────────
│││││││││││┌ show_typeparams(io::IOBuffer, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:727
││││││││││││ runtime dispatch detected: show(io::IOBuffer, %190::Any)::Any
│││││││││││└────────────────────
││││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1157
│││││││││││ runtime dispatch detected: show(io::IOBuffer, %224::Any)::Any
││││││││││└────────────────────
││││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1162
│││││││││││ runtime dispatch detected: show(io::IOBuffer, %54::Any)::Any
││││││││││└────────────────────
││││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1148
│││││││││││ runtime dispatch detected: show(io::IOBuffer, %57::Any)::Any
││││││││││└────────────────────
││││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1150
│││││││││││ runtime dispatch detected: show(io::IOBuffer, %54::Any)::Any
││││││││││└────────────────────
││││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1172
│││││││││││ runtime dispatch detected: Base.show_at_namedtuple(io::IOBuffer, %329::Tuple, %328::DataType)::Any
││││││││││└────────────────────
││││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:981
│││││││││┌ show_unionaliases(io::IOBuffer, x::Union) @ Base ./show.jl:901
││││││││││┌ make_typealiases(x::Union) @ Base ./show.jl:822
│││││││││││┌ modulesof!(s::Set{Module}, x::Union) @ Base ./show.jl:595
││││││││││││ runtime dispatch detected: Base.modulesof!(s::Set{Module}, %3::Any)::Any
│││││││││││└────────────────────
│││││││││││┌ modulesof!(s::Set{Module}, x::Union) @ Base ./show.jl:596
││││││││││││ runtime dispatch detected: Base.modulesof!(s::Set{Module}, %17::Any)::Any
│││││││││││└────────────────────
│││││││││┌ show_unionaliases(io::IOBuffer, x::Union) @ Base ./show.jl:914
││││││││││ runtime dispatch detected: show(io::IOBuffer, %89::Any)::Any
│││││││││└────────────────────
│││││││││┌ show_unionaliases(io::IOBuffer, x::Union) @ Base ./show.jl:920
││││││││││ runtime dispatch detected: Base.show_typealias(io::IOBuffer, %206::Any, x::Union, %204::Core.SimpleVector, %205::Vector{TypeVar})::Any
│││││││││└────────────────────
│││││││││┌ show_unionaliases(io::IOBuffer, x::Union) @ Base ./show.jl:928
││││││││││ runtime dispatch detected: Base.show_typealias(io::IOBuffer, %269::Any, x::Union, %267::Core.SimpleVector, %268::Vector{TypeVar})::Any
│││││││││└────────────────────
││││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:985
│││││││││┌ show_delim_array(io::IOBuffer, itr::Vector{Any}, op::Char, delim::Char, cl::Char, delim_one::Bool) @ Base ./show.jl:1392
││││││││││┌ show_delim_array(io::IOBuffer, itr::Vector{Any}, op::Char, delim::Char, cl::Char, delim_one::Bool, i1::Int64, l::Int64) @ Base ./show.jl:1403
│││││││││││ runtime dispatch detected: show(%3::IOContext{IOBuffer}, %52::Any)::Any
││││││││││└────────────────────
││││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:1012
│││││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1185
││││││││││┌ show_type_name(io::IOContext{IOBuffer}, tn::Core.TypeName) @ Base ./show.jl:1059
│││││││││││ runtime dispatch detected: Base.isvisible(%29::Symbol, %86::Module, %80::Any)::Bool
││││││││││└────────────────────
│││││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1157
││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %227::Any)::Any
│││││││││└────────────────────
│││││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1162
││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %55::Any)::Any
│││││││││└────────────────────
│││││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1148
││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %58::Any)::Any
│││││││││└────────────────────
│││││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1150
││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %55::Any)::Any
│││││││││└────────────────────
│││││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1172
││││││││││ runtime dispatch detected: Base.show_at_namedtuple(io::IOContext{IOBuffer}, %338::Tuple, %337::DataType)::Any
│││││││││└────────────────────
│││││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1180
││││││││││ runtime dispatch detected: Base.show_at_namedtuple(io::IOContext{IOBuffer}, %387::Tuple, %391::DataType)::Any
│││││││││└────────────────────
││││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:1014
│││││││││ runtime dispatch detected: show(%98::IOContext{IOBuffer}, %99::Any)::Any
││││││││└────────────────────
│││││││┌ show(io::IOBuffer, x::DataType) @ Base ./show.jl:970
││││││││ runtime dispatch detected: Base._show_type(io::IOBuffer, %1::Any)::Nothing
│││││││└────────────────────
```

I haven't looked through all instances thoroughly, just a quick `grep`.
However, this PR should address several common cases.
)

When an input line like `[import|using] AAA: xxx` is entered, if `AAA`
is already loaded in the REPL session, it will now autocomplete to the
names available in `AAA` that start with `xxx`.
For example, it will autocomplete `using Base.Experimental: @ov|` to
`using Base.Experimental: @overlay`.

- fixes #23374
The file got commited in #52834 and seems useless.
This should cover the current usecases of this error.

---------

Co-authored-by: Sukera <[email protected]>
Co-authored-by: Jameson Nash <[email protected]>
…s` (#54752)

The implementation can be slightly more simply.
Closes #53854. After talking
with @vtjnash, we are ready to commit to the `GenericMemory` interface.
Sorry @nsajko that this took me so long to get around to.

---------

Co-authored-by: Marek Kaluba <[email protected]>
Co-authored-by: Neven Sajko <[email protected]>
We changed the default number of GC threads in
#53608 but didn't update the man
page and docs.

I think I covered all mentions of it in the docs.
Apparently on some distributions `nm --with-symbol-versions` does not
report symbol versions, despite the flag.

`readelf` should be a more reliable alternative which is also part of
binutils.

See spack/spack#44534 (comment)
for more information
…54758)

This avoids the fallback `copyto_unaliased!` implementation that indexes
into the `HermOrSym` matrix, and instead this forwards the copy to the
parent. This provides a slight speed-up. Also, with this `copyto!`
specialized, we don't need the `Matrix` methods anymore. The fallback
`Matrix` constructors call `copyto!` internally, and would remain
equally performant.

```julia
julia> H = Hermitian(rand(ComplexF64,2000,2000));

julia> dest = similar(H, size(H));

julia> @Btime copyto!($dest, $H);
  15.023 ms (0 allocations: 0 bytes) # nightly v"1.12.0-DEV.699"
  12.844 ms (0 allocations: 0 bytes) # this PR
```

This PR also changes the behavior for `copyto!` involving matrices with
mismatched sizes, in which case the `copyto!` will now be a linear copy
(which will usually error for a `Hermitian` matrix).
Stdlib: Pkg
URL: https://github.com/JuliaLang/Pkg.jl.git
Stdlib branch: master
Julia branch: master
Old commit: 4e43058c2
New commit: 78bca4227
Julia version: 1.12.0-DEV
Pkg version: 1.12.0
Bump invoked by: @KristofferC
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/Pkg.jl@4e43058...78bca42

```
$ git log --oneline 4e43058c2..78bca4227
78bca4227 use the correct TOML.Parser coupled to Base.TOMLCache (#3921)
```

Co-authored-by: Dilum Aluthge <[email protected]>
Interpolating a type into a string leads to runtime dispatches, and JET
throws numerous warnings. Using a `LazyString` gets rid of these.
```julia
julia> using JET

julia> @report_opt -(typemin(Int)//1)
[ Info: tracking Base
┌ Warning: skipping (::Base.var"#show_bound#661")(io::IO, b) @ Base show.jl:2777 to avoid parsing too much code
└ @ Revise ~/.julia/packages/Revise/bAgL0/src/packagedef.jl:1092
┌ Warning: skipping (::Base.var"#show_bound#661")(io::IO, b) @ Base show.jl:2777 to avoid parsing too much code
└ @ Revise ~/.julia/packages/Revise/bAgL0/src/packagedef.jl:1092
═════ 32 possible errors found ═════
┌ -(x::Rational{Int64}) @ Base ./rational.jl:334
│┌ __throw_rational_numerator_typemin(T::Type{Int64}) @ Base ./rational.jl:337
││┌ string(::String, ::Type{Int64}, ::String) @ Base ./strings/io.jl:189
│││┌ print_to_string(::String, ::Type{Int64}, ::String) @ Base ./strings/io.jl:148
││││┌ print(io::IOBuffer, x::DataType) @ Base ./strings/io.jl:35
│││││┌ show(io::IOBuffer, x::DataType) @ Base ./show.jl:970
││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:975
│││││││┌ show_typealias(io::IOBuffer, x::Type) @ Base ./show.jl:810
││││││││┌ make_typealias(x::Type) @ Base ./show.jl:620
│││││││││┌ modulesof!(s::Set{Module}, x::Type) @ Base ./show.jl:595
││││││││││ runtime dispatch detected: Base.modulesof!(s::Set{Module}, %20::Any)::Any
│││││││││└────────────────────
│││││││││┌ modulesof!(s::Set{Module}, x::Type) @ Base ./show.jl:596
││││││││││ runtime dispatch detected: Base.modulesof!(s::Set{Module}, %34::Any)::Any
│││││││││└────────────────────
│││││││││┌ modulesof!(s::Set{Module}, x::TypeVar) @ Base ./show.jl:589
││││││││││ runtime dispatch detected: Base.modulesof!(s::Set{Module}, %1::Any)::Set{Module}
│││││││││└────────────────────
│││││││┌ show_typealias(io::IOBuffer, x::Type) @ Base ./show.jl:813
││││││││┌ show_typealias(io::IOBuffer, name::GlobalRef, x::Type, env::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:760
│││││││││┌ show_typeparams(io::IOContext{IOBuffer}, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:724
││││││││││┌ show(io::IOContext{IOBuffer}, tv::TypeVar) @ Base ./show.jl:2788
│││││││││││┌ (::Base.var"#show_bound#661")(io::IOContext{IOBuffer}, b::Any) @ Base ./show.jl:2780
││││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, b::Any)::Any
│││││││││││└────────────────────
│││││││││┌ show_typeparams(io::IOContext{IOBuffer}, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:719
││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %252::Any)::Any
│││││││││└────────────────────
│││││││││┌ show_typeparams(io::IOContext{IOBuffer}, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:722
││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %313::Any)::Any
│││││││││└────────────────────
│││││││││┌ show_typeparams(io::IOContext{IOBuffer}, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:727
││││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %191::Any)::Any
│││││││││└────────────────────
││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:978
│││││││┌ show_datatype(io::IOBuffer, x::DataType) @ Base ./show.jl:1094
││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1097
│││││││││┌ maybe_kws_nt(x::DataType) @ Base ./show.jl:1085
││││││││││ runtime dispatch detected: eltype(%76::DataType)::Any
│││││││││└────────────────────
││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1186
│││││││││┌ show_typeparams(io::IOBuffer, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:724
││││││││││┌ show(io::IOBuffer, tv::TypeVar) @ Base ./show.jl:2788
│││││││││││┌ (::Base.var"#show_bound#661")(io::IOBuffer, b::Any) @ Base ./show.jl:2780
││││││││││││ runtime dispatch detected: show(io::IOBuffer, b::Any)::Any
│││││││││││└────────────────────
│││││││││┌ show_typeparams(io::IOBuffer, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:719
││││││││││ runtime dispatch detected: show(io::IOBuffer, %250::Any)::Any
│││││││││└────────────────────
│││││││││┌ show_typeparams(io::IOBuffer, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:722
││││││││││ runtime dispatch detected: show(io::IOBuffer, %310::Any)::Any
│││││││││└────────────────────
│││││││││┌ show_typeparams(io::IOBuffer, env::Core.SimpleVector, orig::Core.SimpleVector, wheres::Vector{TypeVar}) @ Base ./show.jl:727
││││││││││ runtime dispatch detected: show(io::IOBuffer, %190::Any)::Any
│││││││││└────────────────────
││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1157
│││││││││ runtime dispatch detected: show(io::IOBuffer, %224::Any)::Any
││││││││└────────────────────
││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1162
│││││││││ runtime dispatch detected: show(io::IOBuffer, %54::Any)::Any
││││││││└────────────────────
││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1148
│││││││││ runtime dispatch detected: show(io::IOBuffer, %57::Any)::Any
││││││││└────────────────────
││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1150
│││││││││ runtime dispatch detected: show(io::IOBuffer, %54::Any)::Any
││││││││└────────────────────
││││││││┌ show_datatype(io::IOBuffer, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1172
│││││││││ runtime dispatch detected: Base.show_at_namedtuple(io::IOBuffer, %329::Tuple, %328::DataType)::Any
││││││││└────────────────────
││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:981
│││││││┌ show_unionaliases(io::IOBuffer, x::Union) @ Base ./show.jl:901
││││││││┌ make_typealiases(x::Union) @ Base ./show.jl:822
│││││││││┌ modulesof!(s::Set{Module}, x::Union) @ Base ./show.jl:595
││││││││││ runtime dispatch detected: Base.modulesof!(s::Set{Module}, %3::Any)::Any
│││││││││└────────────────────
│││││││││┌ modulesof!(s::Set{Module}, x::Union) @ Base ./show.jl:596
││││││││││ runtime dispatch detected: Base.modulesof!(s::Set{Module}, %17::Any)::Any
│││││││││└────────────────────
│││││││┌ show_unionaliases(io::IOBuffer, x::Union) @ Base ./show.jl:914
││││││││ runtime dispatch detected: show(io::IOBuffer, %89::Any)::Any
│││││││└────────────────────
│││││││┌ show_unionaliases(io::IOBuffer, x::Union) @ Base ./show.jl:920
││││││││ runtime dispatch detected: Base.show_typealias(io::IOBuffer, %206::Any, x::Union, %204::Core.SimpleVector, %205::Vector{TypeVar})::Any
│││││││└────────────────────
│││││││┌ show_unionaliases(io::IOBuffer, x::Union) @ Base ./show.jl:928
││││││││ runtime dispatch detected: Base.show_typealias(io::IOBuffer, %269::Any, x::Union, %267::Core.SimpleVector, %268::Vector{TypeVar})::Any
│││││││└────────────────────
││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:985
│││││││┌ show_delim_array(io::IOBuffer, itr::Vector{Any}, op::Char, delim::Char, cl::Char, delim_one::Bool) @ Base ./show.jl:1392
││││││││┌ show_delim_array(io::IOBuffer, itr::Vector{Any}, op::Char, delim::Char, cl::Char, delim_one::Bool, i1::Int64, l::Int64) @ Base ./show.jl:1403
│││││││││ runtime dispatch detected: show(%3::IOContext{IOBuffer}, %52::Any)::Any
││││││││└────────────────────
││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:1012
│││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1185
││││││││┌ show_type_name(io::IOContext{IOBuffer}, tn::Core.TypeName) @ Base ./show.jl:1059
│││││││││ runtime dispatch detected: Base.isvisible(%29::Symbol, %86::Module, %80::Any)::Bool
││││││││└────────────────────
│││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1157
││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %227::Any)::Any
│││││││└────────────────────
│││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1162
││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %55::Any)::Any
│││││││└────────────────────
│││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1148
││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %58::Any)::Any
│││││││└────────────────────
│││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1150
││││││││ runtime dispatch detected: show(io::IOContext{IOBuffer}, %55::Any)::Any
│││││││└────────────────────
│││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1172
││││││││ runtime dispatch detected: Base.show_at_namedtuple(io::IOContext{IOBuffer}, %338::Tuple, %337::DataType)::Any
│││││││└────────────────────
│││││││┌ show_datatype(io::IOContext{IOBuffer}, x::DataType, wheres::Vector{TypeVar}) @ Base ./show.jl:1180
││││││││ runtime dispatch detected: Base.show_at_namedtuple(io::IOContext{IOBuffer}, %387::Tuple, %391::DataType)::Any
│││││││└────────────────────
││││││┌ _show_type(io::IOBuffer, x::Type) @ Base ./show.jl:1014
│││││││ runtime dispatch detected: show(%98::IOContext{IOBuffer}, %99::Any)::Any
││││││└────────────────────
│││││┌ show(io::IOBuffer, x::DataType) @ Base ./show.jl:970
││││││ runtime dispatch detected: Base._show_type(io::IOBuffer, %1::Any)::Nothing
│││││└────────────────────

julia> @noinline Base.__throw_rational_numerator_typemin(T) = throw(OverflowError(LazyString("rational numerator is typemin(", T, ")")))

julia> @report_opt -(typemin(Int)//1)
No errors detected
```
This makes it so we avoid a ccall boundary and potentially optimize away
repeated world age checks
Nothing is ever activating this, and it probably hasn't been tested in a
while.

As far as I can tell, this code path was added by @vtjnash in
082d7d2

I have no particular beef with this code other than "it complicates the
thread / task logic, so dealing with this requires understanding one
more moving part, removing it makes it simpler". If it is decided that
this code should rather be kept, "just in case" (which, though), that's
equally fine by me. Thought perhaps a comment could be added explaining
the motivation for keeping it even thought it is currently always
disabled?
The `outerref` form was added in
c3eedce, but the renaming pass for them
was removed two years later in c446444,
without removing the form itself. As far as I can tell, today,
`outerref` is essentially equivalent to `(globalref (thismodule) name)`
(which was the original form, before outteref was introduced) because it
just expands to a toplevel symbol. I don't think there remains any
reason to keep this form after the renaming pass was removed and
moreover it is confusing as one could reasonaly infer (as I did an
incorrectly wrote in a comment) that `outerref` provides outer access,
which it does not. This PR removes the form entirely and replaces them
with an appropriate globalref.
Actually these do not really seem to matter much in practice (as
explained to me by @vtjnash on Slack, thank you). The one thing that did
cause me some grief here, though, was that stack_hi was the low address
and stack_lo the high address.

A smaller change to achieve that "hi means high, lo means low" would be
to just reverse `stack_hi` and `stack_lo`.
This pass was assuming that the post-dominator of all finalizer uses
exists as a real BB in the CFG.

Resolves #54596
LilithHafner and others added 30 commits July 25, 2024 13:53
This PR implements another (limited) backward analysis pass in abstract
interpretation; it exploits signatures of matching methods and refines
types of slots.

Here are couple of examples where these changes will improve the
accuracy:

> generic function example
```julia
addint(a::Int, b::Int) = a + b
@test Base.infer_return_type((Any,Any,)) do a, b
    c = addint(a, b)
    return a, b, c # now the compiler understands `a::Int`, `b::Int`
end == Tuple{Int,Int,Int}
```

> `typeassert` example
```julia
@test Base.infer_return_type((Any,)) do a
    a::Int
    return a # now the compiler understands `a::Int`
end == Int
```

Unlike `Conditional` constrained type propagation, this type refinement
information isn't encoded within any lattice element, but rather they
are propagated within the newly added field `frame.curr_stmt_change` of
`frame::InferenceState`.
For now this commit exploits refinement information available from call
signatures of generic functions and `typeassert`.

---

- closes #37866
- fixes #38274
- closes #55115
There's a few reasons for making it public:
- It's already mentioned in the manual (#54211).
- It's the easiest way to deprecate a function that shouldn't be used
anymore at all.
- It's already widely used in the ecosystem:
https://juliahub.com/ui/Search?type=code&q=Base.depwarn(

I also moved the `@deprecate` docs into a new `Managing deprecations`
section because I felt it should go together with `Base.depwarn()`.
Might be worth backporting to 1.11?
Fixes #55005 and helps work
around issues discussed in
#54998.
This enhances some printing security:

> At present, this warns about calls to printf and scanf functions where
> the format string is not a string literal and there are no format
arguments,
> as in printf (foo);. This may be a security hole if the format string
came
> from untrusted input and contains ‘%n’. (This is currently a subset of
what
> -Wformat-nonliteral warns about, but in future warnings may be added
to
> -Wformat-security that are not included in -Wformat-nonliteral.)
…R_BLASTRAMPOLINE=0 (#49938)

Error:
```
cp: cannot stat 'libblastrampoline.dll': No such file or directory
```
Build commands:
```
cd ~/devel/julia && \
git clean -ffxd --exclude=srccache --exclude=scratch && \
  [[ -d "./usr-staging" ]] && rm -rf "./usr-staging" ; \
  [[ -d "./usr" ]] && rm -rf "./usr" ; \
  [[ -d "./deps/srccache/blastrampoline.git" ]] && rm -rf "./deps/srccache/blastrampoline.git" ; \
  [[ -d "./deps/scratch/blastrampoline" ]] && rm -rf "./deps/scratch/blastrampoline" ; \
  [[ -d "./deps/scratch/SuiteSparse-5.10.1" ]] && rm -rf "./deps/scratch/SuiteSparse-5.10.1" ; \
git checkout master && \
git log -1 --format=oneline && \
echo 'XC_HOST = x86_64-w64-mingw32'          > Make.user && \
echo 'DEPS_GIT = 1'                         >> Make.user && \
echo 'USE_BINARYBUILDER_BLASTRAMPOLINE = 0' >> Make.user && \
echo 'USE_BINARYBUILDER_LIBSUITESPARSE = 0' >> Make.user && \
make -C deps install-csl && \
cp /usr/x86_64-w64-mingw32/sys-root/mingw/lib/libmsvcrt.a ./usr/lib/libmsvcrt.a && \
make all --jobs=1 2>&1 | tee ../julia-master-blastrampoline-all-build.log && echo -ne '\007'
```

Tim S.
…55237)

Seems like this `mallocarray_t` container is only carrying objects of
type `jl_genericmemory_t` after the memory work.

Let's:

* Rename the container type to `mallocmemory_t`.
* Make the payload type a bit more strict to ensure a bit more type
safety (i.e. change the `a` field from `jl_value_t *` to
`jl_genericmemory_t *`).
* Add a comment to indicate the pointer tagging in the lowest bit of the
payload.
Much of this is based on the work of Val Packett in PR 28171; she is
included as a co-author of these changes.

Co-Authored-By: Val Packett <[email protected]>
This reflects the removal of JuliaSyntaxHighlighting from the 1.11 release, in light of
it first being used within the stdlib in the development version (1.12).
Use our shiny new URL
[modernjuliaworkflows.org](https://modernjuliaworkflows.org/).
[Thanks a
lot](#55036 (comment))
@ViralBShah!
Stdlib: Pkg
URL: https://github.com/JuliaLang/Pkg.jl.git
Stdlib branch: master
Julia branch: master
Old commit: 6b4394914
New commit: e4a6723bf
Julia version: 1.12.0-DEV
Pkg version: 1.12.0
Bump invoked by: @IanButterworth
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/Pkg.jl@6b43949...e4a6723

```
$ git log --oneline 6b4394914..e4a6723bf
e4a6723bf Use `Base.TOML.Parser{Dates}` for TOML parsing w/ Dates support (#3938)
8c1f45d98 Append bundled depots to places where we empty it during tests (#3807)
2fdfabaf5 Test fixes (#3972)
34bb51ece fix bad depot path setting (#3971)
3715685b9 fix suggestions threshold for printing (#3968)
3f81d6c4d feat: add JULIA_PKG_GC_AUTO env var (#3642)
fad26d7f2 check `project_file` isa String (#3967)
8875120ad fix not hardcoding "Project.toml" when fixing up extensions in manifest (#3851)
90d42a1b0 Make manifest usage log errors non-fatal (#3962)
```

Co-authored-by: Dilum Aluthge <[email protected]>
Should fix #46724.

Example output:

```
   8 :       0/      0 objects (  0% old),     0 pages,     0 kB,     0 kB waste
  16 :    1857/ 725307 objects ( 89% old),   709 pages,    29 kB, 11340 kB waste
  24 :       0/      0 objects (  0% old),     0 pages,     0 kB,     0 kB waste
  32 :   55025/ 922866 objects ( 96% old),  1806 pages,  1719 kB, 28841 kB waste
  40 :       0/      0 objects (  0% old),     0 pages,     0 kB,     0 kB waste
  48 :   31668/ 199826 objects ( 97% old),   586 pages,  1484 kB,  9338 kB waste
  56 :       0/      0 objects (  0% old),     0 pages,     0 kB,     0 kB waste
  64 :   32767/ 118320 objects ( 94% old),   464 pages,  2047 kB,  7311 kB waste
  72 :       0/      0 objects (  0% old),     0 pages,     0 kB,     0 kB waste
  80 :   13711/  19584 objects ( 95% old),    96 pages,  1071 kB,  1486 kB waste
  88 :       0/      0 objects (  0% old),     0 pages,     0 kB,     0 kB waste
  96 :    4893/   8500 objects ( 95% old),    50 pages,   458 kB,   781 kB waste
 104 :       0/      0 objects (  0% old),     0 pages,     0 kB,     0 kB waste
 112 :    3513/   6132 objects ( 99% old),    42 pages,   384 kB,   670 kB waste
 120 :       0/      0 objects (  0% old),     0 pages,     0 kB,     0 kB waste
 128 :    3890/   4572 objects ( 90% old),    36 pages,   486 kB,   532 kB waste
 136 :       0/      0 objects (  0% old),     0 pages,     0 kB,     0 kB waste
 144 :     387/  12656 objects ( 94% old),   112 pages,    54 kB,  1789 kB waste
 160 :     553/   1836 objects ( 96% old),    18 pages,    86 kB,   284 kB waste
 176 :     463/   1395 objects ( 99% old),    15 pages,    79 kB,   239 kB waste
 192 :     170/    765 objects ( 96% old),     9 pages,    31 kB,   142 kB waste
 208 :     137/    468 objects ( 82% old),     6 pages,    27 kB,    91 kB waste
 224 :    6180/   6497 objects ( 99% old),    89 pages,  1351 kB,  1423 kB waste
 240 :      93/    544 objects (100% old),     8 pages,    21 kB,   128 kB waste
 256 :     310/    693 objects ( 98% old),    11 pages,    77 kB,   175 kB waste
 272 :     196/    360 objects ( 91% old),     6 pages,    52 kB,    91 kB waste
 288 :     817/   1120 objects ( 92% old),    20 pages,   229 kB,   301 kB waste
 304 :      67/    265 objects (100% old),     5 pages,    19 kB,    80 kB waste
 336 :     133/    480 objects ( 99% old),    10 pages,    43 kB,   159 kB waste
 368 :     238/    572 objects ( 97% old),    13 pages,    85 kB,   205 kB waste
 400 :      91/    360 objects (100% old),     9 pages,    35 kB,   144 kB waste
 448 :     127/    432 objects ( 96% old),    12 pages,    55 kB,   189 kB waste
 496 :     110/    330 objects ( 99% old),    10 pages,    53 kB,   159 kB waste
 544 :     150/    330 objects ( 98% old),    11 pages,    79 kB,   174 kB waste
 576 :      45/    168 objects (100% old),     6 pages,    25 kB,    96 kB waste
 624 :      61/    182 objects (100% old),     7 pages,    37 kB,   112 kB waste
 672 :      49/    144 objects (100% old),     6 pages,    32 kB,    96 kB waste
 736 :      63/    198 objects ( 93% old),     9 pages,    45 kB,   141 kB waste
 816 :      63/    180 objects ( 98% old),     9 pages,    50 kB,   143 kB waste
 896 :      61/    126 objects (100% old),     7 pages,    53 kB,   112 kB waste
1008 :      59/    128 objects ( 89% old),     8 pages,    58 kB,   122 kB waste
1088 :      67/    120 objects ( 91% old),     8 pages,    71 kB,   121 kB waste
1168 :      22/     70 objects (100% old),     5 pages,    25 kB,    80 kB waste
1248 :      23/     78 objects (100% old),     6 pages,    28 kB,    96 kB waste
1360 :      36/     72 objects ( 97% old),     6 pages,    47 kB,    94 kB waste
1488 :      27/     66 objects (100% old),     6 pages,    39 kB,    96 kB waste
1632 :      22/     50 objects (100% old),     5 pages,    35 kB,    80 kB waste
1808 :      18/     54 objects (100% old),     6 pages,    31 kB,    96 kB waste
2032 :      26/     72 objects (100% old),     9 pages,    51 kB,   144 kB waste
772 kB (82% old) in 167 large objects (82% old)
```
This uses LLVM's BOLT to optimize libLLVM, libjulia-internal and
libjulia-codegen.

This improves the allinference benchmarks by about 10% largely due to
the optimization of libjulia-internal.
The example in issue #45395
which stresses LLVM significantly more also sees a ~10% improvement.
We see a 20% improvement on 
```julia
@time for i in 1:100000000
    string(i)
end
```

When building corecompiler.ji:
BOLT gives about a 16% improvement
PGO+LTO gives about a 21% improvement
PGO+LTO+BOLT gives about a 23% improvement

This only requires a single build of LLVM and theoretically none if we
change the binary builder script (i.e. we build with relocations and the
`-fno-reorder-blocks-and-partition` and then we can use BOLT to get
binaries with no relocations and reordered blocks and then ship both
binaries?) compared to the 2 in PGO. Also, this theoretically can
improve performance of a PGO+LTO build by a couple %.

The only reproducible test problem I see is that the BOLT, PGO+LTO and
PGO+LTO+BOLT builds all cause `readelf` to emit warnings as part of the
`osutils` tests.

```
readelf: Warning: Unrecognised form: 0x22
readelf: Warning: DIE has locviews without loclist
readelf: Warning: Unrecognised form: 0x23
readelf: Warning: DIE at offset 0x227399 refers to abbreviation number 14754 which does not exist
readelf: Warning: Bogus end-of-siblings marker detected at offset 212aa9 in .debug_info section
readelf: Warning: Bogus end-of-siblings marker detected at offset 212ab0 in .debug_info section
readelf: Warning: Further warnings about bogus end-of-sibling markers suppressed
```

The unrecognised form warnings seem to be a bug in binutils,
https://sourceware.org/bugzilla/show_bug.cgi?id=28981.
`DIE at offset` warning I believe was fixed in binutils 2.36,
https://sourceware.org/bugzilla/show_bug.cgi?id=26808, but `ld -v` says
I have 2.38.
I assume these are all benign. I also don't see them on CI here
https://buildkite.com/julialang/julia-buildkite/builds/1507#018f00e7-0737-4a42-bcd9-d4061dc8c93e
so could just be a local issue.
Seems fairly odd to have a single lock protecting the symbol table, GC
pages and the permanent allocator -- three parts of the codebase which
have little interconnection.

Let's create a lock for each.
Changes made:
- Use 0 for the thread ID to ensure it's always valid. The function
expects `0 <= tid < jl_n_threads` so 1 is incorrect if `jl_n_threads` is
1.
- After retrieving the affinity mask with `jl_getaffinity`, pass that
same mask back to `jl_setaffinity`. This ensures that the mask is always
valid. Using a mask of all ones results in `EINVAL` on FreeBSD. Based on
the discussion in #53402, this change may also fix Windows, so I've
tried reenabling it here.
- To check whether `jl_getaffinity` actually did something, we can check
that the mask is no longer all zeros after the call.

Fixes #54817
)

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.
…55281)

There some advantages in running this on GitHub Actions (GHA) rather
than Buildkite (BK):

* on GHA this task takes ~10 seconds, on BK it takes ~1 minute (job
setup on BK takes way too long)
* since for this task we can use GitHub-hosted runners (which come with
Julia preinstalled), we can spare BK runners from running this job.
Admittedly it's very marginal saving, but better than nothing when the
queue gets long
* using GHA allows us to easily add source code annotations in PR
overviews, which make it easier to quickly spot the line to fix from the
GitHub web interface. This would be doable also on BK, but slightly more
annoying. As [an
example](giordano@a7725e4):

![image](https://github.com/user-attachments/assets/8a459a61-8953-4590-980e-ff156a62701f)

If this PR is accepted, I'll remove the corresponding job from BK.

---------

Co-authored-by: Dilum Aluthge <[email protected]>
… external GitHub Actions to full-length commit hashes (#55283)
This is a very slight tweak to the implementation of
`isinteger(::AbstractFloat)` to use `iszero` rather than `== 0`. It
shouldn't make any difference with any of the built-in floating-point
types, but `iszero` might conceivably be faster for some user-defined
types.

I also added a comment to indicate why it's using `iszero(x - trunc(x))`
rather than `x == trunc(x)` (due to non-finite values); this code dates
back to #14569 in Julia 0.5.

---------

Co-authored-by: Sukera <[email protected]>
`const_prop_entry_heuristics` currently checks the return type only, so
I have given it a name that reflects this and adjusted the remarks
accordingly. There are no changes to the basic behavior of inference.
All changes are cosmetic and do not change the basic functionality:
- Added the interface type to the callbacks received by `simple_walker`
to clarify which objects are passed as callbacks to `simple_walker`.
- Replaced ambiguous names like `idx` with more descriptive ones like
`defidx` to make the algorithm easier to understand.
Ref:
#54107 (comment).
If accepted, I'll add the NEWS.md entry for PGO/LTO in the release-1.11
branch too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment