Skip to content

Require valid states for SPECTRE physical losses#496

Merged
krystophny merged 1 commit into
mainfrom
agent/spectre-valid-crossings-clean
Jul 17, 2026
Merged

Require valid states for SPECTRE physical losses#496
krystophny merged 1 commit into
mainfrom
agent/spectre-valid-crossings-clean

Conversation

@krystophny

Copy link
Copy Markdown
Member

Prevents numerical failures or non-finite interface states from becoming physical loss events.

  • only OUTSIDE_DOMAIN can seed an outer-boundary landing
  • validate landed coordinates, momentum, pitch, B, mu, and refraction radicand
  • return CROSS_INVALID and roll back into recovery instead of logging a loss
  • apply the same validity contract to RK SPECTRE stepping
  • adversarial NaN and invalid-momentum tests

The complete stacked branch passes the full fo static, build, test, and lint pipeline.

@krystophny
krystophny force-pushed the agent/spectre-valid-crossings-clean branch from d5f8688 to 99758d8 Compare July 17, 2026 06:33
@krystophny
krystophny changed the base branch from agent/liberal-generic-newton-clean to agent/nonfatal-recovery-accounting-clean July 17, 2026 06:33
@krystophny
krystophny force-pushed the agent/spectre-valid-crossings-clean branch from 99758d8 to 7997ef8 Compare July 17, 2026 06:40
Base automatically changed from agent/nonfatal-recovery-accounting-clean to main July 17, 2026 07:49
@krystophny
krystophny force-pushed the agent/spectre-valid-crossings-clean branch from 7997ef8 to b4789a2 Compare July 17, 2026 07:52
@krystophny
krystophny enabled auto-merge (squash) July 17, 2026 07:52
@krystophny
krystophny merged commit a105cf4 into main Jul 17, 2026
6 of 7 checks passed
@krystophny
krystophny deleted the agent/spectre-valid-crossings-clean branch July 17, 2026 07:53
krystophny added a commit that referenced this pull request Jul 17, 2026
## Summary

- keep Newton warning recovery bounded; the obsolete unbounded
finite-iterate policy from closed PR #495 is not included
- recover failed non-SPECTRE symplectic steps through the established
adaptive RK path, cap recovery at 10,000 internal steps, and stop
repeating identical failed recovery work
- reject non-finite, non-local, or out-of-domain RK and symplectic
states before they can be committed or mislabeled as physical LCFS
losses
- retain the reviewed SPECTRE hardening and the independent fixes from
PRs #494, #496, #497, and #498
- compare golden outcomes by physical contract: identities, initial
invariants, exit status/time, valid resolved endpoints, and strict
physical events; completed chaotic survivor phase points may decorrelate

## Validation

- full `fo` at `c57f419`: static analysis, build, complete test suite,
and lint passed in 304.4 s
- focused `test_sympl_testfield` and `test_newton_solver_status` pass
- 13 golden-comparator unit tests pass
- fresh Albert golden run completed without the former stall; all 32
markers resolved, every endpoint was finite, and mapped final radius
stayed in 0.017 to 1.013
- the golden comparison identifies 27 recovered numerical exits and
corrects three old physical-loss records whose reference endpoints had
radial coordinates of roughly 5e5 to 2e6

PR #495 was closed because its generic policy admitted arbitrarily large
finite Newton iterates and produced invalid physical outcomes. This
branch was rebuilt without it. The final performance comparison will be
rerun without the concurrent large LFS archive upload before merge.
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