Skip to content

ForceFreeStates - REFACTOR - Reorganize ForceFreeStates into subdirectories (pure move) - #400

Merged
jhalpern30 merged 4 commits into
developfrom
refactor/forcefreestates-reorg
Aug 25, 2026
Merged

ForceFreeStates - REFACTOR - Reorganize ForceFreeStates into subdirectories (pure move)#400
jhalpern30 merged 4 commits into
developfrom
refactor/forcefreestates-reorg

Conversation

@matt-pharr

@matt-pharrmatt-pharr commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Split the module into ownership-based subdirectories with zero logic changes:

  • Riccati/: Riccati.jl split into Types (IntegrationChunk, ChunkPropagator), Propagators (chunk FM integration, renormalization, propagator application), Crossings (singular-surface crossing algorithms), DeltaPrimeBVP (STRIDE BVP assembly/solve + PEST-3 decomposition), and Driver (chunk orchestration).
  • Surfaces/: singular-surface machinery in one place — Types (SingType, SingAsymptotics), Finding + Asymptotics (split of Sing.jl), Resist (GGJ coefficients only), ResistEval.
  • Matching/: outer<->inner matching seed — DeltaPrimeData (shared Delta-prime payload) and resonant_match_rpec/ResonantMatchResult (from Resist.jl).
  • ForceFreeStatesStructs.jl dissolved: FourFitVars -> Fourfit.jl, FreeBoundaryResult -> Free.jl, OdeState/EdgeScanState -> EulerLagrange.jl, module-wide types (ModeSpace, DebugSettings, Internal, Control) -> CoreTypes.jl.
  • Sing.jl's EL derivative kernel (sing_der!, el_derivatives!, compute_node_xi_s!) moved to EulerLagrange.jl where it belongs.
  • Include order in ForceFreeStates.jl rearranged so types load before the code that dispatches on them; updated the stability.md autodocs Pages list and stale file-path references in docs/comments.

Verified: full test suite passes; gpec.h5 bit-identical vs the pre-move commit on the forward and riccati decks (h5diff; only the date_created attribute and HDF5 object-header timestamps differ); regression harness diiid_n1 47/47 unchanged with zero diff; local Documenter build clean.

Closes#394

Release note

  • Audience: developers
  • Numerical impact: none (harness @ 3d30557)
  • Migration: none

Pure file reorganization of ForceFreeStates into ownership-based subdirectories. No physics, algorithms, or numerical results change; only the on-disk layout and include order differ.

Regression report

Ran at 3d30557f (merge of develop into this branch), 7 cases, origin/develop (dacdeae) vs working tree:

diiid_n1 Summary: 47 unchanged
diiid_n1_riccati Summary: 17 unchanged
solovev_n1 Summary: 22 unchanged
solovev_multi_n Summary: 15 unchanged
gal_resistive_diiid Summary: 10 unchanged
gal_resistive_pe Summary: 8 missing/N/A (identical on both refs - pre-existing)
diiid_slayer_n1 Summary: 1 changed, 14 unchanged
diiid_slayer_n1 - the single flagged quantity:
SLAYER Q_root [2/1,3/1,4/1] [3 elem] [3 elem] 4.0e-06 OK
SLAYER omega_Hz [2/1,3/1,4/1] [3 elem] [3 elem] 5.5e-02 OK
SLAYER gamma_Hz [2/1,3/1,4/1] [3 elem] [3 elem] 1.377e-01 (0.02%) ** CHANGED **

Every other tracked quantity across all six remaining cases is exactly 0.0e+00, including
the full diiid_n1 deck (47/47) and the Riccati Delta-prime deck (17/17).

The diiid_slayer_n1 gamma_Hz flag is pre-existing nondeterminism, not a change from this PR.
Running the unmodified SLAYER deck twice on identical code gives:

run 1 gamma = [227.1065853182484, -202.4307917454267, -784.2381199170826]
run 2 gamma = [227.1065853182484, -202.3031094466293, -784.2381219437412]

i.e. the 3/1 surface scatters by ~0.128 Hz run-to-run - the same magnitude as the 1.377e-01
diff the harness flags. That quantity's noise_threshold is 1e-1, marginally below its own
run-to-run scatter, which is why it trips. The case TOML already notes that root extraction
"is sensitive to the AMR cell topology and ODE solver". Worth re-pinning the threshold
separately; it is not caused by this reorganization.

gal_resistive_pe reports all 8 quantities N/A on both refs, so it is likewise pre-existing
and not introduced here.

Notes for reviewers

This branch now contains a merge of develop (3d30557f). develop had modified two files
that this PR deletes, so the two modify/delete conflicts were resolved by porting develop's
edits into their new homes:

  • OdeState.ca_populated + zeros-initialized ca_l/ca_r (ForceFreeStatesStructs.jl -> EulerLagrange.jl)
  • ca_populated = true in _capture_right_crossing_data! (Riccati.jl -> Riccati/Crossings.jl)
  • per-column abstol in integrate_fm_with_ua_ic (Riccati.jl -> Riccati/Propagators.jl)

The diiid_n1_riccati case coming back 17/17 with zero diff is the direct check that the
abstol port is faithful, and the h5-schema tests cover the ca_populated port.

… move)
Split the module into ownership-based subdirectories with zero logic changes:
- Riccati/: Riccati.jl split into Types (IntegrationChunk, ChunkPropagator),
Propagators (chunk FM integration, renormalization, propagator application),
Crossings (singular-surface crossing algorithms), DeltaPrimeBVP (STRIDE BVP
assembly/solve + PEST-3 decomposition), and Driver (chunk orchestration).
- Surfaces/: singular-surface machinery in one place — Types (SingType,
SingAsymptotics), Finding + Asymptotics (split of Sing.jl), Resist (GGJ
coefficients only), ResistEval.
- Matching/: outer<->inner matching seed — DeltaPrimeData (shared Delta-prime
payload) and resonant_match_rpec/ResonantMatchResult (from Resist.jl).
- ForceFreeStatesStructs.jl dissolved: FourFitVars -> Fourfit.jl,
FreeBoundaryResult -> Free.jl, OdeState/EdgeScanState -> EulerLagrange.jl,
module-wide types (ModeSpace, DebugSettings, Internal, Control) -> CoreTypes.jl.
- Sing.jl's EL derivative kernel (sing_der!, el_derivatives!,
compute_node_xi_s!) moved to EulerLagrange.jl where it belongs.
- Include order in ForceFreeStates.jl rearranged so types load before the code
that dispatches on them; updated the stability.md autodocs Pages list and
stale file-path references in docs/comments.
Verified: full test suite passes; gpec.h5 bit-identical vs the pre-move commit
on the forward and riccati decks (h5diff; only the date_created attribute and
HDF5 object-header timestamps differ); regression harness diiid_n1 47/47
unchanged with zero diff; local Documenter build clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@matt-pharrmatt-pharr self-assigned this Aug 17, 2026
Base automatically changed from refactor/forcefreestates-result to developAugust 17, 2026 21:46
@jhalpern30

jhalpern30 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

@matt-pharr (and @logan-nc ) if it would help, I can take over reviewing/getting this merged? I have two PRs stacked on top of this so once this is merged I can get those moving along

@jhalpern30
jhalpern30 self-requested a review August 24, 2026 21:32

@jhalpern30jhalpern30 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks great - I like the reorganization and think it cleans up some files that were getting particularly bloated. Trusting the description that this is a pure move - I am reviewing the file structure alone and assuming all code was unchanged

Resolve the two modify/delete conflicts by porting develop's edits into the
new file locations:
- OdeState.ca_populated (+ zeros-initialized ca_l/ca_r) from
ForceFreeStatesStructs.jl into EulerLagrange.jl.
- ca_populated flag in _capture_right_crossing_data! from Riccati.jl into
Riccati/Crossings.jl.
- Per-column abstol in integrate_fm_with_ua_ic from Riccati.jl into
Riccati/Propagators.jl.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAMWNadfK6utwJz1AJrmKz
@jhalpern30jhalpern30 changed the title FFS - REFACTOR - Reorganize ForceFreeStates into subdirectories (pure move)ForceFreeStates - REFACTOR - Reorganize ForceFreeStates into subdirectories (pure move)Aug 25, 2026
@jhalpern30
jhalpern30 merged commit 6b5e801 into developAug 25, 2026
10 of 12 checks passed
@jhalpern30
jhalpern30 deleted the refactor/forcefreestates-reorg branch August 25, 2026 17:37
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactorBehavior-preserving restructuring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FFS - REFACTOR - Reorganize ForceFreeStates into subdirectories (pure-move PR)

2 participants

@matt-pharr@jhalpern30