✗ Failed on benchmark 2026

GQL Safe Residual Layer

Implementation & benchmark of arXiv:2606.31992 — GQL-Based Physical-Constraint-Preserving High-Order Finite Difference Schemes for Special Relativistic Hydrodynamics in Arbitrary Dimensions

Usefulness6/10
Difficulty5/10
Novelty7/10

Source paper: GQL-Based Physical-Constraint-Preserving High-Order Finite Difference Schemes for Special Relativistic Hydrodynamics in Arbitrary Dimensions arXiv:2606.31992 ⓘ · analyzed Aug 29, 2026

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

Idea description

Insert a scalar flux-correction-style limiter after a neural operator predicts a conservative state or residual. Interpolate between a known-admissible baseline state and the learned high-order candidate, choosing the largest coefficient that satisfies a geometric family of linear inequalities encoding positive density, positive pressure, and subluminal velocity. This retains as much of the neural prediction as possible instead of independently clipping physical variables.

Formulas

$$\mathbf U^L_{ij}=\mathbf U^n_{ij}-\frac{\Delta t}{\Delta x}\left(\widehat{\mathcal F}_{i+\frac12,j}^{L}-\widehat{\mathcal F}_{i-\frac12,j}^{L}\right)-\frac{\Delta t}{\Delta y}\left(\widehat{\mathcal G}_{i,j+\frac12}^{L}-\widehat{\mathcal G}_{i,j-\frac12}^{L}\right),$$
$$\mathbf U^{n+1}_{ij}=\mathbf U^L_{ij}-\frac{\Delta t}{\Delta x}\left(\theta_{i+\frac12,j}\widehat{\mathcal F}_{i+\frac12,j}^{A}-\theta_{i-\frac12,j}\widehat{\mathcal F}_{i-\frac12,j}^{A}\right)-\frac{\Delta t}{\Delta y}\left(\theta_{i,j+\frac12}\widehat{\mathcal G}_{i,j+\frac12}^{A}-\theta_{i,j- rac12}\widehat{\mathcal G}_{i,j- rac12}^{A}\right).$$
$$g_{\mathbf s}(\mathbf U)=E-s_DD-\mathbf s_m^{\top}\mathbf m,\qquad E-\sqrt{D^2+\|\mathbf m\|_2^2}=\min_{\|\mathbf s\|_2\leq1}g_{\mathbf s}(\mathbf U).$$
$$\theta=\min\left\{1,\ \min_{\mathbf s:\,g_{\mathbf s}(\mathbf U_1)<\varepsilon}\frac{g_{\mathbf s}(\mathbf U_0)-\varepsilon}{g_{\mathbf s}(\mathbf U_0)-g_{\mathbf s}(\mathbf U_1)}\right\},\qquad \mathbf U_{\mathrm{safe}}=\mathbf U_0+\theta(\mathbf U_1-\mathbf U_0).$$

Mathematical statement

