ISLANDS - M2: Level-0 solve machinery (Newton-Krylov, Δ moments, species/frames/fields) — structure, gated physics#324
Merged
Conversation
…ylov solver Matrix-free GMRES backend for the L0 solve (design docs/src/islands/design/04-numerics.md $5, $9). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…es, fields, moments
Land the Level-0 solve structure (design 03 §1-3, 04 §3-5; M2 contract), every
physics coefficient a supplied [VERIFY]-gated parameter — no literal in src/:
- solvers/Solvers.jl: matrix-free Newton-Krylov (Krylov.jl GMRES on a
preallocated ForwardDiff JVP operator; Eisenstat-Walker forcing; backtracking
line search; convergence on both norm and max-norm per 04 §5), YBlockJacobi
physics-block preconditioner skeleton with TSVD-regularized pencil solves
(the explicit y_c treatment of 04 §3), dense tiny-grid debug Jacobian, and a
pseudo-arclength continuation scaffold with fold detection from day one.
- species/Species.jl: Species{AbstractBackground}, Maxwellian/SlowingDown,
Bulk/Trace roles, validation + trace-criteria check (warn, never degrade) —
the D3 first-class species plumbing (02 §1).
- frames/Frames.jl: Level0Parameters input vector (01 §5) and the frame
conversion FORMS with every sign/normalization a NaN-defaulted gated
FrameConvention field — an un-cleared convention poisons results instead of
guessing (QUESTIONS Q3).
- fields/Fields.jl: Q(Ω)/h(Ω) flattened-electron closure structure (prefactor
supplied), the coefficient-free A7 identity ⟨∂²h/∂x²⟩_Ω = 0, and the
NaN-gated ElectronClosure constant set.
- moments/Moments.jl: J̄_∥ assembly from charge-scaled weighted moments,
Δ_cos/Δ_sin projections with REQUIRED gated prefactors (ψ̃ open [VERIFY],
sin normalization unpinned — QUESTIONS Q4), Ω label + ⟨·⟩_Ω average +
channel-split diagnostics (pinned half-width convention).
- operators/: PitchAngleDiffusion in mimetic divergence form (exact discrete
particle conservation + entropy sign, ladder A4), FarFieldConditions
matching BCs (never bare Neumann, 01 §3), weighted_moment!, flat-index
helpers; IslandGrid now records y_c for the A8 monitor.
- verify/: solve-level MMS + zero-drive configurations (A5/A1-solve) and the
yc_block_sigma_min conditioning monitor (A8, the L23 §4.2 silent-noise
regression tripwire).
All new kernels pass a --check-bounds=yes run (M1 lesson).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016pUwoFRo9a5AjF8HuwcZMr
…/A8 + solve-MMS) test/runtests_islands_solve.jl (67 tests, wired into runtests.jl): - A5 zero-drive null: residual exactly machine zero at g ≡ 0; Newton falls back to the zero state from a perturbation. - A1-solve: assembled Newton-Krylov solve recovers the manufactured state at design order (observed 3.98 on the nx = 17→33 pair). - A4: exact discrete particle conservation (≲1e-11) + entropy sign of the mimetic pitch-angle operator; allocation-free apply!. - A3: Δ_cos even / Δ_sin odd under ξ-reflection, spectrally exact projections. - A7: ⟨∂²h/∂x²⟩_Ω = 0 to 1e-10 across Ω and prefactors (coefficient-free). - A8: y_c-block σ_min monitor is finite/positive and detects an artificially singularized pencil. - Preconditioner gate: YBlockJacobi cuts GMRES iterations >2× at identical solutions; far-field BC rows; pseudo-arclength fold detection; species + gated-frames plumbing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pUwoFRo9a5AjF8HuwcZMr
…ctural regression case - benchmarks/islands/ (+ figures/): the docs/05 B-ladder scripts B2 (large-w limits), B4 (polarization ω_E structure), B5a/b/c (York threshold triangle) — all SKIPPED, each naming the QUESTIONS.md entries (Q2-Q4) whose human clearance un-gates it. Un-skipping by filling in a coefficient is the forbidden action; the scripts say so. - regression-harness: new computed case islands_l0_structural tracking the structural numbers that silently move if the discretization/solver/quadratures drift — solve-MMS error + Newton/GMRES iteration counts (nx=17), the A7 closure identity, and the A8 y_c-block sigma_min. Verified locally: err=5.254e-2, 6 Newton / 1210 GMRES, A7=8.0e-17, sigma_min=0.1139. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pUwoFRo9a5AjF8HuwcZMr
- docs/src/islands/papers/paper-1/OUTLINE.md: the Level-0 figure contract (docs/07 §3), claims → figures → ladder IDs. C1-C3 (discretization order, solver conditioning, conservation structure) are green as CI artifacts; C4-C8 (neoclassics, large-w limits, the York triangle, the Δ_pol(ω_E) reversal, the L23 electron-Δ_pol question) are gated on QUESTIONS Q2-Q4. - docs/src/islands.md: M2 status (all seven submodules, gating summary). - LOG.md: M2 session entry, including the solve-well-posedness lesson (generic y-diffusion without BCs is unstable; the mimetic degenerate form + far-field x-BCs are the correct structure). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pUwoFRo9a5AjF8HuwcZMr
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pUwoFRo9a5AjF8HuwcZMr
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pUwoFRo9a5AjF8HuwcZMr
…ocs missing_docs) Extend the islands.md API reference with @autodocs sections for the five M2 submodules (SpeciesLists, Frames, Fields, Moments, Solvers) on top of the M1 fix — checkdocs=:exports requires every exported docstring covered. Local docs build passes clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pUwoFRo9a5AjF8HuwcZMr
…uations + figures, Islands site section Address the missing narrative documentation: the design docs existed in-repo but were never wired into the rendered site, and no figures existed because the figure pipeline was contracted to the (gated) B-ladder. - docs/src/islands/numerics.md: "numerics as implemented (M1-M2)" — the equations of everything actually built (sinh layer maps, spectral/Fornberg operators, the operator-stack residual, the mimetic collision form with its exact discrete conservation/entropy identities, Newton-Krylov + EW forcing + TSVD preconditioning, pseudo-arclength fold detection, Ω/⟨·⟩_Ω/h(Ω) geometry and the A7 identity, the Δ projections with gated prefactors), each anchored to its implementing symbols, with the A-ladder evidence table. - benchmarks/islands/figures/make_structural_figures.jl: pinned script (docs/07 §2) generating the five structural figures from the verification machinery (grid clustering, MMS+solve convergence, Q/h profiles + A7, preconditioner GMRES comparison, continuation fold); PNGs committed under docs/src/islands/figures/ (gitignore exception) as docs assets. - docs/make.jl: new "Islands" nav section — overview, numerics chapter, Paper-I figure contract, and the full design-document set (00-08). - docs/src/islands.md: now links the narrative pages from the API reference. Local docs build passes clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pUwoFRo9a5AjF8HuwcZMr
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pUwoFRo9a5AjF8HuwcZMr
logan-nc
added a commit
that referenced
this pull request
Jul 9, 2026
…tract (derivation lane) User decisions (2026-07-08): PR #324 merged; D7 and D8 ratified as written (Decision Log updated, Q2 RESOLVED); Q3 clearance mode = re-derivation first. M2b-launch-prompt.md is the next milestone contract: independent derivations of the L0 coefficient set into docs/src/islands/derivations/ with cross-check tables against the [CHECKED] transcriptions, item-by-item human sign-off (recorded in docs/01) clearing coefficients into a named-configuration builder, progressive un-skipping of the B-ladder with docs/05 reporting, and honest triage of any threshold disagreement. Provenance rules sharpened: [DERIVED] never presented as transcription, no unsigned coefficient in src/, no tuning to pass benchmarks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016pUwoFRo9a5AjF8HuwcZMr
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.
Milestone M2 of the Islands module per the contract
docs/src/islands/design/M2-launch-prompt.md: the full Level-0 solvemachinery as structure, with every physics coefficient a supplied
[VERIFY]-gated parameter. Stacked on #320 (M1) — this PR retargets tofeature/islandswhen #320 merges; review only the M2 commits here.What's here
solvers/— matrix-free Newton–Krylov (Decision D2,04 §5):Krylov.jl GMRES on a preallocated ForwardDiff JVP operator, Eisenstat–Walker
forcing, backtracking line search, convergence on norm and max-norm;
YBlockJacobiphysics-block preconditioner skeleton with TSVD-regularizedpencil solves (the explicit
y_ctreatment of04 §3); dense tiny-grid debugJacobian; pseudo-arclength continuation with fold detection from day one.
species/— first-class species plumbing (D3,02 §1): backgrounds,Bulk/Traceroles, trace-criteria checks (warn, never silently degrade).frames/— the ω/normalization conversion forms; every sign aNaN-defaulted
FrameConventionfield: an un-cleared convention poisonsresults instead of guessing (QUESTIONS Q3).
fields/—Q(Ω)/h(Ω)flattened-electron closure structure (suppliedprefactor) + NaN-gated
ElectronClosureconstants; the coefficient-freeidentity
⟨∂²h/∂x²⟩_Ω = 0.moments/—J̄_∥assembly,Δ_cos/Δ_sinAmpère projections withrequired gated prefactors (
ψ̃carries an open[VERIFY]; sinnormalization
[DERIVED]-unpinned — QUESTIONS Q4),⟨·⟩_Ωdiagnostics.operators/additions —PitchAngleDiffusionin mimetic divergenceform (exact discrete particle conservation + entropy sign);
FarFieldConditionsneoclassical-matching BCs (never bare Neumann,01 §3);weighted_moment!; flat-index helpers;IslandGrid.y_c.benchmarks/islands/): B2/B4/B5a-c each namethe QUESTIONS IDs gating them. Regression case
islands_l0_structural(solve-MMS error, Newton/GMRES counts, A7 identity,
σ_min(y_c)) — verifiedlocally. Paper-I OUTLINE (
docs/src/islands/papers/paper-1/): the Level-0figure contract, C1–C3 green / C4–C8 gated.
Structural gates (all green; 67 new tests, 120 Islands total)
g ≡ 0; Newton falls back to zeroΔ_coseven /Δ_sinodd under ξ-reflection, spectrally exact⟨∂²h/∂x²⟩_Ω≈ 1e-16 across Ω and prefactorsy_cconditioningσ_minmonitor finite/positive + detects a singularized pencilVerification
julia --project=. test/runtests.jl(all 120Islands tests incl. the new
runtests_islands_solve.jl).[VERIFY]-policy violation; theliterature numbers (−1.173, 1−1.46√ε, 8.73/1.46 ρ_bi, w_ψ/2√2) appear only as
docstring provenance on NaN-gated fields, never assigned.
--check-bounds=yesrun (M1 lesson).Krylov.jl(04 §9). Nothing removed.Explicitly NOT here (gated on the human clearance queue)
The York gates (B5a/b/c), large-w limits (B2), polarization curve (B4), and
Paper-I claims C4–C8 — all require the
QUESTIONS.mdQ2 (ratify D7/D8),Q3 (clear the L0
[CHECKED]coefficient set), Q4 (open[VERIFY]s)clearances. A thin follow-up fills the numbers and un-skips the B-ladder once
cleared.
docs-not-needed:no — docs included:docs/src/islands.mdM2 status,Paper-I OUTLINE, LOG entry.
🤖 Generated with Claude Code
https://claude.ai/code/session_016pUwoFRo9a5AjF8HuwcZMr