Skip to content

Carry the QNDF2 difference array across steps - #4526

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:devin/qndf2-difference-history
Sep 12, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:devin/qndf2-difference-history

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Summary

Rebase of #4455 (authored by @singhharsh1708 — original commit authorship is preserved) onto current master, resolving merge conflicts. Fixes #4332.

QNDF2 rebuilt its backward differences from uprev, uprev2 and uprev3 on every step and corrected a change of step size with a first-order scaling, so an O(h²) error sat inside a quantity whose signal is O(h³) and the local error estimate tracked dt/dtₙ₋₁ instead of the error. There was no step size at which the estimate settled near 1, so the controller alternated between growing by the maximum factor and rejecting.

D now stays at the step size its differences were formed with, a step that changes dt scales them through the exact R * U transform into locals, and a successful step commits the new differences incrementally, which is what variable-order QNDF already does. Reading D and writing locals also removes the aliasing in D[2] = D[1] * R[1, 2] + D[2] * R[2, 2], which used the D[1] assigned on the line above; that was inert because (R * U)[1, 2] is zero for k = 2.

Rebase notes

Conflicts vs. #4455's base were trivial: Project.toml (master is now at 2.4.8, so this bumps to 2.4.9) and bdf_regression_tests.jl (both sides appended testsets — all kept). bdf_perform_step.jl and bdf_caches.jl merged cleanly.

Test evidence

The regression test asserts QNDF2/QBDF2 reject fewer than a tenth of accepted steps on u' = -u at 1e-8.

On current master (d63b9c8fce), the bug still reproduces — solve(ODEProblem((u,p,t)->-u, 1.0, (0.0,10.0)), alg, reltol=1e-8, abstol=1e-8):

QNDF2    naccept=4211  nreject=6427
QBDF2    naccept=5992  nreject=7807

On this branch:

QNDF2    naccept=765   nreject=2
QBDF2    naccept=965   nreject=12

test/bdf_regression_tests.jl run in full on the rebased branch: all testsets pass, including the new "QNDF2 step size control does not thrash (#4332)" (6/6) and the existing backward-integration rejection tests. typos clean; the changed files match master's existing formatting state (master itself is not raw-SciMLStyle clean in these files, so no formatting sweep was folded in).

🤖 Generated with Devin (harness: Devin CLI 3000.10.21, model: SWE-2 Max, session: local CLI session, workspace /home/crackauc/sandbox/tmp_20260912_121314_35902) — rebase + conflict resolution + verification only; the fix itself is @singhharsh1708's.

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Agent-Harness: Devin CLI 3000.10.21
Agent-Model: SWE-2 Max
Agent-Session: local Devin CLI session (workspace /home/crackauc/sandbox/tmp_20260912_121314_35902)
@ChrisRackauckas
ChrisRackauckas merged commit e5af59f into SciML:master Sep 12, 2026
137 of 141 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 13, 2026
- OrdinaryDiffEqDefault: require OrdinaryDiffEqCore 4.17.1 (#4520)
- Add adaptive step size control to SDC (#4346)
- Allow JET 0.12 in every QA test environment (#4513)
- Resolve OrdinaryDiffEqDefault against the local sublibraries (#4514)
- NonlinearSolveAlg: stale-Jacobian retry + rejected-step W reassembly (carries #4282 to current master) (#4505)
- Do not seed a retry from the previous-step interpolant (#4473)
- Say why the linear path ignores new_W_dt_cutoff (#4527)
- Carry the QNDF2 difference array across steps (#4526)
- Pass Θ = 0, not the absolute time, to the AN5 startup interpolant (#4534)
- Make the stabilized-RK step cap and eigenvalue tolerance direction-agnostic (#4536)



Agent-Harness: Claude Code
Agent-Model: claude-opus-5[1m]
Claude-Session: https://claude.ai/code/session_014FEzNTLFutCmTEAZ3zBg5R

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

QNDF2 and QBDF2 reject many more steps than expected

3 participants