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

Backports for julia v1.10.0-beta2 #50708

Merged
merged 34 commits into from
Aug 16, 2023
Merged

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Jul 28, 2023

Backported PRs:

Need manual backport:

Contains multiple commits, manual intervention needed:

Non-merged PRs with backport label:

dkarrasch and others added 6 commits July 28, 2023 11:48
More generic than #50444.

Should we keep the boundscheck on the getfield since we got the index
from the runtime itself?

(cherry picked from commit 207c09a)
Fixes #50612

The issue here was the reinterpret change made a bunch of operations
like `Core.bitcast(UInt64,24)` not fold, even though they are fully
known at compile time. That made `UInt32(Char)` not inline which then
caused the regression.

(cherry picked from commit dc06468)
@KristofferC KristofferC added the release Release management and versioning. label Jul 28, 2023
aviatesk and others added 17 commits August 4, 2023 22:03
This makes irinterp not override `:nothrow=true` that are assumed by
`Base.@assume_effects`.
Currently the `compact!`-ion pass fails to fold constant `PiNode` like
`PiNode(0.0, Const(0.0))`. This commit fixes it up.
…ompact!`-ion (#50767)

In code like below
```julia
Base.@assume_effects :nothrow function erase_before_inlining(x, y)
    z = sin(y)
    if x
        return "julia"
    end
    return z
end

let y::Float64
    length(erase_before_inlining(true, y))
end
```
the constant prop' can figure out the constant return type of
`erase_before_inlining(true, y)` while it is profitable not to inline
expand it since otherwise we left some `!:nothrow` callees there
(xref: #47305).

In order to workaround this problem, this commit makes `compact!`move
inlineable constants into argument positions so that the such
"inlineable, but safe as a whole" calls to be erased during compaction.
This should give us general compile-time performance improvement too
as we no longer need to expand the IR for those calls.

Requires:
- #50764
- #50765
- #50768
Co-authored-by: Martin Holters <[email protected]>
(cherry picked from commit 210c5b5)
fixes #50575

Co-authored-by: Shuhei Kadowaki <[email protected]>
(cherry picked from commit 9822257)
If something odd happens during GC (the PC goes to sleep) or a very big
transient the heuristics might make a bad decision. What this PR
implements is if we try to make our target more than double the one we
had before we fallback to a more conservative method. This fixes the new
issue @vtjnash found in #40644
for me.

(cherry picked from commit ab94fad)
fixes #50780 caused by #47013.

(cherry picked from commit 3e04129)
```
julia> @CCall jl_dump_host_cpu()::Cvoid
CPU: znver2
Features: sse3, pclmul, ssse3, fma, cx16, sse4.1, sse4.2, movbe, popcnt, aes, xsave, avx, f16c, rdrnd, fsgsbase, bmi, avx2, bmi2, rdseed, adx, clflushopt, clwb, sha, rdpid, sahf, lzcnt, sse4a, prfchw, mwaitx, xsaveopt, xsavec, xsaves, clzero, wbnoinvd

julia> target = only(Base.current_image_targets())
znver2; flags=0; features_en=(sse3, pclmul, ssse3, fma, cx16, sse4.1, sse4.2, movbe, popcnt, aes, xsave, avx, f16c, fsgsbase, bmi, avx2, bmi2, adx, clflushopt, clwb, sha, rdpid, sahf, lzcnt, sse4a, prfchw, mwaitx, xsavec, xsaves, clzero, wbnoinvd)
```

Co-authored-by: Prem Chintalapudi <[email protected]>
Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 958da95)
This bumps the build numbers for stdlib and binary dependency JLLs,
updates libssh2 to 1.11.0, libgit2 to 1.6.4, and objconv to 2.53.

Julia's FreeBSD CI has been running on FreeBSD 13.2 for a while, but
until more recently, Yggdrasil was still building FreeBSD binaries using
the 12.2 sysroot. The sysroot was updated to 13.2 and I went through and
rebuilt the dependencies that Julia uses. The updated build numbers
correspond to these rebuilt but otherwise unchanged binaries.

The actual version updates are because libssh2 in Yggdrasil was at
1.11.0 so I left it there (its [release
notes](https://github.com/libssh2/libssh2/releases/tag/libssh2-1.11.0)
suggest it's a safe update), libgit2 had a newer patch version available
and needed to be fixed anyway since the Windows build was broken, and
objconv needed its Yggdrasil build recipe fixed but Elliot's GitHub
mirror of objconv was at 2.53 so I updated to use that.

(cherry picked from commit 5e51fbe)
Currently, `Array(r::AbstractRange)` falls back to `vcat(r)`, but
certain ranges may choose to specialize `vcat(r::AbstractRange)` to not
return an `Array`. This PR ensures that `Array(r)` always returns an
`Array`.

At present, there's some code overlap with `vcat` (just above the
`Array` method added in this PR). Perhaps some of these may be replaced
by `unsafe_copyto!`, but the tests for ranges include some special cases
that don't support `getindex`, which complicates things a bit. I've not
done this for now. In any case, the common bit of code is pretty simple,
so perhaps the duplication is harmless.

(cherry picked from commit 3cc0590)
oscardssmith and others added 2 commits August 10, 2023 10:58
This fixes 2 bugs introduced by #49996 and #50041.
Closes #50628.

(cherry picked from commit c777c71)
The documentation of `Pkg.jl` is instructing
developers to rely on the existence of this function, and there doesn't
seem to be any alternative which is a part of the API that developers
can use instead on to guarantee forward compatibility for the same
behavior.

`Base.get_extension` is [referred to
explicitly](https://pkgdocs.julialang.org/v1.9/creating-packages/#Backwards-compatibility)
in the `Pkg.jl` docs to conditionally use package extensions vs
`Requires.jl`.

The `Pkg.jl` docs suggest
```julia
if !isdefined(Base, :get_extension)
  include("../ext/PlottingContourExt.jl")
end
```
to transition from "normal dependency to extension," which will break
and automatically load the extension in future versions should
`Base.get_extension` go away.

`Base.get_extension` is the only way (that I know of) to directly access
the module associated with a package extension, which can be a useful
utility as well.

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

@nanosoldier runtests(ALL, vs = ":release-1.9")

andrebsguedes and others added 2 commits August 10, 2023 13:54
…poptask (#50802)

Currently `poptask` is allocating every time it calls into
`jl_task_get_next` due to `StickyWorkqueue`
(`IntrusiveLinkedListSynchronized`) being immutable and requiring an
allocation to be used as `Any` on the `ccall`.

The allocations can be seen in the following snippet:
```
function work()
    done = 0.0
    l = Threads.SpinLock()
    Threads.@sync for _ in 1:(Threads.nthreads() / 2)
        Threads.@Spawn begin
            v = 1.0
            for i in 1:(1<<33)
                v *= 1.0001
                if i % (1 << 13) == 0
                    yield()
                end
            end
            Base.@lock_nofail l done += v
        end
    end
    return done
end

julia> @time work()
 15.758794 seconds (5.03 M allocations: 153.523 MiB, 0.35% gc time)
```

Which after the change becomes:
```
julia> @time work()
 15.907513 seconds (67 allocations: 4.719 KiB)
```

(cherry picked from commit 2f03072)
We don't need to merge all of the workqueue modules when performing
compilation with `--image-codegen` set, we just need the global variable
initializers to be defined before they're used in one of the modules.
Therefore we can do this by compiling all of the global variable
initializers upfront, so that later references will link them properly.

(cherry picked from commit ff14eaf)
pchintalapudi and others added 5 commits August 10, 2023 09:51
This sticks the compiled opaque closure module into the
`compiled_functions` list of modules that we have compiled for the
particular `jl_codegen_params_t`. We probably should manage that vector
in codegen_params, since it lets us see if a particular codeinst has
already been compiled but not yet emitted.

(cherry picked from commit 441fcb1)
@nanosoldier
Copy link
Collaborator

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

maleadt and others added 2 commits August 11, 2023 09:54
Otherwise we may end up with the state of a dead thread, as the system
IDs can alias. This can lead to an early return from the exception
handler, resulting in e.g. safepoint exceptions being actually delivered
to user code.

---------

Co-authored-by: Jameson Nash <[email protected]>
Co-authored-by: Cody Tapscott <[email protected]>
@KristofferC KristofferC merged commit 77e7e73 into release-1.10 Aug 16, 2023
@KristofferC KristofferC deleted the backports-release-1.10 branch August 16, 2023 08:43
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.