# Invariant-domain learned reconstruction

- ID: 1178
- Canonical URL: https://synthcore.org/idea/1178/invariant-domain-learned-reconstruction
- API JSON: https://synthcore.org/api/idea/1178.json
- API Markdown: https://synthcore.org/api/idea/1178.md
- Verification status: mech_ok_no_baseline
- Source: [arXiv:2607.20171](https://arxiv.org/abs/2607.20171)
- Category: architecture
- Solves: stability, accuracy, generalization
- ML areas: graph-nn, cnn, world-model, regularization
- Math tags: pde, numerical-analysis, geometry, optimization
- Ratings: usefulness 7/10; difficulty 5/10; novelty 7/10

## Idea description

Insert a neural local reconstruction into a finite-volume or graph-based simulator, but hard-cap its contribution so every reconstructed state remains in the physical admissible set. The network learns accuracy-sensitive gradients or stencil weights; a deterministic limiter, rather than a penalty loss, guarantees positive density and pressure for arbitrary network outputs.

## Mathematical statement

The governing state is \(\mathbf{w}=(\rho,\rho v_x,\rho v_y,E)^\top\), where \(\rho\) is density, \(v_x,v_y\) are velocity components, and \(E\) is total energy. For an ideal gas, \(E=p/(\gamma-1)+\tfrac12\rho|\mathbf v|^2\), so pressure is \(p(\mathbf w)=(\gamma-1)(E-\tfrac12(m_x^2+m_y^2)/\rho)\), with momenta \(m_x=\rho v_x\), \(m_y=\rho v_y\), and \(\gamma=1.4\). The admissible set is \(\mathcal G=\{\mathbf w:\rho>0,\ p(\mathbf w)>0\}\). The paper reconstructs each scalar variable using \(q_i(\mathbf x)=\bar q_i+\phi_i\,\mathbf g_i\cdot(\mathbf x-\mathbf x_i)\), where \(\bar q_i\) is the cell average, \(\mathbf x_i\) is the cell centroid, \(\mathbf g_i\) is a learned or reconstructed gradient, and \(\phi_i\) is a limiter. Use a hard limiter by defining a raw face state \(\mathbf w_f^{\rm raw}(\theta)=\bar{\mathbf w}_i+\theta(\mathbf w_f^{\rm NN}-\bar{\mathbf w}_i)\) and selecting the largest \(\theta\in[0,1]\) such that the interpolated state lies in \(\mathcal G\). Density is affine in \(\theta\), so its bound is explicit; pressure positivity is enforced by bisection using the ideal-gas pressure formula. The convex interpolation toward the admissible cell average is the constructive invariant-domain mechanism. Nonnegative normalized stencil weights can additionally prevent cancellation in the learned gradient operator.

## Key formulas

- $$\partial_t\mathbf{w}+\nabla\cdot\mathbf{F}(\mathbf{w})=0,\qquad \mathbf{w}=(\rho,\ \rho v_x,\ \rho v_y,\ E)^\top,$$
- $$E=\frac{p}{\gamma-1}+\frac12\rho|\mathbf v|^2,\qquad \mathcal G=\{\mathbf w:\rho>0,\ p(\mathbf w)>0\},$$
- $$q_i(\mathbf x)=\bar q_i+\phi_i\,\mathbf g_i\cdot(\mathbf x-\mathbf x_i),$$
- $$\mathbf w_f(\theta)=\bar{\mathbf w}_i+\theta\bigl(\mathbf w_f^{\mathrm{NN}}-\bar{\mathbf w}_i\bigr),\qquad \theta_i^*=\max\{\theta\in[0,1]:\rho(\mathbf w_f(\theta))\ge\varepsilon_\rho,\ p(\mathbf w_f(\theta))\ge\varepsilon_p\}.$$

## Implementation notes

1. Integration point: use a small MLP or message-passing network on each cell and its one-ring neighbors. Feed normalized neighbor differences, centroid offsets, local Mach number, and cell-average conserved variables into the network. Let it output either a gradient \(\mathbf g_i^{\rm NN}\) for each conserved variable or a raw face state \(\mathbf w_f^{\rm NN}\). Apply this module before the numerical flux and before the finite-volume update; do not replace the Riemann flux or CFL time-step calculation. 2. Pseudocode: compute \(z_i=\mathrm{MLP}(\mathrm{features}_i)\); decode \(\mathbf g_i^{\rm NN}\) or \(\mathbf w_f^{\rm NN}\); form each face extrapolation with \(q_i(\mathbf x)=\bar q_i+\phi_i\mathbf g_i\cdot(\mathbf x-\mathbf x_i)\); for every face define \(\mathbf w_f(\theta)=\bar{\mathbf w}_i+\theta(\mathbf w_f^{\rm NN}-\bar{\mathbf w}_i)\). First set \(\theta\leftarrow\min(1,(\rho_i-\varepsilon_\rho)/(\rho_i-\rho_f^{\rm NN}))\) when the density endpoint violates the lower bound. Then run 20 bisection iterations on \([0,\theta]\), retaining the largest midpoint satisfying \(p(\mathbf w_f(\theta))\ge\varepsilon_p\), and use the resulting state in the flux. 3. The admissible-set definition and interpolation are mathematical guarantees; \(\varepsilon_\rho,\varepsilon_p\) are engineering floors, while neural-output scaling, gradient normalization, and bisection tolerance are empirical choices. Add a hard constraint for stencil weights by decoding \(a_{ij}=\exp(u_{ij})/(\sum_k\exp(u_{ik})+\delta)\), where \(u_{ij}\) are unconstrained network outputs and \(\delta>0\) prevents a zero denominator. 4. First experiment: train this module on a small unstructured-mesh 2-D Euler solver for Mach-2 flow past a step or obstacle. Compare against the same solver with a conventional minmod or Venkatakrishnan limiter and against an unconstrained learned reconstruction with only a positivity penalty, using identical coarse meshes and time steps. Measure invalid-state frequency, shock-location error, density and pressure overshoot, L1 state error, limiter activation rate, and wall-clock cost. Success means zero invalid states across held-out Mach numbers and geometries while reducing L1 density error by at least 20% relative to the classical limiter without substantially increasing flux evaluations.

## Verification

- Status: mech_ok_no_baseline
- Mechanism evidence: yes
- Mechanism confirmed: yes
- Practical verdict: inconclusive
- Verdict: Built a deterministic invariant-domain limiter for 2-D ideal-gas conserved states using an explicit density bound and pressure bisection. The mechanism manifested: density-limit error was 0, pressure-root error was at most 2.22e-16, and Lambda*theta remained constant with tail ratio 1.0 across a 32x raw-strength sweep. In the secondary random test, raw invalid states occurred 56.0% of the time while limited states had 0% invalid states; this toy test does not establish an Euler accuracy win.

### Mechanism check

- Verdict: Built a deterministic invariant-domain limiter for 2-D ideal-gas conserved states using an explicit density bound and pressure bisection. The mechanism manifested: density-limit error was 0, pressure-root error was at most 2.22e-16, and Lambda*theta remained constant with tail ratio 1.0 across a 32x raw-strength sweep. In the secondary random test, raw invalid states occurred 56.0% of the time while limited states had 0% invalid states; this toy test does not establish an Euler accuracy win.
- Confidence: 9/10
- Limitations: No neural network training, finite-volume Euler time integration, shock-location or L1 accuracy study, GPU benchmark, unstructured mesh, or comparison against a true minmod/Venkatakrishnan reconstruction was performed. The baseline comparison is only a small conserved-state reconstruction sanity test.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.0823
- Paired wins: 6/8
- Benchmark verdict: no significant win

## Artifacts

- [bench_report.json](https://synthcore.org/code/468/bench_report.json)
- [invariant_reconstruction.py](https://synthcore.org/code/468/invariant_reconstruction.py)
- [report.md](https://synthcore.org/code/468/report.md)
- [report_bench_2026-08-31T125617.md](https://synthcore.org/code/468/report_bench_2026-08-31T125617.md)
- [results.json](https://synthcore.org/code/468/results.json)
- [run_bench.py](https://synthcore.org/code/468/run_bench.py)
- [run_experiment.py](https://synthcore.org/code/468/run_experiment.py)
- [Download all files as ZIP](https://synthcore.org/download/468)

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
