Bound numerical orbit recovery and resolved accounting#492
Closed
krystophny wants to merge 11 commits into
Closed
Conversation
This was referenced Jul 15, 2026
Member
Author
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.
Risk tier
Correctness contract
This stacks and supersedes #490/#491. In the default
symplectic_newton_warning_mode=.true.policy, an ordinary numerical failurenever terminates a marker. Newton maxiter commits only a finite correction
within ten times the configured tolerance. Larger or non-finite corrections
roll back and retry by bounded dyadic subdivision. If a later subinterval
exhausts recovery, SIMPLE preserves the contiguous accepted prefix, holds only
the unresolved remainder, advances the clock, records
warning_step_skip, andcontinues the same marker from that meaningful state.
The same policy now covers generic RK, RK45 SPECTRE, symplectic, SPECTRE
symplectic, classifier, wall, and full-orbit paths. Full-orbit rollback restores
both public
zand hidden Boris state. RK crossing localization must prove itsradial residual before applying a physical interface map. Strict warning-off
mode may terminate only the affected marker with code 101--105 and a
NaNlosstime; it never aborts the ensemble.
Physical LCFS/wall codes 1/2 remain losses. A marker reaching final time after
warning holds remains a resolved survivor; holds remain quality diagnostics.
Terminal numerical markers are neither confined nor lost. Code-3 deep-passing
shortcuts retain SIMPLE's existing analytically-confined convention.
OpenMP and output
Independent markers use
schedule(dynamic,1). Live worker-side result dumpswere removed because they raced with trajectory arrays, resolved counters, and
per-thread diagnostic counters. Progress remains periodic; result snapshots and
event totals are written only at a team-safe point. The full-orbit one-time
warning is synchronized.
Downstream accounting
pysimple.plottingloadsorbit_exit_code.dat; numericalNaNloss times nolonger poison trace time or masks. Energy/loss curves use resolved denominators,
and each COLL/NOCOLL data set uses its own per-bin survivor population.
Verification
fo: static analysis, build, all tests, and lint pass in323.4 s;
and energy tolerances;
now matches the test's existing 280 s subprocess cap and Level-1's 300 s
outer cap so slow shared runners do not truncate a passing physics test;
sanity suite pass; the real
meiss_coilscase passes while explicitlyreporting old numerical exits recovered to resolved outcomes, retaining
strict comparison for every unaffected marker and a workload-scaled
performance guard;
exits and distinct paired-run denominators;
1e-5s local VMEC midpoint warning smoke: 32/32 codezero, resolved denominator 32, zero unresolved, zero warning-step skips,
0.156 s tracing and 5.471 s total;
git diff --check: pass. Whole-filefprettifywarnings remain on legacyformatting; applying it would rewrite unrelated files.
Dependency/build gate
NVHPC production builds pin ready libneo PR #394 at
8eef891af9c9743b0e3f2a6f2ff7b9f2aebacfc1, use the complete NVIDIAC/C++/Fortran family, enable CPU OpenMP, and explicitly disable both SIMPLE and
libneo OpenACC. Exact NVHPC rebuild and exact-binary smoke follow fresh CI for
this commit before any production campaign is submitted.
Adversarial findings resolved
Bounded versus arbitrary finite maxiter acceptance; repeated warning holds;
accepted-prefix preservation and wall timing; RK45 warning termination;
crossing-locator convergence; hidden Boris-state rollback; worker-side snapshot
races; one-time warning race; terminal numerical accounting; skipped-marker
denominator consistency; plotting
NaNhandling; and COLL/NOCOLL denominatormixing.