Record active phi-grid placement decisions#157
Draft
krystophny wants to merge 2 commits into
Draft
Conversation
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.
Summary
This PR adds an opt-in record of the phi-grid strategy that
modify_propagatoractually applies.The first implementation recorded only automatic
phi_placerintervals. A production reconstruction then emitted no CSV because its configured path usesphi_split_mode=1; the automatic eta placer is never called. The recorder now covers the decision boundary shared by all modes:placed: automatic eta-interval placement, with the rawCEILINGdecision and the count after the existing odd/minimum adjustment;halfstep: configured mode-1 refinement, with input and output grid-point counts;no_eta_halfstep: the mode-2 fallback when no eta value lies in the propagator interval;divider: the mode-3 retry path, with input and output grid-point counts.Each row identifies the propagator and outcome. It also records the interval, branch, eta index, phi endpoints, and original phi spacing. The generic count columns are named
decision_countandresult_countbecause their exact meaning is strategy-specific.Behavior and invariants
Set
NEO2_PHI_PLACEMENT_FILEto request the CSV. With the variable unset, the recorder performs no allocation or file I/O. A requested path that cannot be written is a hard error rather than an incomplete record.The diagnostic does not change the selected strategy,
CEILINGexpression, parity adjustment, half-step or divider grid, point locations, field-line integration, source, collision operator, join normalization, convergence criteria, ABI, or generated physics-data layout. It only observes the grid beforemodify_propagatorreplaces the old coordinates.Relation to the flux-pumping stack
This branch is stacked on PR #154 because the downstream convergence campaign uses one pinned executable history. It does not depend on the join-normalization values. The record is intended to distinguish a response change caused by a phi-grid strategy or count transition from a downstream change.
Verification
Failing before the recorder existed:
The first production attempt at the previous head also failed strict validation because no requested CSV was created. That exposed the process-coverage gap: the unit test exercised the writer, but the carrier never entered automatic placement.
Focused test at
defe172:Full repository pipeline:
The format warning is existing whole-file drift in
COMMON/flint_mod.f90andNEO-2-QL/flint.f90; the touched lines and staged diff pass whitespace and line-length checks.A real three-stage reconstruction at
nstep=480now writes 203 validated rows in stage 0 and 203 in stage 2. The records are byte-identical between those stages: 199 usehalfstepand four use thedividerretry path. Decision counts span 5-865 grid points and result counts span 9-1739. The solve retains 199 reconstructed responses and closes qflux below8.7e-15relative error.