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 1.8.0-beta2 #44324

Merged
merged 46 commits into from
Mar 15, 2022
Merged

Backports for julia 1.8.0-beta2 #44324

merged 46 commits into from
Mar 15, 2022

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Feb 24, 2022

Backported PRs:

Contains multiple commits, manual intervention needed:

Non-merged PRs with backport label:

@KristofferC KristofferC added the release Release management and versioning. label Feb 24, 2022
@fredrikekre fredrikekre changed the title Backports for julia beta-2 Backports for julia 1.8.0-beta2 Feb 24, 2022
@timholy
Copy link
Member

timholy commented Feb 24, 2022

Hmm, that tester_macos64 failure is concerning since it happened in test/precompile.jl. Might be #44328? The crash happened in the very next @testset.

@timholy
Copy link
Member

timholy commented Feb 25, 2022

@simeonschaub clarifies that the warnings aren't serious, so that's unlikely to be the cause.

Looking at the log, it might have failed in precompile simply due to a timeout. That's consistent with #44338, which will be fixed by #44345.

@timholy
Copy link
Member

timholy commented Mar 3, 2022

You'll definitely want #44345 and #44325

@KristofferC
Copy link
Member Author

KristofferC commented Mar 3, 2022

You'll definitely want #44345 and #44325

Added

@KristofferC KristofferC requested a review from a team as a code owner March 4, 2022 06:57
@KristofferC
Copy link
Member Author

@nanosoldier runtests(["AbstractDifferentiation", "AbstractTrees", "AdaStress", "AdventOfCode", "AnyMOD", "ApproxFun", "ApproxFunFourier", "ApproxFunOrthogonalPolynomials", "ApproxFunSingularities", "ArrayLayouts", "AssociativeArrays", "AtomicGraphNets", "AxisKeys", "AxisSets", "AxisTables", "BEASTXMLConstructor", "BIDSTools", "BPFnative", "BSON", "BlockArrays", "Bonsai", "CBinding", "CGAL", "CUDAKernels", "Caching", "Cassette", "Causal", "ChainRulesCore", "ChainRulesOverloadGeneration", "Checkpointing", "ClassicalOrthogonalPolynomials", "ClimaCore", "ClimaCorePlots", "ClimaCoreVTK", "ClimatePlots", "ClimateTools", "Cloudy", "CodeInfoTools", "CombinedParsers", "CompactBases", "CompilerPluginTools", "ConditionalDists", "Conductor", "ConjugatePriors", "ControlSystems", "CxxWrap", "DSP", "DailyTreasuryYieldCurve", "Dash", "DataFrames", "DataKnots", "DataStructures", "DeIdentification", "DeepDiffs", "DiffEqCallbacks", "DiffEqParamEstim", "DiscreteEvents", "Dispatcher", "DynamicBoundsBase", "DynamicPPL", "DynamicalBilliards", "EconJobMarket", "Enzyme", "EquationsOfStateOfSolids", "EquivalentCircuits", "ExSup", "FMIFlux", "FastJet", "FastTransforms", "FeatureEng", "FeatureSelectors", "FillArrays", "FinEtoolsVoxelMesher", "FinRua", "FindClosest", "FlightMechanics", "FlxQTL", "FormattedTables", "GPUCompiler", "GalacticOptim", "GarishPrint", "GeneralizedSVD", "GenericSchur", "GeoEfficiency", "GeoStatsDevTools", "GoogleCodeSearch", "GroebnerBasis", "HalfIntegers", "HarmonicOrthogonalPolynomials", "HierarchicalUtils", "HomotopyContinuation", "Hypatia", "IBMQClient", "ITensorGaussianMPS", "ITensorUnicodePlots", "ITensorVisualizationBase", "ImageCore", "ImageQuilting", "ImageSegmentation", "ImplicitArrays", "InfiniteArrays", "InverseLaplace", "JET", "JSONPointer", "JuliennedArrays", "Juniper", "KernelAbstractions", "KernelGradients", "LCIO", "LMDB", "LRSLib", "LazyArrays", "LazySets", "LegibleLambdas", "LinearMaps", "LiterateOrg", "LiterateTest", "LocalRegistry", "LogParser", "LogRoller", "LoweredCodeUtils", "Luxor", "MEstimation", "MIRT", "MIRTjim", "MPSToolkit", "Mamba", "MambaModels", "MappedArrays", "MarketCycles", "Memento", "MeshCore", "MetaArrays", "Metatheory", "MinimallyDisruptiveCurves", "MultinomialRegression", "MultipleTesting", "MultivariateOrthogonalPolynomials", "NMRTools", "NeuralArithmetic", "NicePipes", "NotebookToLaTeX", "OpenEphysLoader", "OrbitalTrajectories", "OscillatoryIntegrals", "PLCTag", "POMDPPolicies", "PProf", "PSIS", "PackageAnalyzer", "ParallelUtilities", "Parallelism", "Pathfinder", "PerfChecker", "PkgDeps", "Plots", "Poltergeist", "Polyhedra", "PowerGraphics", "PredictMDExtra", "ProfileSVG", "QML", "QXTns", "QXTools", "QuantizedArrays", "QuantumESPRESSOCommands", "QuantumOptics", "QuasiArrays", "Qwind", "ROCKernels", "RSCG", "RangeHelpers", "RedefStructs", "RiemannHilbert", "RobotDescriptions", "RobotOSData", "Runner", "SIAN", "SIMD", "SOM", "SemiclassicalOrthogonalPolynomials", "SemiseparableMatrices", "Signals", "SimplePadics", "SingularIntegralEquations", "SlackThreads", "SnoopCompile", "SocialSolver", "SolverTraces", "Soss", "SparseTimeSeries", "SpatialBoundaries", "SpatialJackknife", "SpecialFunctions", "StableDQMC", "StackOverflow", "StarAlgebras", "StatProfilerHTML", "StaticTrafficAssignment", "StochasticDiffEq", "StrBase", "StrRegex", "StructuralIdentifiability", "StructuredArrays", "TORA", "TaylorModels", "TensorKitManifolds", "TheFix", "ThresholdStability", "TimeSeries", "TimeZones", "Tracker", "TraitSimulation", "TurbulenceConvection", "Wikidata", "WriteVTK", "YaoQX", "ZfpCompression", "Zomato"], vs = ":release-1.7")

@nanosoldier
Copy link
Collaborator

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

jipolanco and others added 21 commits March 7, 2022 10:20
Prior to this PR, Julia's precompiled `*.ji` files saved just two
categories of code: unspecialized method definitions and
type-specialized code for the methods defined by the package.  Any
novel specializations of methods from Base or previously-loaded
packages were not saved, and therefore effectively thrown away.

This PR caches all the code---internal or external---called during
package definition that hadn't been previously inferred, as long
as there is a backedge linking it back to a method owned by
a module being precompiled. (The latter condition ensures it will
actually be called by package methods, and not merely transiently
generated for the purpose of, e.g., metaprogramming or variable
initialization.) This makes precompilation more intuitive (now it
saves all relevant inference results), and substantially reduces
latency for inference-bound packages.

Closes #42016
Fixes #35972

Issue #35972 arose because codegen got started without re-inferring
some discarded CodeInstances. This forced the compiler to insert a
`jl_invoke`. This PR fixes the issue because needed CodeInstances are
no longer discarded by precompilation.

(cherry picked from commit df81bf9)
…44274)

Co-authored-by: Johnny Chen <[email protected]>
(cherry picked from commit 9c0e5b0d186ea95a06d5b0bdc4bc19d1a17b444d)
(cherry picked from commit aa2421d)
Because we're starting to distribute macOS tarballs as well, let's
codesign them by default, when possible.

(cherry picked from commit 6b29ebd)
…et (#44262)

We collect the relocations (i.e. the GOT slots that is used in the code) for each target
in `tgt.relocs`. Needing a relocation, however, does not imply that the function is cloned
for this target within the group (It does mean that at least one target
in the group has it cloned). The previous version would miss the relocation in this case.

This was triggerred with the following cloning situation

    caller: clone_1
    callee: clone_1, clone_1.clone_3

Since caller.clone_1 may call either callee.clone_1 or callee.clone_1.clone_3 a relocation
for callee will be used and is required to be initialized.
In addition to target 1, target 2 (and in fact target 3) within group 1
will also use caller.clone_1. However, since callee isn't cloned for target 2
the previous version wouldn't have saved this slot in the relocation array.

(cherry picked from commit 76fc067)
I believe it's intentional that for these methods, the `sig` field is
just ignored and always set to `Tuple`. Also fixes a lowering bug I
discovered that would cause errors if `Union` was shadowed.

I have verified that this fixes the reported warnings.

Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 5deb503)
`vendor()` returns `:lbt`
`libblas_name` and `liblapack_name` are set to "libblastrampoline"

(cherry picked from commit bf6d9de)
Simple oversight when these were turned into macros. I could not find
any others that seemed applicable, so just these two appeared to need
fixing right now.

Fix #44373

(cherry picked from commit 8eb872c)
* Clarify the behavior of `@threads for`

Co-authored-by: Ian Butterworth <[email protected]>
(cherry picked from commit 2f67b51)
* fix errors

Co-authored-by: Simeon Schaub <[email protected]>
(cherry picked from commit a9d8c85)
…4416)

Intersection cannot deal with this `metharg`, so it does not simplify
the type at all when handling this case. This can cause us to run into
an assertion later, where we assume the intersection of a non-Varags
type will always return a simple DataType without Varargs.

Fixes #44238

    atype = Tuple{typeof(Base.similar),
      Tuple{Union{Polyhedra.Polyhedron{T}, Polyhedra.Representation{T}} where T},
      Array{_A, 1} where _A,
      Array{_C, 1} where _C,
      Array{_B, 1} where _B}

    metharg = Tuple{typeof(Base.similar),
      Tuple{Vararg{Union{Polyhedra.Polyhedron{T}, Polyhedra.Representation{T}} where T}},
      Vararg{Union{Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.HyperPlane{T, AT} where AT<:AbstractArray{T, 1}), Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.HalfSpace{T, AT} where AT<:AbstractArray{T, 1}), Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:AbstractArray{T, 1}, Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.Line{T, AT} where AT<:AbstractArray{T, 1}), Union{AbstractArray{var"#s14", 1}, Polyhedra.AbstractRepIterator{var"#s13", var"#s14"} where var"#s13", Polyhedra.AllRepIterator{var"#s14", var"#s14", LinElemT, LRT, RT} where RT<:Polyhedra.AbstractRepIterator{var"#s14", var"#s14"} where LRT<:Polyhedra.AbstractRepIterator{var"#s14", LinElemT} where LinElemT where var"#s14"} where var"#s14"<:(Polyhedra.Ray{T, AT} where AT<:AbstractArray{T, 1})} where T}}

Currently `typeintersection(atype, metharg) === metharg`

