You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stage: KIM periodic linear solve and convergence gates Source language: Fortran Manuals to read first:#175; docs/plans/2026-07-10-kim-forced-periodicity-design.md, sections 4, 5, and 7; LAPACK documentation for zgesv and reciprocal condition estimation Depends on:#185, #186, #187, #188
Goal
Turn the branch's convergence programs into quantitative CI gates and report whether each dense solve is numerically trustworthy. Numerical resolution, background deformation, and cross-method physics agreement must remain separate measurements.
Reproduction and evidence
At d4ac12b0, test_periodic_vs_global prints a warning at 84.3% relative L2 and exits zero. test_periodic_convergence reports deformation residuals 0.3570, 0.3028, 0.7836; its final 78.4% error also exits zero because only two consecutive increases fail. dense_solve checks zgesv's info but no condition estimate or backward residual.
Files to edit
KIM/src/electrostatic_poisson/periodic_solve.f90: retain an operator norm, estimate conditioning, and compute the scaled backward residual.
KIM/tests/test_periodic_convergence.f90: enforce one-knob-at-a-time numerical and deformation gates.
For every solve report rcond and ||A Phi-b||/(||A||||Phi||+||b||) using the unmodified A and b. Reject singular, non-finite, ill-conditioned-beyond-policy, or large-residual solutions with a solver status usable by host applications. Scan N_rg, M, and physical window width independently while keeping the diagnostic interval and all other physical scales fixed. A non-monotone 78% deformation sequence is a failure, not a plateau.
Scaffold
A0 = A
b0 = b
call zgesv(...)
backward_error = norm2(matmul(A0, x)-b0) / &
(matrix_norm(A0)*norm2(x) + norm2(b0))
call estimate_reciprocal_condition(A0, rcond)
if (backward_error > solve_residual_tolerance) info = KIM_SOLVE_INACCURATE
No validation path may convert a failed physical tolerance into a warning followed by exit zero.
Relation to existing work
PR #181 supplies a comparison script and negative Krook evidence but no accepted reference. Reuse its common-grid metrics only. PRs #182 and #183 explain why parameter tuning and derived-quantity interpolation can create misleading results; they do not replace FP convergence gates.
Non-goals
Do not weaken a threshold to accommodate the current branch result.
Do not mix model-truncation uncertainty into the linear-solver residual.
Stage: KIM periodic linear solve and convergence gates
Source language: Fortran
Manuals to read first: #175;
docs/plans/2026-07-10-kim-forced-periodicity-design.md, sections 4, 5, and 7; LAPACK documentation forzgesvand reciprocal condition estimationDepends on: #185, #186, #187, #188
Goal
Turn the branch's convergence programs into quantitative CI gates and report whether each dense solve is numerically trustworthy. Numerical resolution, background deformation, and cross-method physics agreement must remain separate measurements.
Reproduction and evidence
At
d4ac12b0,test_periodic_vs_globalprints a warning at 84.3% relative L2 and exits zero.test_periodic_convergencereports deformation residuals0.3570, 0.3028, 0.7836; its final 78.4% error also exits zero because only two consecutive increases fail.dense_solvecheckszgesv'sinfobut no condition estimate or backward residual.Files to edit
KIM/src/electrostatic_poisson/periodic_solve.f90: retain an operator norm, estimate conditioning, and compute the scaled backward residual.KIM/tests/test_periodic_convergence.f90: enforce one-knob-at-a-time numerical and deformation gates.KIM/tests/test_periodic_vs_global.f90: fail on a predeclared matched-problem tolerance after [kim-fp-04] Match the periodic and hat electrostatic boundary-value problem #188.Behavior to implement
For every solve report
rcondand||A Phi-b||/(||A||||Phi||+||b||)using the unmodified A and b. Reject singular, non-finite, ill-conditioned-beyond-policy, or large-residual solutions with a solver status usable by host applications. ScanN_rg, M, and physical window width independently while keeping the diagnostic interval and all other physical scales fixed. A non-monotone 78% deformation sequence is a failure, not a plateau.Scaffold
Positive fixtures to add
rcond, backward error below1e-10, recovered solution.1e-3.Negative fixtures to add
info=0but unacceptablercondor backward error: return failure.Makefile target
Extend
test_periodic_solve,test_periodic_convergence, andtest_periodic_vs_global.Success criteria
No validation path may convert a failed physical tolerance into a warning followed by exit zero.
Relation to existing work
PR #181 supplies a comparison script and negative Krook evidence but no accepted reference. Reuse its common-grid metrics only. PRs #182 and #183 explain why parameter tuning and derived-quantity interpolation can create misleading results; they do not replace FP convergence gates.
Non-goals
Verification