0006 — Decisions from the 2026-09-22 review¶
Status: accepted; amends the change-control rule of plan.md, restates G4,
reorders steps 1.9b–1.9d, sets the 1.9b boundary conditions, replaces
validation row 6, and adds the speed-and-derivative programme (Phase 2b).
Basis: main at 385be68 (v1.4.0 pre-release), measurements taken for this
review on the office RTX A4000 and an Apple M3 Max, primary sources read in full
(ANL/FPP/TM-228; Ni et al. 2007 Part I), and six literature surveys recorded in
plan.md Section 3.7. Each decision names the measurement or source that forced it.
D22. plan.md is the logbook. The plan changes at every merged batch, not
only at phase boundaries: Section 2 records the measured state, Section 6 marks
each step done with its PR, and Section 13 gains one row per batch or review.
A pull request carries its own handoff in its description (what, why, how
verified, plan step, next step); a standing handoff issue or PR points to the
latest plan state. Day-to-day discussion stays in PRs and issues. Reason: after
three batches in two days, agents acting on a stale Section 2 re-opened solved
problems (the Ha 1000 public solve and the parity row were both stale).
D23. G4 is restated as absolute throughput, with the speed-up as a secondary, qualified number. The RTX A4000 (GA104) runs float64 at 1/64 of its float32 rate (NVIDIA GA102 whitepaper; the same ratio on GA104). A bandwidth-bound float64 kernel on one such card against a bandwidth-saturated 36-core node has a ceiling near the bandwidth ratio, about 1.5–3×; the measured 7.85× at 128³ (#142) exceeds it only because the CPU baseline is the same JAX code on XLA:CPU. G4 therefore reads: milliseconds per step and nanoseconds per cell per step at 64³–256³, reported separately for the float64-accurate mode (mixed precision, D16) and for true float32, on named hardware with the matmul precision recorded; the same-code CPU/GPU ratio is reported with its baseline named in the same sentence. The 10× float64 target on an A4000 is withdrawn. A float64 speed-up headline needs a card with fast float64 (A100/H100 class); one rented reference run is enough if it is ever wanted.
D24. Step 1.12 (partial diagonalization) is closed as not worth building
now. Measured for this review, one dense per-axis contraction against one
jnp.fft round trip on a 3-D array: on the A4000 in float32 the dense
contraction is as fast or faster (0.23 against 0.52 ms at 128³); in float64 the
FFT saves about 3× on the one periodic axis; on the CPU the FFT is 4–10× slower.
The shipped float64-accurate mode runs its contractions in float32, and the
tridiagonal alternative was 100× slower on the card (Section 2.1). Reopen only
for a pure-float64 mode at ≥ 256³ or a datacentre card.
D25. 1.9c before 1.9b. The inertialess core-flow model is the only route to
the ALEX parameters (Ha 2,900–6,600), its reference is verified, and it is cheap
(seconds to minutes in published implementations). It follows ANL/FPP/TM-228
equations (4a)–(4c) and (14): core pressure and the Hartmann- and side-wall
potentials, the side-layer flux closure, a staggered grid across the field, a
split corner cell, and an explicit floor on 1/B. The pressure and potential
equations are solved together, never segregated (TM-228: a segregated scheme
diverges for small wall conductance). The coupled operator is self-adjoint and
indefinite; MINRES with a block-diagonal preconditioner built from the existing
fast-diagonal solvers is the default, and the adjoint is the same solve. Gate:
the ANL fringe (x0 = 3, c = 0.02, B_y = ½(1 − sin(πx/2x0)), x ∈ [−6, 2])
Δp = 0.0932 within 1 %, and 0.0754 in the locally fully developed limit; the
reference was stopped at 0.1 %, so tighter tolerances are meaningless. The
inertial error of the model scales as N^(−1/3) (Mistrangelo et al. 2021), which
at ALEX B2 (N = 540) is as large as the three-dimensional excess it computes;
the 5–10 % B2 tolerance of D20 stands.
D26. Boundary conditions of the non-periodic axial direction (1.9b). Chosen
from the published practice of HIMAG, FreeMHD/epotFoam, GridapMHD and the 2025
six-code benchmark, and from what keeps LMX’s solves direct and differentiable:
the inlet velocity is LMX’s own fully developed profile at the inlet field,
scaled to the imposed flow rate, so the flow rate is exact and the pressure drop
is an output with no extra unknown; the outlet has a zero axial velocity
gradient and p = 0, which makes the pressure operator non-singular while the
axial axis stays fast-diagonalizable (mixed Neumann–Dirichlet); both ends carry
no normal current, ∂φ/∂n = (u × B)·n, not ∂φ/∂n = 0; the potential gauge is
fixed by removing its mean, not by pinning a cell. Buffers are 15 half-widths
upstream and 10 downstream of the field ramp, gated by a domain-doubling test on
the pressure drop and on the axial current through the end faces, which no
published code reports. A bordered one-row flow-rate constraint (Formaggia et
al. 2002) is used only if a problem needs the pressure level as an unknown;
an outer secant loop on the pressure drop is not used. BoundaryCondition
gains array-valued Dirichlet data for the inlet profile.
D27. Validation ladder changes. Row 6 (Ni et al. 2007 Figs 16–17) is not a quantitative gate: the paper gives streamlines and trends only, with no reference values, and states that its inflow is not fully developed. It is replaced by the six-code benchmark of Mistrangelo et al. (Nucl. Fusion 65 (2025) 116006; uniform-field pressure gradient within 0.9 % of the analytic value, plus its fringe case with the published code-to-code scatter) and by the ALEX pipe of Ni et al. 2007 Part II (domain −20a to +15a). Row 7’s source is verified (TM-228, read in full). Smolentsev et al. 2015 Table I (Shercliff and Hunt, Ha 500–15,000) is solved, not only stored: the reference file ships with the package but no test solves above Ha 1000. GridapMHD.jl (divergence-conforming finite elements, MIT) becomes the second comparator beside FreeMHD; it is a different discretization family and has a published 0.22 % Shercliff error at Ha 1000.
Addendum (owner, 2026-09-23; plan D27a). Row 7 gates the excess
Δp − Δp_FD over [−6, 2], both computed by LMX on the same mesh, against
TM-228’s 0.0178 within 1 %. The absolute Δp (0.0951 against 0.0932, 2.0 %) is
reported, not gated: TM-228’s own fully developed gradient integrates to 0.0776
over [−6, 2], not the quoted 0.0754.
D28. The name stays LMX. Public text disambiguates the code from PPPL’s LMX-U liquid-metal experiment where both could be read in one context (README, paper, citation metadata).
D29. Speed and derivative cost become a phase with its own goal (G12, Phase
2b). Measured on the A4000 on 2026-09-22 (plan Section 2.5): a 2-D steady solve
takes 24–92 ms warm but 24–31 s to compile, and a new Hartmann number on the
same mesh recompiles in 15 s while the same change through the traced
field_scale argument costs 29 ms; gradients cost 1.6–2.1× the forward solve;
the field-line preconditioner’s banded substitutions are 70–85 % of a 2-D
iteration because they run as sequential scans; and a fringing duct needs 1,454
CG iterations where a uniform field needs 13–49. The programme therefore
targets, in order of evidence: compiling once per shape by passing the problem
data as pytree leaves (the largest measured cost); skipping adjoint solves that
the operator’s symmetry makes unnecessary; removing the round-off floor at the
potential solve rather than tolerating it; batching independent solves and
replacing the line scans by batched products on the card; and, after 1.9c, a
two-level preconditioner whose coarse space is the core-flow model, which the
theory of nearly singular systems (Lee, Wu, Xu & Zikatanov 2007) identifies as
the space the damped preconditioner misses. Every solver PR reports the warm
forward time, the gradient time, their ratio, the iterations and the cold
compile, before and after, on named hardware. Not pursued: s-step or pipelined
CG, differentiating through iterations, per-component exact inverses beside
damped components, two-GPU spatial decomposition below 512³, and partial
diagonalization (D24).