Skip to content

Record active phi-grid placement decisions#157

Draft
krystophny wants to merge 2 commits into
diag/flux-pumping/join-normalizationfrom
diag/flux-pumping/phi-placement
Draft

Record active phi-grid placement decisions#157
krystophny wants to merge 2 commits into
diag/flux-pumping/join-normalizationfrom
diag/flux-pumping/phi-placement

Conversation

@krystophny

@krystophny krystophny commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds an opt-in record of the phi-grid strategy that modify_propagator actually applies.

The first implementation recorded only automatic phi_placer intervals. A production reconstruction then emitted no CSV because its configured path uses phi_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 raw CEILING decision 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_count and result_count because their exact meaning is strategy-specific.

Behavior and invariants

Set NEO2_PHI_PLACEMENT_FILE to 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, CEILING expression, 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 before modify_propagator replaces 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:

phi_placement_diagnostic_test: record_phi_placement is absent

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:

phi_placement_diagnostic_test  PASS  0.06s
Summary: 1 passed, 0 failed, 0 skipped

Full repository pipeline:

Static: OK (348 modules, 348 changed, 348 affected)
Build: OK
Tests: OK
Lint: OK
All stages passed
Fmt: WARN

The format warning is existing whole-file drift in COMMON/flint_mod.f90 and NEO-2-QL/flint.f90; the touched lines and staged diff pass whitespace and line-length checks.

A real three-stage reconstruction at nstep=480 now writes 203 validated rows in stage 0 and 203 in stage 2. The records are byte-identical between those stages: 199 use halfstep and four use the divider retry path. Decision counts span 5-865 grid points and result counts span 9-1739. The solve retains 199 reconstructed responses and closes qflux below 8.7e-15 relative error.

@krystophny krystophny changed the title Record phi-placement quantization decisions Record active phi-grid placement decisions Jul 13, 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