Skip to content

Resize VCAB/VCABM Adams history and nested startup caches on resize! - #4703

Draft
ChrisRackauckas-Claude wants to merge 8 commits into
SciML:masterfrom
ChrisRackauckas-Claude:abm-resize-cache
Draft

ChrisRackauckas-Claude wants to merge 8 commits into
SciML:masterfrom
ChrisRackauckas-Claude:abm-resize-cache

Conversation

@ChrisRackauckas-Claude

@ChrisRackauckas-Claude ChrisRackauckas-Claude commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Callback resize!(integrator, n) failed for VCAB*/VCABM* with DimensionMismatch: array could not be broadcast to match destination because @cache's generated full_cache only walks uType/rateType/uNoUnitsType fields, missing the coefType ϕ-history vectors and nested BS3/RK4 startup caches. This PR adds resize_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 via full_cache and are covered as a regression fence.

Before / after

  • Before (src fix stashed): resize regression tests — 36 passed, 0 failed, 14 errored (all 7 VCAB*/VCABM* × grow+shrink errored with DimensionMismatch).
  • After (with fix): ABM Resize Cache Tests | 116 Pass on Julia 1.12 (twice); same suite 116 Pass on Julia 1.10.12. Coupled grow 3→4 / shrink 3→2 vs exp(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):

ABM Convergence Tests | 24 Pass
Adams Variable Coefficients Tests | 20 Pass
ABM Discontinuity Restart Tests | 211 Pass
ABM Resize Cache Tests | 116 Pass
Testing OrdinaryDiffEqAdamsBashforthMoulton tests passed

Julia 1.10.12 (resize suite):

ABM Resize Cache Tests | 116 Pass

QA (GROUP=QA Pkg.test, from prior round):

Allocation Tests | 1 Pass, 12 Broken
JET Tests | 1 Pass
Aqua | 21 Pass
Testing OrdinaryDiffEqAdamsBashforthMoulton tests passed

