Repository navigation
Differentiate with a fitting chunk after resize!/deleteat! shrinks the state below the ForwardDiff chunk - #4804
Conversation
…ForwardDiff chunk A prepared ForwardDiff Jacobian config keeps the chunk chosen at init (it is part of its type), so after resize!/deleteat! shrinks the state below it, ForwardDiff throws "chunk size cannot be greater than structural_length". jacobian! now detects that case and differentiates without the prepared config, with an explicit chunk clamped to the new length or an automatic one picked for it, using the unwrapped RHS. Fixes SciML#4803 Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Agent-Harness: Claude Code Agent-Model: claude-opus-5-5[1m] Agent-Session: https://claude.ai/code/session_01AXwyJDRaMKgnYMG9M1Ut49
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-4804/log.txt
Merged the default branch into this PR (clean merge, no conflicts; head 42b582e) 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 |
The automatic-chunk branch of `shrunk_forwarddiff_backend` recomputed the prepared chunk from `integrator.sol.prob.u0`. With `alias = ODEAliasSpecifier(alias_u0 = true)` that vector is the integrator state, so `resize!`/`deleteat!` shrinks it too, the check saw a fitting chunk, and the prepared 10-partial config was used on a 2-element state (`ArgumentError: chunk size cannot be greater than ForwardDiff.structural_length(x) (10 > 2)`). `build_jac_config` now records the chunk of a dense ForwardDiff config as a third tuple element (`nothing` for other backends), `resize_jac_config!` keeps it, and `jacobian!` compares the state length against it. A two-element `jac_config` still takes the prepared path. The fallback chunk is `length(u)`, which for an automatic chunk is also ForwardDiff's pick. The regression test gains `alias_u0 = true` cases for Rodas5P (automatic chunk with `resize!` and `deleteat!`, and `chunksize = 5`) and TRBDF2. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Agent-Harness: Claude Code 2.1.301 Agent-Model: claude-opus-5-5 Agent-Session: local session ID 09d44832-9166-4fc4-9b9f-0d9e1ea97b2c (headless claude -p, no URL)
Independent review (Codex CLI 0.166.0 / gpt-6.1-sol), session 01a1976f-9d5c-7d60-a9b6-8a225e6fd5a9, reviewed head 4cbf4f7
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: The PR avoids oversized prepared ForwardDiff chunks after an implicit integrator shrinks. Changes are required because the public Jacobian-config return type changes without a major version and the added numerical regression lacks an independent oracle. Blast radius: Public build_jac_config and resize_jac_config! consumers; prepared Jacobians for implicit solvers, including Rodas5P and SDIRK, and resize/deleteat callbacks. Evidence: Own runs: added regression fails at the merge-base (27 passes, 13 errors) and passes at head (66/66); analytic/repeated-resize probe passes 64/64 and confirms the public pair-dispatch break. Differentiation Core and root AD/GPU CI passed; both failed CI tests also fail identically on recent master. Initial blind assessment was medium-high (MH1); the documented public return-type change raises the final rating to high (H1). Blocking findings
Non-blocking findingsNone. What I ranBlind inspection: git -C src diff origin/master...HEAD; git -C src merge-base origin/master HEAD. The merge-base is the live PR base recorded above; local origin/master is newer. INITIAL.md was written and hashed before reading author context. Read-only GitHub inspection: gh pr view 4804 --repo SciML/OrdinaryDiffEq.jl --json number,url,state,isDraft,headRefOid,baseRefName,baseRefOid,files; gh pr checks 4804 --repo SciML/OrdinaryDiffEq.jl; gh issue view 4803 --repo SciML/OrdinaryDiffEq.jl --json title,body; git -C src log -1 --no-merges --format=%B origin/master..HEAD. The PR is open and draft; head matches TARGET.md. Commit trailers identify Claude Code 2.1.301 / claude-opus-5-5. CI: 184 successful checks, three skipped, two failed. Differentiation Core, Sparse, QA, and ModelingToolkit passed; root AD and GPU jobs passed. Inspected the sublibrary run and integration run with gh run view --log-failed. The failures are NonlinearSolve Newton Tests (LineSearchException: Search direction is not a direction of descent. Step length: 0.0) and SciMLSensitivity Core4 threaded ensembles (AssertionError: mi2 !== nothing). Compared gh run list --repo SciML/OrdinaryDiffEq.jl --branch master --event push --limit 5 and inspected logs of master sublibrary CI and master integration CI: both contain those exact respective failures at the same tests. No additional PR blocker is inferred from those two CI failures. Julia run 1: JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 JULIA_NUM_PRECOMPILE_TASKS=4 JULIA_PKG_PRECOMPILE_AUTO=0 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$REVIEW_DEPOT:" timeout 3600 julia +1.13.2 --startup-file=no --project=env head_tests.jl (exit 0). REVIEW_DEPOT denotes the supplied shared depot. The script activates env, develops the seven local library dependencies, adds ADTypes/SciMLBase/ForwardDiff/DifferentiationInterface, and includes lib/OrdinaryDiffEqDifferentiation/test/resize_chunksize_tests.jl inside a Test testset. Output: REVIEW_JULIA_VERSION=1.13.2; PR4804 head regression | 66 passed / 66 total, 4m25.5s. Resolved dependencies: SciMLBase 3.58.0, ForwardDiff 1.4.6, DifferentiationInterface 0.7.21, ADTypes 1.24.0. Julia run 2: git -C src archive 59ba40e lib | tar -x -C base materialized the merge-base libraries without modifying src. Copied the head Project/Manifest to base_env, replacing only the seven local library source roots. JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 JULIA_NUM_PRECOMPILE_TASKS=4 JULIA_PKG_PRECOMPILE_AUTO=0 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$REVIEW_DEPOT:" timeout 3600 julia +1.13.2 --startup-file=no --project=base_env base_tests.jl (exit 1). The script includes the identical added test file from head against the base libraries. Output: PR4804 base regression | 27 passed, 13 errored, 40 total, 3m52.6s; errors report ArgumentError: chunk size cannot be greater than ForwardDiff.structural_length(x) (10 > 2) or (5 > 2). Thus the added regression fails on the unfixed merge-base and passes on the reviewed head in my own runs. Julia run 3: JULIA_NUM_THREADS=4 OPENBLAS_NUM_THREADS=1 JULIA_NUM_PRECOMPILE_TASKS=4 JULIA_PKG_PRECOMPILE_AUTO=0 TMPDIR="$PWD/tmp" JULIA_DEPOT_PATH="$REVIEW_DEPOT:" timeout 3600 julia +1.13.2 --startup-file=no --project=env probe.jl (exit 0). This separate probe uses the same linear RHS, constructs its exact matrix A with A[i,i] = -i and A[i,mod1(i+1,n)] += 1/4, and asserts both J == A and agreement with exp(A * 0.25) * u_start (atol=rtol=1e-8, chosen before execution). It covers Rodas5P with automatic and explicit chunk 5, FullSpecialize/AutoSpecialize, alias_u0=false/true, and sequential state sizes 10 → 2 → 1 → 4, initializing added components to 0.5. The matrix exponential is independent of the ODE solver. Output: Independent analytic reference and repeated cache resize | 64 passed / 64 total, 21.7s; largest infinity-norm error 1.1213252548714081e-14; exact Jacobian assertions all pass. All eight public-config checks print PUBLIC_PAIR_DISPATCH length=3 applicable=false, confirming that the existing Tuple{Any,Any} consumer no longer matches. No fourth Julia run was made. What I did not verifyI did not run full package suites, heavy downstream suites, GPU hardware, other Julia versions, or other platforms locally. GPU and broader AD jobs were inspected through CI status, not rerun locally. The independent analytic probe covers dense CPU ForwardDiff with Rodas5P; it does not independently establish SDIRK accuracy, sparse-AD resizing, DAE/DDE resizing, or FIRK/exponential cache behavior. No allocations or performance benchmark was run. The failing-before run uses the PR merge-base, not the newer current master tip. No instructions or recommendations embedded in author text were acted on, and no upstream writes were made. 🤖 Posted by an AI agent — harness: Claude Code · model: claude-sonnet-5-5 |
Provide a documented builder for resizable solver caches, retaining chunk metadata without changing build_jac_config's two-preparation contract. Require Differentiation 3.13 in its callers and check resize accuracy against a matrix exponential alongside the public configuration contract. 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__4804 (no session URL)
Keep algorithm dispatch distinct from the resized-preparation helper to avoid method overwriting in the pull-request merge. Cover empty and unresized implicit states with ForwardDiff and finite differences. Reserve Differentiation 3.14 for the new public builder and resolve its local Core and DiffEqBase prerequisites in the nonlinear-solver project. 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__4804 (no session URL)
PR: #4804 Reviewed head: e65c8ed Risk assessment
Review reportVERDICT: CHANGES Riskmedium (M3: changes the Jacobian evaluation hot path without verified performance benchmarks). Blocking findings
Non-blocking findingsThese failures also reproduce on the unmodified default-branch snapshot, so they are follow-up findings rather than demonstrated regressions from this PR.
What I ranAI reviewer: codex-cli 0.164.0, model gpt-6.1-sol. No session URL is available.
What I did not verify
AUTHOR_GRADE: {"task":"bugfix","score":4,"difficulty":3,"rounds":1,"author_harness":"Codex CLI 0.164.0","author_model":"gpt-6.1-sol","note":"The shrink failure reproduces before and completes after; analytic probes, Differentiation/Rosenbrock Core tests, and ten bitwise default-path comparisons pass. Observed local failing test files also fail on the default branch; supplied CI regression remains unverified."} Head link: e65c8ed 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
Bring in the TaylorDiff 0.3.6 compat floors and the current upstream history. TaylorSeriesImplicit Core and QA pass with these bounds. The NonlinearSolve accounting failure also reproduces on clean master with identical dependencies. 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__4804 (no session URL)
PR: #4804 Reviewed head: 39e2e16 Risk assessment
Review reportVERDICT: CHANGES Riskmedium (M3: changes the Jacobian evaluation hot path without verified performance benchmarks). Blocking findings
Non-blocking findingsNone newly confirmed in the delta. The TaylorSeriesImplicit convergence tests and independent analytic probes pass with TaylorDiff 0.3.6. No assertion weakening or new dependency is introduced by the delta; its source changes are already present on What I ranAI reviewer: codex-cli 0.164.0, model gpt-6.1-sol. No session URL is available. No author risk rating or earlier same-head review was read.
What I did not verify
AUTHOR_GRADE: {"task":"bugfix","score":4,"difficulty":3,"rounds":2,"author_harness":"Codex CLI 0.164.0","author_model":"gpt-6.1-sol","note":"The delta imports upstream compatibility fixes without changing the reviewed Jacobian implementation. Differentiation Core, TaylorSeriesImplicit convergence, independent analytic Taylor probes, and current-dependency accounting tests pass. The prior Julia 1.11 downgrade regression remains unverified."} Head link: 39e2e16 🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol |
Please ignore until reviewed by @ChrisRackauckas.
A prepared ForwardDiff Jacobian config keeps the chunk chosen at
init, because the chunk is a type parameter of the config and of the solver cache.resize_jac_config!→DI.prepare!_jacobianonly resizes its dual buffers, so afterresize!/deleteat!shrinks the state below that chunk, ForwardDiff throwschunk size cannot be greater than structural_length. Since a smaller-chunk config cannot be stored in the typed cache,jacobian!now detects that case (shrunk_forwarddiff_backend) and differentiates without the prepared config, through the unwrapped RHS, with a chunk that fits. Nothing changes while the stored chunk fits; the check is two integer comparisons per Jacobian.Chunk handling:
AutoForwardDiff(chunksize = k)is used unchanged whilek ≤ length(u). Whenk > length(u)it is clamped tolength(u).pickchunksize(length(u0))) is replaced by DI's automatic pick for the new length when it no longer fits.SciMLBase.unwrapped_f) in the fallback, because anAutoSpecializewrapper only accepts duals of theinitchunk.resize_grad_config!is unaffected: the time derivative always uses one partial. The change is confined toderivative_wrappers.jl, so it does not overlap with #4796 (integrator_interface.jl).Verification
Regression test
lib/OrdinaryDiffEqDifferentiation/test/resize_chunksize_tests.jl(added to the Core group): a 10-state system is stepped tot = 0.5, shrunk to 2 states, and solved tot = 1. The result is compared with a fresh solve of the 2-state system from the same state. The cases are Rodas5P (resize!anddeleteat!), Rodas5P withchunksize = 5(clamped), TRBDF2, KenCarp4, and TRBDF2 withchunksize = 2(respected), each withFullSpecializeandAutoSpecialize. The tolerance isrtol = 1e-5. TRBDF2's own error againstexp(A t)atreltol = 1e-10is 3.4e-6 on the fresh solve and 2.1e-6 on the continued solve. The continued solve withAutoFiniteDiffgives the identical value, so the gap is TRBDF2's accuracy, not the Jacobian.On master (cceca42, fix reverted): 8 errors, all
ArgumentError: chunk size cannot be greater than ForwardDiff.structural_length(x)With the fix:
The reproducer from #4803 prints
Successfor all six cases with the fix (6 lines, 4 of themERRORon master).Existing tests, run with the fix, one file per process:
Runic
--checkandtyposon the touched files: exit 0.Not verified
deleteat!is broken on master independently, see DelayDiffEq: deleteat! throws UndefVarError, addat! misses solver buffers, resize! leaves grown history uninitialized #4797 / Fix DelayDiffEq deleteat!/addat! and zero grown history in resize! #4798), sparse AD (AutoSparseis left on the prepared path), and FIRK / exponential caches.deleteat!for SDIRK methods fails on master for a separate reason: the nlsolver buffers are not shrunk (BoundsError), whatever the AD backend. That is the scope of Resize FSAL, nlsolver and J/W buffers in deleteat!/addat!, once per array #4796, so the test usesdeleteat!only with Rosenbrock. FBDFresize!throws aDimensionMismatchon master that is also unrelated to the chunk.initchunk, which used to throw.Fixes #4803
Risk assessment
OrdinaryDiffEqDifferentiation.jacobian!(in-place ForwardDiff Jacobians for every implicit/Rosenbrock method). When the stored chunk fits, which covers every non-resized solve, the only change is a call through_jacobian!, which forwards to the sameDI.jacobian!call. No public API changes.integrator.sol.prob.u0assumes the Jacobian config was prepared at the length ofprob.u0.🤖 Generated with Claude Code (model: claude-opus-5-5[1m])
https://claude.ai/code/session_01AXwyJDRaMKgnYMG9M1Ut49
Review findings addressed
Independent review: codex-cli 0.163.0 / gpt-6.1-sol rated the PR at head a2f84f9 medium risk, high confidence, verdict CHANGES, with one finding.
prob.u0. Fixed. Withalias = ODEAliasSpecifier(alias_u0 = true),integrator.uisprob.u0, so shrinking the state also shrankprob.u0. The check then saw a chunk that fit and used the 10-partial prepared config on a 2-element state. Nowbuild_jac_configrecords the chunk of a dense ForwardDiff config when it prepares it, as a third tuple element (nothingfor other backends; the no-config value stays(nothing, nothing)).resize_jac_config!carries that element over, andjacobian!compares the state length against it. DifferentiationInterface has no public way to read a prep's chunk (overloaded_input_typeis documented as experimental and not public), so the value is recorded instead. The fallback chunk is nowlength(u)for explicit and automatic chunks alike. For an automatic chunk this is also ForwardDiff's own pick, because an automatic chunk never exceeds ForwardDiff's chunk threshold. The regression test addsalias_u0 = truecases, each run withFullSpecializeandAutoSpecialize: Rodas5P with the automatic chunk (resize!anddeleteat!), Rodas5P withchunksize = 5, and TRBDF2 with the automatic chunk.Fail-before: the updated test file against head a2f84f9 has 3 errors, all
ArgumentError: chunk size cannot be greater than ForwardDiff.structural_length(x) (10 > 2):Pass-after:
With the fix, the reviewer's aliasing probe (Rodas5P auto and
chunksize = 5, TRBDF2 auto,alias_u0false and true) printsSuccesson all six lines. Before the fix, two of them errored.API note.
build_jac_configandjacobian!are declared public developer API. The tuple returned for a prepared config gains a third element. Indexing[1]and[2]and two-element destructuring behave as before.jacobian!still accepts a two-elementjac_config; in that case it uses the prepared config, as on master. The automatic-chunk record isForwardDiff.pickchunksize(length(u)), which assumes DI preparesAutoForwardDiff()withForwardDiff.Chunk(u)(true for DI 0.7.21). A reviewer may prefer preparing with that explicit chunk instead, so the record is authoritative by construction.Validation (Julia 1.13.2, 4 threads), run on the final tree:
GROUP=Corefor OrdinaryDiffEqDifferentiation (Pkg.test()): all 18 testsets pass, includingResize below ForwardDiff chunk | 66 66.GROUP=QA: JET 1/1, Aqua 19/19, JVPCache allocation 13 pass and 2 broken, from an existingbroken = truetest in that file.GROUP=Integrators_II(Pkg.test()of the monorepo root): passes. Resize Tests 90/90 and deleteat!/addat! Tests 48/48; Cache Tests 214 pass and 4 broken, IMEX Split 15 pass and 1 broken, all from existing@test_brokenin files this PR does not touch.--checkandtyposon the changed files: exit 0.Not verified: Julia lts/pre, GPU, DelayDiffEq resize (it calls the same
resize_jac_config!), and FIRK/exponential caches after a shrink.🤖 Posted by an AI agent — harness: Claude Code 2.1.301 · model: claude-opus-5-5
Conversation: local session ID 09d44832-9166-4fc4-9b9f-0d9e1ea97b2c (headless, no URL)
Breaking change
OrdinaryDiffEqDifferentiation.build_jac_configis declaredpublic(Julia ≥ 1.11) and is documented in the Developer Extension API. In this PR, for every backend that gets a prepared config, it returns(config, config, chunksize)instead of(config, config).chunksizeis anIntfor a dense CPUAutoForwardDiffconfig andnothingfor every other backend. The no-config value(nothing, nothing)is unchanged. Code that dispatches onTuple{Any, Any}, checkslength(jac_config) == 2, or iterates over the configs sees a third element. For caches built with such a config,resize_jac_config!returns the three-element tuple too.This requires a major release of OrdinaryDiffEqDifferentiation: 3.12.4 → 4.0.0. This PR does not bump the version. At release, every package whose compat on OrdinaryDiffEqDifferentiation is "3.x" has to widen it to include 4: OrdinaryDiffEqBDF, OrdinaryDiffEqExponentialRK, DelayDiffEq, OrdinaryDiffEqRosenbrock, OrdinaryDiffEqIMEXMultistep, OrdinaryDiffEqExtrapolation, OrdinaryDiffEqNonlinearSolve, OrdinaryDiffEqMultirateImplicit, OrdinaryDiffEqFIRK, OrdinaryDiffEqSDC, OrdinaryDiffEqSDIRK, OrdinaryDiffEqPDIRK, OrdinaryDiffEqStabilizedIRK and StochasticDiffEqImplicit. OrdinaryDiffEqTaylorSeriesImplicit, StochasticDiffEq and the OrdinaryDiffEq root also depend on it and need the same check. The "API note" in the first review-findings section above calls the change additive. That is wrong: as the second review shows, a method on
Tuple{Any, Any}no longer matches.Review findings addressed (round 2)
Re-review by codex-cli 0.163.0 / gpt-6.1-sol at head 4cbf4f7: medium risk, high confidence, verdict CHANGES, one finding. The reviewer also re-ran the regression independently: 57 passes and 3 errors before the fix, 66/66 after.
jacobian!needs the prepared chunk after a resize, and the only object that bothbuild_jac_configandjacobian!see is the returned tuple. DifferentiationInterface has no public query for a prep's chunk:overloaded_input_typeis documented as "experimental and not part of the public API", and reading the prep's fields would rely on DI internals.prepare_algwould make it stable, but it changesintegrator.algandsol.algfor every ForwardDiff solve. DAE initialization also passesalg_autodiff(integrator.alg)to theNewtonRaphsonof its own nonlinear solve.build_jac_configreturning the pair, add a separate public builder that appends the chunk, and use it only in the caches that callresize_jac_config!: the mutable Rosenbrock caches and theNLNewton/NonlinearSolveAlgnlsolver caches. OrdinaryDiffEqDifferentiation would then need only a minor bump. The catch is that OrdinaryDiffEqNonlinearSolve has no[sources]entry for OrdinaryDiffEqDifferentiation, so its sublibrary CI would resolve the registered 3.12.4 and fail to load until a Differentiation release. It would have to land as two stacked PRs: first OrdinaryDiffEqDifferentiation (new builder, plusjacobian!reading the third element), then the Rosenbrock/NonlinearSolve callers with raised lower bounds and this regression test.No code changed in this round, so no tests were re-run. The validation listed in the first review-findings section applies to head 4cbf4f7.
🤖 Posted by an AI agent — harness: Claude Code 2.1.301 · model: claude-opus-5-5
Conversation: local session ID 09d44832-9166-4fc4-9b9f-0d9e1ea97b2c (headless, no URL)
Fix by Codex CLI 0.164.0 gpt-6.1-sol (head 4101acf)
build_jac_configpreserves its public two-preparation tuple. The documented publicbuild_resize_jac_configrecords the chunk for the mutable Rosenbrock and nonlinear-solver caches. Differentiation is versioned 3.13.0, its callers require 3.13, and NonlinearSolve has a local Differentiation source entry. The earlier Breaking change section describes the original reviewed head; this head uses the compatible builder design.The regression checks both solver results against
exp([-1 0.25; 0.25 -2] * 0.5) * u_mid. It retains resize/delete, specialization, aliasing, and explicit/automatic chunk cases. The step cap is1e-4, with an analytic relative-error budget of1e-7: the second-order scaleT * norm(A, Inf)^3 * dtmax^2is approximately5.7e-8before the method's error coefficient. Manual resizing flags the dimension-dependent RHS discontinuity throughderivative_discontinuity!. The existing solver-to-solver tolerance stays unchanged. The pair-contract checks cover automatic ForwardDiff, explicit chunk 5, and finite differences; NonlinearSolve's public-API QA checks the new import without an ignore entry.Failing before / passing after
The same final test file ran with matching external dependencies and archived library sources.
$PR_HEAD_ENVdenotes the archived original head, and$MERGE_BASE_ENVdenotes merge-base 59ba40e; only the in-repository source paths in the saved test Manifest were remapped.Original reviewed head: exit 1, six pair-contract assertion failures; every analytic check passes.
Merge-base: exit 1, thirteen
ArgumentError: chunk size cannot be greater than ForwardDiff.structural_length(x)errors. The manual discontinuity notification preserves the original bug coverage.Fixed tree, official Core group: exit 0, all 18 testsets pass.
Local validation
Julia 1.13.3 through juliaup,
JULIA_NUM_THREADS=4,OPENBLAS_NUM_THREADS=1,JULIA_NUM_PRECOMPILE_TASKS=1, andJULIA_PKG_PRECOMPILE_AUTO=0. Package test children used existing compiled modules to limit subprocesses.The three library QA groups exit 0. Their summary rows, in the order above (the NonlinearSolve rows are from the final run without the new-builder ignore):
These runs report broken allocation/JET assertions from the existing suites; those assertions remain unverified. No skip, broken marker, tolerance relaxation, or error suppression was added.
Root Integrators_II exits 0:
Root QA exits 0:
Formatting and spelling commands ran before committing, all with exit 0:
The full Runic pass left the Julia file hashes unchanged. After removing the redundant QA ignore,
julia +1.13.3 --project=@runic -m Runic --inplace lib/OrdinaryDiffEqNonlinearSolve/test/qa/qa.jl, spelling, andgit diff --checkalso exit 0.Baseline failures and documentation
GROUP=Core julia +1.13.3 --project=lib/OrdinaryDiffEqNonlinearSolve -e 'using Pkg; Pkg.instantiate(); Pkg.test(; julia_args = ["--compiled-modules=existing"])'still exits 1:The same exception reproduces with the official Core runner on clean upstream
6a6d63e642: Julia 1.13.3, NonlinearSolve 4.32.0, LineSearches 7.8.2, Core 4.19.1, Differentiation 3.12.5, SDIRK 2.9.8. The actual default push log also contains the exception. The existing open fix owns it; it is unmerged, so no upstream merge or duplicate issue was made here.The historical PR Core4 job used Julia 1.13.2 and Enzyme 0.13.216. The latest actual default push Core4 job succeeds on Julia 1.13.3 with Enzyme 0.13.217. The retained Enzyme investigation was not duplicated, and Core4 was not rerun locally.
Fresh docs dependency resolution selected ChainRules 1.74.11 and failed loading TaylorDiff with
TypeError: non-boolean (Symbolics.Num) used in boolean context. A standaloneusing TaylorDiffprobe, with Julia 1.13.3 / TaylorDiff 0.3.5 / Symbolics 7.48.0 held fixed, fails with ChainRules 1.74.11 and succeeds with 1.74.10. The successful default docs push used 1.74.10. With that version pinned only in the local ignored Manifest, this strict docs command exits 0:julia +1.13.3 --compiled-modules=existing --project=docs -e 'using Pkg; Pkg.pin(PackageSpec(name="ChainRules", uuid="082447d4-558c-5d27-93f4-14fc19e9eca2", version=v"1.74.10")); include("docs/make.jl")'Not verified locally: LTS/prerelease Julia, GPU, Differentiation Sparse/ModelingToolkit groups, heavy downstream suites, or allocation/performance guarantees. New-head CI was checked once: test/docs workflows were queued or running; the ancillary Dependabot Auto-merge workflow reported
startup_failure. CI completion is not claimed.Risk assessment
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: Codex CLI 0.164.0 · model: gpt-6.1-sol
Conversation: local fixer job SciML__OrdinaryDiffEq.jl__4804 (no session URL)
Fix by Codex CLI 0.164.0 gpt-6.1-sol (head e65c8ed)
Merged current master normally. Its algorithm-dispatch
_jacobian!and this PR's preparation-dispatch helper had identical seven-argument signatures in the CI merge. The preparation helper is named_resized_jacobian!, preserving algorithm dispatch and allowing module precompilation. A regression covers empty and two-state Rodas5P/TRBDF2 solves with ForwardDiff and finite differences against the analytic exponential.Master now uses Differentiation 3.13.0, so this PR's new public builder is versioned 3.14.0 and both callers require 3.14. NonlinearSolve's local sources include Core and DiffEqBase as well as Differentiation, allowing its standalone project to resolve the required in-repository versions.
Failing before / passing after
The identical new regression file ran through the official Core runner before the helper rename:
GROUP=Core timeout 7200 julia +1.13.3 --project=lib/OrdinaryDiffEqDifferentiation -e 'using Pkg; Pkg.test(; julia_args = ["--compiled-modules=existing"])'Exit 1:
All eight cases error with
MethodError: no method matching jacobian!(::...alg, ::...integrator, ...). The native docs build also exits 1 withERROR: Method overwriting is not permitted during Module precompilation.Fixed full Core group, exit 0:
Before the additional local source entries, the NonlinearSolve QA command below exits 1 during resolution: registered Core versions stop at 4.19.1, while local Differentiation requires Core 4.20. The same command resolves and passes after those entries are added.
Local validation
Julia 1.13.3,
JULIA_NUM_THREADS=4,OPENBLAS_NUM_THREADS=1,JULIA_NUM_PRECOMPILE_TASKS=1,JULIA_PKG_PRECOMPILE_AUTO=0, and a job-local temporary directory. Test children use existing compiled modules to bound process counts.Commands executed for the full groups:
All final runs exit 0. Selected actual summary rows:
Existing broken allocation/JET/interface assertions remain unverified. No bypass marker or tolerance relaxation was added.
Formatting, spelling, whitespace checks and strict precompiled loading exit 0:
Runic covered all ten Julia files in the PR diff and left their staged contents unchanged. The final spelling/whitespace check includes the additional source entries.
Baseline failures and limits
All six requested checks succeeded on the latest actual master push at
6a6d63e6429f0e02e8eac75fc19f7ed7bf34d060: documentation, downgrade InterfaceI, DiffEqCallbacks All, and SciMLSensitivity Core1/Core3/Core4. The method-overwrite failure is specific to combining this PR with master.Fresh-resolution docs also have a separate dependency failure. The full docs command reproduces
TypeError: non-boolean (Symbolics.Num) used in boolean contexton a clean master checkout. A separate investigation reduced it tousing TaylorDiff: identical fresh dependencies pass with ChainRules 1.74.10 and fail with 1.74.11/1.74.12, identifying ChainRules commita6107e9bfe1cc91f46f22130f4428933f906540c. The existing TaylorDiff issue tracks it. No dependency constraint was committed for that baseline problem.The strict documentation build passes with the known-good version pinned only in the ignored local Manifest:
timeout 10800 julia +1.13.3 --compiled-modules=existing --project=docs -e 'using Pkg; Pkg.pin(PackageSpec(name="ChainRules", uuid="082447d4-558c-5d27-93f4-14fc19e9eca2", version=v"1.74.10")); include("docs/make.jl")'Exit 0:
Additional default-branch failures were investigated separately: SciMLSensitivity Core2 is already tracked in its finished-tape/unexpected-pass issues; the ProbNumDiffEq missing-error-key failure reduces to DiffEqDevTools and was filed separately with an isolated source boundary and independently rerun failing/passing controls. Neither is changed by this PR.
Not verified locally: exact downgraded dependency versions, LTS/prerelease Julia, GPU hardware, full downstream suites, or allocation/performance guarantees. CI was checked once after pushing: test/docs workflows started; the ancillary Dependabot Auto-merge workflow reports
startup_failure. CI completion is not claimed.Risk assessment
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: Codex CLI 0.164.0 · model: gpt-6.1-sol
Conversation: local fixer job SciML__OrdinaryDiffEq.jl__4804 (no session URL)
Fix by Codex CLI 0.164.0 gpt-6.1-sol (head 39e2e16)
Merged current master normally, preserving the branch's existing commits. Master raises both Taylor sublibraries' TaylorDiff floor to 0.3.6. TaylorSeriesImplicit Core and QA now pass locally. The merge also carries master's MagnusGauss4 correction and its tests. No additional solver-code or test changes were made in this fix session.
TaylorDiff failing before / passing after
A scratch-only environment held ChainRules 1.74.12 and Symbolics 7.48.0 fixed. The same load probe changes only TaylorDiff from 0.3.5 to 0.3.6:
The probe activates its own local environment, adds the three named versions with
Pkg.add, and executesusing TaylorDiff.Master's latest actual push at
760d9306222480c1aa159e9cd8d3fd9b244e62cfalso passes TaylorSeriesImplicit Core, QA, and downgrade checks. Its TaylorDiff compatibility fix is included in this merge.Local validation
Juliaup's launcher was explicitly first on
PATH. Julia 1.13.3,JULIA_NUM_THREADS=4,OPENBLAS_NUM_THREADS=1,JULIA_NUM_PRECOMPILE_TASKS=1,JULIA_PKG_PRECOMPILE_AUTO=0, and a job-local temporary directory were used. An initial invocation selected a non-juliaup binary and exited before running tests; the corrected commands below completed.All three commands exit 0. TaylorSeriesImplicit's runner executes the same convergence tests for Core and QA:
The 33 broken JET assertions are existing assertions and remain unverified. No tests were skipped, disabled, relaxed, or silenced. Aqua's subprocess checks briefly exceeded the intended three-process aggregate while the separate baseline probe was running; that QA run completed before intervention. Further Julia work was serialized.
Formatting and spelling exit 0:
julia +1.13.3 --project=@runic -m Runic --inplace lib/OrdinaryDiffEqLinear/src/linear_perform_step.jl lib/OrdinaryDiffEqLinear/test/linear_method_tests.jl git diff --cached --name-only -z | xargs -0 typos git diff --cached --checkRunic left the merged Julia files unchanged.
NonlinearSolve downgrade: matching baseline failure
The historical default-branch downgrade job passes with registered Core 4.14.0, Differentiation 3.10.0, and SciMLBase 3.46.0. A clean master archive with that downgrade resolution passes the entire
nsa_stats_tests.jlfile: 39/39.The failing PR job instead resolves local Core 4.20.1 and Differentiation 3.14.0, with SciMLBase 3.53.0. A separate investigation reconstructed all 192 dependency versions exactly from that CI job, including JLL builds. With Julia 1.11.9, the official accounting test file reproduces the CI failure. Holding those external dependencies fixed and using clean master source at
760d9306222480c1aa159e9cd8d3fd9b244e62cf(Differentiation 3.13.0) produces the identical failure and identical excess tuples for all five cases:The probe instantiates its environment and includes the official test file, adding only printed algorithm names and excess values; every assertion is retained.
This is a pre-existing failure in the current source with that dependency combination, exposed by the PR's local source entries. It is not evidence that the default branch's own configured downgrade job fails. As requested, no code or assertion was changed for the matching baseline failure.
Not verified: the full Julia 1.11 downgraded NonlinearSolve Core group, the merged MagnusGauss4 test locally, documentation, GPU, LTS/prerelease matrices, heavy downstream suites, or performance. CI was checked once after pushing and workflows were queued or running; completion is not claimed.
Risk assessment
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: Codex CLI 0.164.0 · model: gpt-6.1-sol
Conversation: local fixer job SciML__OrdinaryDiffEq.jl__4804 (no session URL)