FA-66151 / Aviation weight and balance / Open access
Out-of-table CG clamped to the nearest trim value · case 01
A CG beyond the certified trim table produces a plausible-looking trim setting.
ROOT CAUSE
Values outside the table are clamped to the end nodes instead of being rejected.
VERIFIED REPAIR
Return ERR_RANGE for any %MAC outside the table.
Unsuccessful approach: A one-percent clamping tolerance still invents trim settings for uncertified CGs.
Case contract
Input {'pmac','flaps','tables':{flap string:[[%MAC, trim units] ascending]}}. Missing flap table -> 'ERR_FLAPS'; %MAC outside the table's inclusive range -> 'ERR_RANGE' (no extrapolation or clamping); otherwise linear interpolation between bracketing nodes, rounded to 0.1 unit.
Why this case matters
Takeoff stabilizer trim is read from a flap-specific table indexed by %MAC; out-of-table values must not be silently clamped.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
tables = x['tables']
key = str(x['flaps'])
if key not in tables: return 'ERR_FLAPS'
t = tables[key]
p = x['pmac']
p = min(max(p, t[0][0]), t[-1][0])
for (p0, u0), (p1, u1) in zip(t, t[1:]):
if p0 <= p <= p1:
u = u0 + (u1 - u0) * (p - p0) / (p1 - p0)
return round(u, 1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['mid table flaps 5', {'pmac': 19.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.4], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.5, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 11, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 17.23, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.7], ['sampled case 2', {'pmac': 11.67, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.1], ['sampled case 3', {'pmac': 23.34, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.8]], [['mid table flaps 5', {'pmac': 20.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.3], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.6, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 12, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 32.69, 'flaps': 1, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['sampled case 2', {'pmac': 17.85, 'flaps': 20, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['sampled case 3', {'pmac': 7.44, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE']], [['mid table flaps 5', {'pmac': 21.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.1], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.699999999999996, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 13, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 13.07, 'flaps': 10, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['sampled case 2', {'pmac': 13.47, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.9], ['sampled case 3', {'pmac': 38.52, 'flaps': 1, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS']], [['mid table flaps 5', {'pmac': 22.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.8, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 14, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 27.81, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.9], ['sampled case 2', {'pmac': 14.63, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.2], ['sampled case 3', {'pmac': 6.07, 'flaps': 1, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS']], [['mid table flaps 5', {'pmac': 23.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.8], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.9, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 15.63, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.0], ['sampled case 2', {'pmac': 26.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.0], ['sampled case 3', {'pmac': 25.32, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.2]]]
for label, args, expected in fixtures[N-1]:
check(label, 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 |
|---|---|---|---|
| mid table flaps 5 | 5.4 | 5.4 | Passed |
| exact node | 5.0 | 5.0 | Passed |
| forward end of table | 6.6 | 6.6 | Passed |
| aft end of table | 2.9 | 2.9 | Passed |
| aft of table | 2.4 | ERR_RANGE | Failed |
| forward of table | 6.6 | ERR_RANGE | Failed |
| flap setting without table | ERR_FLAPS | ERR_FLAPS | Passed |
| flaps 15 between nodes | 3.7 | 3.7 | Passed |
| sampled case 1 | 5.7 | 5.7 | Passed |
| sampled case 2 | 6.1 | 6.1 | Passed |
| sampled case 3 | 4.8 | 4.8 | Passed |
SHA-256 / c06709c4924715e4b27d6a2cd3241c22c4c8800fc866b75fd859f4ddf9597b40
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
tables = x['tables']
key = str(x['flaps'])
if key not in tables: return 'ERR_FLAPS'
t = tables[key]
p = x['pmac']
if p < t[0][0] - 1 or p > t[-1][0] + 1: return 'ERR_RANGE'
p = min(max(p, t[0][0]), t[-1][0])
for (p0, u0), (p1, u1) in zip(t, t[1:]):
if p0 <= p <= p1:
u = u0 + (u1 - u0) * (p - p0) / (p1 - p0)
return round(u, 1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['mid table flaps 5', {'pmac': 19.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.4], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.5, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 11, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 17.23, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.7], ['sampled case 2', {'pmac': 11.67, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.1], ['sampled case 3', {'pmac': 23.34, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.8]], [['mid table flaps 5', {'pmac': 20.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.3], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.6, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 12, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 32.69, 'flaps': 1, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['sampled case 2', {'pmac': 17.85, 'flaps': 20, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['sampled case 3', {'pmac': 7.44, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE']], [['mid table flaps 5', {'pmac': 21.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.1], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.699999999999996, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 13, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 13.07, 'flaps': 10, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['sampled case 2', {'pmac': 13.47, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.9], ['sampled case 3', {'pmac': 38.52, 'flaps': 1, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS']], [['mid table flaps 5', {'pmac': 22.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.8, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 14, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 27.81, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.9], ['sampled case 2', {'pmac': 14.63, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.2], ['sampled case 3', {'pmac': 6.07, 'flaps': 1, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS']], [['mid table flaps 5', {'pmac': 23.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.8], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.9, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 15.63, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.0], ['sampled case 2', {'pmac': 26.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.0], ['sampled case 3', {'pmac': 25.32, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.2]]]
for label, args, expected in fixtures[N-1]:
check(label, 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 |
|---|---|---|---|
| mid table flaps 5 | 5.4 | 5.4 | Passed |
| exact node | 5.0 | 5.0 | Passed |
| forward end of table | 6.6 | 6.6 | Passed |
| aft end of table | 2.9 | 2.9 | Passed |
| aft of table | 2.4 | ERR_RANGE | Failed |
| forward of table | 6.6 | ERR_RANGE | Failed |
| flap setting without table | ERR_FLAPS | ERR_FLAPS | Passed |
| flaps 15 between nodes | 3.7 | 3.7 | Passed |
| sampled case 1 | 5.7 | 5.7 | Passed |
| sampled case 2 | 6.1 | 6.1 | Passed |
| sampled case 3 | 4.8 | 4.8 | Passed |
SHA-256 / dba47353988600094491c9a6dff39e74f4664d0d4bc7b8c537a5081474fe95dd
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
tables = x['tables']
key = str(x['flaps'])
if key not in tables: return 'ERR_FLAPS'
t = tables[key]
p = x['pmac']
if p < t[0][0] or p > t[-1][0]: return 'ERR_RANGE'
for (p0, u0), (p1, u1) in zip(t, t[1:]):
if p0 <= p <= p1:
u = u0 + (u1 - u0) * (p - p0) / (p1 - p0)
return round(u, 1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['mid table flaps 5', {'pmac': 19.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.4], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.5, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 11, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 17.23, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.7], ['sampled case 2', {'pmac': 11.67, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.1], ['sampled case 3', {'pmac': 23.34, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.8]], [['mid table flaps 5', {'pmac': 20.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.3], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.6, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 12, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 32.69, 'flaps': 1, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['sampled case 2', {'pmac': 17.85, 'flaps': 20, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['sampled case 3', {'pmac': 7.44, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE']], [['mid table flaps 5', {'pmac': 21.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.1], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.699999999999996, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 13, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 13.07, 'flaps': 10, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['sampled case 2', {'pmac': 13.47, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.9], ['sampled case 3', {'pmac': 38.52, 'flaps': 1, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS']], [['mid table flaps 5', {'pmac': 22.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.8, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 14, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS'], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 27.81, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.9], ['sampled case 2', {'pmac': 14.63, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.2], ['sampled case 3', {'pmac': 6.07, 'flaps': 1, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_FLAPS']], [['mid table flaps 5', {'pmac': 23.25, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.8], ['exact node', {'pmac': 22.0, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['forward end of table', {'pmac': 8.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.6], ['aft end of table', {'pmac': 36.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 2.9], ['aft of table', {'pmac': 36.9, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['forward of table', {'pmac': 7.35, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 'ERR_RANGE'], ['flap setting without table', {'pmac': 20.0, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 5.0], ['flaps 15 between nodes', {'pmac': 29.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 3.7], ['sampled case 1', {'pmac': 15.63, 'flaps': 5, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 6.0], ['sampled case 2', {'pmac': 26.63, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.0], ['sampled case 3', {'pmac': 25.32, 'flaps': 15, 'tables': {'5': [[8.0, 7.2], [15.0, 6.1], [22.0, 5.0], [30.0, 3.6], [36.0, 2.4]], '15': [[8.0, 6.6], [18.0, 5.3], [26.0, 4.1], [36.0, 2.9]]}}, 4.2]]]
for label, args, expected in fixtures[N-1]:
check(label, 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 |
|---|---|---|---|
| mid table flaps 5 | 5.4 | 5.4 | Passed |
| exact node | 5.0 | 5.0 | Passed |
| forward end of table | 6.6 | 6.6 | Passed |
| aft end of table | 2.9 | 2.9 | Passed |
| aft of table | ERR_RANGE | ERR_RANGE | Passed |
| forward of table | ERR_RANGE | ERR_RANGE | Passed |
| flap setting without table | ERR_FLAPS | ERR_FLAPS | Passed |
| flaps 15 between nodes | 3.7 | 3.7 | Passed |
| sampled case 1 | 5.7 | 5.7 | Passed |
| sampled case 2 | 6.1 | 6.1 | Passed |
| sampled case 3 | 4.8 | 4.8 | Passed |
SHA-256 / 2ba317ddf29b1d1404863f657f5c9160e087c6003cdc00f2773195622a8cefd0
Verification & scope
A deterministic toy loading model with stipulated constants; it is not an approved aircraft flight manual procedure and makes no claim of regulatory conformance. 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:47:40.469162+00:00.
Case digest / ef2d100b70a88943fe59da8a7934e2579c7689f14f5c0cec5ec462f0155cdc49