Skip to content

Add exemplary end-to-end Interface tests through the public interface - #53

Merged
xtalax merged 19 commits into
masterfrom
test/interface-e2e
Nov 5, 2026
Merged

xtalax merged 19 commits into
masterfrom
test/interface-e2e

Conversation

@xtalax-droid

@xtalax-droid xtalax-droid commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Adds an Interface test group: end-to-end examples that go through the public interface only (a PDESystem built with the ModelingToolkit macros, FEMDiscretization, discretize, solve, then a comparison with an exact or manufactured solution), in the style of MethodOfLines.jl's interface tests. Each case is one narrated testset: a comment block states the PDE, domain, boundary and initial conditions, the exact solution and what it shows, and the testset name reads as a sentence. Cases stay under about 40 lines. Shared helpers are small functions (l2_error, observed_rate, sample_points) in test/shared/interface_helpers.jl. test/Interface/README.md explains the layout and how to add a case; the group is registered in test/test_groups.toml and runs as GROUP=Interface.

This branch is current with master ee31958 (M4 included): the rejection cases were rewritten for the messages master gives now, and the M4 features have their own files: steady problems, time-last variables, observed expressions, dirichlet = :eliminate, nonlinear terms, unequal orders and field regions, SUPG, a Kovasznay Navier-Stokes case, and the metadata and operators API.

Local results: 26 files pass on Julia 1.12 and on lts 1.10. GROUP=Core and GROUP=QA pass, Runic 1.13 is clean, Codex approved with no findings. advection_diffusion.jl is the only file over 90 s on 1.12, and that is JIT compile (59 s for its first testset; the solves take 3 to 6 s). CI is currently billing-blocked, so these are local results only.

Cases:

