FA-87046 / Physics integrator stability / Open access
Rejected steps still advance simulation time · case 01
The integrator reaches t_end early with the state lagging behind.
ROOT CAUSE
The reject branch increments t by h.
THE FAILURE
The reject branch increments t by h.
Unsuccessful approach: Adopting the rejected Heun state (without time) corrupts y instead.
Case contract
solve(y0, lam, s, t_end, dt0, tol): integrate y'=-lam*y+s to t_end with the embedded Euler/Heun pair. err=|y_heun-y_euler|/max(1,|y|) at the step start. Accept if err<=tol (propagate Heun); grow h by min(2, 0.9*(tol/err)^(1/2)) (2 when err=0); on reject shrink by max(0.2, 0.9*(tol/err)^(1/2)). Steps are clipped to t_end; at most 500 attempts. Return [y, accepted, rejected, last h] rounded.
Why this case matters
Game and robotics physics loops depend on integrator update order, step control and stabilization terms; a wrong decision point turns a stable simulation into drifting or exploding motion.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(y0, lam, s, t_end, dt0, tol):
def f(y):
return -lam * y + s
t, y, h = 0.0, y0, dt0
acc = rej = 0
while t < t_end - 1e-12 and acc + rej < 500:
h = min(h, t_end - t)
k1 = f(y)
k2 = f(y + h * k1)
y_low = y + h * k1
y_high = y + h / 2 * (k1 + k2)
err = abs(y_high - y_low) / max(1.0, abs(y))
if err <= tol:
t += h
y = y_high
acc += 1
grow = 2.0 if err == 0 else min(2.0, 0.9 * (tol / err) ** 0.5)
h = h * grow
else:
rej += 1
t += h
h = h * max(0.2, 0.9 * (tol / err) ** 0.5)
return [round(y, 6), acc, rej, round(h, 6)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[-0.473, 0.404, -0.399, 0.5, 0.05, 0.0001], [-0.567122, 11, 1, 0.048132]], [[2.127, 2.453, -0.788, 0.5, 0.1, 0.01], [0.399031, 11, 1, 0.040862]], [[1.761, 1.735, -1.932, 1.5, 0.05, 0.01], [-0.898458, 21, 0, 0.089026]], [[1.121, 4.954, -0.6, 0.5, 0.3, 0.01], [-0.014719, 14, 2, 0.068659]], [[-0.678, 2.724, 0.55, 1.5, 0.05, 0.01], [0.185448, 16, 0, 0.164424]], [[1.139, 2.427, 1.934, 2.0, 0.1, 0.0001], [0.799559, 87, 2, 0.085016]], [[1.455, 0.0, 0.495, 1.5, 0.3, 0.001], [2.1975, 3, 0, 1.2]], [[-0.733, 3.2, 1.948, 1.0, 0.3, 0.01], [0.552207, 17, 2, 0.145814]]], [[[1.227, 3.342, -1.923, 1.5, 0.3, 0.001], [-0.563203, 65, 3, 0.069758]], [[-2.326, 4.308, 0.769, 2.0, 0.7, 0.0001], [0.178032, 236, 4, 0.069889]], [[1.164, 0.0, 0.608, 0.5, 0.05, 0.0001], [1.468, 4, 0, 0.3]], [[2.239, 1.802, 1.61, 2.0, 0.3, 0.01], [0.932171, 15, 1, 0.302135]], [[-2.712, 3.277, 1.673, 1.0, 0.05, 0.01], [0.386621, 23, 1, 0.024826]], [[-0.907, 0.0, 0.08, 2.0, 0.3, 0.0001], [-0.747, 3, 0, 2.2]], [[-2.921, 0.388, -0.833, 2.0, 0.1, 0.01], [-2.505775, 5, 0, 0.782558]], [[2.279, 0.391, 1.095, 2.0, 0.3, 0.001], [2.561598, 9, 1, 0.024918]]], [[[-2.296, 0.0, -1.609, 1.5, 0.3, 0.001], [-4.7095, 3, 0, 1.2]], [[0.886, 0.0, -0.594, 2.0, 0.1, 0.0001], [-0.302, 5, 0, 1.0]], [[-0.141, 3.366, 0.739, 1.0, 0.7, 0.0001], [0.207075, 80, 3, 0.015925]], [[-1.73, 3.371, -0.993, 2.0, 0.05, 0.0001], [-0.296289, 179, 2, 0.081261]], [[-1.619, 0.0, 0.292, 1.0, 0.1, 0.0001], [-1.327, 4, 0, 0.6]], [[-2.368, 1.168, -1.559, 1.0, 0.3, 0.001], [-1.656414, 17, 2, 0.075628]], [[-0.594, 1.289, 1.387, 1.0, 0.05, 0.001], [0.615674, 32, 1, 0.037933]], [[-1.42, 0.295, -0.767, 1.5, 0.1, 0.0001], [-1.841919, 28, 1, 0.003961]]], [[[1.914, 2.384, 1.376, 2.0, 0.7, 0.0001], [0.588566, 157, 3, 0.015462]], [[-1.306, 2.198, -1.371, 0.5, 0.7, 0.01], [-0.852711, 6, 2, 0.111407]], [[1.53, 2.301, -1.863, 0.5, 0.7, 0.0001], [-0.069181, 103, 3, 0.006397]], [[-1.717, 4.95, -0.375, 0.5, 0.3, 0.001], [-0.214121, 45, 3, 0.020868]], [[-1.664, 0.608, -1.437, 1.0, 0.05, 0.01], [-1.981366, 5, 0, 0.426033]], [[0.741, 0.0, 1.287, 1.5, 0.1, 0.001], [2.6715, 4, 0, 1.6]], [[-1.257, 0.0, -1.478, 0.5, 0.1, 0.01], [-1.996, 3, 0, 0.4]], [[-1.416, 3.263, -0.863, 0.5, 0.05, 0.0001], [-0.489781, 93, 2, 0.002341]]], [[[-2.168, 3.971, -0.843, 1.5, 0.1, 0.01], [-0.218747, 23, 1, 0.239273]], [[2.057, 4.405, 0.797, 1.5, 0.1, 0.01], [0.185265, 23, 1, 0.310434]], [[1.902, 0.0, 1.399, 0.5, 0.1, 0.001], [2.6015, 3, 0, 0.4]], [[-1.507, 4.389, 1.938, 2.0, 0.3, 0.01], [0.439365, 26, 2, 0.506375]], [[-0.195, 0.0, -1.909, 2.0, 0.1, 0.001], [-4.013, 5, 0, 1.0]], [[-2.329, 2.398, 0.58, 2.0, 0.3, 0.001], [0.220401, 71, 2, 0.072966]], [[-2.606, 3.176, -1.717, 1.5, 0.1, 0.001], [-0.55846, 60, 2, 0.071009]], [[-1.462, 0.388, 0.689, 0.5, 0.05, 0.001], [-0.891098, 8, 0, 0.062929]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("case %d" % i, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| case 0 | [-0.558543, 10, 1, 0.047675] | [-0.567122, 11, 1, 0.048132] | Failed |
| case 1 | [0.598609, 9, 1, 0.045441] | [0.399031, 11, 1, 0.040862] | Failed |
| case 2 | [-0.898458, 21, 0, 0.089026] | [-0.898458, 21, 0, 0.089026] | Passed |
| case 3 | [0.500858, 6, 2, 0.026127] | [-0.014719, 14, 2, 0.068659] | Failed |
| case 4 | [0.185448, 16, 0, 0.164424] | [0.185448, 16, 0, 0.164424] | Passed |
| case 5 | [0.800462, 86, 2, 0.004674] | [0.799559, 87, 2, 0.085016] | Failed |
| case 6 | [2.1975, 3, 0, 1.2] | [2.1975, 3, 0, 1.2] | Passed |
| case 7 | [0.433606, 14, 2, 0.001123] | [0.552207, 17, 2, 0.145814] | Failed |
SHA-256 / ac5ad84758a76b61c8f4e9ee7d286cf5306cd4cc1f21845bc86ed4cc8fff29fb
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(y0, lam, s, t_end, dt0, tol):
def f(y):
return -lam * y + s
t, y, h = 0.0, y0, dt0
acc = rej = 0
while t < t_end - 1e-12 and acc + rej < 500:
h = min(h, t_end - t)
k1 = f(y)
k2 = f(y + h * k1)
y_low = y + h * k1
y_high = y + h / 2 * (k1 + k2)
err = abs(y_high - y_low) / max(1.0, abs(y))
if err <= tol:
t += h
y = y_high
acc += 1
grow = 2.0 if err == 0 else min(2.0, 0.9 * (tol / err) ** 0.5)
h = h * grow
else:
rej += 1
y = y_high
h = h * max(0.2, 0.9 * (tol / err) ** 0.5)
return [round(y, 6), acc, rej, round(h, 6)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[-0.473, 0.404, -0.399, 0.5, 0.05, 0.0001], [-0.567122, 11, 1, 0.048132]], [[2.127, 2.453, -0.788, 0.5, 0.1, 0.01], [0.399031, 11, 1, 0.040862]], [[1.761, 1.735, -1.932, 1.5, 0.05, 0.01], [-0.898458, 21, 0, 0.089026]], [[1.121, 4.954, -0.6, 0.5, 0.3, 0.01], [-0.014719, 14, 2, 0.068659]], [[-0.678, 2.724, 0.55, 1.5, 0.05, 0.01], [0.185448, 16, 0, 0.164424]], [[1.139, 2.427, 1.934, 2.0, 0.1, 0.0001], [0.799559, 87, 2, 0.085016]], [[1.455, 0.0, 0.495, 1.5, 0.3, 0.001], [2.1975, 3, 0, 1.2]], [[-0.733, 3.2, 1.948, 1.0, 0.3, 0.01], [0.552207, 17, 2, 0.145814]]], [[[1.227, 3.342, -1.923, 1.5, 0.3, 0.001], [-0.563203, 65, 3, 0.069758]], [[-2.326, 4.308, 0.769, 2.0, 0.7, 0.0001], [0.178032, 236, 4, 0.069889]], [[1.164, 0.0, 0.608, 0.5, 0.05, 0.0001], [1.468, 4, 0, 0.3]], [[2.239, 1.802, 1.61, 2.0, 0.3, 0.01], [0.932171, 15, 1, 0.302135]], [[-2.712, 3.277, 1.673, 1.0, 0.05, 0.01], [0.386621, 23, 1, 0.024826]], [[-0.907, 0.0, 0.08, 2.0, 0.3, 0.0001], [-0.747, 3, 0, 2.2]], [[-2.921, 0.388, -0.833, 2.0, 0.1, 0.01], [-2.505775, 5, 0, 0.782558]], [[2.279, 0.391, 1.095, 2.0, 0.3, 0.001], [2.561598, 9, 1, 0.024918]]], [[[-2.296, 0.0, -1.609, 1.5, 0.3, 0.001], [-4.7095, 3, 0, 1.2]], [[0.886, 0.0, -0.594, 2.0, 0.1, 0.0001], [-0.302, 5, 0, 1.0]], [[-0.141, 3.366, 0.739, 1.0, 0.7, 0.0001], [0.207075, 80, 3, 0.015925]], [[-1.73, 3.371, -0.993, 2.0, 0.05, 0.0001], [-0.296289, 179, 2, 0.081261]], [[-1.619, 0.0, 0.292, 1.0, 0.1, 0.0001], [-1.327, 4, 0, 0.6]], [[-2.368, 1.168, -1.559, 1.0, 0.3, 0.001], [-1.656414, 17, 2, 0.075628]], [[-0.594, 1.289, 1.387, 1.0, 0.05, 0.001], [0.615674, 32, 1, 0.037933]], [[-1.42, 0.295, -0.767, 1.5, 0.1, 0.0001], [-1.841919, 28, 1, 0.003961]]], [[[1.914, 2.384, 1.376, 2.0, 0.7, 0.0001], [0.588566, 157, 3, 0.015462]], [[-1.306, 2.198, -1.371, 0.5, 0.7, 0.01], [-0.852711, 6, 2, 0.111407]], [[1.53, 2.301, -1.863, 0.5, 0.7, 0.0001], [-0.069181, 103, 3, 0.006397]], [[-1.717, 4.95, -0.375, 0.5, 0.3, 0.001], [-0.214121, 45, 3, 0.020868]], [[-1.664, 0.608, -1.437, 1.0, 0.05, 0.01], [-1.981366, 5, 0, 0.426033]], [[0.741, 0.0, 1.287, 1.5, 0.1, 0.001], [2.6715, 4, 0, 1.6]], [[-1.257, 0.0, -1.478, 0.5, 0.1, 0.01], [-1.996, 3, 0, 0.4]], [[-1.416, 3.263, -0.863, 0.5, 0.05, 0.0001], [-0.489781, 93, 2, 0.002341]]], [[[-2.168, 3.971, -0.843, 1.5, 0.1, 0.01], [-0.218747, 23, 1, 0.239273]], [[2.057, 4.405, 0.797, 1.5, 0.1, 0.01], [0.185265, 23, 1, 0.310434]], [[1.902, 0.0, 1.399, 0.5, 0.1, 0.001], [2.6015, 3, 0, 0.4]], [[-1.507, 4.389, 1.938, 2.0, 0.3, 0.01], [0.439365, 26, 2, 0.506375]], [[-0.195, 0.0, -1.909, 2.0, 0.1, 0.001], [-4.013, 5, 0, 1.0]], [[-2.329, 2.398, 0.58, 2.0, 0.3, 0.001], [0.220401, 71, 2, 0.072966]], [[-2.606, 3.176, -1.717, 1.5, 0.1, 0.001], [-0.55846, 60, 2, 0.071009]], [[-1.462, 0.388, 0.689, 0.5, 0.05, 0.001], [-0.891098, 8, 0, 0.062929]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("case %d" % i, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| case 0 | [-0.575531, 11, 1, 0.048663] | [-0.567122, 11, 1, 0.048132] | Failed |
| case 1 | [0.244277, 11, 1, 0.000778] | [0.399031, 11, 1, 0.040862] | Failed |
| case 2 | [-0.898458, 21, 0, 0.089026] | [-0.898458, 21, 0, 0.089026] | Passed |
| case 3 | [-0.071013, 11, 2, 0.019284] | [-0.014719, 14, 2, 0.068659] | Failed |
| case 4 | [0.185448, 16, 0, 0.164424] | [0.185448, 16, 0, 0.164424] | Passed |
| case 5 | [0.798891, 76, 2, 0.105902] | [0.799559, 87, 2, 0.085016] | Failed |
| case 6 | [2.1975, 3, 0, 1.2] | [2.1975, 3, 0, 1.2] | Passed |
| case 7 | [0.584423, 12, 2, 0.131686] | [0.552207, 17, 2, 0.145814] | Failed |
SHA-256 / abee516b3d8124d7366277c378ce22ec661f8471f7279fe3ea9161332c37bcba
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
A deterministic bounded teaching model with stipulated toy conventions and rounded float output; not a production physics engine or a proof of numerical stability. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:50:55.145919+00:00.
Case digest / 1a7e53ef522fabdd3790867a2ddfedeb1311e3a94bc3faf21d61596e37c6f546