Certified Sim-to-Real Gap Detection with A Posteriori Error Bounds

Engineers increasingly replace slow physics simulators with fast learned surrogates trained entirely on simulator output. When a surrogate's prediction disagrees with a real measurement, there are two possible causes. The surrogate may be a poor copy of the simulator, or the simulator may be a poor copy of reality. Hold-out errors, statistical distances, and uncertainty estimates cannot tell these apart, so practitioners cannot say whether to retrain the network or fix the physics.

We propose using a certified a posteriori error bound to separate the two causes. Such a bound is a guaranteed, computable upper limit on how far the surrogate is from the exact simulator solution for this particular input. Subtracting it from the observed mismatch gives a lower bound on the simulator's own error. That lower bound holds for every input, including inputs far outside the training distribution. A positive value is therefore a proof, up to a stated noise level, that the synthetic training data came from wrong physics in that regime. Mapped across the parameter space, these values show where synthetic data can stand in for real data and where it cannot.

Core Claim

Let $u$ be the real field, $u_{\text{sim}}$ the exact solution of the simulator's equations, and $u_N$ the surrogate's prediction. Let $\Delta_N$ be a certified bound with $\|u_{\text{sim}} - u_N\| \le \Delta_N$. Let the measurements be $y = Hu + \eta$, where $H$ is the sensor operator and $\eta$ is noise bounded by $\|\eta\| \le \varepsilon$ with high probability. The triangle inequality then gives

$$\|H(u - u_{\text{sim}})\| \;\ge\; \|y - Hu_N\| - \|H\|\,\Delta_N - \varepsilon .$$

The right-hand side is computable at surrogate cost. Whenever it is positive, the simulator, not the surrogate, is provably wrong at that input.

The inequality itself is elementary. Its usefulness depends on one empirical fact, which is the open question this proposal answers. The detector only has power if $\Delta_N$ is tight and stays valid off-distribution. A bound ten times larger than the true error, like the worst-case Koopman bounds on cavity flow in Trustworthy Koopman Operator Learning, would bury most real gaps. Certificates whose ratio of true error to bound sits near one, such as the Reduced Basis Neural Operator, could expose them.

Relation to Prior Work

Two papers supply the certificate, and we reuse their methods rather than compete with them.

Variationally correct operator learning builds the Reduced Basis Neural Operator (RBNO). It rewrites second-order elliptic equations as first-order systems so that the training residual becomes provably equivalent to the solution error. It predicts coefficients in a basis built by principal-component decomposition of simulator snapshots. It reports that true error divided by the square root of the residual loss clusters tightly around 1.0 on Darcy flow.

Neural functional a posteriori error estimates trains networks on "Astral loss", an upper bound on error derived from the PDE's functional structure and computed through an auxiliary flux field. It reports that this was the only loss in its comparison that consistently upper-bounded the error.

Both papers certify a surrogate only against the simulator's own equations, on clean synthetic problems. Neither asks what the bound says when the reference physics is wrong. We add that question.

Two empirical studies of synthetic data motivate the work.

Both judge synthetic data only through aggregate downstream metrics. Neither offers any per-input guarantee.

PDEBench constrains our metric choice. It shows that aggregate RMSE hides violations of conservation and boundary conditions, so we report certified quantities in the norms the PDE actually controls rather than in RMSE.

The Koopman paper both motivates and constrains the design. Its gap between bound and true error tells us to restrict the core study to settings where tight certificates exist. Its Gaussian-process estimate of expected error is a natural uncertified competitor.

Research Program

We will build the detector on two certified surrogate families: RBNO and Astral-loss networks. The test problems are 2D Darcy flow with lognormal permeability, as used in RBNO and in Neural Operator, and parametric convection-diffusion including the L-shaped domain from the Astral paper. Each surrogate is trained only on output from a nominal simulator.

"Reality" is played by a hidden simulator that adds physics the nominal one lacks. For Darcy, this is anisotropic permeability or a nonlinear Forchheimer drag term. For convection-diffusion, it is a missing reaction term or a mis-specified boundary flux. Each missing term has a dial controlling its strength. Measurements come from sparse point sensors and from boundary-flux sensors, with Gaussian noise whose high-probability norm bound sets $\varepsilon$. With this twin setup, the true simulator error $\|H(u - u_{\text{sim}})\|$ is known exactly, so we can check every certified claim.

The analysis has three parts.

  1. Validity. We check that the lower bound never exceeds the true discrepancy, apart from the stated noise failure probability. This check covers inputs drawn far from the training distribution of permeability fields and parameters.
  2. Power. We measure how often a positive lower bound appears as a function of gap strength, sensor density, and surrogate tightness. The tightness ratio is $\Delta_N$ divided by the true surrogate error.
  3. Substitutability map. We aggregate per-input certified gaps over parameter space into a map of regions where synthetic data is provably inadequate. We then test whether swapping real data in only within flagged regions recovers downstream accuracy more efficiently than swapping uniformly. This turns the Chang et al. notion of substitutability into a per-region, certified statement.

As an exploratory extension to dynamics, we take Koopman bounds on the real Pluto–Charon ephemeris used in the Koopman paper. The nominal model there is a simplified dynamical system missing small-moon perturbations. We expect weak power because of the known pessimism of those bounds, and we will report that honestly.

Baselines

Naive threshold (do-nothing reference). This flags a simulator gap whenever the raw mismatch $\|y - Hu_N\|$ exceeds the noise level. It is what a practitioner does today, and it attributes all surrogate error to the physics. We run it on the identical sensor data and noise bound. Beating it means a large reduction in false alarms when the inputs shift but the physics is correct, at matched detection rate on true physics gaps.

Split conformal prediction on synthetic calibration data. This is the strongest competitor. It replaces $\Delta_N$ with a distribution-free quantile of surrogate error estimated on held-out simulator samples. It needs no PDE structure and is often tight in-distribution. It gets the same surrogate, the same calibration budget of simulator solves as RBNO's offline phase, and the same target error rate.

Gaussian-process expected-error estimator. This follows the Koopman paper. It is fitted with the same simulator budget.

Input-drift detectors from the concept-drift literature. These are surveyed in One or two things we know about concept drift. They flag shifts in the inputs and ignore the physics entirely.

Uncertified-residual ablation. This isolates the key ingredient. We keep the pipeline but substitute a plain $L^2$ residual from an FNO, or a PINN-style residual, for the certified $\Delta_N$. This tests whether certification itself matters or whether any residual signal suffices.

Expensive oracle. This runs the full simulator at every deployment input, which gives the exact decomposition. It is an upper reference, not a competitor. Our method succeeds if it approaches the oracle's detection curve at surrogate cost.

Reported numbers. The relevant figures in the file concern certificate tightness, not gap detection. RBNO reports a true-error-to-root-residual ratio clustering around 1.0 on Darcy. The Koopman paper reports bounds about 10× the true error on cavity flow at Reynolds number 7500. No reported result was found on Lacuna for sim-to-real gap detection with any of these baselines, so all detection comparisons are new measurements.

The certified method beats conformal prediction if it meets two conditions. First, its false-alarm rate stays at the nominal level under strong input shift, where we expect conformal's to rise. Second, its detection power is within a small margin of conformal's in-distribution.

Why not just…?

Why not just use conformal prediction? This is the real threat. In-distribution, conformal quantiles may be tighter than RBNO or Astral bounds, and it could win outright there. Its guarantee rests on the deployment input resembling the calibration data. Sim-to-real deployment is exactly where inputs move into unvisited regimes and surrogate error grows. Calibrated conformal intervals would then misread surrogate extrapolation error as broken physics. Our decisive experiment separates these effects: it shifts inputs with correct physics, and separately alters physics with in-distribution inputs. If conformal's false alarms do not rise under input shift, the certified approach loses its main advantage, and we will say so. A hybrid, using the certificate off-distribution and conformal intervals in-distribution, is the fallback.

Why not just run the high-fidelity solver at the measured inputs? For a handful of offline audits, this is correct, and it serves as our oracle. It fails in two cases: continuous monitoring, and sweeping a substitutability map over thousands of parameter settings, where each solve is the expense the surrogate was built to avoid. PDEBench reports 3D solves taking about 60 seconds against 0.14 seconds for learned inference. We measure the cost at which the certified detector matches the oracle's flags.

Why not just compare synthetic and real data with a statistical distance or an input-drift test? These detect that the data changed, not that the physics is wrong. A correctly simulated new regime looks the same to them as a mis-modeled old one. PDEBench and the RBNO paper both show that distance-style metrics in $L^2$ miss violations in derivatives and fluxes. The drift-detector baseline is evaluated on exactly the scenario where the inputs shift but the physics stays correct.

Why not just use a PDE residual penalty, as physics-informed networks do? The RBNO paper argues that second-order residuals in $L^2$ are not equivalent to the solution error. The Astral paper finds that standard residual losses failed to upper-bound the error. Without a guaranteed upper bound, the subtraction in our core inequality yields no lower bound at all. The uncertified-residual ablation measures how often that produces invalid claims.

Decisive Checks

Three results would make or break the proposal. First, the certified lower bound must hold on all tested inputs, beyond the noise failure probability, including strongly out-of-distribution permeability fields. Second, under input shift with correct physics, false alarms must stay near the nominal level for the certified method while rising for the conformal and naive baselines. Third, detection power must track certificate tightness: high for RBNO, lower for Astral if its bounds are looser, and near zero for the Koopman setting. That ordering would confirm that tight a posteriori bounds are the ingredient that makes certified auditing of synthetic data possible.