File Case PDE Dim Order Boundary conditions
heat_1d.jl P1 convergence rate 2 heat 1 P1 constant Dirichlet
heat_1d.jl P2 convergence rate 3 heat 1 P2 constant Dirichlet
heat_2d.jl eigenmode decay on triangles and quadrilaterals heat 2 P1, P2 zero Dirichlet
heat_2d.jl exact reproduction by P2 heat 2 P2 time-dependent Dirichlet
heat_2d.jl P1 convergence rate 2 heat 2 P1 time-dependent Dirichlet
neumann_robin.jl Neumann on three sides heat 2 P2 Dirichlet and Neumann
neumann_robin.jl Robin with parameters k, α heat 2 P2 Dirichlet and Robin
neumann_robin.jl Dirichlet, Neumann and Robin together heat 2 P2 all three
neumann_robin.jl insulated box heat 2 P1 zero Neumann
solution_access.jl sol[u], sol[x], sol[y] shapes heat with parameter D 2 P2 Dirichlet
solution_access.jl sol(t, x, y; dv) points, grids, outside the mesh heat 2 P2 Dirichlet
solution_access.jl derivative and trace keys heat 2 P2 Dirichlet
solution_access.jl parameter values set the diffusivity heat 2 P2 Dirichlet
heat_3d.jl eigenmode decay on hexahedra and tetrahedra heat 3 P1, P2 zero Dirichlet
heat_3d.jl exact reproduction by P2 heat 3 P2 time-dependent Dirichlet
heat_3d.jl P1 hexahedra rate 2, P2 tetrahedra rate 3 heat 3 P1, P2 zero Dirichlet
element_order.jl line P1, P2 rates 2 and 3 heat 1 P1, P2 zero Dirichlet
element_order.jl triangle and quadrilateral P1, P2, P3 rates 2, 3, 4 heat 2 P1, P2, P3 zero Dirichlet
solver_choices.jl DFBDF, DABDF2, DImplicitEuler, DFBDF order 2 heat 1 P2 constant Dirichlet
solver_choices.jl tolerances and saveat heat 1 P2 constant and time-dependent Dirichlet
solver_choices.jl ODE solver refused for the DAE problem heat 1 P2 time-dependent Dirichlet
advection_diffusion.jl exact reproduction with constant velocity advection-diffusion with source 1 P2 time-dependent Dirichlet
advection_diffusion.jl P2 convergence rate 3 with manufactured source on a line advection-diffusion with source 1 P2 zero Dirichlet
advection_diffusion.jl exact reproduction with velocity vector on triangles and quadrilaterals advection-diffusion with source 2 P2 time-dependent Dirichlet
advection_diffusion.jl P2 convergence rate 3 with manufactured source on triangles advection-diffusion with source 2 P2 zero Dirichlet
reaction_diffusion.jl linear reaction with source on triangles and quadrilaterals reaction-diffusion 2 P2 zero Dirichlet
reaction_diffusion.jl decay reaction, P2 convergence rate 3 reaction-diffusion 1 P2 zero Dirichlet
reaction_diffusion.jl two linearly coupled fields, exact coupled reaction-diffusion 1 P2 time-dependent Dirichlet
reaction_diffusion.jl logistic reaction, manufactured source, rate 3 nonlinear reaction-diffusion 1 P2 zero Dirichlet
variable_coefficient_diffusion.jl Dx(a Dx(u)), rate 3 divergence-form diffusion 1 P2 zero Dirichlet
variable_coefficient_diffusion.jl a Dxx(u), rate 3 non-divergence-form diffusion 1 P2 zero Dirichlet
variable_coefficient_diffusion.jl Dx(a Dx(u)) + Dy(a Dy(u)), rate 3, triangles and quadrilaterals divergence-form diffusion 2 P2 zero Dirichlet
variable_coefficient_diffusion.jl a (Dxx(u) + Dyy(u)), rate 3, triangles and quadrilaterals non-divergence-form diffusion 2 P2 zero Dirichlet
source_terms.jl manufactured source, rates 2 and 3 heat with source 1 P1, P2 time-dependent Dirichlet
source_terms.jl manufactured source, rate 3, triangles and quadrilaterals heat with source 2 P2 time-dependent Dirichlet
source_terms.jl polynomial solution, exact heat with source 2 P2 time-dependent Dirichlet
coupled_systems.jl bidirectionally coupled pair, exact in P2 two coupled reaction-diffusion fields 2 P2 Dirichlet
coupled_systems.jl coupled eigenmode pair (cosh, sinh) on triangles and quadrilaterals two coupled heat fields 2 P2 zero Dirichlet
coupled_systems.jl both fields converge at rate 2 two coupled heat fields 2 P1 time-dependent Dirichlet
coupled_systems.jl different boundary condition kinds per field two coupled reaction-diffusion fields 2 P2 Dirichlet on u; Dirichlet and Neumann on v
wave_first_order.jl convergence of u and v on a line wave as a first-order system 1 P1, P2 zero Dirichlet
wave_first_order.jl wave speed c in ps wave as a first-order system 1 P2 zero Dirichlet
wave_first_order.jl 2D standing wave wave as a first-order system 2 P2 zero Dirichlet
mesh_domains.jl side split into two named pieces heat 2 P2 Dirichlet, Neumann and Robin on five pieces
mesh_domains.jl L-shaped Gmsh mesh read from a file heat with parameters k, α 2 P2 Dirichlet on inlet and wall, Robin on outlet
curved_geometry.jl optimal rates on a quarter annulus with QuadraticTriangle cells heat with source 2 P1, P2 Dirichlet on the arcs, Neumann
parameters.jl D, A, g from ps for three parameter sets heat with source 2 P2 Dirichlet with parameter
parameters.jl Neumann flux q from ps heat 2 P2 Dirichlet and Neumann with parameter
parameters.jl D and reaction rate λ from ps heat with decay 2 P2 zero Dirichlet
steady.jl steady Poisson on a line, rates 2 and 3 Poisson, no time variable 1 P1, P2 constant Dirichlet
steady.jl steady Poisson with Dirichlet and Neumann sides, rates 2 and 3 Poisson 2 P1, P2 Dirichlet and Neumann
steady.jl steady nonlinear diffusion k(u) = 1 + u^2, rate 3 nonlinear diffusion, Newton 2 P2 zero Dirichlet
time_last_variables.jl u(x, y, t) and u(t, x, y) give the same solution, time axis last heat 2 P2 zero Dirichlet
time_last_variables.jl time-last traces, Dirichlet and Neumann data, exact heat with time-dependent source 2 P2 Dirichlet and Neumann
observed_expressions.jl sol[expr] and sol(t, x, y; dv = expr) heat with parameter D 2 P2 Dirichlet
eliminate.jl dirichlet = :eliminate against :algebraic heat 2 P2 space-dependent Dirichlet, constant in time
eliminate.jl dirichlet = :eliminate on a steady problem Laplace 2 P1 Dirichlet
nonlinear.jl viscous Burgers u u_x, rate 3 Burgers with source 1 P2 zero Dirichlet
nonlinear.jl nonlinear diffusion k(u) = 1 + u^2, rate 3 nonlinear diffusion with source 2 P2 zero Dirichlet
multifield_spaces.jl P2 and P1 fields in one system, rates 3 and 2 two coupled heat fields 2 P2, P1 Dirichlet
multifield_spaces.jl a field restricted to a region reads NaN outside it two heat fields, one on a half 2 P2 Dirichlet; natural on the region's other sides
supg.jl Galerkin oscillates, SUPG with the optimal τ is nodally exact convection-diffusion boundary layer 1 P1 Dirichlet
supg.jl constant τ with explicit velocity, and τ(hK, b) convection-diffusion boundary layer 1 P1 Dirichlet
navier_stokes.jl Kovasznay flow, Taylor-Hood, rates 3 and 2 steady incompressible Navier-Stokes 2 P2/P1 Dirichlet velocity, Dirichlet pressure on one side
metadata_and_operators.jl facet_dofs, dof_coordinates, cell_dofs heat 2 P1, P2 zero Dirichlet
metadata_and_operators.jl operators gives the matrices for a hand-made steady solve heat at its steady state 2 P2 Dirichlet
rejections.jl rejected boundary conditions, equations, options, domains, shared facets, SUPG with a nonlinear term, observed expressions, operators heat and others 1 to 2

Still rejected on master, so not covered as solved cases (the first group is asserted as rejections in rejections.jl): periodic conditions, codegen = :mtk, time-dependent coefficients in the mass or stiffness operator, third-order spatial and second-order time operators. Not covered at all: a SUPG velocity or tau that references a PDESystem parameter or depends on the state, and mixed cell types without a spaces entry per field. P3 on a line gives a raw Ferrite MethodError (no cubic Lagrange line in Ferrite) with no package message. remake does not reassemble operators, so parameter cases build a new PDESystem per value. docs/src/equation_classes.md and boundary_conditions.md still say steady problems, :eliminate, periodic conditions and SUPG "land in M3/M4"; that wording is stale on master and not changed here.


🤖 Posted by an AI agent · harness: Claude Code 2.1.312 · model: claude-sonnet-5-5
Review: unreviewed
Session: 43e03fde-3384-4386-bae9-03e81f19ba7c

xtalax and others added 15 commits November 3, 2026 18:02
…ublic API

Heat in 1D and 2D (P1/P2, triangles and quadrilaterals, constant and time-dependent Dirichlet), Neumann, Robin and mixed sides, solution access and parameters, and the documented rejections, each compared with a manufactured solution.

Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
… source-term Interface cases

Manufactured solutions with sources in 1D and 2D, P2 elements on triangles and quadrilaterals, divergence and non-divergence variable diffusivity, linear and coupled reaction terms, and the documented rejection of a nonlinear reaction.

Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
… curved geometry, parameters

Five self-contained files in the Interface group, each case narrated with its PDE, domain, boundary conditions and exact solution.

Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…ace README table

Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…EADME

The two P2 convergence-rate rows had identical descriptions.

Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Steady problems, nonlinear terms, time-last variables, periodic-free options and dirichlet = :eliminate are supported on master now, so rejections.jl asserts the rejections that remain (the current messages) and reaction_diffusion.jl solves the logistic reaction against a manufactured solution at rate 3.

Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Steady problems, time-last variables, observed expressions, dirichlet = :eliminate, nonlinear terms, unequal-order and region fields, SUPG, a Kovasznay Navier-Stokes case, and the facet_dofs / operators data API, each in the one-narrated-testset style of the group. Adds a steady l2_error method to the shared helpers and updates the README case table.

Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@xtalax-droid
xtalax-droid marked this pull request as ready for review November 3, 2026 23:16
typos reads `ue` as a misspelling of "use" or "due" (reaction_diffusion.jl,
lines 70 to 72). The names are now u_sym and v_sym.

Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
master 154b2df... master / 154b2df...
construction/heat P1 10x10 3.9 ± 0.24 ms 3.86 ± 0.24 ms 1.01 ± 0.089
construction/heat P1 20x20 5.38 ± 0.18 ms 5.41 ± 0.15 ms 0.995 ± 0.043
time_to_load 3.77 ± 0.048 s 3.54 ± 0.15 s 1.07 ± 0.048
Memory benchmarks
master 154b2df... master / 154b2df...
construction/heat P1 10x10 0.0393 M allocs: 2.11 MB 0.0393 M allocs: 2.11 MB 1
construction/heat P1 20x20 0.0702 M allocs: 4.73 MB 0.0702 M allocs: 4.73 MB 1
time_to_load 0.2 k allocs: 11.8 kB 0.2 k allocs: 11.8 kB 1

t and others added 3 commits November 5, 2026 02:19
Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
DABDF2 at OrdinaryDiffEqBDF 2.4.0 returns Unstable on the heat problem of
test/Interface/solver_choices.jl (t = 1e-7, error estimate about -548) in the
Downgrade job. Upstream fixed it in SciML/OrdinaryDiffEq.jl PR #3995 ("Fix
DABDF2 adaptive error estimate on DAEs", Unstable regression #3960): the
second-order startup step is a DImplicitEuler step that never wrote fsallast,
so the first BDF2 step used a stale fsalfirst. Bisect with only
OrdinaryDiffEqBDF changed: 2.4.0 Unstable (Julia 1.10.12 and 1.12.1), 2.4.1
and every later version Success (l2 1.15e-5, 898 steps). OrdinaryDiffEqBDF is
a test-only dependency, so this raises the floor of the test environment.

Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@xtalax
xtalax merged commit 6a53bfb into master Nov 5, 2026
51 checks passed
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