feat(domain): add 2D solver-in-the-loop corrector benchmark#116
Draft
andrinr wants to merge 15 commits into
Draft
feat(domain): add 2D solver-in-the-loop corrector benchmark#116andrinr wants to merge 15 commits into
andrinr wants to merge 15 commits into
Conversation
andrinr
force-pushed
the
feat/ns-grid-solver-in-loop
branch
from
July 24, 2026 15:02
2b53888 to
358e231
Compare
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.
Summary
Add a solver-in-the-loop neural-correction benchmark to 2D Navier–Stokes
alongside the existing drag-optimization task.
The benchmark owns the train/test split, references, Equinox corrector,
initialization, optimizer, recurrent objective, paired stop-gradient control,
and evaluation. Candidate cells vary only in the differentiable solver
transition and its VJP.
The central result is a two-stage distinction:
Tesseract boundary to pass a 100-call recurrence test.
No solver is hidden to make the comparison agree. The four failed cells remain
visible as adapter diagnostics, and the complete intrinsic six-solver VJP
ranking is withheld until their recurrent state is preserved.
Type of change
Corrector and paired training
The corrector is an Equinox
PeriodicResidualCNN, not a U-Net:Every model seed is trained twice:
supervision are retained, but temporal credit through the solver is cut.
The reported solver-VJP lift is the paired
log(error_stop-gradient / error_full-VJP)over the same seeds and held-outICs. Each cell's loss is normalized by its own uncorrected recurrent baseline,
so raw solver accuracy does not change the optimizer scale.
Fair all-six forward gate
The analytic control is the smooth N=64 Taylor–Green case from the established
forward benchmark (
nu=0.05,dt=0.01). Admission thresholds are declared as1% relative error for the first interval, 1% for an uninterrupted
t=1trajectory, and 1% for repeated/native closure after 100 canonical calls.
XLB receives four internal substeps per canonical interval. This is the
smallest tested Mach-safe budget that makes its uninterrupted forward solution
pass the same 1% gate; two substeps left 1.79% long-forward error.
t=1This resolves the apparent contradiction in the earlier plots: the native
forward trajectories are accurate, while repeated velocity-only calls are not
the same state transition for four adapters.
center↔face conversions attenuate the state.
equilibrium populations from velocity on every call.
numerical precision.
These are interface-state failures, not evidence that the underlying native
solver VJPs are intrinsically poor.
Nonlinear shared-reference task
The learning stress task uses a benchmark-owned 64² dealiased pseudo-spectral
vorticity RK4 reference, spectrally restricted to the shared 32² grid. It is
not an upscaled candidate solver.
k0=6, amplitude 0.5,nu=0.001;dt=0.02per correction interval;t=1.92, held-out rollout tot=2.88.The flow changes materially over the rollout and uses doubly periodic
[0,2π]²boundaries, appropriate for homogeneous decaying turbulence and thetranslation-equivariant corrector. The benchmark does not claim wall or inlet
generalization; the retained drag task covers that separate regime.
All six cells run and render. PICT and Warp-NS are the conditional intrinsic
comparison because they pass recurrence admission and begin at matched
first-interval p95 error (6.32% and 6.28%).
Warp-NS's incremental VJP lift is distinguishably larger: its lift ratio over
PICT is 1.022× (95% CI 1.008–1.036×). PICT nevertheless learns the stronger
overall correction and lower final error. Warp-NS is about 2.6× faster per
full-VJP update.
So the differentiable solver VJP does help, but modestly. In this nonlinear
task the evidence favors Warp-NS for temporal credit assignment and efficiency,
while PICT is more correctable in absolute terms.
Solver-specific refined-reference control
optimization/solver_in_loop_self_referenceasks the upscaling question:Each solver supplies its own 64², half-step reference, restricted to the 32²
coarse grid. Absolute errors are not compared across solvers because their
targets differ; the paired within-solver VJP lift is comparable.
Both VJPs help at 95% confidence, but their lift difference is not significant.
Warp-NS remains about 2.7× faster.
Analytic TGV null control
The all-six TGV experiment is intentionally smooth and near the error floor.
Among the admitted adapters, PICT and Warp-NS obtain incremental VJP lifts of
2.19% and 0.69%; total correction gains are 1.421× and 1.055×. This confirms
the paired machinery but is not a substitute for the nonlinear learning task.
Supporting JSON, complete plot inputs, physics diagnostics, and job provenance:
local artifact index.
Other fixes included
cross-solver consensus instead of being compared with an unrelated analytic
TGV field.
daemon-free Slurm/Pyxis workflow.
Validation
All experiments and validation ran through Slurm on Kander.
1642897, INS.jl1642898,PhiFlow
1642899, PICT1642900, Warp-NS1642901, XLB1642902;merge/render
1644051;1642930, Warp-NS1642931;merge/render
1644052;1644252, INS.jl1644253,PhiFlow
1644254, PICT1644255, Warp-NS1644256, XLB1644258;merge/render
1644264;1644419, format1644422, full pytest1644423(499 passed, three skipped), problem configs
1644424, Tesseract configs1644425, git-aware pre-commit1644426, artifact integrity1644825.Generated benchmark results live only on the artifact branch. This PR remains
a draft with no benchmark label while the comparison and native-state follow-up
are reviewed.