Preallocate GenericLU packing workspace - #1195
Conversation
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
|
CI note: the NonlinearSolve downstream Core failure occurs during Julia 1.10 dependency resolution, before any tests or code from this PR execute. It reproduces unchanged on LinearSolve main at https://github.com/SciML/LinearSolve.jl/actions/runs/31361291552/job/93370530227. A clean reproduction and git bisect identified NonlinearSolve commit 9f593a8d0c978a9e6c02a6d35b2cb065898ccebe, which requires currently unregistered NonlinearSolveBase 2.43 and NonlinearSolveQuasiNewton 1.15.2. The upstream resolver issue and exact reproducer are tracked at SciML/NonlinearSolve.jl#1154. |
|
Additional CI note: the ModelingToolkit downstream failure is also unrelated to this PR. It is an UndefVarError for generate_DAENLStepData while current ModelingToolkit master precompiles, and it reproduces on unmodified LinearSolve main at https://github.com/SciML/LinearSolve.jl/actions/runs/31361291552/job/93370530272. A separate clean-main reproduction and bisect is in progress per the repository instructions. |
|
Core CI note: both Julia 1.12 and Julia 1.13 pre failed the same unchanged randomized bitwise discriminator at test/Core/genericlu_naive_ldiv.jl:122; the direct path-selection assertion and the other 503 assertions passed. The same jobs passed immediately beforehand on main at https://github.com/SciML/LinearSolve.jl/actions/runs/31355849634/job/93355313404 and https://github.com/SciML/LinearSolve.jl/actions/runs/31355849634/job/93355313769. I ran the exact file locally on this commit with Julia 1.12.6 and 1.13.0-rc1 and observed 504/504 pass both times; 32 additional Julia 1.12 trials at each affected size also produced zero failures. The authenticated token cannot rerun Actions jobs because GitHub requires repository admin permission for that endpoint. No assertion was weakened or skipped. |
|
Additional CI note: the SciMLSensitivity downstream failure exactly matches current LinearSolve main: 251 tests pass, then the BouncingBall ReverseDiff/Tracker/Zygote cases error while converting Vector{ReverseDiff.TrackedReal} to ReverseDiff.TrackedArray in OrdinaryDiffEqRosenbrock. Main comparison: https://github.com/SciML/LinearSolve.jl/actions/runs/31361291552/job/93370530266. PR job: https://github.com/SciML/LinearSolve.jl/actions/runs/31363806735/job/93377835795. A separate clean-main reproduction and bisect is in progress per repository policy. |
|
The ModelingToolkit main failure is bisected and has a separate validated fix: SciML/ModelingToolkit.jl#4920 bumps ModelingToolkitBase from 1.62.0 to 1.63.0 so Julia 1.10 can resolve the newly added public hook. The exact failing checkout loads with the bump, and ModelingToolkitBase InterfaceI passed 1,501 tests with five existing broken tests. |
Ignore this PR until it has been reviewed by @ChrisRackauckas.
What changed
GenericLUFactorizationnow allocates its pivot and blocked-LU packing workspaces during cache initialization, resize, or matrix-shape update and reuses them insolve!. The blocked Schur kernels no longer resize scratch storage during factorization, and the existing private cache consumers were updated for the new private cache representation.The QA allocation suite now uses AllocCheck.jl on the GenericLU refactor-and-solve kernel and checks the public
solve!(cache)path at runtime with a matrix large enough to exercise the packed blocked-LU path.Regression evidence
The finalized QA regression test on an unfixed clean upstream
maincheckout failed at its first allocation assertion:The same test with this change passed:
The original NonlinearSolve reproduction on clean master failed with:
With this LinearSolve checkout developed into that environment, the same sweep measured:
Verification
GROUP=QA julialauncher +1.12 --project -e 'using Pkg; Pkg.test()'Testing LinearSolve tests passedGROUP=Core julialauncher +1.12 --project -e 'using Pkg; Pkg.test()'Testing LinearSolve tests passedjulialauncher +1.12 -m Runic --checkover every changed Julia file: cleantyposover every changed file: cleangit diff --check upstream/main...HEAD: cleanNot verified
Review note
The private GenericLU cache changes from a tuple to a mutable struct so the factorization handle can be updated without replacing initialization-owned scratch buffers. This changes no public API and adds no dependency.
Links