FA-66161 / Aviation weight and balance / Open access
Unsupported flap setting falls back to another table · case 01
Flaps 10 returns a trim from the flaps 15 table instead of an error.
ROOT CAUSE
A missing flap table defaults to the first table in sorted key order.
VERIFIED REPAIR
Reject flap settings that have no trim table.
Unsuccessful approach: Using the nearest flap table is still an unapproved substitution.
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'])
t = tables.get(key, tables[sorted(tables)[0]])
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], ['regression: flap table selection', {'pmac': 5.38, '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']]]
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 | 5.0 | ERR_FLAPS | Failed |
| 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 / d4a044755d2eae16f5cbad04868c39c59bf1a579e5254618ed400e000764f1f0
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'])
t = tables[key] if key in tables else tables[min(tables, key=lambda k: abs(int(k) - x['flaps']))]
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], ['regression: flap table selection', {'pmac': 5.38, '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']]]
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 | 5.0 | ERR_FLAPS | Failed |
| 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 / 757a4b9a0c08434d1ef7749562243f645921950fb9cbd0a972ef763a94a07662
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], ['regression: flap table selection', {'pmac': 5.38, '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']]]
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 / 00edd2131729915aa3753c013bef14070c96d80ea93bb86b7cc0b07a7702eb53
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.499745+00:00.
Case digest / d85812b7efbde2825a35a28e1a85dfa044122f9f26e921d8fe6d03dbb83d7437