Skip to content

Bound numerical orbit recovery and resolved accounting#492

Closed
krystophny wants to merge 11 commits into
mainfrom
agent/spectre-warning-resolved-accounting
Closed

Bound numerical orbit recovery and resolved accounting#492
krystophny wants to merge 11 commits into
mainfrom
agent/spectre-warning-resolved-accounting

Conversation

@krystophny

@krystophny krystophny commented Jul 15, 2026

Copy link
Copy Markdown
Member

Risk tier

  • T0: docs, comments, small build metadata
  • T1: pure refactor, no behavior change intended
  • T2: local numerical logic
  • T3: physics, output behavior, coordinate convention
  • T4: parallelism, dependency, and production recovery policy

Correctness contract

This stacks and supersedes #490/#491. In the default
symplectic_newton_warning_mode=.true. policy, an ordinary numerical failure
never 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, and
continues 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 z and hidden Boris state. RK crossing localization must prove its
radial residual before applying a physical interface map. Strict warning-off
mode may terminate only the affected marker with code 101--105 and a NaN loss
time; 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 dumps
were 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.plotting loads orbit_exit_code.dat; numerical NaN loss times no
longer 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

  • two read-only adversarial reviews of SIMPLE Bound numerical orbit recovery and resolved accounting #492 and stacked libneo Unified radial spline representation avoiding the s-trick and near-axis re-gridding #394;
  • complete local fo: static analysis, build, all tests, and lint pass in
    323.4 s;
  • dedicated Level-1 crossing integration: pass in 91.09 s with unchanged kick
    and energy tolerances;
  • dedicated Level-0 crossing integration: pass in 47.04 s; its CTest timeout
    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;
  • accounting-aware golden comparison: eight focused tests and the golden
    sanity suite pass; the real meiss_coils case passes while explicitly
    reporting old numerical exits recovered to resolved outcomes, retaining
    strict comparison for every unaffected marker and a workload-scaled
    performance guard;
  • slow chartmap wall-loss integration: pass in 15.27 s;
  • end-to-end SPECTRE validation, Newton status, and result accounting: pass;
  • plotting suite: 21/21 pass, including mixed completed/lost/skipped/numerical
    exits and distinct paired-run denominators;
  • 32-thread, 32-marker, 1e-5 s local VMEC midpoint warning smoke: 32/32 code
    zero, resolved denominator 32, zero unresolved, zero warning-step skips,
    0.156 s tracing and 5.471 s total;
  • git diff --check: pass. Whole-file fprettify warnings remain on legacy
    formatting; applying it would rewrite unrelated files.

Dependency/build gate

NVHPC production builds pin ready libneo PR #394 at
8eef891af9c9743b0e3f2a6f2ff7b9f2aebacfc1, use the complete NVIDIA
C/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 NaN handling; and COLL/NOCOLL denominator
mixing.

@krystophny krystophny added tier/T4 parallel GPU dependency security build size/XL review size over 1000 changed lines labels Jul 15, 2026
@krystophny

Copy link
Copy Markdown
Member Author

Superseded by the clean concern-separated stack #494, #495, and #496. The final integration branch is agent/spectre-valid-crossings-clean; it passes the complete local fo pipeline.

@krystophny krystophny closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL review size over 1000 changed lines tier/T4 parallel GPU dependency security build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant