Repository navigation
Fix DDE HistoryFunction boundary after reinit! - #4748
Merged
ChrisRackauckas merged 4 commits intoOct 16, 2026
Merged
ChrisRackauckas merged 4 commits into
ChrisRackauckas merged 4 commits into
Conversation
HistoryFunction compared queries against sol.prob.tspan[1], which reinit! does not update, so lagged values between the old and new start used the reset solution instead of the user history. Use the actual solution start (sol.t[1]) so reinitialized solves keep the correct history boundary. Fixes SciML#4743 Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/tmp_20260923_181807_1012334/jobs-root/jobs/4743-cursor/log.txt on amdci2
Using sol.t[1] for every DEIntegrator broke ordinary ODE wrappers with save_start=false; keep that path on problem tspan and only use the saved start for the internal DDE history integrator. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/tmp_20260923_181807_1012334/jobs-root/jobs/4743-cursor-fix2/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-4748/log.txt
Member
Merged the default branch into this PR (clean merge, no conflicts; head ebdb268) 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 16, 2026 21:48
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.
Please ignore until reviewed by @ChrisRackauckas.
Summary
DelayDiffEq.HistoryFunctiondecided whether a query belongs to the user history by comparing againstsol.prob.tspan[1].reinit!updates the history integrator's saved times to the newt0but leavesprob.tspanunchanged, so queries in[t0_old, t0_new)skipped the user history and extrapolated the reset solution (returning2.0instead of1.9for the analyticu=2+treproducer).This PR uses the actual solution start for the internal
HistoryODEIntegrator(sol.t[1], with a fallback when empty) for both out-of-place and in-place history paths, including the initial-time constant-extrapolation check. OrdinaryDEIntegratorwrappers keep usingsol.prob.tspan[1], sosave_start=falseODE-backed history wrappers stay correct.Fixes #4743
Round-2 revision (Codex review)
Independent review: Codex gpt-6-astra, round 2 VERDICT MERGE, RISK low (high confidence).
Blocking finding 1: unconditional
sol.t[1]broke ordinary ODE wrappers withsave_start=false(in-interval query returned-100instead of2.05). Fixed by dispatchinghistory_start_timeonHistoryODEIntegratorvs otherDEIntegrators. Reviewer reproducer added totest/interface/history_function.jl.Blocking finding 2:
reinit_history_boundary.jlfailed Runic 1.10.0 (1e-8→1.0e-8). Formatted;--check --diffnow exits 0 on all touched files.Numerical impact
reinit!DDE solves: bit-identical to master on three standard problems (constant-lag Tsit5,prob_dde_constant_1delay_scalarBS3, vanishing-delay RK4);diffof serialized(t,u)was empty (BIT_DIFF_EXIT=0).reinit!on the issue reproducer: history at-0.1changes from2.0→1.9; max|u-(2+t)|from5.23e-3→~1e-14. This is a correctness fix for reinitialized solves, not a deliberate algorithm change.Fail-before / pass-after evidence
#4743 reinit boundary
Negative control (restore only
history_function.jlto master, keep the new test/reproducer):With the DDE fix:
Regression file
test/integrators/reinit_history_boundary.jl: all four testsets passed (oop6,iip4,save_start/erase_sol16,backwards4). Integrators Reinitialization Tests: 54/54.Generic ODE
save_start=false(reviewer reproducer)Three-way on
generic-regression.jl(Julia 1.12.7):4b4abefhist(nothing, 0.05)→-100.0(expected≈ 2.05)origin/masterc1558f755Commands run (round 2)
Not verified
GROUP=ALL/ SDDE / QA / Regression suites beyond Integrators+Interfacereinit!that flips integration direction (tdirsign change) — out of scope; pre-existing on master per reviewprob.tspaninsidereinit!as an alternate fix (deliberately avoided)Risk assessment
history_start_timedispatches so that ordinary ODE-backedHistoryFunctionwrappers keep master'stspan[1]boundary, and only the internalHistoryODEIntegrator, which always saves its start, usessol.t[1]. No public API change.save_start=falseregression fails on 4b4abef, passes on master and passes here. Non-reinit DDE solves are bit-identical to master. DelayDiffEq Interface and Integrators pass. Runic 1.10.0 and typos are clean.sol.t[1]broke ODE wrappers withsave_start=false, and the new test file failed Runic. Round 2 on c1558f7 rated it low, high confidence, VERDICT MERGE, no blocking findings.benchmark (1)failed on a missing AirspeedVelocity action file (runner infrastructure) and passes on other PRs.Independent review and orchestration: 🤖 Claude Code (model: claude-opus-5-5[1m]), session https://claude.ai/code/session_015tNYhuzygK9z8yhh6MNCAz
Risk assessment (independent review, codex-cli gpt-6.1-sol, reviewed head c597dbf)
c597dbff8d300c4e03ca6e467cb82e5335b82ba7; all four PR heads were rechecked at the end and remained unchanged. On Julia 1.13.0 with four threads,./run-julia.sh --project=env-4748 test-4748.jlpassed 30/30 boundary assertions and 82/82 history-interface assertions;./run-julia.sh --project=env-4748 probe-4748.jlpassed 17/17 additional assertions (129 total). These cover the linked issue's expected history value and accurate solve, in-place/out-of-place paths, save-start/erase-solution combinations, backwards integration, ordinary ODE wrappers withsave_start=false, derivative/indexed queries, earlier restart times, and initial constant extrapolation. Main log, additional checks. CI: {'IN_PROGRESS': 5, 'SUCCESS': 11, 'QUEUED': 121, 'SKIPPED': 1}, with no completed failures; format, spelling, and docs passed. Sublibrary CI remains pending. Full local Integrators/QA/SDDE/Regression groups, integration-direction reversal during reinit, GPU, and performance were not run.🤖 Posted by an AI agent — harness: codex-cli · model: gpt-6.1-sol (independent reviewer; appended by Claude Code 2.1.301 · claude-opus-5-5)
Conversation: https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq