Repository navigation
Add better logging for singular cases in integration - #1379
Conversation
|
The Downstream CI failure on this PR ("Unitful interpolations" erroring and aborting the rest of the downstream suite, run 27226679941) is caused by a unit bug in the new diagnostic block: ref = max(abs(u0[i]), one(eltype(u)))For a Unitful state (e.g. Verified locally (Julia 1.10.11, OrdinaryDiffEq v7.0.0, Unitful v1.28.0): the unitful test passes on master, fails with this branch with exactly the CI stacktrace, and passes again with the one-character-class fix: ref = max(abs(u0[i]), oneunit(eltype(u)))
Two more things worth addressing while in here:
|
| diagnostic = log_instability(integrator) | ||
| EEst = isdefined(integrator, :EEst) ? | ||
| lazy", step error estimate = $(integrator.EEst)" : "" |
There was a problem hiding this comment.
No reason to allocate this unless verbosity is on.
There was a problem hiding this comment.
That's probably left over from needing backwards compatibility before.
|
@Shreyas-Ekanathan |
|
should be fixed now, lmk if there are any other changes needed! |
The extended diagnostics added in SciML#1379 only ran on the dtmin, sub-epsilon, and unstable-check exits. A solve that dies on maxiters — the common outcome when one equation quietly forces the step size down — reported nothing beyond "larger maxiters is needed", so there was no information to debug from. Every non-Success exit now runs the same diagnostic and reports the time it exited at. Adds `log_error_estimate`, a hook for solver packages to report the adaptive error estimate and the state components contributing most to it. The scalar estimate says "the step was rejected"; the per-component breakdown says which equation rejected it, which is what the user needs to look at. The diagnostics were previously computed and then discarded when the verbosity toggle was off. They are now gated before the work is done, which matters because the numeric diagnostic can build a fresh Jacobian. The dt-below-epsilon exit also gated its diagnostic on `dt_min_unstable` while emitting under `dt_epsilon`; it now uses `dt_epsilon` for both. Drops the `isdefined(integrator, :EEst)` interpolation from the dtmin messages. ODEIntegrator moved `EEst` onto the controller cache, so that branch had gone permanently dead; `log_error_estimate` reports the estimate instead. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DKB6v14nZHZPYtKiLsPLDT
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Uses
uand the jacobian from the integrator to give more insightful error messages on retcodesDtLessThanMinandUnstable.