Skip to content

Pin converged Δ′ instead of a platform-dependent single-point snapshot (q=2) #352

Description

@d-burg

Summary

The pinned ideal-MHD Δ′ diagonal in test/runtests_parallel_integration.jl
(delta_prime_matrix, DIII-D-like STRIDE BVP testset) is a single-point snapshot on a
non-converged grid. For the q=2 surface it is also platform-dependent, which forced a
tolerance widening in #238 as a stopgap. This issue tracks replacing it with a converged Δ′ pin.

Observed platform spread (identical grid, inputs, and mode range)

platform real(dpm[1,1]) (q=2)
linux x86_64, julia 1.11 6.1438
linux x86_64, julia 1.x 6.6867
macOS aarch64 7.7036

~25% end to end, and ~9% between two julia versions on the same OS. q=3 and q=4 are
reproducible across the same platforms.

Stopgap applied in #238

The q=2 pin was re-centered on the midpoint of the observed spread (6.9237) and its tolerance
widened from rtol=1e-1 to rtol=1.5e-1 to span it. q=3 and q=4 keep rtol=1e-1. This is an
explicit, deliberate loosening of an acceptance bound and should be reverted once a converged
pin exists — it is currently sitting at ~75% of its own budget, so a new platform could break it again.

Root cause

q=2 is the surface with the known Δ′ plateau problem. Per the psi_accuracy scan recorded in
docs/src/developer_notes.md ("Open problem: pinning grid-sensitive Δ′ robustly"), on the
two-pass auto grid dpm[3,3] (q=4) plateaus to ~1% over the four tightest grids, dpm[2,2] is
marginal, and dpm[1,1] (q=2) never settles — still moving ~7% between the two tightest grids
(2e-3 → 3.125e-5, a 64x range). Because q=2 sits on the steepest part of the refinement curve,
small platform differences in knot placement translate into large Δ′ differences.

Proposed fix

Pin q=2 Δ′ where it actually converges rather than where the production grid happens to land:

  • On a fixed ldp grid the q=2 Δ′ converges to ≈8.91 at mpsi ≥ 1024 (γ(2/1) ≈ 214.5 Hz,
    γ/Δ′ ≈ 24.1 constant), whereas the auto grid at its default sits ~28% low. See the
    docs/development grid notes and the psi_accuracy scan table in developer_notes.md.
  • Either (a) run the pinned case on a fixed ldp grid at sufficient mpsi, accepting the CI cost, or
    (b) implement the plateau criterion described in developer_notes.md — scan psi_accuracy and
    the truncation controls and pin the stationary value — so the reference is a property of the
    physics rather than of the discretization.

Option (b) is the more general fix and would also make the harness-tracked Δ′ meaningful across
grid-generator changes; option (a) is cheaper but adds a large-mpsi run to CI.

Acceptance criteria

  • q=2 Δ′ pin is a converged value, reproducible across linux/macOS and julia versions
  • q=2 tolerance restored to rtol=1e-1 (or tighter)
  • Pin survives a grid-generator change without manual re-pinning
  • developer_notes.md open-problem section updated to reflect the resolution

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions