FAILURE MAP
← Case archive

FA-87196 / Physics integrator stability / Open access

Positional bias and restitution bounce are summed · case 01

Penetrating bouncy contacts launch with excess energy.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

target = bias + bounce.

THE FAILURE

target = bias + bounce.

Unsuccessful approach: Preferring bounce whenever it is nonzero ignores a larger positional bias.

Case contract

solve(vn, depth, ima, imb, beta, slop, dt, e, e_thresh): one normal contact, vn<0 approaching. bias=(beta/dt)*(depth-slop) if positive; bounce=-e*vn when vn<-e_thresh. Target separating speed is max(bias,bounce); impulse=(target-vn)/(ima+imb) clamped at 0 (no pulling). Zero summed inverse mass gives [0, vn]. Return [impulse, post velocity] rounded to 6.

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(vn, depth, ima, imb, beta, slop, dt, e, e_thresh):
    w = ima + imb
    if w == 0:
        return [0.0, round(vn, 6)]
    pen = depth - slop
    bias = beta / dt * pen if pen > 0 else 0.0
    bounce = -e * vn if vn < -e_thresh else 0.0
    target = bias + bounce
    lam = (target - vn) / w
    if lam < 0:
        lam = 0.0
    return [round(lam, 6), round(vn + lam * w, 6)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[-4.773, 0.009, 0.604, 0.0, 0.1, 0.005, 0.03333333333333333, 0.3, 1.0], [10.273013, 1.4319]], [[-2.562, 0.154, 1.351, 0.513, 0.2, 0.02, 0.016666666666666666, 0.3, 1.0], [2.237124, 1.608]], [[0.67, 0.186, 1.405, 0.0, 0.3, 0.005, 0.03333333333333333, 0.0, 0.5], [0.682562, 1.629]], [[-2.91, 0.165, 0.386, 0.597, 0.3, 0.005, 0.016666666666666666, 0.8, 0.5], [5.890132, 2.88]], [[-2.811, 0.056, 0.589, 0.274, 0.1, 0.01, 0.03333333333333333, 0.8, 1.0], [5.863036, 2.2488]], [[-4.27, 0.161, 0.0, 0.0, 0.3, 0.02, 0.016666666666666666, 0.8, 0.5], [0.0, -4.27]], [[-1.707, 0.165, 1.092, 1.877, 0.2, 0.02, 0.03333333333333333, 0.3, 0.5], [0.867969, 0.87]], [[1.41, 0.135, 0.151, 1.614, 0.3, 0.01, 0.016666666666666666, 0.0, 0.5], [0.475921, 2.25]]], [[[-3.976, 0.068, 0.0, 1.176, 0.1, 0.01, 0.016666666666666666, 0.0, 1.0], [3.676871, 0.348]], [[-1.758, 0.161, 1.195, 0.199, 0.1, 0.02, 0.016666666666666666, 0.3, 1.0], [1.868006, 0.846]], [[0.546, 0.076, 0.0, 0.0, 0.1, 0.005, 0.03333333333333333, 0.0, 0.5], [0.0, 0.546]], [[-2.457, 0.025, 1.653, 0.59, 0.2, 0.02, 0.016666666666666666, 0.3, 0.5], [1.42403, 0.7371]], [[-2.446, 0.046, 0.549, 0.631, 0.1, 0.02, 0.016666666666666666, 0.8, 1.0], [3.731186, 1.9568]], [[-1.066, 0.099, 0.967, 1.983, 0.2, 0.005, 0.016666666666666666, 0.8, 0.5], [0.743729, 1.128]], [[0.063, 0.12, 0.372, 0.0, 0.1, 0.005, 0.03333333333333333, 0.3, 1.0], [0.758065, 0.345]], [[-3.625, 0.161, 0.346, 1.734, 0.1, 0.01, 0.016666666666666666, 0.3, 0.5], [2.265625, 1.0875]]], [[[-2.848, 0.066, 0.963, 0.962, 0.3, 0.005, 0.016666666666666666, 0.3, 1.0], [2.04987, 1.098]], [[1.993, 0.15, 0.513, 1.909, 0.2, 0.005, 0.03333333333333333, 0.8, 1.0], [0.0, 1.993]], [[-1.515, 0.171, 1.571, 0.0, 0.1, 0.02, 0.03333333333333333, 0.3, 1.0], [1.25366, 0.4545]], [[-2.491, 0.113, 0.986, 0.734, 0.2, 0.005, 0.016666666666666666, 0.3, 1.0], [2.201744, 1.296]], [[-1.057, 0.121, 1.527, 0.0, 0.1, 0.01, 0.03333333333333333, 0.8, 0.5], [1.245972, 0.8456]], [[-4.604, 0.061, 0.767, 0.833, 0.3, 0.005, 0.016666666666666666, 0.8, 0.5], [5.1795, 3.6832]], [[-4.581, 0.068, 0.0, 0.0, 0.3, 0.02, 0.016666666666666666, 0.3, 1.0], [0.0, -4.581]], [[0.928, -0.015, 0.698, 0.397, 0.2, 0.01, 0.016666666666666666, 0.8, 1.0], [0.0, 0.928]]], [[[-3.049, 0.072, 1.828, 0.939, 0.3, 0.02, 0.016666666666666666, 0.3, 1.0], [1.440188, 0.936]], [[-0.847, 0.07, 0.608, 0.0, 0.2, 0.01, 0.03333333333333333, 0.3, 0.5], [1.985197, 0.36]], [[-2.12, 0.078, 0.86, 0.0, 0.2, 0.01, 0.016666666666666666, 0.8, 0.5], [4.437209, 1.696]], [[0.052, 0.085, 1.985, 1.159, 0.2, 0.02, 0.03333333333333333, 0.3, 1.0], [0.107506, 0.39]], [[-0.61, 0.047, 0.543, 0.0, 0.2, 0.02, 0.016666666666666666, 0.3, 0.5], [1.720074, 0.324]], [[-1.706, 0.151, 0.445, 0.0, 0.1, 0.02, 0.03333333333333333, 0.3, 1.0], [4.98382, 0.5118]], [[0.08, 0.097, 0.146, 0.0, 0.3, 0.005, 0.016666666666666666, 0.8, 0.5], [10.794521, 1.656]], [[1.301, 0.198, 0.37, 1.907, 0.2, 0.01, 0.016666666666666666, 0.0, 0.5], [0.419412, 2.256]]], [[[-1.984, 0.152, 0.177, 0.796, 0.1, 0.005, 0.016666666666666666, 0.3, 0.5], [2.945529, 0.882]], [[-1.296, 0.02, 1.331, 0.0, 0.1, 0.005, 0.03333333333333333, 0.3, 1.0], [1.265815, 0.3888]], [[-1.445, 0.095, 1.787, 0.0, 0.1, 0.005, 0.03333333333333333, 0.8, 1.0], [1.455512, 1.156]], [[-2.372, 0.177, 1.352, 1.076, 0.2, 0.02, 0.03333333333333333, 0.8, 0.5], [1.758484, 1.8976]], [[-2.146, 0.086, 0.0, 0.793, 0.3, 0.02, 0.016666666666666666, 0.3, 1.0], [4.204288, 1.188]], [[1.424, 0.05, 0.809, 1.444, 0.1, 0.02, 0.016666666666666666, 0.0, 1.0], [0.0, 1.424]], [[-0.222, 0.103, 0.0, 1.833, 0.2, 0.02, 0.03333333333333333, 0.3, 0.5], [0.392799, 0.498]], [[1.4, 0.124, 0.0, 1.761, 0.1, 0.02, 0.016666666666666666, 0.8, 1.0], [0.0, 1.4]]]]
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 fixtureActualExpectedOutcome
case 0[10.292881, 1.4439][10.273013, 1.4319]Failed
case 1[2.649464, 2.3766][2.237124, 1.608]Failed
case 2[0.682562, 1.629][0.682562, 1.629]Passed
case 3[8.258393, 5.208][5.890132, 2.88]Failed
case 4[6.022943, 2.3868][5.863036, 2.2488]Failed
case 5[0.0, -4.27][0.0, -4.27]Passed
case 6[1.040451, 1.3821][0.867969, 0.87]Failed
case 7[0.475921, 2.25][0.475921, 2.25]Passed

SHA-256 / 1547736c2ec066001c07f62e3a173f789f6c9d77d2b8f28ca6be617ef029689b

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(vn, depth, ima, imb, beta, slop, dt, e, e_thresh):
    w = ima + imb
    if w == 0:
        return [0.0, round(vn, 6)]
    pen = depth - slop
    bias = beta / dt * pen if pen > 0 else 0.0
    bounce = -e * vn if vn < -e_thresh else 0.0
    target = bounce if bounce else bias
    lam = (target - vn) / w
    if lam < 0:
        lam = 0.0
    return [round(lam, 6), round(vn + lam * w, 6)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[-4.773, 0.009, 0.604, 0.0, 0.1, 0.005, 0.03333333333333333, 0.3, 1.0], [10.273013, 1.4319]], [[-2.562, 0.154, 1.351, 0.513, 0.2, 0.02, 0.016666666666666666, 0.3, 1.0], [2.237124, 1.608]], [[0.67, 0.186, 1.405, 0.0, 0.3, 0.005, 0.03333333333333333, 0.0, 0.5], [0.682562, 1.629]], [[-2.91, 0.165, 0.386, 0.597, 0.3, 0.005, 0.016666666666666666, 0.8, 0.5], [5.890132, 2.88]], [[-2.811, 0.056, 0.589, 0.274, 0.1, 0.01, 0.03333333333333333, 0.8, 1.0], [5.863036, 2.2488]], [[-4.27, 0.161, 0.0, 0.0, 0.3, 0.02, 0.016666666666666666, 0.8, 0.5], [0.0, -4.27]], [[-1.707, 0.165, 1.092, 1.877, 0.2, 0.02, 0.03333333333333333, 0.3, 0.5], [0.867969, 0.87]], [[1.41, 0.135, 0.151, 1.614, 0.3, 0.01, 0.016666666666666666, 0.0, 0.5], [0.475921, 2.25]]], [[[-3.976, 0.068, 0.0, 1.176, 0.1, 0.01, 0.016666666666666666, 0.0, 1.0], [3.676871, 0.348]], [[-1.758, 0.161, 1.195, 0.199, 0.1, 0.02, 0.016666666666666666, 0.3, 1.0], [1.868006, 0.846]], [[0.546, 0.076, 0.0, 0.0, 0.1, 0.005, 0.03333333333333333, 0.0, 0.5], [0.0, 0.546]], [[-2.457, 0.025, 1.653, 0.59, 0.2, 0.02, 0.016666666666666666, 0.3, 0.5], [1.42403, 0.7371]], [[-2.446, 0.046, 0.549, 0.631, 0.1, 0.02, 0.016666666666666666, 0.8, 1.0], [3.731186, 1.9568]], [[-1.066, 0.099, 0.967, 1.983, 0.2, 0.005, 0.016666666666666666, 0.8, 0.5], [0.743729, 1.128]], [[0.063, 0.12, 0.372, 0.0, 0.1, 0.005, 0.03333333333333333, 0.3, 1.0], [0.758065, 0.345]], [[-3.625, 0.161, 0.346, 1.734, 0.1, 0.01, 0.016666666666666666, 0.3, 0.5], [2.265625, 1.0875]]], [[[-2.848, 0.066, 0.963, 0.962, 0.3, 0.005, 0.016666666666666666, 0.3, 1.0], [2.04987, 1.098]], [[1.993, 0.15, 0.513, 1.909, 0.2, 0.005, 0.03333333333333333, 0.8, 1.0], [0.0, 1.993]], [[-1.515, 0.171, 1.571, 0.0, 0.1, 0.02, 0.03333333333333333, 0.3, 1.0], [1.25366, 0.4545]], [[-2.491, 0.113, 0.986, 0.734, 0.2, 0.005, 0.016666666666666666, 0.3, 1.0], [2.201744, 1.296]], [[-1.057, 0.121, 1.527, 0.0, 0.1, 0.01, 0.03333333333333333, 0.8, 0.5], [1.245972, 0.8456]], [[-4.604, 0.061, 0.767, 0.833, 0.3, 0.005, 0.016666666666666666, 0.8, 0.5], [5.1795, 3.6832]], [[-4.581, 0.068, 0.0, 0.0, 0.3, 0.02, 0.016666666666666666, 0.3, 1.0], [0.0, -4.581]], [[0.928, -0.015, 0.698, 0.397, 0.2, 0.01, 0.016666666666666666, 0.8, 1.0], [0.0, 0.928]]], [[[-3.049, 0.072, 1.828, 0.939, 0.3, 0.02, 0.016666666666666666, 0.3, 1.0], [1.440188, 0.936]], [[-0.847, 0.07, 0.608, 0.0, 0.2, 0.01, 0.03333333333333333, 0.3, 0.5], [1.985197, 0.36]], [[-2.12, 0.078, 0.86, 0.0, 0.2, 0.01, 0.016666666666666666, 0.8, 0.5], [4.437209, 1.696]], [[0.052, 0.085, 1.985, 1.159, 0.2, 0.02, 0.03333333333333333, 0.3, 1.0], [0.107506, 0.39]], [[-0.61, 0.047, 0.543, 0.0, 0.2, 0.02, 0.016666666666666666, 0.3, 0.5], [1.720074, 0.324]], [[-1.706, 0.151, 0.445, 0.0, 0.1, 0.02, 0.03333333333333333, 0.3, 1.0], [4.98382, 0.5118]], [[0.08, 0.097, 0.146, 0.0, 0.3, 0.005, 0.016666666666666666, 0.8, 0.5], [10.794521, 1.656]], [[1.301, 0.198, 0.37, 1.907, 0.2, 0.01, 0.016666666666666666, 0.0, 0.5], [0.419412, 2.256]]], [[[-1.984, 0.152, 0.177, 0.796, 0.1, 0.005, 0.016666666666666666, 0.3, 0.5], [2.945529, 0.882]], [[-1.296, 0.02, 1.331, 0.0, 0.1, 0.005, 0.03333333333333333, 0.3, 1.0], [1.265815, 0.3888]], [[-1.445, 0.095, 1.787, 0.0, 0.1, 0.005, 0.03333333333333333, 0.8, 1.0], [1.455512, 1.156]], [[-2.372, 0.177, 1.352, 1.076, 0.2, 0.02, 0.03333333333333333, 0.8, 0.5], [1.758484, 1.8976]], [[-2.146, 0.086, 0.0, 0.793, 0.3, 0.02, 0.016666666666666666, 0.3, 1.0], [4.204288, 1.188]], [[1.424, 0.05, 0.809, 1.444, 0.1, 0.02, 0.016666666666666666, 0.0, 1.0], [0.0, 1.424]], [[-0.222, 0.103, 0.0, 1.833, 0.2, 0.02, 0.03333333333333333, 0.3, 0.5], [0.392799, 0.498]], [[1.4, 0.124, 0.0, 1.761, 0.1, 0.02, 0.016666666666666666, 0.8, 1.0], [0.0, 1.4]]]]
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 fixtureActualExpectedOutcome
case 0[10.273013, 1.4319][10.273013, 1.4319]Passed
case 1[1.786803, 0.7686][2.237124, 1.608]Failed
case 2[0.682562, 1.629][0.682562, 1.629]Passed
case 3[5.328586, 2.328][5.890132, 2.88]Failed
case 4[5.863036, 2.2488][5.863036, 2.2488]Passed
case 5[0.0, -4.27][0.0, -4.27]Passed
case 6[0.747423, 0.5121][0.867969, 0.87]Failed
case 7[0.475921, 2.25][0.475921, 2.25]Passed

SHA-256 / c1bb7e523bce82d03ef6ee48cd1bb82a90f518529aef4d47734d1e6bd83dd142

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:56.555664+00:00.

Case digest / 80937b2e394ace520b4101e2d41ddcb67c187fd76415c2b804a2640f920e1a1b