Size the T_l recurrence passes of the analytic add-back by their growth rate - #836
Open
CharlesCNorton wants to merge 2 commits into
Open
Size the T_l recurrence passes of the analytic add-back by their growth rate#836CharlesCNorton wants to merge 2 commits into
CharlesCNorton wants to merge 2 commits into
Conversation
CharlesCNorton
force-pushed
the
nestor-extended-precision
branch
from
September 8, 2026 19:27
f2c401f to
c720b6d
Compare
CharlesCNorton
marked this pull request as ready for review
September 8, 2026 19:28
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
CharlesCNorton
force-pushed
the
nestor-extended-precision
branch
from
September 8, 2026 19:32
c720b6d to
4b8e4b2
Compare
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.
Change -
SingularIntegralsevaluates the T_l of Merkel's analytic add-back with a forward pass of the three-term recurrence only while the spurious solutions of that recurrence grow by less than a factor of ten over the kL = mf + nf steps, and otherwise with a backward pass seeded far enough above kL that the seed has decayed below 1e-17 of T_l at kL. The Miller normalization of the backward pass to T_0 is gone, since the recurrence is inhomogeneous. Both passes are one function,ComputeTl.Cause - the homogeneous solutions of the recurrence are a complex pair of modulus sqrt(B/A), with B/A = ap/am for T^-, not B/A as the previous comments assumed. The backward pass therefore damped its zero seed by (A/B)^25 over its fixed 50-step tail instead of (A/B)^50, and the forward pass was kept up to a growth of (B/A)^(kL/2) = 1e5. On the
cth_like_free_bdyboundary at the point of its largest metric cross term (0.89 of sqrt(guu gvv), ap/am = 2.2) that left 2e-9 of the seed in T^-_33 and 5e-12 in T^-_20, the values a 60-digit emulation of the same passes gives at every l, and independent of the working precision: a quad-precision build reproduces them. The alternating binomial sums of the add-back amplify an error in T_33 by up to 1e11 at m + |n| = 33, so the assembled coefficient of mode (17, 16) came out 3.2 times its value.Evidence - at that point, the assembled
bveccoefficients against direct quadrature of the subtracted tangent-plane kernel (mpol 16, ntor 16, kL 33, with the cross-term sign of #825), as the largest relative error per band m + |n|:and
grpmnat band 33 from 2.8e2 to 6.5e-3. On the exact exterior Neumann problem of an interior dipole line on that boundary (residual relative to the external field, zero being exact):which is the floor the previous code reached at mpol 16, ntor 12 (2e-4). In the loop,
cth_like_free_bdyat ftol 1e-9 with the boundary padded to higher cutoffs:rmax_surf1.00872, edge iota 0.86370rmax_surf1.00900, edge iota 0.86381rmax_surf1.00899, edge iota 0.86380rmax_surf1.00899, edge iota 0.86380The three mpol 16 runs now agree with each other to the digits shown, where the previous mpol 16, ntor 12 result differed from them by 0.3 mm in
rmax_surfand 1e-4 in the edge iota.Tests -
TlpTlmAccuracyTestgains the cth metric at kL = 33, where T^-_33 was 2e-9 off the quadrature reference against a 1e-11 bound; the three existing cases pass unchanged.bazel test --config=opt //vmecpp/... //vmecpp_large_cpp_tests/...andpytest(217 passed) pass.Scope - only the T_l passes change. The forward pass is kept exactly where it was accurate, so the bundled cases move at round-off only: every reference comparison of both suites passes at its existing tolerance, and
cth_like_free_bdyconverges in the same 490 iterations to the samermax_surfto nine digits. A backward pass costs at most 17 kL steps per surface point;cth_like_free_bdytakes the same wall time as before (0.52 s against 0.52 s at four threads, minimum of three runs).