Skip to content

Backports release 1.12 #57955

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

Merged
merged 20 commits into from
Apr 1, 2025
Merged

Backports release 1.12 #57955

merged 20 commits into from
Apr 1, 2025

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Mar 31, 2025

Backported PRs:

Need manual backport:

Contains multiple commits, manual intervention needed:

Non-merged PRs with backport label:

@KristofferC KristofferC added the release Release management and versioning. label Mar 31, 2025
@KristofferC
Copy link
Member Author

@nanosoldier runtests(["SIMDTypes", "DontMaterialize", "LazyBroadcast", "MistyClosures", "SyntaxTree", "Fuzzy", "ModuleDocstrings", "TraceFuns", "TypeTree", "CatViews", "Syslogs", "Bits", "FindDefinition", "ExprTools", "FuzzyCompletions", "CoverageTools", "MultiThreadedCaches", "WidthLimitedIO", "WithAlloc", "SingleFloats", "CountFlops", "OverflowContexts", "InterProcessCommunication", "StringAlgorithms", "CellLists", "MappedArrays", "MallocArrays", "PtrArrays", "CompTime", "Recyclers", "InternedStrings", "Infinities", "OperatorScaling", "PrecompileTools", "RNGPool", "Adapt", "EnzymeCore", "ReferenceImplementations", "OptimalSortingNetworks", "ThreadLocalCounters", "NarrativeTest", "RoundingEmulator", "ChangePrecision", "BracedErrors", "StarAlgebras", "FunctionFusion", "TypeStability", "Match", "TestEnv", "RuntimeGeneratedFunctions", "YaoHIR", "FieldFlags", "BSON", "KeywordCalls", "CommonRLInterface", "Umlaut", "Interfaces", "Spec", "Abaco", "NormalHermiteSplines", "JACC", "Baobzi", "BorrowChecker", "LoweredCodeUtils", "LMDB", "MicroFloatingPoints", "TypedSyntax", "LambertW", "Hygienic", "FileCmp", "GAFramework", "DotCall", "TimeRecords", "TrixiBase", "ScikitSpatial", "CellularAutomata", "MixedStructTypes", "Cliffords", "SimpleExpressions", "RBNF", "StaticArraysBlasInterfaces", "GridMaps", "SortedVectors", "Tracy", "DRIPs", "PlutoMonacoEditor", "COESA", "Colors", "BitBasis", "OpenQASM", "JuliaWorkspaces", "HeterogeneousComputing", "PlutoHooks", "SimJulia", "CircularArrayBuffers", "ForwardMethods", "BibInternal", "MaybeInplace", "Mueller", "DimensionfulAngles", "BioAtomsCount", "NL2sol", "RollingWindowArrays", "HypertextTemplates", "ProgressMeter", "FixedPointDecimals", "StaticLint", "AStarGridSearch", "GeometryTypes", "Accessors", "ConstraintCommons", "BioVossEncoder", "SimpleI18n", "PDDL", "QuanticsGrids", "BioMarkovChains", "LaTeXEscapes", "ConcurrentSim", "Divergences", "PiecewiseLinearFunctions", "GraphQLGen", "SHTns", "GenericSchur", "PDMats", "ShortFFTs", "ODEInterface", "ADTypes", "GitCommand", "AutoPrettyPrinting", "DiffieHellman", "XDiag", "NiLang", "PolarizedTypes", "DispatchDoctor", "SnapshotTests", "FCSFiles", "Binning2D", "MCP2221Driver", "LaTeXTabulars", "MultiBroadcastFusion", "RNGTest", "Cosmology", "DocSeeker", "CallableExpressions", "RustFFT", "SMCExamples", "DiscretePIDs", "FINUFFT", "SigmaProofs", "CayleyMengerDeterminant", "Cthulhu", "GenericLinearAlgebra", "CellArrays", "WGSLTypes", "InteractiveErrors", "Delaunator", "MarchingCubes", "FiniteDifferences", "PositionalEmbeddings", "BoundedDegreeGraphs", "LinearMapsAA", "SpectralKit", "DynamicQuantumCircuits", "ColPack", "ShuffleProofs", "OpenSSLGroups", "RRTMGP", "UCX", "UnitfulAssets", "SquashFS", "Stencils", "InteratomicPotentials", "FastCholesky", "MarkovKernels", "DifferentiableFlatten", "InPartS", "AllocCheck", "ConvexHulls2d", "NearestNeighborDescent", "AccessorsExtra", "FeatureSelection", "TerminalGat", "Polyester", "PlayingCards", "NonhomotheticCES", "NLSolvers", "ADOLC", "AtomicSymmetries", "DuckDB", "OpticalPropagation", "GPUCompiler", "NestedGraphs", "WannierIO", "TypedMatrices", "SolverTools", "StructArrays", "StableHashTraits", "LatinHypercubeSampling", "QuasiArrays", "PAndQ", "GridWorlds", "MolecularMinimumDistances", "OpenDSSDirect", "PkgJogger", "NeidArchive", "QXZoo", "Proj", "CharacteristicInvFourier", "AdmittanceModels", "HuggingFaceTokenizers", "LinkedInAPI", "PyBullet", "QEDcore", "Term", "FixedEffects", "JET", "PyMNE", "PyQDecoders", "Pyehtim", "PyFOOOF", "Toolips", "LFRBenchmarkGraphs", "MathematicalSystems", "DictArrays", "YAAD", "LinearAlgebraForCAP", "NLPModelsModifiers", "BurrowsWheelerAligner", "SparseIR", "QEDprocesses", "CometLogger", "LinearElasticityBase", "Presentation", "ExaTron", "QEDfields", "UnitfulLinearAlgebra", "PyCallJLD2", "EnergyExpressions", "DoubleFloats", "DedekindCutArithmetic", "FiniteHorizonGramians", "Norg", "EcRequests", "IntervalLinearAlgebra", "StructuredLight", "QuantumAlgebra", "ParaReal", "DiffPointRasterisation", "XmlStructWriter", "Wandb", "PyThermo", "Kronecker", "NearestCorrelationMatrix", "SymPyCore", "AtiyahBott", "CCBlade", "Quante", "AngularMomentumAlgebra", "DataToolkit", "ScHoLP", "Rotations", "BibParser", "MatrixFactorizations", "AbstractNeuralNetworks", "ThermiaAPI", "PythonPlot", "MonotonicSplines", "MacOSIOReport", "TensorCrossInterpolation", "Bibliography", "ToyPublicKeys", "FiberNlse", "NomnomlJS", "RationalPolygons", "FinancialToolbox", "MvNormalCalibration", "LandauDistribution", "SparseMatrixColorings", "SparseMatricesCOO", "SymbolicIndexingInterface", "Tensors", "DiscreteChoiceCalculations", "Air", "Herb", "CliqueTrees", "SymbolicWedderburn", "ParametricBodies", "Seaborn", "CCDReduction", "ASEconvert", "Dynesty", "Experimenter", "TrustRegionMethods", "RangeEnclosures", "DataToolkitCommon", "DistributionFits", "NeptuneAILogger", "SoleBase", "JuDGE", "Ephemerides", "SLEEFMath", "FrechetDist", "NeutralLandscapes", "SymFEL", "NCDatasets", "BlackBoxOptim", "PlutoStyles", "CatBoost", "QEDevents", "ConstrainedControl", "QuantumElectrodynamics", "HopTB", "PiccoloQuantumObjects", "ConstrainedShortestPaths", "PlutoTeachingTools", "PlutoSplitter", "SymPyPythonCall", "JupyterPlutoConverter", "ConstrainedDynamics", "LaTeXCompilers", "MultiScaleTreeGraph", "AtomsIOPython", "MonteCarloSummary", "ImplicitGlobalGrid", "OutlierDetectionPython", "AbstractLogic", "SimilaritySearch", "TemporalGPs", "ShiftedProximalOperators", "SunAsAStar", "ContinuumArrays", "ConstraintDomains", "PRASCapacityCredits", "FlashAttentionWrapper", "Ipaper", "SpatialEcology", "StaticWebPages", "GraphPPL", "AutomotiveSimulator", "ReinforcementLearningTrajectories", "ConstitutiveModels", "BitSAD", "DifferentiableExpectations", "IntervalMDP", "AbsSmoothFrankWolfe", "SlidingDistancesBase", "StrategicGames", "ShaneGPUCountMinSketch", "IndexSpaces", "TopologicalNumbers", "ChowLiuTrees", "UMAP", "PyPlotUtils", "ChaChaCiphers", "NeumannKelvin", "Octavian", "Speasy", "PlutoPlotly", "Synaptogen", "LaserTypes", "PowerModelsAnnex", "GEMPIC", "ExplainableAI", "InventoryManagement", "AstroForceModels", "WaterModels", "Santiago", "VlasiatorPyPlot", "MatrixProfile", "MLUtils", "ZarrDatasets", "CSDP", "Gaugefields", "SlottedRandomAccess", "EnergyModelsRenewableProducers", "LuxCUDA", "PolynomialAmoebas", "BayesianQuadrature", "RadiationPatterns", "DifferentiableFrankWolfe", "OSQP", "SeeToDee", "Mice", "Mango", "PoincareInvariants", "InfiniteOpt", "FastTransforms", "Maxnet", "SignalTemporalLogic", "RegressionDynamicCausalModeling", "BcdiStrain", "DACE", "TransmuteDims", "MTH229", "CUDASIMDTypes", "GEOTRACES", "BlochSimulators", "PrefectInterfaces", "Galley", "XCALibre", "AbstractCosmologicalEmulators", "DocstringAsImage", "FeynmanDiagram", "TensorCast", "SimulationLogs", "SymbolicUtils", "KiteUtils", "MarkovChainHammer", "EHTUVData", "RegNets", "ApproxFunFourier", "Sensemakr", "TokenCompression", "ElementaryFluxModes", "ReferenceFiniteElements", "EwaldSummations", "GraphSignals", "FinEtools", "SignalAlignment", "InfrastructureSystems", "FourierFlows", "TensorKitSectors", "KomaMRICore", "EtherSPH", "ODE", "ProfileView", "ArDCA", "DynamicHMC", "SphericalScattering", "LowLevelParticleFilters", "Jadex", "EmpiricalPotentials", "MaterialPointGenerator", "XGBoost", "ODEInterfaceDiffEq", "MRFingerprintingRecon", "HuggingFaceDatasets", "SimSpread", "CudaRBMs", "FiniteElementContainers", "RigorousCoupledWaveAnalysis", "TensorOperationsTBLIS", "PhysicalMeshes", "DifferentiableMetabolism", "Polynomials4ML", "SpinGlassTensors", "PySA", "EclipsingBinaryStars", "ImageGather", "SUNRepresentations", "CaratheodoryFejerApprox", "JOLI", "GraphsOptim", "Gadfly", "SparseKmeansFeatureRanking", "LinearRegressionKit", "TransitionsInTimeseries", "DecisionMakingPolicies", "ImageSegmentation", "PassiveTracerFlows", "SimpleBoundaryValueDiffEq", "OrdinaryDiffEqSSPRK", "PsychomotorVigilanceTask", "PhysicalFFT", "PsychometricsBazaarBase", "MPIMeasurements", "MCMCDebugging", "ConstraintExplorer", "ParallelAnalysis", "FusibleBroadcasts", "PhysicalFDM", "PowerSystemCaseBuilder", "PALEOboxes", "CategoryData", "DynACof", "RecurrentLayers", "Wflow", "Jabalizer", "OrdinaryDiffEqExtrapolation", "TaylorInversion", "JUDI", "GilaElectromagnetics", "BcdiMeso", "ACTRSimulators", "PyBraket", "ITensorGPU", "TimeSeriesClassification", "IterativeLQR", "UnROOT", "ImageNetDataset", "StartUpDG", "IESopt", "Qaintmodels", "WordCloud", "BLAKJac", "GeophysicalFlows", "RHEOS", "LatticeModels", "NDTensors", "GMT", "PackageMaker", "MarginalLogDensities", "ArviZPythonPlots", "ElectronLiquid", "Spehulak", "QuantitativeSusceptibilityMappingTGV", "EvoDynamics", "GeometryOptimization", "ConstrainedDynamicsVis", "PlutoPages", "PALEOsediment", "BoundaryValueDiffEqMIRKN", "EnergySamplers", "EntropyScaling", "DiffEqFinancial", "ExpressionTreeForge", "DeconvOptim", "ProbabilisticCircuits", "ExponentialFamilyManifolds", "RingStarProblems", "CameraCalibrations", "FastMPOContractions", "SourceCodeMcCormick", "RelevancePropagation", "Walrus", "QSFit", "OptimizationOptimJL", "GridapTopOpt", "ComputerAdaptiveTesting", "KernelInterpolation", "SystemBenchmark", "SwitchOnSafety", "PowerPlots", "MGVI", "Tasmanian", "Swalbe", "PartiallySeparableNLPModels", "GenericCharacterTables", "ImageQuilting", "WaveOpticsPropagation", "SpinGlassNetworks", "DistributedStwdLDA", "Phonetics", "FluxTraining", "TropicalNN", "GeometricalOptics", "GeoEstimation", "ReinforcementLearningFarm", "PALEOmodel", "FastBEAST", "MultiStateSystems", "LogicCircuits", "DecomposingPolynomialSystems", "SymbolicAnalysis", "ReinforcementLearningCore", "DynamicMovementPrimitives", "GtkUtilities", "ReinforcementLearningZoo", "GeoStatsFunctions", "NonconvexJuniper", "UnfoldBIDS", "SolverBenchmark", "FractionalSystems", "ScatteringOptics", "RvLineList", "MNPDynamics", "WGPUgfx", "Fronts", "DiffusionGarnet", "GNNGraphs", "MimiRFFSPs", "PortfolioAnalytics", "vSmartMOM", "HetaSimulator", "Pesto", "Bactos", "CellMLToolkit", "GeometricFlux", "Fable", "ChargeTransport", "PRONTO", "OpenQuantumSystems", "NuclearToolkit", "SequentialSamplingModels", "GeneticsMakie", "FSimPlots", "TemporalNetworks", "DiagrammaticEquations", "MAGEMinApp", "CropRootBox", "CDGRNs", "Biofilm", "CalibrateEmulateSample", "SwissVAMyKnife", "MRINavigator", "TaijaPlotting", "Microstructure", "SMLMSim", "RigorousInvariantMeasures", "DiskArrayEngine", "SBMLToolkitTestSuite"], vs = ":release-1.11")

@lgoettgens
Copy link
Contributor

The list of commits to backports here is missing #57493. Even though this is shown as closed, it has been merged to master as e2cc68c. (In the PR thread is a small discussion about the github weirdness happening around this.)
It would be great if we could get this backported.

cc @thofma

vtjnash and others added 15 commits March 31, 2025 15:22
Fix typo from #57532 and ensure "inference world" code has the permitted
ability to inspect the max world age, since it needs that info in order
to cache results correctly.

(cherry picked from commit 7ee404c)
…ion (#57833)

Despite disabling these from being compiled in `gf.c` for dynamic
invocations, the pre-compilation code was adding `macro` Methods anyway
to the workqueue.

Replaces #57782

(cherry picked from commit 6ce51d3)
Should make the code less vulnerable to invalidation.

(cherry picked from commit ed3fccc)
…ssors` (#57859)

Should make the code less vulnerable to invalidation.

(cherry picked from commit d9441ac)
…57907)

We are including data from lazily freed pages into this metric, which
makes it inaccurate.

Thanks @qinsoon for spotting it.

(cherry picked from commit d6fdbf5)
#57913)

Avoid using or constructing the vector with nonconcrete element type.

Should make the sysimage more resistant to method invalidation.

(cherry picked from commit 8e03cb1)
Fixes #57190

The fact that this passes thinks memcpy is a potential issue is quite
annoying so it deserves a decent refactor, which flows through the type
information from julia instead of trying to regenerate it on site,
specially given that opaque pointers means we can't really instrospect
into pointers at all

(cherry picked from commit 2c7527b)
I've been a little frustrated with the IOBuffer code. It contains a
whole bunch of implicit invariants, and is poorly commented. It also has
several bugs that ultimately stems from the code being unclear about its
own assumptions.

This is a refactoring of IOBuffer. The primary goals are:
* Comment the code more heavily
* Test the code more thoroughly

The secondary goals are
* Fix a few outstanding bugs
* Add some minor performance improvements

This is a purely internal refactoring with be no change in behaviour of
`IOBuffer`, except straight up bugfixes. However, note that previous
code may have relied on buggy behaviour. Fixing bugs may therefore cause
breakage.

## Current changes
### **BEHAVIOUR CHANGES**
* The following code used to not throw an error, but now does:
`IOBuffer(b"abc"; maxsize=2)`. I consider this a bugfix. It should not
be possible to construct an IOBuffer with a buffersize larger than
`maxsize`.
* It used to be possible to write to indices higher than `maxindex`,
which could trigger a bug causing data loss. The bug has been fixed, but
as a result, some IOBuffers may reach full capacity faster (really:
reach it at the correct point), changing writing behaviour.

### Bugfixes
* Do not corrupt data on `copyline` on a non-appending buffer
* Respect `maxsize` even after `take!` (fix #57549)
* Fix bug when copying from an appending iobuffer to itself
* Fix bug where re-allocating the buffer may cause it to shrink,
discarding data.
* Fix bug where `truncate` may throw a wrong BoundsError
* Fix a bug where truncating a buffer may not correctly removed mark at
position that has been deleted
* Fix a bug where initializing an IOBuffer without an explicit buffer
and with `truncate=false` makes it contain the full buffer
* Current behaviour for `reset` and `position` did not work for
`PipeBuffer`. Fix that

### Changes to brittle code
* Removed some tests that explicitly tested internal code and internal
behaviour. Some of that behaviour has changed.
* Changed some internal `PipeBuffer` behaviour, which did not respect
writable IOBuffer's ownership of their buffer and therefore failed
spuriously

### Performance improvements
* Writing to dense IOBuffer now uses memmove and is up to 10x faster for
long writes.
* Minor optimisations (about ten percent) for writing to IOBuffers in
general

Closes #57549
Co-authored-by: Jameson Nash <vtjnash@gmail.com>

(cherry picked from commit 5419713)
Excising part of #56194 on the
way to reviving that PR.

(cherry picked from commit a5e0eab)
…egen cache (#57272)

Implements a way to add `CodeInstance`s compiled by external
interpreters to JIT, such that they become legal targets for `invoke`
calls.

Based on a design proposed by @Keno, the `AbstractInterpreter` interface
is extended to support providing a codegen cache that is filled during
inference for future use with `add_codeinsts_to_jit!`.

This allows `invoke(f, ::CodeInstance, args...)` to work on external
interpreters, which is currently failing on `master` (see #57193).

---------

Co-authored-by: Cédric Belmant <cedric.belmant@juliahub.com>
(cherry picked from commit 9d2e9ed)
Helps avoids some code duplication and divergence of inference behaviors
in some edge cases, also slightly more correct caching in some edge cases.

(cherry picked from commit e7ff95d)
…re (#57932)

The variable `str` also exists in one of the enclosing closures. Use a
new variable, as was surely intended, instead of capturing and mutating
the `str`.

Improves the sysimage's resistance to invalidation.

(cherry picked from commit fcf492d)
When pre-compiling `stdlib/` this cache has a 91% hit rate, so this
seems fairly profitable. It also dramatically improves some pathological
cases, a few of which have been hit in the wild (arguably due to
inference bugs)

Without this PR, this package takes exponentially long to pre-compile:
```julia
function BigType(N)
    (N == 0) && return Nothing
    T = BigType(N-1)
    return Pair{T,T}
end
foo(::Type{T}) where T = T
precompile(foo, (Type{BigType(40)},))
```

For an in-the-wild test case hit by a customer, this reduces
pre-compilation time from over an hour to just ~two and a half minutes.

Resolves #53331.

(cherry picked from commit 89271dc)
@KristofferC KristofferC force-pushed the backports-release-1.12 branch from 4533038 to 886d74b Compare March 31, 2025 13:22
@nanosoldier
Copy link
Collaborator

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

Report summary

❗ Packages that crashed

16 packages crashed only on the current version.

  • The process was aborted: 1 packages
  • Invalid LLVM IR was generated: 1 packages
  • An internal error was encountered: 11 packages
  • GC corruption was detected: 2 packages
  • A segmentation fault happened: 1 packages

✖ Packages that failed

506 packages failed only on the current version.

  • Package has syntax issues: 4 packages
  • Package fails to precompile: 127 packages
  • Illegal method overwrites during precompilation: 13 packages
  • Package has test failures: 116 packages
  • Package tests unexpectedly errored: 181 packages
  • Networking-related issues were detected: 1 packages
  • There were unidentified errors: 1 packages
  • Tests became inactive: 4 packages
  • Test duration exceeded the time limit: 53 packages
  • Test log exceeded the size limit: 6 packages

7 packages failed on the previous version too.

✔ Packages that passed tests

2 packages passed tests only on the current version.

  • Other: 2 packages

70 packages passed tests on the previous version too.

@KristofferC KristofferC force-pushed the backports-release-1.12 branch from 886d74b to 189359e Compare March 31, 2025 14:30
@KristofferC KristofferC merged commit 2b280ae into release-1.12 Apr 1, 2025
4 of 7 checks passed
@KristofferC KristofferC deleted the backports-release-1.12 branch April 1, 2025 07:56
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.