Not verified

  • Out-of-place constant caches (resize is an in-place interface).
  • Core-level restart gap: calling resize! outside a callback, or with u_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 vs exp(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 return Unstable (~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.
  • Whether VCABM should explicitly reset order on resize beyond the usual DiscreteCallback derivative_discontinuity FSAL re-eval (numerics passed without an order reset).
  • Threaded ABM group, GPU, or reverse-dep CI.

Reviewer pushback

  • Prefer overriding full_cache to flatten ϕ/nested buffers instead of resize_non_user_cache!?
  • Should resize force a multistep restart (cache.step = 1 / order = 1) rather than relying on callback discontinuity + adaptive recovery?
  • Are the exact-solution tolerances too loose/tight for CI flake risk?

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 adds resize_non_user_cache! methods only for the in-place VCAB3/4/5, VCABM3/4/5 and VCABM caches. Before this change, resize! on these solvers threw DimensionMismatch, 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, a runtests.jl include, and LinearAlgebra, an MIT stdlib, added as a test-only dependency ([extras]/[targets]).

  • Evidence: On head 26ae715a there are 127 passing checks, 4 failing, 1 cancelled (benchmark (1)) and 1 skipped. All 4 failures already fail on master 73937995, 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 commit 14f664a1. It is MethodError: no constructors have been defined for Any in the Mooncake with MooncakeAdjoint test at concrete_solve_derivatives.jl:451.
    • tests / GPU (julia 1, self-hosted): fails on master too, at 73937995 (run 36632710497) and 14f664a1.

    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 SciMLBase resize_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:

    • Imports: ODEIntegrator comes 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.
    • Undisclosed: the description doesn't mention the LinearAlgebra test 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)

🤖 Automated review section from an AI agent running as Chris Rackauckas's account — not written or reviewed by Chris.

Fix by Codex CLI 0.164.0 gpt-6.1-sol (head 7b53b68)

  • Merged current master normally, with no history rewrite.
  • Initialize and clear every resized Adams history buffer, reset the startup counter, and reset variable-order VCABM to order one.
  • Use the previous solution as the mutable VCABM order-one corrector base. This covers initial startup and return to order one, including resize restart. Adding the corrector to the Euler predictor counted the predictor twice.
  • Add analytic BigFloat growth tests for all seven variable-coefficient Adams solvers. No assertion or tolerance is weakened.

The reported Core4 failure is pre-existing: both the PR integration run and master push run at d72c55064dd2acee9e312b69f5efda5f56f1e55c report AssertionError: mi2 !== nothing in threaded ensembles. The latest master push run at 6a6d63e6429f0e02e8eac75fc19f7ed7bf34d060 passes 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. julia below 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:

ABM Resize Cache Tests        |  126      2    128  1m03.8s
ERROR: LoadError: Some tests did not pass: 126 passed, 0 failed, 2 errored, 0 broken.

After, exit 0, real test-summary output:

ABM Convergence Tests |   24     24  4m03.5s
Adams Variable Coefficients Tests |   68     68  26.2s
ABM Discontinuity Restart Tests |  283    283  1m54.2s
ABM Resize Cache Tests |  130    130  1m13.9s
     Testing OrdinaryDiffEqAdamsBashforthMoulton tests passed 

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")'
Test Summary:          | Pass  Total     Time
ABM Resize Cache Tests |  130    130  2m44.1s

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_ENV below denotes an unchanged copy of the generated test environment; its machine-specific path is omitted.

export JULIA_NUM_PRECOMPILE_TASKS=1
export JULIA_LOAD_PATH="@:$QA_TEST_ENV:@stdlib"
GROUP=QA timeout 3600 julia +1.12.7 --compiled-modules=no --check-bounds=yes --depwarn=yes --project="$QA_TEST_ENV" lib/OrdinaryDiffEqAdamsBashforthMoulton/test/runtests.jl

Exit 0, real output tail; the 12 broken allocation checks are existing declarations, unchanged by this repair:

AllocCheck found 6 allocation sites in OrdinaryDiffEqAdamsBashforthMoulton.VCABM{FastBroadcast.Serial} perform_step!
Test Summary:    | Pass  Broken  Total     Time
Allocation Tests |   11      12     23  3m06.3s
186.868381 seconds (225.29 M allocations: 10.997 GiB, 1.16% gc time, 81.26% compilation time: <1% of which was recompilation)
Test Summary: | Pass  Total     Time
JET Tests     |    1      1  1m06.5s
 66.491283 seconds (81.23 M allocations: 3.868 GiB, 1.15% gc time, 92.57% compilation time)
Test Summary: | Pass  Total     Time
Aqua          |   21     21  9m28.0s
568.043367 seconds (70.32 M allocations: 3.236 GiB, 0.13% gc time, 6.21% compilation time: 7% of which was recompilation)

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 --check

Not 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

  • Risk: medium
  • Blast radius: mutable variable-coefficient Adams cache resizing and mutable VCABM order-one stepping, including initial startup.
  • Evidence: BigFloat growth fails before and passes after; the full Adams Core group and full QA group pass locally.
  • Independent review: pending for this head; this is the fix author's validation, not an independent rating.
  • Merge: needs human review; numerical startup arithmetic changes and fresh independent review is pending.

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)

🤖 Automated review section from an AI agent running as Chris Rackauckas's account — not written or reviewed by Chris.

Fix by Muse CLI Code muse-wonder-full-1.0 (head ba73ff4)

  • Merged the current default branch normally (no rebase, no force push): 3 upstream commits, clean merge, no conflicts. No source file in this PR's own diff was changed.
  • The merge brings in the TaylorDiff 0.3.6 compat-floor fix. That is the root cause of three of the seven failing checks at the previous head: both Taylor downgrade jobs and Documentation all failed precompiling TaylorDiff v0.3.5 with TypeError: non-boolean (Symbolics.Num) used in boolean context (Documentation at docs/make.jl:57 while loading OrdinaryDiffEqTaylorSeries). rack ci compare classifies all three as base-green (passing on the current default branch).
  • The other four failing checks are pre-existing on the current default branch and were not changed here: tests / GPU and tests / AD (lts) and SciMLSensitivity.jl/Core2 are classified pre-existing by rack ci compare against 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:

ERROR: LoadError: TypeError: non-boolean (Symbolics.Num) used in boolean context
ERROR: LoadError: Failed to precompile TaylorDiff [b36ab563-344f-407b-a36a-4f200bebf99c]

After the merge (TaylorDiff 0.3.6), exit 0 for both sublibraries:

PROBE OK OrdinaryDiffEqTaylorSeries TaylorDiff 0.3.6
PROBE OK OrdinaryDiffEqTaylorSeriesImplicit TaylorDiff 0.3.6

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"])'
ABM Convergence Tests |   24     24  3m27.1s
Adams Variable Coefficients Tests |   68     68  24.2s
ABM Discontinuity Restart Tests |  283    283  1m47.5s
ABM Resize Cache Tests |  130    130  58.6s
     Testing OrdinaryDiffEqAdamsBashforthMoulton tests passed

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"])'
Allocation Tests |   11      12     23  3m03.2s
JET Tests     |    1      1  1m01.5s
Aqua          |   21     21  10m17.6s
     Testing OrdinaryDiffEqAdamsBashforthMoulton tests passed

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 --check

Not 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)

ChrisRackauckas and others added 3 commits October 1, 2026 09:08
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
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

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
Conversation: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master)

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member Author

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Codex CLI 0.166.0 / gpt-6.1-sol), session 01a19838-6c5c-73f2-ba0a-82db2b09d48c, reviewed head 58f5850

  • Verdict: CHANGES
  • Risk: medium-low (ML8: state-sized history and startup buffers now resize; no default solver or coefficient changes).
  • Round / slot: 2 / 1
  • Blocking priorities: P2

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

  1. [P2] lib/OrdinaryDiffEqAdamsBashforthMoulton/src/adams_bashforth_moulton_caches.jl:1160 — confirmed by running: growing history vectors leaves new elements uninitialized. Solving u′ = −u from BigFloat[1,2,3] over (0.0,2.0), with a default DiscreteCallback at t=0.5 calling resize!(integrator,4) and setting u[4]=1, throws UndefRefError: access to undefined reference for both VCABM5 and VCABM at abstol=reltol=1e-10. Expected: successful integration to [exp(-2),2exp(-2),3exp(-2),exp(-1.5)]. VCABM5 computes all five divided differences even during startup (lib/OrdinaryDiffEqAdamsBashforthMoulton/src/adams_bashforth_moulton_perform_step.jl:1389); VCABM retains order seven in this probe and immediately consumes old history (lib/OrdinaryDiffEqAdamsBashforthMoulton/src/adams_bashforth_moulton_perform_step.jl:1556). Their reads fail in lib/OrdinaryDiffEqAdamsBashforthMoulton/src/adams_utils.jl:22 and lib/OrdinaryDiffEqAdamsBashforthMoulton/src/adams_utils.jl:50, respectively. Initialize every newly added history entry, invalidate/rebuild history for the changed dimension, and add BigFloat growth tests covering both algorithms. Merely resetting the startup counter does not protect VCABM5's unconditional full-order history read.

Non-blocking findings

None.

What I ran

The live PR was OPEN and draft, and its head matched TARGET. Git inspection commands (exit 0) were git -C src fetch origin '+refs/pull/4703/head:refs/remotes/pr/4703' master, git -C src checkout --detach pr/4703, git -C src rev-parse HEAD origin/master, git -C src diff --stat origin/master...HEAD, git -C src diff origin/master...HEAD, and git -C src merge-base origin/master HEAD. The fetched master is the Base header; the merge-base used for failing-before evidence is 59ba40e. The initial risk was written to INITIAL.md and sealed with sha256sum INITIAL.md > INITIAL.sha256 before reading author context. No repository-root AGENTS.md or CLAUDE.md was present.

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.jl

The head/base runners activate separate review environments, develop DiffEqBase, OrdinaryDiffEqCore, OrdinaryDiffEqLowOrderRK, and OrdinaryDiffEqAdamsBashforthMoulton together from the corresponding checkout, call Pkg.instantiate(; update_registry=false, allow_autoprecomp=false), and include the identical added lib/OrdinaryDiffEqAdamsBashforthMoulton/test/abm_resize_tests.jl inside a Test testset. The base sources were extracted with git -C src archive 59ba40e4b5bbae713d8df7b792f6ea62f033ff78 | tar -x -C tmp; the test was copied intact from the head. Non-path manifest records match between both environments.

  • Run 1, head: exit 0; PR resize regression head | 116 116 1m47.5s (Pass/Total).
  • Run 2, merge-base: exit 1; PR resize regression base | 48 18 66 1m48.6s (Pass/Error/Total). All 14 variable-coefficient grow/shrink cases and four deleteat! cases errored with DimensionMismatch: array could not be broadcast to match destination; the fixed-step cases passed. Thus the supplied regression fails before and passes after the fix, from my own runs.
  • Run 3, independent analytic probe: exit 1; Independent analytic growth by scalar type | 24 2 26 1m21.4s (Pass/Error/Total). All seven Float64 cases passed, with maximum endpoint error about 5.02e-8. BigFloat VCAB3/4/5 and VCABM3/4 passed; BigFloat VCABM5 and VCABM threw UndefRefError. Instrumentation reported previous-history-assigned=false immediately after BigFloat growth, and VCABM retained order seven. The reference is the analytic exponential, independent of the solver.

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
end

CI and metadata commands were gh pr view 4703 --repo SciML/OrdinaryDiffEq.jl --json number,url,state,isDraft,headRefOid,baseRefName,baseRefOid, gh pr view 4703 --repo SciML/OrdinaryDiffEq.jl --json body,title,statusCheckRollup, gh pr checks 4703 --repo SciML/OrdinaryDiffEq.jl, and gh api --paginate repos/SciML/OrdinaryDiffEq.jl/pulls/4703/commits. AUTHOR_GRADE trailers come from the last API-listed non-merge commit, 26ae715.

CI has 128 successes, one failure, and three skips. The Adams Core job log explicitly reports ABM Resize Cache Tests | 116 116; lts, pre, QA, threaded, and downgrade Adams jobs also passed. Inspected with gh run view 38859053121 --repo SciML/OrdinaryDiffEq.jl --job 116882661913 --log. The failed PR integration job reports AssertionError: mi2 !== nothing in the threaded ensemble case at downstream/test/Core4/ensembles.jl:19 (15 passed, one errored, two broken). The completed master integration run, at d72c550, contains the exact same Core4 assertion and counts. Logs were inspected with gh run view 38859052731 --repo SciML/OrdinaryDiffEq.jl --log-failed and gh run view 41319752001 --repo SciML/OrdinaryDiffEq.jl --log-failed, after listing recent master push runs and the five completed IntegrationTest runs. The first log fetch hit a read-only default gh cache; repeating the fetch with XDG_CACHE_HOME in the review workspace succeeded. This is independently verified baseline CI failure, not the blocker above.

What I did not verify

No 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
Conversation: https://claude.ai/code/session_01379heiiB35TtywhR7uSU74

codex and others added 3 commits November 7, 2026 23:35
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)
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #4703

Reviewed head: ba73ff4
Raw SHA-256: 5a5e0084f8258dddd7ef14e57eb165afe059fd24a201efafc6ff010f7694b79d
Source SHA-256: ee4d64e5417d86046f3f2ee1b13ab7c2c8d0639a9d4c2b2913cb48ec7b81ea64
Source: operator-attested-codex-v1 (runner attested by pankgeorg)
Reviewer session: 01a22387-aede-73d2-b365-c0d2959c7c9a
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes
Redaction: ran (substitutions=2)

Risk assessment

  • Risk: medium (M2)
  • Verdict: CHANGES
  • Reviewed head: ba73ff4

Review report

VERDICT: CHANGES
PR: #4703
Head: ba73ff4
Base: 6343f5a
Reviewer: codex-cli 0.172.0 / gpt-6.2-sol
Session: 01a22387-aede-73d2-b365-c0d2959c7c9a

Risk

medium (M2: The patch changes accepted startup values for explicitly selected in-place VCABM() solves, including ordinary solves without a resize.)

The affected users select VCABM() through solve or init, or change state dimensions with resize!, deleteat!, or append-style addat! while using a variable-coefficient Adams solver. The changes are confined to the opt-in Adams sublibrary’s stepping and cache methods. Automatic solver selection, shared solve and init implementation, and modeling compilation are outside the patch.

Blocking findings

  • P1 · VCABM() startup accuracy depends on the RHS calling convention. For (u'=1), (u(0)=1), tspan=(0.0, 0.25), dt=0.25, and both tolerances set to 1e-10, the exact endpoint is 1.25. The merge base returned 1.5 in both modes. The head returns 1.25 in-place and still returns 1.5 out-of-place with ReturnCode.Success. The out-of-place corrector adds a full step to a predictor that already contains a full step, and its error estimate is zero for this RHS. In perform_step!(integrator, cache::VCABMConstantCache, ...), use uprev as the corrector base when k == 1, matching the mutable method. A temporary version of that one-line fix passed both modes. Add a regression asserting that both calls succeed and return 1.25. lib/OrdinaryDiffEqAdamsBashforthMoulton/src/adams_bashforth_moulton_perform_step.jl:1520

Nonblocking findings

  • Assert the cache restart directly. The analytical shrink checks for VCAB3, VCABM4, and VCABM still passed when I replaced _resize_adams_history! with a size-only implementation. A direct check did detect the stale state. After advancing VCABM to order 5, the head reset it to order 1 and cleared the derivative history. The size-only version retained order 5 and nonzero history. Add those assertions immediately after a mid-solve resize in the test suite. lib/OrdinaryDiffEqAdamsBashforthMoulton/test/abm_resize_tests.jl:72

What I ran

  • diff -qr before head, git apply --check ../changes.diff from before/, and git apply --check --reverse ../changes.diff from head/. The trees differ in the six patched files, and both patch checks passed. ci.json identifies the assigned target as the base. The diff adds tests without removing or weakening existing assertions.
  • Pkg.instantiate(update_registry=false) in an offline scratch project. I used Julia 1.13.4 on AArch64 with the same resolved dependencies for both snapshots and bounds checking enabled.
  • julia --startup-file=no --project=.review/head --compiled-modules=existing --check-bounds=yes head/lib/OrdinaryDiffEqAdamsBashforthMoulton/test/abm_resize_tests.jl, repeated with --project=.review/before. The head passed all 130 assertions. The coupled grow and shrink tests use piecewise matrix exponentials and passed the 1e-6 endpoint and 1e-5 saved-state bounds. Deletion and BigFloat growth passed their 1e-7 analytical checks. The merge base passed 48 fixed-step assertions, then stopped on DimensionMismatch in both VCAB3 resize directions.
  • With the same Julia flags, ran .review/probe.jl against both snapshots and .review/proposed-fix.jl against the head. The constant-derivative probe produced the endpoints above. The temporary correction passed 2/2 assertions. No source snapshot was edited.
  • Ran .review/core.jl and .review/edge.jl with --project=.review/extra, using --threads=2 for the edge probe. The existing Adams convergence, coefficient, and discontinuity checks passed 375/375. The additional append/delete, tuple-shaped resize, and threaded in-place checks passed 14/14 against (u'=-u), with a maximum endpoint error of 9.91e-9.
  • Ran .review/stale.jl and .review/cache-state.jl against the head. The first probe’s expectation that stale history would breach the analytical shrink tolerance failed. The direct cache-state probe passed 8/8 assertions and distinguished the head from the size-only version.
  • Read ci.json, the Sublibrary CI workflow, and the test runner’s Core gate. The exact-head Adams Core job is recorded as successful, and the runner includes the resize suite under that gate. The local run above supplies the test-level results. Adams Core CI

What I did not verify

  • I did not run GPU-only paths on AArch64. The patch changes no GPU kernel, AD rule, Reactant path, or MPI path, so G2 does not apply. The general GPU job is recorded as failing on both revisions. The supplied metadata gives no test logs to diagnose those failures. Head GPU job · Base GPU job
  • I did not run the full monorepo suite, the Julia LTS or prerelease suites locally, or a before/after benchmark. The patch makes no performance claim.

Head link: ba73ff4


🤖 Posted by an AI agent — harness: codex-cli 0.172.0 · model: gpt-6.2-sol
Conversation: local session 01a22387-aede-73d2-b365-c0d2959c7c9a (no session URL)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants