FA-86996 / Physics integrator stability / Open access
Dropped-time statistic records the kept remainder · case 01
Telemetry reports tiny losses while the simulation actually discarded whole steps.
ROOT CAUSE
dropped accumulates keep instead of acc-keep.
VERIFIED REPAIR
Add only the discarded whole steps to the dropped total.
Unsuccessful approach: Adding the entire accumulator also counts the retained remainder.
Case contract
solve(frames, dt, max_frame, max_steps): game loop accumulator. Each frame delta is clamped to max_frame and added; run steps while acc >= dt up to max_steps; if a full dt still remains, whole multiples of dt are dropped (spiral-of-death guard). Return [steps per frame, acc/dt after last frame, dropped time].
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(frames, dt, max_frame, max_steps):
acc = 0.0
dropped = 0.0
steps = []
for delta in frames:
acc += min(delta, max_frame)
n = 0
while acc >= dt and n < max_steps:
acc -= dt
n += 1
if acc >= dt:
keep = acc % dt
dropped += keep
acc = keep
steps.append(n)
return [steps, acc / dt, dropped]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[0.0625, 0.046875, 0.625], 0.0625, 0.125, 1], [[1, 0, 1], 0.75, 0.0625]], [[[0.046875, 0.125, 0.0625, 0.0, 0.03125, 0.046875], 0.03125, 0.25, 5], [[1, 4, 2, 0, 1, 2], 0.0, 0.0]], [[[0.0625], 0.0625, 0.125, 3], [[1], 0.0, 0.0]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.125, 0.0625, 0.25], 0.0625, 0.25, 2], [[2, 1, 2], 0.0, 0.125]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.078125], 0.0625, 0.125, 5], [[1], 0.25, 0.0]], [[[0.25, 0.078125, 0.0625, 0.25, 0.125], 0.0625, 0.25, 1], [[1, 1, 1, 1, 1], 0.25, 0.4375]]], [[[[0.125, 0.046875, 0.625, 0.0, 0.0, 0.125], 0.03125, 0.25, 5], [[4, 1, 5, 0, 0, 4], 0.5, 0.09375]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.625, 0.0, 0.25, 0.015625], 0.03125, 0.125, 1], [[1, 0, 1, 0], 0.5, 0.1875]], [[[0.25], 0.0625, 0.25, 2], [[2], 0.0, 0.125]], [[[0.03125, 0.03125, 0.015625, 0.125, 0.0], 0.0625, 0.25, 3], [[0, 1, 0, 2, 0], 0.25, 0.0]], [[[0.03125, 0.015625, 0.03125, 0.25, 0.125, 0.078125], 0.03125, 0.25, 4], [[1, 0, 1, 4, 4, 3], 0.0, 0.125]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.015625, 0.25, 0.25], 0.03125, 0.125, 3], [[0, 3, 3], 0.5, 0.0625]]], [[[[0.078125, 0.0, 0.03125], 0.0625, 0.25, 3], [[1, 0, 0], 0.75, 0.0]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.078125, 0.25, 0.0625, 0.125], 0.0625, 0.25, 3], [[1, 3, 1, 2], 0.25, 0.0625]], [[[0.125, 0.03125], 0.0625, 0.25, 1], [[1, 0], 0.5, 0.0625]], [[[0.046875, 0.25, 0.625], 0.015625, 0.125, 5], [[3, 5, 5], 0.0, 0.09375]], [[[0.625, 0.0, 0.078125, 0.25, 0.0, 0.625], 0.0625, 0.25, 3], [[3, 0, 1, 3, 0, 3], 0.25, 0.1875]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.03125, 0.125, 0.0, 0.046875, 0.015625, 0.046875], 0.015625, 0.25, 3], [[2, 3, 0, 3, 1, 3], 0.0, 0.078125]]], [[[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.03125, 0.25, 0.125, 0.625, 0.125, 0.078125], 0.03125, 0.25, 4], [[1, 4, 4, 4, 4, 2], 0.5, 0.25]], [[[0.0, 0.015625, 0.125, 0.0, 0.25], 0.0625, 0.25, 1], [[0, 0, 1, 0, 1], 0.25, 0.25]], [[[0.625, 0.625], 0.0625, 0.25, 3], [[3, 3], 0.0, 0.125]], [[[0.078125], 0.0625, 0.25, 3], [[1], 0.25, 0.0]], [[[0.0, 0.25, 0.25, 0.125, 0.0625], 0.015625, 0.125, 4], [[0, 4, 4, 4, 4], 0.0, 0.1875]], [[[0.03125, 0.625, 0.078125], 0.0625, 0.125, 1], [[0, 1, 1], 0.75, 0.0625]]], [[[[0.078125, 0.078125, 0.625, 0.046875, 0.25], 0.03125, 0.25, 2], [[2, 2, 2, 1, 2], 0.5, 0.40625]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.03125, 0.03125], 0.03125, 0.25, 4], [[1, 1], 0.0, 0.0]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.046875, 0.625, 0.0, 0.625, 0.25], 0.015625, 0.25, 4], [[3, 4, 0, 4, 4], 0.0, 0.5625]], [[[0.25, 0.015625, 0.25, 0.625, 0.25, 0.015625], 0.0625, 0.25, 2], [[2, 0, 2, 2, 2, 0], 0.5, 0.5]], [[[0.0, 0.625, 0.015625, 0.25, 0.25], 0.015625, 0.125, 1], [[0, 1, 1, 1, 1], 0.0, 0.328125]], [[[0.625, 0.625, 0.25, 0.046875], 0.015625, 0.125, 3], [[3, 3, 3, 3], 0.0, 0.234375]]]]
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 | [[1, 0, 1], 0.75, 0.046875] | [[1, 0, 1], 0.75, 0.0625] | Failed |
| case 1 | [[1, 4, 2, 0, 1, 2], 0.0, 0.0] | [[1, 4, 2, 0, 1, 2], 0.0, 0.0] | Passed |
| case 2 | [[1], 0.0, 0.0] | [[1], 0.0, 0.0] | Passed |
| case 3 | [[0], 0.0, 0.0] | [[0], 0.0, 0.0] | Passed |
| case 4 | [[2, 1, 2], 0.0, 0.0] | [[2, 1, 2], 0.0, 0.125] | Failed |
| case 5 | [[1], 0.0, 0.0] | [[1], 0.0, 0.0] | Passed |
| case 6 | [[1], 0.25, 0.0] | [[1], 0.25, 0.0] | Passed |
| case 7 | [[1, 1, 1, 1, 1], 0.25, 0.03125] | [[1, 1, 1, 1, 1], 0.25, 0.4375] | Failed |
SHA-256 / dbd40ce919c9a8ed0422afdcd7a609b5182a1963e4543bef2c82378506ce76dc
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(frames, dt, max_frame, max_steps):
acc = 0.0
dropped = 0.0
steps = []
for delta in frames:
acc += min(delta, max_frame)
n = 0
while acc >= dt and n < max_steps:
acc -= dt
n += 1
if acc >= dt:
keep = acc % dt
dropped += acc
acc = keep
steps.append(n)
return [steps, acc / dt, dropped]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[0.0625, 0.046875, 0.625], 0.0625, 0.125, 1], [[1, 0, 1], 0.75, 0.0625]], [[[0.046875, 0.125, 0.0625, 0.0, 0.03125, 0.046875], 0.03125, 0.25, 5], [[1, 4, 2, 0, 1, 2], 0.0, 0.0]], [[[0.0625], 0.0625, 0.125, 3], [[1], 0.0, 0.0]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.125, 0.0625, 0.25], 0.0625, 0.25, 2], [[2, 1, 2], 0.0, 0.125]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.078125], 0.0625, 0.125, 5], [[1], 0.25, 0.0]], [[[0.25, 0.078125, 0.0625, 0.25, 0.125], 0.0625, 0.25, 1], [[1, 1, 1, 1, 1], 0.25, 0.4375]]], [[[[0.125, 0.046875, 0.625, 0.0, 0.0, 0.125], 0.03125, 0.25, 5], [[4, 1, 5, 0, 0, 4], 0.5, 0.09375]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.625, 0.0, 0.25, 0.015625], 0.03125, 0.125, 1], [[1, 0, 1, 0], 0.5, 0.1875]], [[[0.25], 0.0625, 0.25, 2], [[2], 0.0, 0.125]], [[[0.03125, 0.03125, 0.015625, 0.125, 0.0], 0.0625, 0.25, 3], [[0, 1, 0, 2, 0], 0.25, 0.0]], [[[0.03125, 0.015625, 0.03125, 0.25, 0.125, 0.078125], 0.03125, 0.25, 4], [[1, 0, 1, 4, 4, 3], 0.0, 0.125]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.015625, 0.25, 0.25], 0.03125, 0.125, 3], [[0, 3, 3], 0.5, 0.0625]]], [[[[0.078125, 0.0, 0.03125], 0.0625, 0.25, 3], [[1, 0, 0], 0.75, 0.0]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.078125, 0.25, 0.0625, 0.125], 0.0625, 0.25, 3], [[1, 3, 1, 2], 0.25, 0.0625]], [[[0.125, 0.03125], 0.0625, 0.25, 1], [[1, 0], 0.5, 0.0625]], [[[0.046875, 0.25, 0.625], 0.015625, 0.125, 5], [[3, 5, 5], 0.0, 0.09375]], [[[0.625, 0.0, 0.078125, 0.25, 0.0, 0.625], 0.0625, 0.25, 3], [[3, 0, 1, 3, 0, 3], 0.25, 0.1875]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.03125, 0.125, 0.0, 0.046875, 0.015625, 0.046875], 0.015625, 0.25, 3], [[2, 3, 0, 3, 1, 3], 0.0, 0.078125]]], [[[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.03125, 0.25, 0.125, 0.625, 0.125, 0.078125], 0.03125, 0.25, 4], [[1, 4, 4, 4, 4, 2], 0.5, 0.25]], [[[0.0, 0.015625, 0.125, 0.0, 0.25], 0.0625, 0.25, 1], [[0, 0, 1, 0, 1], 0.25, 0.25]], [[[0.625, 0.625], 0.0625, 0.25, 3], [[3, 3], 0.0, 0.125]], [[[0.078125], 0.0625, 0.25, 3], [[1], 0.25, 0.0]], [[[0.0, 0.25, 0.25, 0.125, 0.0625], 0.015625, 0.125, 4], [[0, 4, 4, 4, 4], 0.0, 0.1875]], [[[0.03125, 0.625, 0.078125], 0.0625, 0.125, 1], [[0, 1, 1], 0.75, 0.0625]]], [[[[0.078125, 0.078125, 0.625, 0.046875, 0.25], 0.03125, 0.25, 2], [[2, 2, 2, 1, 2], 0.5, 0.40625]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.03125, 0.03125], 0.03125, 0.25, 4], [[1, 1], 0.0, 0.0]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.046875, 0.625, 0.0, 0.625, 0.25], 0.015625, 0.25, 4], [[3, 4, 0, 4, 4], 0.0, 0.5625]], [[[0.25, 0.015625, 0.25, 0.625, 0.25, 0.015625], 0.0625, 0.25, 2], [[2, 0, 2, 2, 2, 0], 0.5, 0.5]], [[[0.0, 0.625, 0.015625, 0.25, 0.25], 0.015625, 0.125, 1], [[0, 1, 1, 1, 1], 0.0, 0.328125]], [[[0.625, 0.625, 0.25, 0.046875], 0.015625, 0.125, 3], [[3, 3, 3, 3], 0.0, 0.234375]]]]
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 | [[1, 0, 1], 0.75, 0.109375] | [[1, 0, 1], 0.75, 0.0625] | Failed |
| case 1 | [[1, 4, 2, 0, 1, 2], 0.0, 0.0] | [[1, 4, 2, 0, 1, 2], 0.0, 0.0] | Passed |
| case 2 | [[1], 0.0, 0.0] | [[1], 0.0, 0.0] | Passed |
| case 3 | [[0], 0.0, 0.0] | [[0], 0.0, 0.0] | Passed |
| case 4 | [[2, 1, 2], 0.0, 0.125] | [[2, 1, 2], 0.0, 0.125] | Passed |
| case 5 | [[1], 0.0, 0.0] | [[1], 0.0, 0.0] | Passed |
| case 6 | [[1], 0.25, 0.0] | [[1], 0.25, 0.0] | Passed |
| case 7 | [[1, 1, 1, 1, 1], 0.25, 0.46875] | [[1, 1, 1, 1, 1], 0.25, 0.4375] | Failed |
SHA-256 / 907f7801df572efa947ec4a44a8990c4e0aeb560eb9b2ef3c382a73709c88ba6
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(frames, dt, max_frame, max_steps):
acc = 0.0
dropped = 0.0
steps = []
for delta in frames:
acc += min(delta, max_frame)
n = 0
while acc >= dt and n < max_steps:
acc -= dt
n += 1
if acc >= dt:
keep = acc % dt
dropped += acc - keep
acc = keep
steps.append(n)
return [steps, acc / dt, dropped]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[[0.0625, 0.046875, 0.625], 0.0625, 0.125, 1], [[1, 0, 1], 0.75, 0.0625]], [[[0.046875, 0.125, 0.0625, 0.0, 0.03125, 0.046875], 0.03125, 0.25, 5], [[1, 4, 2, 0, 1, 2], 0.0, 0.0]], [[[0.0625], 0.0625, 0.125, 3], [[1], 0.0, 0.0]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.125, 0.0625, 0.25], 0.0625, 0.25, 2], [[2, 1, 2], 0.0, 0.125]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.078125], 0.0625, 0.125, 5], [[1], 0.25, 0.0]], [[[0.25, 0.078125, 0.0625, 0.25, 0.125], 0.0625, 0.25, 1], [[1, 1, 1, 1, 1], 0.25, 0.4375]]], [[[[0.125, 0.046875, 0.625, 0.0, 0.0, 0.125], 0.03125, 0.25, 5], [[4, 1, 5, 0, 0, 4], 0.5, 0.09375]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.625, 0.0, 0.25, 0.015625], 0.03125, 0.125, 1], [[1, 0, 1, 0], 0.5, 0.1875]], [[[0.25], 0.0625, 0.25, 2], [[2], 0.0, 0.125]], [[[0.03125, 0.03125, 0.015625, 0.125, 0.0], 0.0625, 0.25, 3], [[0, 1, 0, 2, 0], 0.25, 0.0]], [[[0.03125, 0.015625, 0.03125, 0.25, 0.125, 0.078125], 0.03125, 0.25, 4], [[1, 0, 1, 4, 4, 3], 0.0, 0.125]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.015625, 0.25, 0.25], 0.03125, 0.125, 3], [[0, 3, 3], 0.5, 0.0625]]], [[[[0.078125, 0.0, 0.03125], 0.0625, 0.25, 3], [[1, 0, 0], 0.75, 0.0]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.078125, 0.25, 0.0625, 0.125], 0.0625, 0.25, 3], [[1, 3, 1, 2], 0.25, 0.0625]], [[[0.125, 0.03125], 0.0625, 0.25, 1], [[1, 0], 0.5, 0.0625]], [[[0.046875, 0.25, 0.625], 0.015625, 0.125, 5], [[3, 5, 5], 0.0, 0.09375]], [[[0.625, 0.0, 0.078125, 0.25, 0.0, 0.625], 0.0625, 0.25, 3], [[3, 0, 1, 3, 0, 3], 0.25, 0.1875]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.03125, 0.125, 0.0, 0.046875, 0.015625, 0.046875], 0.015625, 0.25, 3], [[2, 3, 0, 3, 1, 3], 0.0, 0.078125]]], [[[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.03125, 0.25, 0.125, 0.625, 0.125, 0.078125], 0.03125, 0.25, 4], [[1, 4, 4, 4, 4, 2], 0.5, 0.25]], [[[0.0, 0.015625, 0.125, 0.0, 0.25], 0.0625, 0.25, 1], [[0, 0, 1, 0, 1], 0.25, 0.25]], [[[0.625, 0.625], 0.0625, 0.25, 3], [[3, 3], 0.0, 0.125]], [[[0.078125], 0.0625, 0.25, 3], [[1], 0.25, 0.0]], [[[0.0, 0.25, 0.25, 0.125, 0.0625], 0.015625, 0.125, 4], [[0, 4, 4, 4, 4], 0.0, 0.1875]], [[[0.03125, 0.625, 0.078125], 0.0625, 0.125, 1], [[0, 1, 1], 0.75, 0.0625]]], [[[[0.078125, 0.078125, 0.625, 0.046875, 0.25], 0.03125, 0.25, 2], [[2, 2, 2, 1, 2], 0.5, 0.40625]], [[[0.015625], 0.015625, 0.25, 2], [[1], 0.0, 0.0]], [[[0.03125, 0.03125], 0.03125, 0.25, 4], [[1, 1], 0.0, 0.0]], [[[0.0], 0.015625, 0.25, 2], [[0], 0.0, 0.0]], [[[0.046875, 0.625, 0.0, 0.625, 0.25], 0.015625, 0.25, 4], [[3, 4, 0, 4, 4], 0.0, 0.5625]], [[[0.25, 0.015625, 0.25, 0.625, 0.25, 0.015625], 0.0625, 0.25, 2], [[2, 0, 2, 2, 2, 0], 0.5, 0.5]], [[[0.0, 0.625, 0.015625, 0.25, 0.25], 0.015625, 0.125, 1], [[0, 1, 1, 1, 1], 0.0, 0.328125]], [[[0.625, 0.625, 0.25, 0.046875], 0.015625, 0.125, 3], [[3, 3, 3, 3], 0.0, 0.234375]]]]
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 | [[1, 0, 1], 0.75, 0.0625] | [[1, 0, 1], 0.75, 0.0625] | Passed |
| case 1 | [[1, 4, 2, 0, 1, 2], 0.0, 0.0] | [[1, 4, 2, 0, 1, 2], 0.0, 0.0] | Passed |
| case 2 | [[1], 0.0, 0.0] | [[1], 0.0, 0.0] | Passed |
| case 3 | [[0], 0.0, 0.0] | [[0], 0.0, 0.0] | Passed |
| case 4 | [[2, 1, 2], 0.0, 0.125] | [[2, 1, 2], 0.0, 0.125] | Passed |
| case 5 | [[1], 0.0, 0.0] | [[1], 0.0, 0.0] | Passed |
| case 6 | [[1], 0.25, 0.0] | [[1], 0.25, 0.0] | Passed |
| case 7 | [[1, 1, 1, 1, 1], 0.25, 0.4375] | [[1, 1, 1, 1, 1], 0.25, 0.4375] | Passed |
SHA-256 / fce1c3656d6d057ab2dab64d3c6fd24ffe637c4f8b1a06494a6361f3ec67fcd9
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:54.709020+00:00.
Case digest / 371129331a0461cf9c07dc5d0b0b76239270c03ed90d9afdce3e78cba42fb5de