(cherry picked from commit ffc5ffa)
@DilumAluthge DilumAluthge removed the request for review from a team March 7, 2022 20:52
IanButterworth and others added 13 commits March 7, 2022 17:01
Co-authored-by: Gerhard Aigner <[email protected]>
Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit c6b5fa2)
Since we couldn't confirm any performance benefit from `CachedMethodTable`
in the current infrastructure (see the benchmark results in #44240), now
I'd like to propose to eliminate that entirely and save a bit of space.
…InferenceState)` interface (#44389)

In #44240 we removed the `CachedMethodTable` support as it turned out to
be ineffective under the current compiler infrastructure.
Because of this, there is no strong reason to keep a method table per `InferenceState`.
This commit simply removes the `method_table(::AbstractInterpreter, ::InferenceState)`
interface and should make it clearer which interface should be overloaded to
implement a contextual dispatch.
#44511)

- respect world range of failed lookup into `OverlayMethodTable`:
  <#44448 (comment)>
- fix calculation of merged valid world range:
  <#44448 (comment)>
- make `findsup` return valid `WorldRange` unconditionally, and enable
  more strict world validation within `abstract_invoke`:
  <#44448 (comment)>
- fix the default `limit::Int` value of `findall`
*fix negative numbers to powers >2^64

(cherry picked from commit 03433a2)
There appeared to be a possibility they could race and the data field
might already be destroyed before we reached the close callback,
from looking at the state of the program when reproducing #44460.

This is because the uv_return_spawn set the handle to NULL, which later
can cause the uvfinalize to exit early (if the finalizer gets run on
another thread, since we have disabled finalizers on our thread). Then
the GC can reap the julia Process object prior to uv_close cleaning up
the object. We solve this by calling disassociate_julia_struct before
dropping the reference to the handle. But then we also fully address any
remaining race condition by having uvfinalize acquire a lock also.

The uv_return_spawn callback also needs to be synchronized with the
constructor, since we might have arrived there before we finished
allocating the Process struct here, leading to missed exit events.

Fixes #44460

(cherry picked from commit c591bf2)
The main difference since previous version should be the libraries for
aarch64-apple-darwin, which are based on a more recent version of the GCC fork
for this platform.  There are a couple of notable ABI changes here:

* `libgcc_s` is now called `libgcc_s.1.1.dylib` instead of `libgcc_s.2.dylib`
* there is now `libquadmath.0.dylib` for this platform, which was missing
  before.

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

@nanosoldier runtests(["AbstractDifferentiation", "AbstractTrees", "AdaStress", "AdventOfCode", "AnyMOD", "ApproxFun", "ApproxFunFourier", "ApproxFunOrthogonalPolynomials", "ApproxFunSingularities", "ArrayLayouts", "AssociativeArrays", "AtomicGraphNets", "AxisKeys", "AxisSets", "AxisTables", "BEASTXMLConstructor", "BIDSTools", "BPFnative", "BSON", "BlockArrays", "Bonsai", "CBinding", "CGAL", "CUDAKernels", "Caching", "Cassette", "Causal", "ChainRulesCore", "ChainRulesOverloadGeneration", "Checkpointing", "ClassicalOrthogonalPolynomials", "ClimaCore", "ClimaCorePlots", "ClimaCoreVTK", "ClimatePlots", "ClimateTools", "Cloudy", "CombinedParsers", "CompactBases", "CompilerPluginTools", "ConditionalDists", "Conductor", "ConjugatePriors", "CxxWrap", "DailyTreasuryYieldCurve", "Dash", "DataFrames", "DataKnots", "DataStructures", "DeIdentification", "DeepDiffs", "DiffEqCallbacks", "DiffEqParamEstim", "DiscreteEvents", "Dispatcher", "DynamicBoundsBase", "DynamicPPL", "DynamicalBilliards", "EconJobMarket", "Enzyme", "EquationsOfStateOfSolids", "EquivalentCircuits", "ExSup", "FMIFlux", "FastJet", "FastTransforms", "FeatureEng", "FeatureSelectors", "FillArrays", "FinEtoolsVoxelMesher", "FinRua", "FindClosest", "FlightMechanics", "FlxQTL", "FormattedTables", "GPUCompiler", "GarishPrint", "GeneralizedSVD", "GenericSchur", "GeoEfficiency", "GeoStatsDevTools", "GoogleCodeSearch", "GroebnerBasis", "HarmonicOrthogonalPolynomials", "HierarchicalUtils", "HomotopyContinuation", "Hypatia", "IBMQClient", "ImageCore", "ImageQuilting", "ImageSegmentation", "ImplicitArrays", "InfiniteArrays", "InverseLaplace", "JET", "JSONPointer", "JuliennedArrays", "KernelGradients", "LCIO", "LMDB", "LRSLib", "LazyArrays", "LegibleLambdas", "LinearMaps", "LiterateOrg", "LiterateTest", "LogParser", "LogRoller", "LoweredCodeUtils", "Luxor", "MEstimation", "MIRT", "MIRTjim", "Mamba", "MambaModels", "MappedArrays", "MarketCycles", "Memento", "MeshCore", "MetaArrays", "Metatheory", "MinimallyDisruptiveCurves", "MultinomialRegression", "MultipleTesting", "MultivariateOrthogonalPolynomials", "NMRTools", "NeuralArithmetic", "NicePipes", "NotebookToLaTeX", "OpenEphysLoader", "OrbitalTrajectories", "OscillatoryIntegrals", "PLCTag", "POMDPPolicies", "PProf", "PSIS", "PackageAnalyzer", "ParallelUtilities", "Parallelism", "Pathfinder", "PerfChecker", "PkgDeps", "Plots", "Poltergeist", "Polyhedra", "PowerGraphics", "PredictMDExtra", "ProfileSVG", "QML", "QuantizedArrays", "QuantumESPRESSOCommands", "QuantumOptics", "QuasiArrays", "Qwind", "ROCKernels", "RSCG", "RangeHelpers", "RedefStructs", "RiemannHilbert", "RobotDescriptions", "RobotOSData", "Runner", "SIAN", "SIMD", "SOM", "SemiclassicalOrthogonalPolynomials", "SemiseparableMatrices", "Signals", "SimplePadics", "SingularIntegralEquations", "SlackThreads", "SnoopCompile", "SocialSolver", "SolverTraces", "Soss", "SparseTimeSeries", "SpatialBoundaries", "SpecialFunctions", "StableDQMC", "StackOverflow", "StarAlgebras", "StatProfilerHTML", "StaticTrafficAssignment", "StochasticDiffEq", "StrRegex", "StructuralIdentifiability", "StructuredArrays", "TORA", "TaylorModels", "TensorKitManifolds", "TheFix", "TimeSeries", "Tracker", "TraitSimulation", "TurbulenceConvection", "Wikidata", "ZfpCompression", "Zomato"], vs = ":release-1.7")

@nanosoldier
Copy link
Collaborator

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

oscardssmith and others added 8 commits March 12, 2022 09:17
* improve accuracy for x^-3

(cherry picked from commit 258ddc0)
* inference: fix tmerge lattice over issimpleenoughtype

Previously we assumed only union type could have complexity that
violated the tmerge lattice requirements, but other types can have that
too. This lets us fix an issue with the PartialStruct comparison failing
for undefined fields, mentioned in #43784.

* inference: refine PartialStruct lattice tmerge

Be more aggressive about merging fields to greatly accelerate
convergence, but also compute anyrefine more correctly as we do now
elsewhere (since #42831, a121721)

Move the tmeet algorithm, without changes, since it is a precise lattice
operation, not a heuristic limit like tmerge.

Close #43784

(cherry picked from commit ff88fa4)
(cherry picked from commit 8c4ff55)
…4561)

The PR #43852 missed to implement the mechanism to override analyzed
effects with effect settings annotated by `Base.@assume_effects`.
This commits adds such an mechanism within `finish(::InferenceState, ::AbstractInterpreter)`,
just after inference analyzed frame effect.

Now we can do something like:
```julia
Base.@assume_effects :consistent :effect_free :terminates_globally consteval(
    f, args...; kwargs...) = f(args...; kwargs...)
const ___CONST_DICT___ = Dict{Any,Any}(:a => 1, :b => 2)
@test fully_eliminated() do
    consteval(getindex, ___CONST_DICT___, :a)
end
```
`AbstractInterpreter`: enable selective concrete-evaluation for external `AbstractInterpreter` with overlayed method table
@KristofferC
Copy link
Member Author

CI is not great here (which is the same as master) but all these commits have already had a full CI run on them and the failures here are known and it is "just" a beta that we really need to get out so I will merge this nonetheless.

@KristofferC KristofferC merged commit 1d93878 into release-1.8 Mar 15, 2022
@KristofferC KristofferC deleted the backports-release-1.8 branch March 15, 2022 13:00
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.