Expose midpoint iteration diagnostics#29
Open
rogeriojorge wants to merge 1 commit into
Open
Conversation
bcd8a52 to
afc5e4b
Compare
5b5bce8 to
934dc4e
Compare
afc5e4b to
e97d9b3
Compare
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.
Summary
midpoint_statsonly forImplicitMidpointWhy
Steady-state timing alone cannot distinguish a costly spectral residual/JVP from
poor nonlinear convergence. These four counters provide that distinction without
logging inside JIT-compiled loops or retaining per-step arrays. Diffrax rolls
solver state back when an adaptive step is rejected, so the totals describe the
accepted trajectory.
The explicit-solver output is unchanged: SPECTRAX does not request or expose
Diffrax solver state for other solvers, whose state can contain arrays as large
as the physical state.
Validation
7 passedin the complete SPECTRAX test suite_simulation.pyimport-order and unused-import findings excluded)1e-3as the measured work minimum, while ruling out restart 4The larger run preserves exactly 2 Newton and 3 GMRES iterations per step. Its
superlinear runtime growth therefore lies in residual/JVP execution rather than
nonlinear convergence.
Stack
This draft intentionally targets
agent/midpoint-collision-diffusion-preconditioner(#28), so the PR contains only the diagnostics change.