feat(solver): add full-field XLB cylinder surrogate#117
Draft
andrinr wants to merge 2 commits into
Draft
Conversation
Contributor
📊 View the full benchmark resultsNo benchmarks ran for this PR, so there is no status report. |
andrinr
force-pushed
the
feat/ns-grid-surrogate-solver
branch
from
July 25, 2026 11:30
6337047 to
34d5fd4
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
N=32,Re=20cylinder-flow drag-optimization task
bundle; dataset generation and training remain external to this repository
drag with the shared
drag_jaxsurface integral (there is no scalar drag head)full-field Jacobian
benchmark cells
This PR is stacked on
feat/ns-grid-solver-in-loop.Model and data
The residual MLP maps the 32-value inflow profile to 128 POD coefficients. Its
decoder reconstructs four
32 x 32fields: finalu_x, finalu_y,tail-averaged
u_x, and tail-averaged pressure. The first two form the publiccanonical velocity result; the latter two feed the same surface-traction drag
functional used by the projection solvers.
The external XLB-generated dataset contains 4,096 stable profiles split
3,072/512/512 for training/validation/test. Profile families include smooth
Fourier, multiscale, localized, and near-flat controls over the optimizer's
[0, 1.5]bounds.2832fecfb85d1ced442b38b608c512c71aca224c9a3b982d39e736d2bdf16ac86089ba29d9644e1f3b87404302b0b19aaeb7ea6ee0b359d7aa5fe395ef04626cOffline accuracy and performance
All measurements below were run offline on RTX 5090 cluster nodes using the
same Slurm runner, Buildah, Enroot/Pyxis, and remote-Tesseract workflow as the
solver-in-the-loop work.
benchmark:noneis the PR disposition: CI solverbuilds and benchmark execution are skipped.
n=512)n=512)2.39e-4/0.99925n=8)n=8)5.81e-5n=8)0.9950/0.9885n=8)The compiled speedups measure synchronized, in-process JAX calls after
compilation. The full benchmark below exercises the remote Tesseract protocol
for every forward/VJP, including HTTP/base64 serialization, request scheduling,
client bookkeeping, and periodic checkpoint writes. Those fixed costs dominate
this small
32 x 32model: the full optimization is therefore 1.17x fasterend-to-end (
31.09 / 26.50) rather than 113x.A separate 250-update exploitation check reached surrogate drag
-0.04689;float64 XLB re-evaluation of the final profile gave
-0.04758. The packagedTesseract's full harness run independently reproduced this: its final
full-field surface-integral drag was
-0.04699, and float64 XLB re-evaluationof the saved final profile was
-0.04758.Full-field Jacobian conditioning
For
J = d(final velocity) / d(inflow profile), both XLB and the surrogatehave rank 30. The two exact null directions are the profile samples at the
no-slip wall endpoints: XLB overwrites those inlet corners with no-slip states,
and the surrogate now preserves the same gradient semantics without changing
its forward predictions.
The table reports median values over eight held-out profiles. Since the raw
condition number is infinite in both models,
kappa_resolvedissigma_max / sigma_minover singular values above a relative1e-6threshold.kappa_resolvedkappa_resolvedx >= 0.5)The inlet identity makes the full returned-field spectrum look especially
well-conditioned; the interior number is the more revealing dynamics-only
diagnostic. The surrogate is more ill-conditioned there, although the
Jacobian orientation and wake spectrum remain close to XLB.
Full
optimization/drag_optbenchmark-0.068912-0.047789-0.068863-0.046985-0.023863-0.017738-0.000835-0.000710Offline optimization fields
Media is generated from the completed offline runs. The full-field GIF replays
the 14 saved optimizer-profile checkpoints through the packaged surrogate; its
frames are actual decoded velocity fields, not interpolation. Because this is a
direct profile-to-final-state model, the animation axis is optimization update,
not physical simulation time.
Supporting data: artifact index,
run manifest,
held-out/gradient/timing evaluation,
full-field Jacobian conditioning,
and float64 XLB final-profile re-evaluation.
Validation
ruff check mosaic testsruff format --check mosaic tests(156 files already formatted)tesseract-runtime check1533241, XLB surrogate1533244,PICT
1533248, and PhiFlow15332431533250, field-history replay1540226,final render
1540227, and Jacobian conditioning1540907