Skip to content

Tolerate roundoff-scale dt differences in SBDF dt-change reset - #4574

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-sbdf-dt-tolerance-4573
Sep 16, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-sbdf-dt-tolerance-4573

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

What changed and why

SBDF's dt-change restart (#4366) compared dt with exact !=, so a final step clipped to a 1-ulp-perturbed tspan[2] (dt differing by ~eps(t)) restarted the fixed-coefficient history at first order, amplifying a 1e-16 end-time perturbation into an O(dt^2) solution change (#4573). Both SBDF caches now compare via _sbdf_dt_changed, which tolerates differences within the same 100*eps(t) window modify_dt_for_tstops! uses when clipping to a tstop, preserving the genuine-restart behavior fixed in #4329.

Verification

  • Reproduced the OrdinaryDiffEqBDF.jl v2.4.10 changed behavior significantly #4573 MWE on released BDF v2.4.9 (|u(T)-u(T2)| = 1.4e-17) vs v2.4.10 (3.7e-05, ratio ~4 under refinement); deleting only the two reset lines from unmodified v2.4.10 restores v2.4.9 bit-for-bit.
  • New regression test fails before, passes after (stashed the src fix, re-ran):
    • before: 0 passed, 4 failed (SBDF2/3/4 out-of-place + SBDF2 in-place)
    • after: 4 passed, diffs ~1.4e-17
  • lib/OrdinaryDiffEqBDF/test/bdf_convergence_tests.jl with fix: 98/98 pass (36+36 convergence, 14 SBDF incl. the SBDF solvers do not achieve expected convergence order #4329 clipped-step test, 12 static-array).
  • SBDF solvers do not achieve expected convergence order #4329 behavior preserved: clipped-step err ratio 1.04 < 5.
  • Runic: 3 changed files clean. typos: clean.
  • GROUP=QA julia --project=lib/OrdinaryDiffEqBDF -e 'using Pkg; Pkg.test()': Allocation 4 pass / 18 broken (pre-existing broken=true markers) / 0 fail; JET 18 pass / 23 broken (pre-existing) / 0 fail; Aqua 21/21; suite reports passed.

Fixes #4573.

What was not verified

  • GPU group (no hardware here) and downstream packages.
  • Allowed-to-fail CI jobs.

Reviewer notes

  • The tolerance keys off the t scale rather than dt: the roundoff in a clipped step is O(eps(T)), so an eps(dt)-relative threshold still misfires for small dt (verified: 100*eps(dt) still breaks at dt=2^-8..2^-10). Non-AbstractFloat t keeps exact comparison, mirroring modify_dt_for_tstops!.
  • New internal helper is underscore-prefixed with no docstring, matching neighboring helpers in bdf_utils.jl.

Note

This PR should be ignored until reviewed by @ChrisRackauckas.

🤖 Generated with OpenCode 1.17.18 (model: opencode/muse-spark-1.3-contributor-free) — local session in /home/crackauc/sandbox/tmp_20260916_155340_76607

The dt-change restart added in SciML#4366 compared dt with exact `!=`, so a
final step clipped to a 1-ulp-perturbed tspan[2] (dt differing by ~eps(t))
restarted the fixed-coefficient history at first order, amplifying a 1e-16
end-time perturbation into an O(dt^2) solution change (SciML#4573). Compare
with the same 100*eps(t) window `modify_dt_for_tstops!` uses instead,
preserving the genuine-restart behavior fixed in SciML#4329.

Adds a regression test: a 1-ulp end-time perturbation must not change the
SBDF2/3/4 result (out-of-place and in-place).

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: OpenCode <[email protected]>
Agent-Harness: OpenCode 1.17.18
Agent-Model: opencode/muse-spark-1.3-contributor-free
Agent-Session: local session in /home/crackauc/sandbox/tmp_20260916_155340_76607
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review September 16, 2026 21:54
@ChrisRackauckas
ChrisRackauckas merged commit 4d67a01 into SciML:master Sep 16, 2026
136 of 141 checks passed
ChrisRackauckas added a commit that referenced this pull request Sep 17, 2026
Ships the NordsieckBDF trial-step interpolation fix for delay equations (#4575) and the roundoff-tolerant SBDF dt-change reset (#4574).

Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Claude <[email protected]>
Agent-Harness: Claude Code 2.1.273
Agent-Model: claude-opus-5[1m]
Agent-Session: 6a01e420-3436-4518-83cc-6cd853283cfb (local transcript; this harness publishes no conversation URL)
ChrisRackauckas added a commit that referenced this pull request Sep 17, 2026
Ships the NordsieckBDF trial-step interpolation fix for delay equations (#4575) and the roundoff-tolerant SBDF dt-change reset (#4574).



Agent-Harness: Claude Code 2.1.273
Agent-Model: claude-opus-5[1m]
Agent-Session: 6a01e420-3436-4518-83cc-6cd853283cfb (local transcript; this harness publishes no conversation URL)

Co-authored-by: Claude <[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.

OrdinaryDiffEqBDF.jl v2.4.10 changed behavior significantly

2 participants