Skip to content

Add the M1 end-to-end Integration test group - #7

Merged
xtalax-droid merged 7 commits into
forge/m1-3-assemblyfrom
forge/m1-4-integration
Oct 26, 2026
Merged

xtalax-droid merged 7 commits into
forge/m1-3-assemblyfrom
forge/m1-4-integration

Conversation

@xtalax-droid

Copy link
Copy Markdown
Collaborator

PR 4 of 4 for milestone M1 (spec §11.1), the PR that meets M1's exit criterion: an end-to-end test for every M1 code path. Stacked on #5 (base forge/m1-3-assembly), which is stacked on #4 and #1.

What

A new Integration test group, test/Integration/, with five files: linear.jl, nonlinear.jl, multifield.jl, convergence.jl and rejections.jl.

Every test runs the whole chain that exists before M2: Symbolics equations and boundary conditions, then the test stand-in for PDEBase's analyse, then weak_form, then emit_kernels and emit_dirichlet, then assemble_linear or assemble_nonlinear with Ferrite. The result is compared with one of two things:

  • Hand-written Ferrite assembly, in test/shared/references.jl, ported from the dauntless prototypes. The references take only plain Julia closures and Ferrite primitives, and never call the code under test.
  • Manufactured solutions, solved with a linear solve or with Newton, and checked for convergence rates.

The PR also extends the test-only stand-in (test/shared/strongform_seam.jl) in three ways:

  • the ProductRule and Weighted(w) integration-by-parts policies;
  • the clarified §5.1 rule for registered functions without a derivative rule, which rejects them only where state reaches their argument;
  • a pass-through PeriodicBC.

The stand-in will be replaced by PDEBase's StrongForm.analyse in a test-only follow-up.

Branches covered

Accepted term classes (Appendix A):

  • Constant and variable isotropic diffusion.
  • Non-divergence a(x,y)Δu: K to ≤ 1e-14, and manufactured-solution nodal rates 1.96, 2.01 and 2.01.
  • Anisotropic diffusion with cross terms.
  • The mixed partial Dx(Dy u).
  • An opaque registered coefficient in divergence form.
  • An ifelse coefficient in divergence form.
  • Linear advection and reaction.

Nonlinear terms:

  • Nonlinear diffusion with k = 1 + u² and k = u²: residual ≤ 1e-14, tangent ≤ 1e-9 against central differences, quadratic Newton convergence asserted on every solve, and nodal rates 1.71, 1.83 and 1.94.
  • Nonlinear advection, −u·u_x and −(u²)_x.
  • The nonlinear natural condition ∂ₙu = −(u⁴−1).

Multi-field:

  • Two-field cross-diffusion: K, M, F and the residual to ≤ 1e-14, block norms compared element-wise, and Dirichlet data routed to field 2.
  • An algebraic row with a zero mass block.
  • The wave equation written as a first-order system.

Boundary conditions:

  • Dirichlet, constant and time-dependent: the dof sets and values at two times.
  • Neumann: sum(F) shifts by exactly k·h·|Γ|.
  • Robin.

Spaces: P1 and P2 Lagrange on triangles, quadrilaterals and 1D lines, checked for K, M and F and for L2 rates of p + 1.

Time- and parameter-dependent coefficients: the timedep and paramdep flags, and reassembly at a new (t, p).

§10.1 regressions: ProductRule versus Weighted(r²) on the spherical Laplacian.

Periodic data: checked only for passing through weak_form unchanged. Rejecting periodic conditions before M4 belongs to the discretizer (M2/M4).

Rejections: every Appendix A rejection that the stand-in or the driver raises today.

Five @test_broken entries flip when PDEBase's analyse replaces the stand-in:

  • the KdV "third-order" message;
  • the single ProductRule warning;
  • the two-field essential condition;
  • the non-divergence ifelse rejection;
  • the Integral rejection.

Not coverable until PDEBase's real analyse is swapped in (M0): the symbolic normal slot, an operator and a trace on different pieces, and periodic conditions without a translation.

Tests

GROUP=Integration gives 184 pass, 5 broken and 0 fail in 152 s. Runic and typos are clean.

This PR was reviewed in two rounds. An independent reviewer approved it and raised 7 minor findings and 2 nits about test strength; all were fixed in b59761f, 352fb4b and 28dad04. Codex review then approved it with no findings.


🤖 Posted by an AI agent · harness: Claude Code 2.1.310 · model: claude-opus-5-5
Review: unreviewed
Session: d6252e53-ed42-4149-9811-233262edb2ef

xtalax and others added 7 commits October 26, 2026 16:18
…le and periodic pairings

The M1 integration suite needs three things the seam lacked: ProductRule and Weighted(w) integration-by-parts policies for the spec 10.1 spherical-Laplacian regression; the clarified spec 5.1 rule that a registered function without a derivative rule is rejected only where state reaches its argument (the strong residual is now converted non-strictly so divergence-form opaque(x) coefficients are accepted); and a pass-through PeriodicBC list. Test-only; PDEBase.StrongForm replaces all of it at the swap.

Agent-Harness: Claude Code 2.1.310
Agent-Model: claude-opus-5-5
Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Linear block K, M, F and steady residual references ported from the dauntless prototypes, plus the chain, constraint, Newton and error-rate helpers the Integration group shares.

Agent-Harness: Claude Code 2.1.310
Agent-Model: claude-opus-5-5
Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Every Appendix A accepted class, every BC kind, single and multi-field, steady and time-dependent, P1/P2 on triangles, quadrilaterals and lines, run from Symbolics equations through analyse, weak_form, emit_kernels and the Ferrite driver, against hand-written assembly and manufactured solutions; plus every rejection the chain raises today.

Agent-Harness: Claude Code 2.1.310
Agent-Model: claude-opus-5-5
Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
CI's typos check flags ue, ur and similar abbreviations, and Documenter must not see test helper docstrings; helpers now carry plain comments.

Agent-Harness: Claude Code 2.1.310
Agent-Model: claude-opus-5-5
Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Review findings 1, 2, 3, 4 and 9. Block norms are compared element-wise, so the 1390 block no longer hides the others. Every Newton solve must converge within 8 steps with its last order estimate above round-off at least 1.8, guarded against an empty estimate list (replaces maximum(orders)). The nonlinear rate check keeps only r[end] >= 1.9. raises() accepts any exception and matches on showerror, so the broken rejections flip when PDEBase throws ArgumentError or its own type. Dirichlet values compare with rtol = 1e-15 instead of ==.

Agent-Harness: Claude Code 2.1.310
Agent-Model: claude-opus-5-5
Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…ression

Review findings 5, 6 and 7. A @test_broken asks for a 'third-order' message on Dxxx (KdV, spec m2), and the duplicate Dxxx @test_throws is gone. A @test_broken asks for exactly one ProductRule warning on the spherical chain, beside a passing zero-warning check for Weighted(r^2). The accepted half of the ifelse regression assembles Dx(ifelse(x<0.5,1,3) Dx u) + Dy(...) end to end against a closure coefficient. The periodic testset comment now says it checks only the weak_form pass-through.

Agent-Harness: Claude Code 2.1.310
Agent-Model: claude-opus-5-5
Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Review finding 8: P0, RIGHT, iso, field_dofs, a check_operators(A, Kr, Mr, Fr; tol) helper and manufactured_bcs (Dirichlet u* everywhere but right, user-written Neumann on right) now live in references.jl instead of being redefined per file. Also renames the spherical test's unknown from u_rand, a leftover of the earlier typo rename, to radial.

Agent-Harness: Claude Code 2.1.310
Agent-Model: claude-opus-5-5
Agent-Session: d6252e53-ed42-4149-9811-233262edb2ef
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@xtalax-droid
xtalax-droid merged commit 4eb4e6b into forge/m1-3-assembly Oct 26, 2026
5 checks passed
xtalax-droid added a commit that referenced this pull request Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants