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

Commits on Jul 28, 2023

  1. Remove SparseArrays legacy code (#50637)

    (cherry picked from commit c57d33a)
    dkarrasch authored and KristofferC committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    ea34b13 View commit details
    Browse the repository at this point in the history
  2. print @time msg into print buffer (#50665)

    (cherry picked from commit 9124234)
    IanButterworth authored and KristofferC committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    6ea6ddd View commit details
    Browse the repository at this point in the history
  3. Avoid generic call in most cases for getproperty (#50523)

    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)
    gbaraldi authored and KristofferC committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    d673a25 View commit details
    Browse the repository at this point in the history
  4. versioninfo(): include build info and unofficial warning (#50635)

    (cherry picked from commit c43e5a1)
    IanButterworth authored and KristofferC committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    291dc6b View commit details
    Browse the repository at this point in the history
  5. Make reinterpret specialize fully. (#50670)

    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)
    gbaraldi authored and KristofferC committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    528d4ed View commit details
    Browse the repository at this point in the history
  6. include --pkgimage=no caches for stdlibs (#50666)

    (cherry picked from commit 62605cc)
    IanButterworth authored and KristofferC committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    21fe723 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2023

  1. Configuration menu
    Copy the full SHA
    821f6a5 View commit details
    Browse the repository at this point in the history
  2. irinterp: refine :nothrow only when it is not proved yet (#50764)

    This makes irinterp not override `:nothrow=true` that are assumed by
    `Base.@assume_effects`.
    aviatesk committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    f10c461 View commit details
    Browse the repository at this point in the history
  3. ssair: compact! constant PiNode (#50768)

    Currently the `compact!`-ion pass fails to fold constant `PiNode` like
    `PiNode(0.0, Const(0.0))`. This commit fixes it up.
    aviatesk committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    2a70dac View commit details
    Browse the repository at this point in the history
  4. optimizer: move inlineable constants into argument position during `c…

    …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
    aviatesk committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    9e9f67d View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2023

  1. Configuration menu
    Copy the full SHA
    80ccc37 View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2023

  1. Attach tanpi docstring to method (#50689)

    (cherry picked from commit 5c69561)
    sostock authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    4799388 View commit details
    Browse the repository at this point in the history
  2. Fix rdiv of complex lhs by real factorizations (#50671)

    Co-authored-by: Martin Holters <martin@holters.name>
    (cherry picked from commit 210c5b5)
    dkarrasch authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    6a8559d View commit details
    Browse the repository at this point in the history
  3. only limit types in stack traces in the REPL (#50598)

    fixes #50575
    
    Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
    (cherry picked from commit 9822257)
    JeffBezanson authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    2e71492 View commit details
    Browse the repository at this point in the history
  4. Don't partition alwaysinline functions (#50766)

    (cherry picked from commit bea8c44)
    pchintalapudi authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    ac0eec2 View commit details
    Browse the repository at this point in the history
  5. re-allow non-string values in ENV get! (#50771)

    fixes #50472
    
    (cherry picked from commit 6dd763b)
    JeffBezanson authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    aed6f5a View commit details
    Browse the repository at this point in the history
  6. Add fallback if we have make a weird GC decision. (#50682)

    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)
    gbaraldi authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    8cfb350 View commit details
    Browse the repository at this point in the history
  7. fix bit_map! with aliasing (#50781)

    fixes #50780 caused by #47013.
    
    (cherry picked from commit 3e04129)
    oscardssmith authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    e57f1c7 View commit details
    Browse the repository at this point in the history
  8. print feature flags used for matching pkgimage (#50172)

    ```
    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 <prem.chintalapudi@gmail.com>
    Co-authored-by: Jameson Nash <vtjnash@gmail.com>
    (cherry picked from commit 958da95)
    vchuravy authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    9b78fb5 View commit details
    Browse the repository at this point in the history
  9. Bump OpenBLAS binaries to use the new GEMM multithreading threshold (#…

    …50844)
    
    Detailed discussion and benchmarks by @oscardssmith in
    JuliaPackaging/Yggdrasil#7189
    
    (cherry picked from commit 626f687)
    ViralBShah authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    98db4d5 View commit details
    Browse the repository at this point in the history
  10. Update dependency builds (#50826)

    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)
    ararslan authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    c5e7846 View commit details
    Browse the repository at this point in the history
  11. fix #50438, use default pool for at-threads (#50845)

    (cherry picked from commit 744aa79)
    JeffBezanson authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    e22d308 View commit details
    Browse the repository at this point in the history
  12. Array(::AbstractRange) should return an Array (#50568)

    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)
    jishnub authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    c33aad8 View commit details
    Browse the repository at this point in the history
  13. fix hashing regression. (#50655)

    This fixes 2 bugs introduced by #49996 and #50041.
    Closes #50628.
    
    (cherry picked from commit c777c71)
    oscardssmith authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    3e133c9 View commit details
    Browse the repository at this point in the history
  14. Add Base.get_extension to docs/API (#50860)

    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)
    SBuercklin authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    27bc777 View commit details
    Browse the repository at this point in the history
  15. Makes IntrusiveLinkedListSynchronized mutable to avoid allocation on …

    …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)
    andrebsguedes authored and KristofferC committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    185dd81 View commit details
    Browse the repository at this point in the history
  16. Reuse incremental JIT compilation for --image-codegen (#50649)

    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 committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    8ad72d3 View commit details
    Browse the repository at this point in the history
  17. Merge opaque closure modules with the rest of the workqueue (#50724)

    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)
    pchintalapudi committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    e549d74 View commit details
    Browse the repository at this point in the history
  18. Add alignment to constant globals (#50738)

    (cherry picked from commit 3708229)
    pchintalapudi committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    6ba470d View commit details
    Browse the repository at this point in the history
  19. Minor refactor to image generation (#50779)

    (cherry picked from commit f337c3d)
    pchintalapudi committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    081bc5c View commit details
    Browse the repository at this point in the history
  20. Make symbols internal in jl_create_native, and only externalize them …

    …when partitioning (#50791)
    
    (cherry picked from commit 8b8da91)
    pchintalapudi committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    013e951 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    6b636b9 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2023

  1. macOS: Don't inspect dead threadtls during exception handling. (#50871)

    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 <vtjnash@gmail.com>
    Co-authored-by: Cody Tapscott <topolarity@tapscott.me>
    3 people committed Aug 11, 2023
    Configuration menu
    Copy the full SHA
    f9afbbb View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2023

  1. Change addprocs limit to total_memory instead of free memory.

    (cherry picked from commit 5e3fb41)
    gbaraldi authored and KristofferC committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    1fc06f2 View commit details
    Browse the repository at this point in the history