The paper evolves conservative variables using a low-order safe update and a limited antidiffusive update, as in the extracted formulas $\mathbf U^L_{ij}=\mathbf U^n_{ij}-\frac{\Delta t}{\Delta x}(\widehat{\mathcal F}^{L}_{i+1/2,j}-\widehat{\mathcal F}^{L}_{i-1/2,j})-\frac{\Delta t}{\Delta y}(\widehat{\mathcal G}^{L}_{i,j+1/2}-\widehat{\mathcal G}^{L}_{i,j-1/2})$ and $\mathbf U^{n+1}_{ij}=\mathbf U^L_{ij}-\frac{\Delta t}{\Delta x}(\theta_{i+1/2,j}\widehat{\mathcal F}^{A}_{i+1/2,j}-\theta_{i-1/2,j}\widehat{\mathcal F}^{A}_{i-1/2,j})-\frac{\Delta t}{\Delta y}(\theta_{i,j+1/2}\widehat{\mathcal G}^{A}_{i,j+1/2}-\theta_{i,j-1/2}\widehat{\mathcal G}^{A}_{i,j-1/2})$. Here $\mathbf U^L$ is the safe low-order state, $\widehat{\mathcal F}^{A},\widehat{\mathcal G}^{A}$ are antidiffusive fluxes, and $0\leq\theta\leq1$ limits them. The paper also represents coefficients as sign-index dot products, $c_\star=\mathbf s_0\cdot\mathbf V_{c_\star}=\sum_{i=1}^{4}s_i(\mathbf V_{c_\star})_i$, compactly enumerating sign combinations. For the neural adaptation, let $\mathbf U_0$ be a valid baseline and $\mathbf U_1$ the network output, and use $\mathbf U(\theta)=\mathbf U_0+\theta(\mathbf U_1-\mathbf U_0)$. The relativistic admissibility condition is represented by the GQL family $g_{\mathbf s}(\mathbf U)=E-s_DD-\mathbf s_m^\top\mathbf m\geq\varepsilon$ for every auxiliary vector $\mathbf s=(s_D,\mathbf s_m)$ with $\|\mathbf s\|_2\leq1$, together with $D\geq\varepsilon$. Since $E-\sqrt{D^2+\|\mathbf m\|_2^2}=\min_{\|\mathbf s\|\leq1}g_{\mathbf s}(\mathbf U)$, these inequalities enforce the relativistic admissibility condition. For each normal with a negative denominator, the maximal safe interpolation coefficient is $\theta_{\mathbf s}=\frac{g_{\mathbf s}(\mathbf U_0)-\varepsilon}{g_{\mathbf s}(\mathbf U_0)-g_{\mathbf s}(\mathbf U_1)}$; take the minimum over normals. In the basic relativistic case, the worst normal is $\mathbf s^\star=(D_1-D_0,\mathbf m_1-\mathbf m_0)/\|(D_1-D_0,\mathbf m_1-\mathbf m_0)\|$. For more general GQL constraints, the paper’s stereographic parameterization transforms the worst-case minimization into a generalized Rayleigh quotient and obtains the optimum from a small symmetric eigenvalue problem.

Implementation notes

(1) Integration point: apply this layer to the final conservative-state tensor produced by a neural operator, learned finite-volume flux network, or neural ODE time-stepper. Let each predicted state be $\mathbf U_1=(D,\mathbf m,E)$ and obtain $\mathbf U_0$ from the previous valid state, a first-order numerical update, or a positivity-preserving primitive-variable fallback. Do not independently clamp $D$, $E$, and momentum; scale the complete residual toward $\mathbf U_0$. (2) Pseudocode: delta = U1-U0; theta=ones_like(D); q=norm(concat(D1-D0,m1-m0),dim=channel); s=concat(D1-D0,m1-m0)/(q+1e-12); g0=E0-s_D*D0-dot(s_m,m0); g1=E1-s_D*D1-dot(s_m,m1); bad=(g1 < eps); theta[bad]=clamp((g0[bad]-eps)/(g0[bad]-g1[bad]+1e-12),0,1); density_bad=(D1 < eps); theta[density_bad]=min(theta[density_bad],clamp((D0[density_bad]-eps)/(D0[density_bad]-D1[density_bad]+1e-12),0,1)); Usafe=U0+theta[...,None]*delta. Recompute primitive variables from Usafe and reject the sample if the EOS inversion fails. (3) The GQL identity and interpolation bound are computed analytically. The normal $s^\star$ is the exact minimizer for the Euclidean relativistic constraint. For an extended EOS or additional learned constraints, estimate the worst normal using a small sampled set on the unit sphere, or implement the paper’s stereographic parameterization and solve its $(d+1)\times(d+1)$ symmetric eigenproblem. Use detached $\theta$ initially for robust gradients, then compare straight-through and differentiable versions. (4) First experiment: train a small Fourier neural operator or ConvNet to advance 1D relativistic shock-tube states on a generated dataset, comparing an unconstrained output, primitive-variable parameterization, componentwise clipping, and this residual layer. Track invalid-state rate, rollout horizon before NaNs, shock error, and one-step and long-rollout accuracy. Success is zero invalid states at comparable error, fewer fallback activations than clipping, and materially longer stable rollouts without reducing one-step accuracy.

Verification

Failed on benchmark

Stage 1 · Toy mechanism gate: Passed ✓

Stage 2 · Mechanism transferred to benchmark: Not reproduced ✗

