Repository navigation
Resize VCAB/VCABM Adams history and nested startup caches on resize! - #4703
ChrisRackauckas-Claude wants to merge 8 commits into
Conversation
Callback `resize!(integrator, n)` left VCAB* ϕ-history vectors (`coefType`) and nested BS3/RK4 startup caches at the old length, causing DimensionMismatch on the next step. Mirror the SDC pattern with `resize_non_user_cache!` and add grow/shrink regression tests for every ABM/VCABM method. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent 2026.09.28-64d2043 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/pr-abm-resize/log.txt on amdci2
Decoupled u'=-u could not catch a missing shrink restart; switch the regression to a coupled linear system vs exp(At), assert wrong results without discontinuity restart, and exercise deleteat! on VCAB*/VCABM*. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent 2026.09.28-64d2043 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/pr-abm-resize/log.txt on amdci2
The negative testset read uninitialized grow-history and flaked in Core (sometimes near-correct, sometimes Unstable); document the Core restart gap in the PR body instead and align LinearAlgebra test compat. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent 2026.09.28-64d2043 Agent-Model: unknown (Cursor auto) Agent-Session: local session, transcript /home/crackauc/sandbox/goals/performance/jobs/pr-abm-resize/log.txt on amdci2
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Devin <[email protected]> Agent-Harness: Devin CLI 3000.11.3 (conflict resolution), Claude Code 2.1.285 (orchestration) Agent-Model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium Agent-Session: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master); Devin log /Users/chrisrackauckas/sandbox/master/fusion-fixes/SciML_OrdinaryDiffEq.jl-4703/log.txt
Merged the default branch into this PR (clean merge, no conflicts; head 1515fb7) so CI runs on current master. Its earlier failures in SciMLSensitivity Core1 and the downgrade jobs were fixed on master after this PR's last CI run. 🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (merge), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium |
Independent review (Codex CLI 0.166.0 / gpt-6.1-sol), session 01a19838-6c5c-73f2-ba0a-82db2b09d48c, reviewed head 58f5850
Review written by the reviewer named above in a session other than the PR author's, and copied here by the posting agent without change to its findings. The posting agent did not re-run the reviewer's commands. Summary: Repairs resizing of history and nested startup caches for in-place variable-coefficient Adams solvers. BigFloat growth still throws UndefRefError with VCABM5 and VCABM under the default callback restart, so changes are required. Blast radius: In-place VCAB3/4/5, VCABM3/4/5, and VCABM cache resizing, including deleteat! through the Core fallback; fixed-step AB/ABM tests provide a regression fence. Evidence: Blind assessment sealed before author context. The identical regression file failed on merge-base 59ba40e (48 passed, 18 DimensionMismatch errors; exit 1) and passed on the head (116/116; exit 0); An analytic scalar-type probe confirmed two BigFloat growth errors (24 assertions passed, two cases errored; exit 1). CI has 128 successes, one failure, and three skips; the failure is reproduced in master CI. Blocking findings
Non-blocking findingsNone. What I ranThe live PR was OPEN and draft, and its head matched TARGET. Git inspection commands (exit 0) were Exactly three Julia processes ran sequentially, all on Julia 1.13.2. In the commands below, REVIEW_DEPOT represents TARGET's shared depot; its machine-specific absolute prefix is omitted to satisfy the output-path rule. Output was redirected to head.log, base.log, and probe.log, respectively. JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$REVIEW_DEPOT": JULIA_PKG_PRECOMPILE_AUTO=0 timeout 3600 julia +1.13.2 --startup-file=no --compiled-modules=no run-head.jl
JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$REVIEW_DEPOT": JULIA_PKG_PRECOMPILE_AUTO=0 timeout 3600 julia +1.13.2 --startup-file=no --compiled-modules=no run-base.jl
JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$REVIEW_DEPOT": JULIA_PKG_PRECOMPILE_AUTO=0 timeout 3600 julia +1.13.2 --startup-file=no --compiled-modules=no --project=env-head probe.jlThe head/base runners activate separate review environments, develop DiffEqBase, OrdinaryDiffEqCore, OrdinaryDiffEqLowOrderRK, and OrdinaryDiffEqAdamsBashforthMoulton together from the corresponding checkout, call
The complete third-run probe was: using OrdinaryDiffEqAdamsBashforthMoulton, DiffEqBase, Test
println("REVIEW JULIA ", VERSION)
algs = (VCAB3(), VCAB4(), VCAB5(), VCABM3(), VCABM4(), VCABM5(), VCABM())
@testset "Independent analytic growth by scalar type" begin
for T in (Float64, BigFloat), alg in algs
@testset "$(T) $(typeof(alg))" begin
f!(du,u,p,t) = (du .= -u; nothing)
before_order = Ref(0)
function affect!(integ)
before_order[] = integ.cache.order
resize!(integ, 4)
integ.u[4] = one(T)
println("GROW ",T," ",nameof(typeof(alg))," order-before=",before_order[]," previous-history-assigned=",all(b -> isassigned(b, 4), integ.cache.ϕstar_nm1))
flush(stdout)
return nothing
end
cb = DiscreteCallback((u,t,i)->t==0.5, affect!; save_positions=(false,false))
sol = solve(ODEProblem(f!, T[1,2,3], (0.0,2.0)),alg;
callback=cb,tstops=[0.5],abstol=1e-10,reltol=1e-10)
exact = vcat(T[1,2,3] .* exp(-T(2)), exp(-T(1.5)))
err = maximum(abs,sol.u[end] .- exact)
println("PROBE ",T," ",nameof(typeof(alg))," order-before=",before_order[]," retcode=",sol.retcode," error=",err)
@test SciMLBase.successful_retcode(sol)
@test err < T(1e-7)
end
end
endCI and metadata commands were CI has 128 successes, one failure, and three skips. The Adams Core job log explicitly reports What I did not verifyNo whole-package suite, local downstream suite, GPU, AD, MPI, or Reactant run. The changed code is ordinary CPU cache handling; no specialized GPU/AD/MPI/Reactant implementation changes. Out-of-place constant caches, custom array containers, other Julia/platform versions, repeated resize/reinit sequences, addat!, manual resizing outside callbacks, and callbacks suppressing discontinuity were not tested locally. The independent BigFloat probe was not run on the base; only the supplied Float64 regression has failing-before/passing-after evidence. I did not implement or test the proposed repair. 🤖 Posted by an AI agent — harness: Claude Code · model: claude-sonnet-5-5 |
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.164.0 Agent-Model: gpt-6.1-sol Agent-Session: local fixer job SciML__OrdinaryDiffEq.jl__4703 (no session URL)
Clear resized divided-difference buffers and restart variable-coefficient Adams history so BigFloat growth cannot read uninitialized entries. Use the previous solution as the order-one corrector base on restart. Cover all seven variable-coefficient solvers against analytic decay. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.164.0 Agent-Model: gpt-6.1-sol Agent-Session: local fixer job SciML__OrdinaryDiffEq.jl__4703 (no session URL)
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Muse <[email protected]> Agent-Harness: Muse CLI Code Agent-Model: muse-wonder-full-1.0 Agent-Session: local fixer job SciML__OrdinaryDiffEq.jl__4703 (no session URL)
PR: #4703 Reviewed head: ba73ff4 Risk assessment
Review reportVERDICT: CHANGES Riskmedium (M2: The patch changes accepted startup values for explicitly selected in-place The affected users select Blocking findings
Nonblocking findings
What I ran
What I did not verify
Head link: ba73ff4 🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol |
Summary
Callback
resize!(integrator, n)failed for VCAB*/VCABM* withDimensionMismatch: array could not be broadcast to match destinationbecause@cache's generatedfull_cacheonly walksuType/rateType/uNoUnitsTypefields, missing thecoefTypeϕ-history vectors and nested BS3/RK4 startup caches. This PR addsresize_non_user_cache!for those VCAB* caches (same pattern as SDC #4673) so every buffer that participates in the step grows/shrinks with the state. Fixed-step AB*/ABM* already worked viafull_cacheand are covered as a regression fence.Before / after
36 passed, 0 failed, 14 errored(all 7 VCAB*/VCABM* × grow+shrink errored withDimensionMismatch).ABM Resize Cache Tests | 116 Passon Julia 1.12 (twice); same suite116 Passon Julia 1.10.12. Coupled grow 3→4 / shrink 3→2 vsexp(A t)matches to ≤3e-7 (fixed AB3) / ≤4e-8 (adaptive VCAB*) under the default callback restart.deleteat!on VCAB*/VCABM* matches the coupled reference as well.Test-group tails
Core (
GROUP=Core Pkg.test, Julia 1.12, ×2):Julia 1.10.12 (resize suite):
QA (
GROUP=QA Pkg.test, from prior round):Not verified
resize!outside a callback, or withu_modified!(integrator, false)/derivative_discontinuity!(integrator, false), skips the multistep restart. Measured on the coupled 3→4 / 3→2 system at abstol=reltol=1e-10 vsexp(A t): with the default DiscreteCallback restart, errors are 1e-11–4e-8; without restart, VCAB3 grow is typically ~1.4e-4 but reads uninitialized grown ϕ entries so it can also returnUnstable(~1e287) or occasionally land near-correct (~5e-10); VCAB5 shrink is steady at ~3.6e-4; VCABM ~4.3e-6; fixed-step AB*/ABM* ~1.6e-3. That was already true on master for fixed-step AB/ABM (VC methods previously crashed). A proper fix belongs in OrdinaryDiffEqCore (resize!/deleteat!/addat!should mark a derivative discontinuity); it is not asserted in CI here because grow-without-restart is allocator-dependent and would pin the current Core bug.orderon resize beyond the usual DiscreteCallbackderivative_discontinuityFSAL re-eval (numerics passed without an order reset).Reviewer pushback
full_cacheto flatten ϕ/nested buffers instead ofresize_non_user_cache!?cache.step = 1/order = 1) rather than relying on callback discontinuity + adaptive recovery?Please ignore until reviewed by @ChrisRackauckas.
Risk assessment
Independent review: Claude Code (claude-opus-5-5) rated it low, high confidence: every state-sized field (ϕ histories, nested BS3/RK4 caches) is resized through the SciMLBase resize_non_user_cache! hook; coupled-system grow/shrink matches exp(At) to 1e-11–4e-8. Rounds 2–3: coupled exp(At) and deleteat! tests added; a flaky no-restart negative test was removed at the reviewer's request (26ae715).
🤖 Generated with Cursor Agent 2026.09.28-64d2043 (model: unknown (Cursor auto)), transcript /log.txt; orchestrated by Claude Code (claude-opus-5-5[1m]) https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv
Made with Cursor
Risk assessment
Risk: low
Blast radius: Limited to
OrdinaryDiffEqAdamsBashforthMoulton. The PR addsresize_non_user_cache!methods only for the in-placeVCAB3/4/5,VCABM3/4/5andVCABMcaches. Before this change,resize!on these solvers threwDimensionMismatch, so no working code path changes behavior. The fixed-step AB*/ABM* methods, the out-of-place constant caches and other sublibraries are untouched. Source changes are about 43 lines in two files. The rest is a new test file, aruntests.jlinclude, andLinearAlgebra, an MIT stdlib, added as a test-only dependency ([extras]/[targets]).Evidence: On head
26ae715athere are 127 passing checks, 4 failing, 1 cancelled (benchmark (1)) and 1 skipped. All 4 failures already fail on master73937995, which is this PR's merge base (0 commits behind). None are regressions:downgrade-sublibraries / test (lib/DiffEqBase): fails on master too (run 36632710010).downgrade-sublibraries / test (lib/OrdinaryDiffEqDifferentiation): fails on master too (same run).SciMLSensitivity.jl/Core1/1 / Downstream Tests - Core1: same error on master (run 36632710114) and on the earlier master commit14f664a1. It isMethodError: no constructors have been defined for Anyin the Mooncake with MooncakeAdjoint test atconcrete_solve_derivatives.jl:451.tests / GPU (julia 1, self-hosted): fails on master too, at73937995(run 36632710497) and14f664a1.The ABM sublibrary's own checks all pass: Core on Julia 1, lts and pre, plus QA, Threaded and the downgrade job. Runic, Typos and top-level QA also pass.
Independent review: Devin CLI / fusion-claude-opus-5-5-high-sidekick-swe-2-medium rated it low, high confidence. The fix covers every
coefTypeϕ-history field in each VC cache struct (I checked them against the struct definitions on master) and the nested BS3/RK4 caches, through the public SciMLBaseresize_non_user_cache!hook, following the existing SDC pattern. No test is weakened and the new tests pass on all three Julia versions. Smaller points:ODEIntegratorcomes from a sibling monorepo package, and it is listed in OrdinaryDiffEqCore's public names. No non-public dependency internals are used.deleteat!: it falls back to a resize that truncates the ϕ history instead of removing the deleted index. It gives correct results only because the callback restart happens; the description calls this the restart gap and says the real fix belongs in OrdinaryDiffEqCore.LinearAlgebratest dependency, which is trivial. There is no version bump, and none is needed for a non-breaking bug fix.Merge: auto-merge candidate
🤖 Risk assessment posted by an AI agent (fleet master) — harness: Devin CLI / fusion-claude-opus-5-5-high-sidekick-swe-2-medium; dispatched by Claude Code 2.1.285 fleet-master head, model claude-opus-5-5[1m]
Conversation: local session 3c311569-dda6-4687-bc9f-65febb212c33 (no session URL)
Fix by Codex CLI 0.164.0 gpt-6.1-sol (head 7b53b68)
The reported Core4 failure is pre-existing: both the PR integration run and master push run at
d72c55064dd2acee9e312b69f5efda5f56f1e55creportAssertionError: mi2 !== nothingin threaded ensembles. The latest master push run at6a6d63e6429f0e02e8eac75fc19f7ed7bf34d060passes Core4:16 passed, 2 broken, 18 total. No claim is made that a particular source commit repaired that compiler/dependency assertion; no SciMLSensitivity code was changed here.Verification
Julia 1.12.7,
JULIA_NUM_THREADS=4,OPENBLAS_NUM_THREADS=1,JULIA_PKG_PRECOMPILE_AUTO=0, and a configured temporary directory.juliabelow denotes the Juliaup launcher.Identical full Core command before and after the repair:
GROUP=Core timeout 3600 julia +1.12.7 --project=lib/OrdinaryDiffEqAdamsBashforthMoulton -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=no"])'Before, after merging master but before the repair, exit 1: VCABM5 and VCABM BigFloat growth throw
UndefRefError: access to undefined reference:After, exit 0, real test-summary output:
A separate focused run also exited 0:
timeout 3600 julia +1.12.7 --compiled-modules=no --project=lib/OrdinaryDiffEqAdamsBashforthMoulton -e 'using Test; @testset "ABM Resize Cache Tests" include("lib/OrdinaryDiffEqAdamsBashforthMoulton/test/abm_resize_tests.jl")'QA used the unmodified package test entry point and the same dependency environment and fallback load path as
Pkg.test. Its extra controller would exceed the three-process cap when Aqua starts nested precompilation, so that invocation was stopped and the complete QA group was rerun directly.QA_TEST_ENVbelow denotes an unchanged copy of the generated test environment; its machine-specific path is omitted.Exit 0, real output tail; the 12 broken allocation checks are existing declarations, unchanged by this repair:
Formatting, spelling over the full PR diff, and whitespace checks exited 0 with no output:
julia +1.12.7 --project=@runic -m Runic --inplace lib/OrdinaryDiffEqAdamsBashforthMoulton/src/adams_bashforth_moulton_caches.jl lib/OrdinaryDiffEqAdamsBashforthMoulton/src/adams_bashforth_moulton_perform_step.jl lib/OrdinaryDiffEqAdamsBashforthMoulton/test/abm_resize_tests.jl git diff upstream/master --unified=0 | typos - git diff upstream/master --checkNot verified locally: SciMLSensitivity/Core4, the root integration suite, other sublibraries, Threaded, GPU, downstream AD, custom array containers, repeated resize/reinit sequences, or other Julia versions. The fresh CI result has not been awaited.
Links
Risk assessment
Next counted review must come from a smart model in a fresh session, not this fix session (risk.md § Independent reviews).
🤖 Posted by an AI agent — harness: Codex CLI 0.164.0 · model: gpt-6.1-sol
Conversation: local fixer job SciML__OrdinaryDiffEq.jl__4703 (no session URL)
Fix by Muse CLI Code muse-wonder-full-1.0 (head ba73ff4)
TypeError: non-boolean (Symbolics.Num) used in boolean context(Documentation atdocs/make.jl:57while loading OrdinaryDiffEqTaylorSeries).rack ci compareclassifies all three as base-green (passing on the current default branch).tests / GPUandtests / AD (lts)andSciMLSensitivity.jl/Core2are classified pre-existing byrack ci compareagainst the latest default-branch run; ProbNumDiffEq downstream fails on the default branch with the same 6 Interface failures (PR:1719 passed, 6 failed, 4 broken; default branch:1730 passed, 6 failed, 4 broken, Interface subtotal identical at 1227/6/4).Verification
Julia 1.12.4,
JULIA_NUM_THREADS=4,OPENBLAS_NUM_THREADS=1,JULIA_PKG_PRECOMPILE_AUTO=0, and a configured temporary directory.Taylor floor probe (develop the sublibrary in a scratch environment, pin TaylorDiff, load the sublibrary). Before the merge (pre-merge tree, TaylorDiff 0.3.5), exit 1 with the exact CI error:
After the merge (TaylorDiff 0.3.6), exit 0 for both sublibraries:
Adams Core group in full, exit 0:
GROUP=Core timeout 3600 julia --startup-file=no --project=lib/OrdinaryDiffEqAdamsBashforthMoulton -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=no"])'Adams QA group in full, exit 0 (the 12 broken allocation checks are existing declarations, unchanged here):
GROUP=QA timeout 3600 julia --startup-file=no --project=lib/OrdinaryDiffEqAdamsBashforthMoulton -e 'using Pkg; Pkg.test(; julia_args=["--compiled-modules=no"])'Formatting, spelling over the full PR diff, and whitespace checks exited 0 with no output and no file changes:
julia --project=@runic -m Runic --inplace lib/OrdinaryDiffEqAdamsBashforthMoulton/src/adams_bashforth_moulton_caches.jl lib/OrdinaryDiffEqAdamsBashforthMoulton/src/adams_bashforth_moulton_perform_step.jl lib/OrdinaryDiffEqAdamsBashforthMoulton/src/OrdinaryDiffEqAdamsBashforthMoulton.jl lib/OrdinaryDiffEqAdamsBashforthMoulton/test/abm_resize_tests.jl lib/OrdinaryDiffEqAdamsBashforthMoulton/test/runtests.jl git diff upstream/master --unified=0 | typos - git diff upstream/master --checkNot verified locally: the downgrade harness itself, the docs build, GPU, AD (lts), SciMLSensitivity Core2, ProbNumDiffEq downstream, Threaded, or other Julia versions; those rely on the fresh CI run and on the default-branch evidence above. Fresh CI was not awaited.
Links
Next counted review must come from a smart model in a fresh session, not this fix session (risk.md § Independent reviews).
🤖 Posted by an AI agent — harness: Muse CLI Code · model: muse-wonder-full-1.0
Conversation: local fixer job SciML__OrdinaryDiffEq.jl__4703 (no session URL)