Diagnose local Lorentz projector compatibility#162
Draft
krystophny wants to merge 1 commit into
Draft
Conversation
This was referenced Jul 13, 2026
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
Add an opt-in, observation-only diagnostic for testing whether the existing global Lorentz solvability projector can be moved to individual local propagators.
For a local boundary map (A_k), incoming and outgoing constant-distribution band vectors (w_\mathrm{in}) and (w_\mathrm{out}), and the particle invariant (e^T), endpoint projectors can commute with propagation only if
[
e_\mathrm{out}^T A_k=e_\mathrm{in}^T,
\qquad
A_k w_\mathrm{in}=w_\mathrm{out},
\qquad
P_\mathrm{out}A_k=A_kP_\mathrm{in}.
]
The diagnostic records these residuals, the local source compatibility defect, and the flux contraction with the constant-distribution direction. It runs only when
NEO2_LOCAL_PROJECTION_TRACE_FILEis set and otherwise returns before allocation. This PR is stacked on #161. It does not apply a projector or change a numerical result.Why the constant-distribution vector is fixed
DOC/ripple_solver_normalizations_and_output.texidentifies each stored pitch unknown as[
Y_k=\int_{\eta_{k-1}}^{\eta_k} f,d\eta.
]
Consequently, a pitch-independent distribution is represented by the band widths, including the truncated final band at (\eta=1/B). This is the discrete target supplied by the continuous Lorentz gauge; it is not a fitted numerical null vector.
The continuous Fredholm calculation has since established the following constraints on the interpretation of this diagnostic:
join_endssource correction is therefore a numerical compatibility repair that should converge to zero, not an additional physical Pfirsch-Schlueter source.Result
The 480-step Lorentz reconstruction contains 199 local propagators. The measured maxima are:
The latter two residuals exceed (10^{-12}) in 139 of 199 propagators. A stage-0 spatial scan at fixed
eta_part=30gives (3.58\times10^{-3}), (1.84\times10^{-3}), and (6.69\times10^{-4}) at 240, 480, and 960 spatial steps. The 240-step run contains solver recoveries, the 960-step value is diagnostic only, and a 60-pitch attempt failed bounds checks before producing physics evidence. The trend suggests a converging spatial consistency error but does not establish its order.The call site is decisive: the trace is written immediately after each single-ripple solve, before adaptive pitch transfer,
join_ripples, its Lorentz column normalization, andjoin_ends. The pinned final-end transfer matrices are exactly identity. The defect therefore enters in one of three places:The signed local source-defect sums for forces 1 and 3 reproduce the global pre-projection defects to reported precision; force 2 is cancellation dominated. Global compatibility alone does not determine a unique local affine-source correction, and a rank-one map repair is also non-unique. No operator change follows from this PR.
Next diagnostic
Evaluate the assembled single-ripple sparse equations on the exact constant-(f) state at every internal spatial point, before factorization. Then compare:
If the first residual is nonzero, the fault is in the discretization or mirror matching. If it is zero but the second is not, the sparse solve is responsible. If the second closes and the third does not, map extraction is responsible. Only this evidence, followed by a failure-free multidimensional convergence campaign, can justify a numerical correction.
Preserved invariants
The change is diagnostic only. It leaves unchanged:
With tracing enabled and disabled, all 596 matching local propagator files and all 199 reconstruction propagators were byte-identical. The local-response and reconstruction summaries were identical. All local HDF5 response files and the final transport/current files were equal under
h5diff; configuration differences were limited to run metadata.Verification
Failing before:
Passing after:
The build and tests used bounds checks, backtraces, debug optimization, and floating-point traps for invalid, division-by-zero, and overflow operations.