ISLANDS - M1: phase-space grids + operator-stack skeleton + MMS/AD harness#320
Merged
Conversation
M1 needs forward-mode AD for the JVP/AD-compatibility checks (design docs/src/islands/design/04-numerics.md §9). Adds ForwardDiff to Project.toml (already present transitively in the manifest); removes nothing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ck + verify harness Land the milestone-M1 numerical skeleton (design 03 §1-2, 04; ladder A1/A2), structure only — no [VERIFY] physics coefficients assigned in src/. - phasespace/PhaseSpace.jl: the (x, ξ, y, E, σ) grids with layer-clustered maps. Fourier spectral ∂ξ; Fornberg high-order finite differences for ∂x/∂y on sinh-stretched grids (per-derivative window widths so D1 and D2 are both 4th-order including boundaries); composite-Simpson quadrature weights; Gauss-Laguerre energy nodes. Pure numerics. - operators/Operators.jl: AbstractTerm + apply! + residual! and the term structs of 03 §2 (ParallelStreaming, MagneticDrift with the :original/:improved toggle, ExBDrift as the (x,ξ) Poisson bracket, Collisions, GradientDrive, PerpTransport and RadiationSink L4 stubs, Quasineutrality field residual). Every physics coefficient is a supplied data field, never a literal; allocation-free and generic over eltype so ForwardDiff duals flow through. - verify/Verify.jl: manufactured-solution (MMS) + AD-vs-finite-difference JVP harness, plus allocation probes. Manufactured coefficients are arbitrary order-unity test values (not physics), exercising the discretization only. - Islands.jl: wire the three submodules. physics-verifier: PASS (no [VERIFY]-policy violation). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…to runtests test/runtests_islands_grids.jl and test/runtests_islands_operators.jl, included in test/runtests.jl: - A1 per-operator MMS: 4th-order convergence for the ∂x/∂y differential terms, machine precision for the Fourier ∂ξ (drift) term; assembled kinetic residual converges at 4th order. - A2: forward-mode-AD JVP of the (nonlinear) assembled residual matches the central finite-difference directional derivative to ~1e-9. - Allocation regression: every apply! and residual! hot path allocates 0 bytes. - Grid unit tests: Fourier exactness, mapped-FD order, Simpson/Gauss quadrature, layer-clustered packing, IslandGrid assembly and input validation. All 53 Islands tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…path) - docs/src/islands.md: document the M1 skeleton (PhaseSpace/Operators/Verify), restating the structure-only [VERIFY] discipline. - LOG.md: M1 session entry (what moved / blocked / next). - QUESTIONS.md: Q1 RESOLVED — julia is at the ncl2128 software dir and must be invoked with a clean LD_LIBRARY_PATH (OMFIT contamination); used here to run the suite locally. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Set up the next milestone (M2 — L0 solve machinery) for the autonomous loop, mirroring the M1 launch-prompt bootstrap. - docs/src/islands/design/M2-launch-prompt.md: the M2 milestone contract. Scope = full L0 solve machinery (solvers/, moments/, frames/, fields/, species/, neoclassical-matching BCs) as AD-compatible allocation-free structure with every physics coefficient a [VERIFY]-gated parameter. DoD = the physics-free structural gates (A5 null, assembled solve-MMS, A8 y_c conditioning, A4 conservation, A3 parity, A7 ⟨∂²h/∂x²⟩=0) + suite + PR + Paper-I OUTLINE + the clearance queue. The York gates (B5a/b/c, B2, B4) are explicitly OUT — they need human-cleared physics; reaching one by hardcoding is a policy violation, not completion. - QUESTIONS.md: seed the parallel-human clearance queue — Q2 (ratify D7/D8), Q3 (clear the L0 [CHECKED] coefficient set with exact cites), Q4 (open [VERIFY]s: the psi-tilde q_s'/q_s typo, B5a collisionality, acquire WCHH96 + Park 2022). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the overnight-loop framing (dontAsk/--continue header, unattended language, Stop-hook exit-criteria) — M2 is driven interactively via /goal in auto mode. Blocked coefficients are surfaced to the user to clear live rather than only parked in QUESTIONS.md. The contract (scope, DoD, [VERIFY] hard rule, gated York gates) is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…docs missing_docs) Documenter's checkdocs=:exports requires every exported docstring in the package (including submodules) to appear in a page; the islands.md @autodocs block only listed the top-level Islands module, so the PhaseSpace/Operators/ Verify exports failed the docs build. Add per-submodule @autodocs sections. 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 M1 of the Islands module (
src/Islands/) — the drift-kineticisland/layer solver. Lands the numerical skeleton and verification harness,
not the physics numbers (design docs
03 §1–2,04, ladderA1/A2;src/Islands/CLAUDE.md[VERIFY]policy).What's here
phasespace/PhaseSpace.jl— the(x, ξ, y, E, σ)phase space withlayer-clustered maps (
04 §1): Fourier spectral∂ξ; Fornberg high-orderfinite differences for
∂x/∂yonsinh-stretched grids (window sizedper-derivative so
D1andD2are both 4th-order including boundaries);composite-Simpson quadrature weights; Gauss–Laguerre energy nodes. Pure
numerics — no physics coefficients.
operators/Operators.jl—AbstractTerm+apply!+residual!and theterm structs of
03 §2(ParallelStreaming,MagneticDriftwith the:original/:improvedtoggle,ExBDriftas the(x,ξ)Poisson bracket,Collisions,GradientDrive,PerpTransport/RadiationSinkL4 stubs,Quasineutralityfield residual). Every physics coefficient is a supplieddata field — never a literal. Allocation-free; generic over
eltypesoForwardDiff duals flow through.
verify/Verify.jl— the manufactured-solution (MMS) + AD-vs-FD JVP harnessand allocation probes. Manufactured coefficients are arbitrary order-unity test
values (not physics), exercising the discretization only.
test/runtests_islands_{grids,operators}.jl, wired intoruntests.jl), all green:∂x/∂yterms, machine precisionfor the Fourier
∂ξterm; assembled kinetic residual → 4th order.central-difference directional derivative to ~1e-9.
apply!/residual!hot path allocates0 bytes.
ForwardDiffadded toProject.toml(04 §9).Verification
julia --project=. test/runtests.jlpasses (incl. the 53 newIslands tests).
[VERIFY]-policy violation. The flagged literature numbers (8.73/1.46 ρ_bi,k=−1.173, …) appear only in docstring prose, never assigned to a coefficient.
[VERIFY]disciplineNo
[VERIFY]/[CHECKED]physics coefficient, sign, or normalization is assigneda value anywhere in
src/. Physics operators (drift frequencies, collisionkernels, the Δ moments, York thresholds) land in later milestones and stay gated
until their tags are human-cleared.
docs/src/islands/QUESTIONS.mdQ1(julia-on-PATH) is resolved.
docs-not-needed:M1 changes no physics behavior; the Islands docs page isupdated with the M1 status and the design docs remain the normative spec.
🤖 Generated with Claude Code