Stage 2 · Practical benchmark result: Inconclusive

Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works

Stage 1 — Mechanism check agent confidence 8/10

Built a NumPy GQL-style residual safety layer for U=(D,m,E), with an exact GQL identity check and robust scalar bisection to find the admissible interpolation boundary. Across two fixed seeds, the limiter produced 100% admissible states versus about 52–53% for the componentwise clipping control, while retaining about 0.67 of the learned residual; the identity error was below 2e-15. The claimed safety phenomenon is real in this toy setting, but the proposed delta-derived worst-normal shortcut was not safe here, so the MVP uses convex-margin bisection instead.

Agent confidence
8/10
Baseline
Componentwise D/E clipping: valid rate 0.52505 (seed 1234), 0.52385 (seed 2025); mean residual retention 0.9238.
Idea
GQL residual limiter: valid rate 1.0 for both seeds; mean theta/residual retention 0.67179 (seed 1234), 0.66942 (seed 2025); minimum admissibility margin approximately 1.0e-6.

Limitations: No neural operator, training loop, PDE shock-tube rollout, GPU implementation, EOS pressure inversion, runtime comparison, or multidimensional flux update was tested. The implementation uses numerical bisection rather than the paper's generalized eigenvalue/stereographic solver, and the clipping control only clips density and energy independently.

How to run: python3 gql_experiment.py

Stage 2 — Benchmark vs. tuned baseline (arXiv:2606.31992)

No significant difference vs. the tuned baseline (+14.5%, p=0.9216, wins 5 / 8 paired seeds).

Benchmark
Custom_relativistic_conservative_regression
Model
mlp_tiny
Paired seeds
8
Baseline mean
0.2555
Idea mean
0.2925
Effect (Δ)
0.037 (+14.5%; negative = idea better)
Wins
5 / 8 paired seeds
p-value
0.9216 (permutation test, 20 000 shuffles)
Smallest detectable effect
n/a
Mechanism
Not confirmed ✗
Practical effect
Inconclusive
Baseline tuning
swept over 3 configs
Limitations:

The custom task is a small synthetic conservative-state regression benchmark, not a full PDE shock-tube or neural-operator rollout. Bisection was used instead of the paper's generalized eigenvalue solver; EOS inversion, multidimensional flux updates, and large models were not tested.

How to run: python3 stage2_bench.py

Verdict computed by deterministic test code from paired-seed statistics — not by the language model.

Stage 2 — Benchmark latest Failed ✗

Agent confidence: 9/10

Built and evaluated an end-to-end GQL Safe Residual Layer with identical MLP architecture for baseline and idea systems, eight paired seeds, shared hyperparameter sweep, and permutation testing. The limiter reduced average invalid predictions from 13% raw to about 2%, but the idea had worse MSE (0.2925 vs 0.2555), paired delta +0.0370, and p=0.92165. Therefore the mechanism showed a safety signal but no benchmark win.

Baseline
MSE mean 0.255469, std 0.020298; best lr=0.006, epochs=12.
Comparison
delta_mean=+0.0369997, idea_wins=5/8, permutation p=0.92165, verdict=no significant win
Idea
MSE mean 0.292469, std 0.114345; best lr=0.006, epochs=12.

Benchmark result

No significant difference vs. the tuned baseline (+14.5%, p=0.9216, wins 5 / 8 paired seeds).

Benchmark
Custom_relativistic_conservative_regression
Model
mlp_tiny
Paired seeds
8
Baseline mean
0.2555
Idea mean
0.2925
Effect (Δ)
0.037 (+14.5%; negative = idea better)
Wins
5 / 8 paired seeds
p-value
0.9216 (permutation test, 20 000 shuffles)
Smallest detectable effect
n/a
Mechanism
Not confirmed ✗
Practical effect
Inconclusive
Baseline tuning
swept over 3 configs
Limitations:

The custom task is a small synthetic conservative-state regression benchmark, not a full PDE shock-tube or neural-operator rollout. Bisection was used instead of the paper's generalized eigenvalue solver; EOS inversion, multidimensional flux updates, and large models were not tested.

How to run: python3 stage2_bench.py

Artifacts

Implementation overview ⬇ Download all as ZIP 7 files · code, reports and structured results