Skip to content

Reject a t change that lands behind a saved solution point - #4580

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
singhharsh1708:core-reject-rewind-behind-saved-point
Sep 17, 2026
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
singhharsh1708:core-reject-rewind-behind-saved-point

Conversation

@singhharsh1708

Copy link
Copy Markdown
Member

change_t_via_interpolation! now refuses to move the integrator behind a point the solution already holds, instead of leaving sol.t out of order.
save_positions[1] stores the step end before affect! runs, so a callback that rewound inside its own step put integrator.t behind sol.t[end], and interpolating across the inverted pair returned a value from the wrong side of the step with retcode = Success.
On the repro in #4579 that solve now errors, where it used to return sol(1.9925) = 1.1289 against an exact 0.1363.
The Val{true} rewind in handle_tstop! stays exempt because it repairs the endpoint itself, and a continuous callback's root find is unaffected since the step it rewinds into has not been saved yet; both are covered by the new tests.
Fixes #4579.
AI Disclosure: Claude assisted with this change.

@singhharsh1708
singhharsh1708 force-pushed the core-reject-rewind-behind-saved-point branch from 567135f to 760481c Compare September 17, 2026 11:09
@ChrisRackauckas
ChrisRackauckas merged commit 10ff83d into SciML:master Sep 17, 2026
241 of 260 checks passed
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.

change_t_via_interpolation! behind a saved point leaves sol.t out of order

2 participants