Skip to content

Report confinement over resolved orbits#491

Closed
krystophny wants to merge 1 commit into
mainfrom
agent/resolved-confined-fraction
Closed

Report confinement over resolved orbits#491
krystophny wants to merge 1 commit into
mainfrom
agent/resolved-confined-fraction

Conversation

@krystophny

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, GPU, dependency, CI, or security-sensitive build logic

Correctness contract

Intended behavior change

confined_fraction.dat now reports confinement conditional on numerically
resolved outcomes. Numerically fatal markers are excluded from both the
confined numerator and the denominator; column 4 records that resolved
denominator. Numerical fatalities are written as NaN in times_lost.dat.
The SPECTRE RK and symplectic drivers now populate exit codes and unresolved
counts consistently, and restarts recognize completed wall-loss markers.

Behavior that must not change

Physical LCFS and wall losses remain in the resolved denominator. Completed
and intentionally skipped markers retain their existing confinement
semantics. This PR does not change an integrator, recovery policy, trajectory,
or physical loss decision.

Coordinate / unit conventions

No coordinate or unit convention changes. Loss times remain in seconds.

Numerical invariants

For a nonempty resolved population,
confined_fraction = N_confined / (N_confined + N_physical_loss).
If no marker is resolved, both confined-fraction columns are NaN. Numerical
exit codes 101--105 always have a NaN loss time and are never counted as
confined or physically lost.

Tests added

  • unit: test_result_accounting covers one confined marker, one physical
    loss, one numerical fatality, the resolved denominator, numerical NaN,
    and the zero-resolved case.
  • integration: updated SPECTRE validation checks NaN together with a
    numerical exit code and compares the final fraction with the resolved
    population.
  • system: full fo check suite.
  • golden record: none.

Golden-record impact

  • unchanged
  • changed

When a run contains numerical fatalities, confined_fraction.dat increases
from a lower bound over the initial population to the conditional fraction
over resolved outcomes, and column 4 decreases by the unresolved count.
Runs without numerical fatalities are unchanged.

Failure modes considered

The implementation guards the zero-resolved denominator with NaN, keeps
physical losses in the denominator, sanitizes stale finite loss times for
numerical exit codes at write time, and preserves wall-loss results across a
restart.

Manual validation

The focused accounting test passed in 0.06 s. The affected SPECTRE validation
passed in 25.66 s.

Verification

fo check built 176 modules and passed 85/85 tests in 280.2 s.
git diff --check passed. fo lint reached the existing repository-wide
baseline of 374 compiler warnings and reported zero unused imports.

@krystophny krystophny marked this pull request as ready for review July 15, 2026 20:48
@krystophny

Copy link
Copy Markdown
Member Author

Superseded by the adversarially reviewed integration PR #492, which includes the resolved-population accounting together with the recovery signal it needs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant