Stabilize orbit recovery and boundary reporting - #503
Merged
Conversation
src/simple_main.f90 conflicted in two initialization sites. PR 503 replaces the map_boundary_is_lcfs boolean with map_boundary_exit_code and chart_boundary_kind_effective, whose 'auto' case reproduces the old boolean exactly; main added invariant_edge_radius for the invariant API. Both are kept: the boundary classification from this branch, the invariant edge state from main. map_boundary_is_lcfs survives only in a golden-record reference patch.
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.
What changed
historical warning-level default with one bounded isolated hold.
conventional
B_parallel_stardenominator is singular, continue only thatinterval through the established toroidally regularized, axis-local, and
co-rotating Cartesian recovery cascade.
impossible pitch, non-positive momentum, or more than 0.5% collisionless
momentum drift.
conventional-RK intervals outside the axis/edge hysteresis region.
ORBIT_EXIT_NUMERICAL_CONFINED(code 4) only after allrecovery paths are exhausted, and only for collisionless guiding-centre
tracing in warning mode when its last validated normalized toroidal flux is
below
s=0.01. VMEC coordinates already stores; chartmap radii areconverted as
s=rho^2.tracing, strict mode, and every other exit cause. Record it separately in
NetCDF/results accounting and restart state.
Successful legacy RK intervals, the source ensemble, field, wall, boundary
conditions, symmetry, units, and ordinary Meiss/Boozer symplectic paths remain
unchanged. Intentional deep-passing source screens also remain code 3.
Root cause and bounded fallback
The SQUID failures occur when the conventional guiding-centre factor
B_parallel_star = B + (m/e) p_parallel b dot curl(b)crosses zero. The release warning policy could leave such a marker frozen
indefinitely; a bounded warning policy exposes the exhausted recovery. Axis
smoothing, denser near-axis reconstruction, Zernike continuation, and naive
curl rescaling do not remove this physical coordinate singularity.
The broad experiment that accepted every finite Newton iterate was rejected:
the exact three-marker SQUID diagnostic exceeded ten minutes instead of the
bounded policy's 43.4 seconds. The final fallback therefore does not advance an
unvalidated state. It closes only an already core-confined marker after all
physical recovery attempts fail, with a separate auditable exit code.
Local validation
5a0b7e5de17d154380e68717832c28a7cbf9ffeband currentlibneo main
e2b281b1bc9f9f48f9526622445e0b2c0f8a4984.fopipeline passed static analysis, build, the default testsuite, and lint twice; the final run completed in 314.9 s. No golden record
changed.
4, 4, 2and zerounresolved markers. The code-4 endpoints are at chartmap
rho=0.0204and0.0930, hences=0.00042and0.00864; the third marker retains itsphysical wall code 2. Recovery counters match the bounded baseline.
byte-identical to the preceding physical-recovery candidate: Albert has 958
physical losses and 66 completions; Meiss--Hazeltine has 966 losses and 58
completions. Albert differs from the release loss fraction by 1.17 percentage
points. The larger old Meiss/old-libneo difference predates this patch and the
old endpoints include severe invariant corruption, so no golden was rewritten
to conceal it.
Cluster acceptance in progress
The complete paired rerun is live from clean immutable roots with the same
SIMPLE/libneo revisions:
735896, exact diagnostics735897, diagnostic gate735898, all-case smoke735899, smoke gate735900, production array735901, and final acceptance735902. Build, exact diagnostics, and all 14smoke cases have passed; full production is running. Each orbit job uses 48
CPUs and 96 GiB.
156, smoke cluster157, then all five256-marker, 0.3 s production cases. The GNU 14.2 Release binary SHA-256 is
33f4c760ba4465ce94dc449a9679185776f99cbb2714cc0200cb874b8f1550a5.Final acceptance requires zero code-102 exits, zero unresolved markers,
unchanged intentional deep-passing screens, the established SPECTRE
populations, and physical loss fractions within one percentage point of the
applicable release or paper reference. This PR remains draft until both full
campaigns pass and the retained historical comparison is explicitly judged.