Repository navigation
DelayDiffEq: coalesce tracked dependent-lag discontinuities (fixes Waltman dt = 0) - #4802
Merged
ChrisRackauckas merged 3 commits intoOct 14, 2026
Conversation
…ated heaps track_propagated_discontinuities! pushed discontinuities found for dependent lags into the user heaps opts.d_discontinuities/opts.tstops. handle_discontinuities! coalesces solver-generated discontinuities within 10eps of the handled one, but deliberately never drops user tstops, so a tracked tstop one ulp after a handled discontinuity survived the shift_past_discontinuity! nudge. The integrator then sat exactly on that tstop and modify_dt_for_tstops! set dt = 0, giving a non-finite Rosenbrock W (prob_dde_RADAR5_waltman_5 at t = 197.00000007880783 / ...786). Push tracked discontinuities into d_discontinuities_propagated and tstops_propagated, like constant-lag ones, stored as tdir * t. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Agent-Harness: Claude Code (subagent of ci-green head) Agent-Model: claude-opus-5-5[1m] Agent-Session: https://claude.ai/code/session_011aK5Xvp9NpdkzKuEwtiMGd
Read the tracked stop with SciMLBase.first_tstop instead of the non-public OrdinaryDiffEqCore.first_discontinuity, assert the handled discontinuity is saved, and cover neutral problems. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Agent-Harness: Claude Code (subagent of ci-green head) Agent-Model: claude-opus-5-5[1m] Agent-Session: https://claude.ai/code/session_011aK5Xvp9NpdkzKuEwtiMGd
This was referenced Oct 8, 2026
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-4802/log.txt
Member
Merged the default branch into this PR (clean merge, no conflicts; head 377c324) 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 |
ChrisRackauckas
marked this pull request as ready for review
October 14, 2026 01:56
xtalax
added a commit
to xtalax/OrdinaryDiffEq.jl
that referenced
this pull request
Oct 17, 2026
…DAE comparison (SciML#4869) fixes
xtalax
added a commit
to xtalax/OrdinaryDiffEq.jl
that referenced
this pull request
Oct 17, 2026
…DAE comparison (SciML#4869) fixes
xtalax
added a commit
to xtalax/OrdinaryDiffEq.jl
that referenced
this pull request
Oct 17, 2026
…DAE comparison (SciML#4869) fixes
xtalax
added a commit
to xtalax/OrdinaryDiffEq.jl
that referenced
this pull request
Oct 17, 2026
…DAE comparison (SciML#4869) fixes
xtalax
added a commit
to xtalax/OrdinaryDiffEq.jl
that referenced
this pull request
Oct 17, 2026
…DAE comparison (SciML#4869) fixes
ChrisRackauckas
referenced
this pull request
Oct 18, 2026
Bump versions: DelayDiffEq 6.4.4 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 Claude-Session: https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ignore until reviewed by @ChrisRackauckas.
What changed and why
lib/DelayDiffEq [Regression]on master fails intest/regression/waltman.jl(Rodas5P+MethodOfStepsonprob_dde_RADAR5_waltman_5,reltol = 1e-7) withArgumentError: matrix contains Infs or NaNs. The Jacobian is finite at the failure.Wis non-finite because the step being attempted hasdt == 0.0. Instrumented trace on mastercceca4245:t - u[5]andt - u[6], run on rejected steps, registered two discontinuities exactly one ulp apart:197.00000007880783and197.00000007880786.track_propagated_discontinuities!pushed both into the user heaps,opts.d_discontinuitiesandopts.tstops....783.handle_discontinuities!pops both discontinuities, because they are within10eps. It only drops propagated tstops neart, and never drops user tstops (Rkmk2[WIP] #1124), so the tstop at...786survives.shift_past_discontinuity!then movesttonextfloat(...783) == ...786, which is exactly on that tstop.modify_dt_for_tstops!setsdt = distance_to_tstop = 0, soW = I/(dtγ) - Jis non-finite.The fix: tracked discontinuities are solver-generated, just like constant-lag ones. They now go into
d_discontinuities_propagatedandtstops_propagated, stored astdir * tto follow those heaps' convention.handle_discontinuities!already coalesces those heaps within10epsof a handled discontinuity. User tstops are unchanged.#4592 (
498c765cc, clock alignment incalc_dt_propose!) is the bisected first bad commit only because it changes the dt sequence enough to reach this ulp coincidence. The alignment itself is not wrong for DDEs, so this replaces the exemption in #4771 instead of adding to it.Verification
Julia 1.13.1,
lib/DelayDiffEqwith the repository's sublibraries dev'ed.New mechanism test
test/regression/tracked_discontinuity_coalescing.jl(Regression group, run forneutral = falseandneutral = true). It uses a dependent lag that is constant and has tracking register its propagated discontinuity. The test reads that timetd ≈ 1through the publicSciMLBase.first_tstop, then adds a discontinuity and tstop atprevfloat(td). It asserts that the solve returnsSuccess, thatprevfloat(td) ∈ sol.tand thatsol.t[end] == 2.Before (
track.jlfromorigin/master,--check-bounds=yes):(on master the solve stops at
tdwith adt_min_unstablewarning; driving it withstep!instead hangs, becauseDDEIntegrator'sstep!retry loop has nocheck_error!)After:
GROUP=Regression julia +1 --project -e 'using Pkg; Pkg.test()'fromlib/DelayDiffEq(the CI path, so--check-bounds=yes):GROUP=InterfaceandGROUP=Integrators, same command: bothexit 0(e.g.Discontinuity Tests | 55 55,Dependent Delay Tests | 17 17,Backwards Testspass,Rosenbrock Tests | 42 42,Event Tests | 29 29).Runic
--checkandtyposare clean on the changed files.Not verified / for the reviewer
SDDEandQAgroups and the Julialts/preversions were not run locally.tdir * t, matching every other heap entry. Before this they were stored unscaled. The tracking code itself still compares rawtagainsttdir-scaledT, which was already the case. This PR does not attempt to fix that.DDEIntegrator'sstep!retry loop (while !integrator.accept_step) does not callcheck_error!, so adt == 0step hangsstep!instead of erroring. (2) A user tstop at exactlynextfloat(t_d)of a handled discontinuityt_dwould still producedt = 0.W→ step rejection) is independent defense in depth.Risk assessment
DelayDiffEq.track_propagated_discontinuities!only, i.e. DDEs withdependent_lags. Tracked discontinuities within10epsof a handled one are now coalesced, as constant-lag discontinuities already are. No public API change.first_discontinuity, is fixed. It also flagged a separate, pre-existing inaccuracy in where tracking places discontinuities on master, which is left as a follow-up.🤖 Generated with Claude Code (model: claude-opus-5-5[1m]) https://claude.ai/code/session_011aK5Xvp9NpdkzKuEwtiMGd