FA-65921 / Aviation weight and balance / Open access
Loaded item weights left out of the conversion weight · case 01
%MAC drifts further from the chart the heavier the payload, while the index itself is correct.
ROOT CAUSE
The loop adds item indices but never adds item weights, so the index is converted back to an arm with the dry operating weight only.
VERIFIED REPAIR
Add every item weight to the total weight used for the index-to-arm conversion.
Unsuccessful approach: Adding only items aft of the reference still omits forward-loaded weight from the divisor.
Case contract
Input {'dow','doi','ref','c','k','lemac','mac','items':[[kg,arm m]]}. Item index = kg*(arm-ref)/c; the dry operating index already contains K. Total index = doi + item indices; CG arm = ref + (index-K)*c/total weight; %MAC = (CG-LEMAC)/MAC*100. Return [index r2, %MAC r1].
Why this case matters
Airline loadsheets carry balance as a dimensionless index offset by K; converting back to %MAC requires removing K and scaling by C over total weight.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
ref, c, k = x['ref'], x['c'], x['k']
w = x['dow']
ti = x['doi']
for iw, arm in x['items']:
ti += iw * (arm - ref) / c
cg = ref + (ti - k) * c / w
pmac = (cg - x['lemac']) / x['mac'] * 100
return [round(ti, 2), round(pmac, 1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3100.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [50.3, 37.6]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.1]]}, [80.4, 54.0]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.2]]}, [17.2, 19.5]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[2500.0, 18.0]]}, [48.0, 36.4]], ['different constants', {'dow': 36050.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 33485.0, 'doi': 37.0, 'ref': 20.4, 'c': 500.0, 'k': 44.4, 'lemac': 18.68, 'mac': 3.58, 'items': [[4603.0, 5.73], [2919.0, 25.41], [5509.0, 29.73], [5663.0, 28.02]]}, [120.3, 68.4]], ['sampled case 2', {'dow': 45884.0, 'doi': 51.2, 'ref': 20.0, 'c': 200.0, 'k': 57.4, 'lemac': 14.39, 'mac': 4.79, 'items': [[4694.0, 15.31], [4327.0, 9.7], [185.0, 15.41], [4752.0, 22.51], [992.0, 14.27]]}, [-254.74, 95.7]], ['sampled case 3', {'dow': 36007.0, 'doi': 45.2, 'ref': 20.5, 'c': 2000.0, 'k': 46.9, 'lemac': 17.4, 'mac': 3.61, 'items': []}, [45.2, 83.3]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3200.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [49.9, 37.5]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.2]]}, [80.8, 54.2]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.4]]}, [17.9, 19.9]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[5000.0, 18.0]]}, [48.0, 36.4]], ['different constants', {'dow': 36100.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 41485.0, 'doi': 53.7, 'ref': 17.2, 'c': 500.0, 'k': 53.6, 'lemac': 14.91, 'mac': 4.7, 'items': [[323.0, 8.3], [3020.0, 17.98], [2440.0, 14.22]]}, [38.12, 45.2]], ['sampled case 2', {'dow': 36221.0, 'doi': 55.1, 'ref': 19.8, 'c': 2000.0, 'k': 56.4, 'lemac': 18.06, 'mac': 3.42, 'items': [[1053.0, 22.91]]}, [56.74, 51.4]], ['sampled case 3', {'dow': 36359.0, 'doi': 27.6, 'ref': 16.4, 'c': 200.0, 'k': 30.8, 'lemac': 14.16, 'mac': 3.79, 'items': [[2072.0, 5.02]]}, [-90.3, 42.5]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3300.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [49.5, 37.3]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.3]]}, [81.2, 54.5]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.6]]}, [18.6, 20.2]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[7500.0, 18.0]]}, [48.0, 36.5]], ['different constants', {'dow': 36150.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 33923.0, 'doi': 39.1, 'ref': 19.3, 'c': 200.0, 'k': 45.3, 'lemac': 16.18, 'mac': 4.5, 'items': [[3739.0, 10.15]]}, [-131.96, 48.4]], ['sampled case 2', {'dow': 40403.0, 'doi': 39.1, 'ref': 21.4, 'c': 1000.0, 'k': 44.8, 'lemac': 14.64, 'mac': 4.94, 'items': [[4674.0, 28.04]]}, [70.14, 148.2]], ['sampled case 3', {'dow': 30111.0, 'doi': 38.1, 'ref': 15.0, 'c': 200.0, 'k': 36.0, 'lemac': 15.26, 'mac': 4.8, 'items': [[5589.0, 17.22]]}, [100.14, 2.1]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3400.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [49.1, 37.1]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.4]]}, [81.6, 54.7]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.8]]}, [19.3, 20.6]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[10000.0, 18.0]]}, [48.0, 36.5]], ['different constants', {'dow': 36200.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 40381.0, 'doi': 38.2, 'ref': 17.2, 'c': 200.0, 'k': 35.3, 'lemac': 17.91, 'mac': 3.25, 'items': [[1141.0, 14.25], [3763.0, 12.45]]}, [-68.0, -35.9]], ['sampled case 2', {'dow': 40833.0, 'doi': 53.7, 'ref': 21.5, 'c': 2000.0, 'k': 48.5, 'lemac': 17.83, 'mac': 3.22, 'items': [[4174.0, 19.61], [2120.0, 18.46], [4779.0, 27.55], [1973.0, 12.04]]}, [51.66, 117.6]], ['sampled case 3', {'dow': 33856.0, 'doi': 31.0, 'ref': 19.9, 'c': 200.0, 'k': 36.6, 'lemac': 18.08, 'mac': 4.82, 'items': []}, [31.0, 37.1]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [48.7, 36.9]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.5]]}, [82.0, 54.9]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 10.0]]}, [20.0, 21.0]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[12500.0, 18.0]]}, [48.0, 36.6]], ['different constants', {'dow': 36250.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 34075.0, 'doi': 33.7, 'ref': 19.6, 'c': 2000.0, 'k': 36.1, 'lemac': 15.76, 'mac': 3.12, 'items': [[4801.0, 23.6], [3956.0, 16.47], [1810.0, 18.75], [1491.0, 15.01], [3514.0, 6.44]]}, [9.8, 89.1]], ['sampled case 2', {'dow': 33834.0, 'doi': 57.4, 'ref': 20.6, 'c': 500.0, 'k': 55.3, 'lemac': 15.75, 'mac': 3.95, 'items': [[3292.0, 11.8], [4846.0, 14.0], [3222.0, 25.52], [2090.0, 7.1], [168.0, 27.97]]}, [-86.76, 84.9]], ['sampled case 3', {'dow': 46921.0, 'doi': 51.0, 'ref': 17.8, 'c': 500.0, 'k': 52.3, 'lemac': 14.61, 'mac': 3.01, 'items': [[2487.0, 11.85], [4542.0, 19.68]]}, [38.48, 101.7]]]]
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 |
|---|---|---|---|
| typical cabin and hold | [50.3, 37.7] | [50.3, 37.6] | Failed |
| empty operating aircraft | [48.0, 36.3] | [48.0, 36.3] | Passed |
| aft hold heavy | [80.4, 55.6] | [80.4, 54.0] | Failed |
| forward hold heavy | [17.2, 18.0] | [17.2, 19.5] | Failed |
| item at reference arm | [48.0, 36.3] | [48.0, 36.4] | Failed |
| different constants | [34.0, 57.7] | [34.0, 58.2] | Failed |
| sampled case 1 | [120.3, 79.7] | [120.3, 68.4] | Failed |
| sampled case 2 | [-254.74, 88.7] | [-254.74, 95.7] | Failed |
| sampled case 3 | [45.2, 83.3] | [45.2, 83.3] | Passed |
SHA-256 / 0029dc11d3215b7b4969c91539a41c3e71873231b46cffd1dc5d598788343145
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
ref, c, k = x['ref'], x['c'], x['k']
w = x['dow']
ti = x['doi']
for iw, arm in x['items']:
w += iw if arm > ref else 0.0
ti += iw * (arm - ref) / c
cg = ref + (ti - k) * c / w
pmac = (cg - x['lemac']) / x['mac'] * 100
return [round(ti, 2), round(pmac, 1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3100.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [50.3, 37.6]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.1]]}, [80.4, 54.0]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.2]]}, [17.2, 19.5]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[2500.0, 18.0]]}, [48.0, 36.4]], ['different constants', {'dow': 36050.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 33485.0, 'doi': 37.0, 'ref': 20.4, 'c': 500.0, 'k': 44.4, 'lemac': 18.68, 'mac': 3.58, 'items': [[4603.0, 5.73], [2919.0, 25.41], [5509.0, 29.73], [5663.0, 28.02]]}, [120.3, 68.4]], ['sampled case 2', {'dow': 45884.0, 'doi': 51.2, 'ref': 20.0, 'c': 200.0, 'k': 57.4, 'lemac': 14.39, 'mac': 4.79, 'items': [[4694.0, 15.31], [4327.0, 9.7], [185.0, 15.41], [4752.0, 22.51], [992.0, 14.27]]}, [-254.74, 95.7]], ['sampled case 3', {'dow': 36007.0, 'doi': 45.2, 'ref': 20.5, 'c': 2000.0, 'k': 46.9, 'lemac': 17.4, 'mac': 3.61, 'items': []}, [45.2, 83.3]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3200.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [49.9, 37.5]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.2]]}, [80.8, 54.2]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.4]]}, [17.9, 19.9]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[5000.0, 18.0]]}, [48.0, 36.4]], ['different constants', {'dow': 36100.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 41485.0, 'doi': 53.7, 'ref': 17.2, 'c': 500.0, 'k': 53.6, 'lemac': 14.91, 'mac': 4.7, 'items': [[323.0, 8.3], [3020.0, 17.98], [2440.0, 14.22]]}, [38.12, 45.2]], ['sampled case 2', {'dow': 36221.0, 'doi': 55.1, 'ref': 19.8, 'c': 2000.0, 'k': 56.4, 'lemac': 18.06, 'mac': 3.42, 'items': [[1053.0, 22.91]]}, [56.74, 51.4]], ['sampled case 3', {'dow': 36359.0, 'doi': 27.6, 'ref': 16.4, 'c': 200.0, 'k': 30.8, 'lemac': 14.16, 'mac': 3.79, 'items': [[2072.0, 5.02]]}, [-90.3, 42.5]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3300.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [49.5, 37.3]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.3]]}, [81.2, 54.5]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.6]]}, [18.6, 20.2]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[7500.0, 18.0]]}, [48.0, 36.5]], ['different constants', {'dow': 36150.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 33923.0, 'doi': 39.1, 'ref': 19.3, 'c': 200.0, 'k': 45.3, 'lemac': 16.18, 'mac': 4.5, 'items': [[3739.0, 10.15]]}, [-131.96, 48.4]], ['sampled case 2', {'dow': 40403.0, 'doi': 39.1, 'ref': 21.4, 'c': 1000.0, 'k': 44.8, 'lemac': 14.64, 'mac': 4.94, 'items': [[4674.0, 28.04]]}, [70.14, 148.2]], ['sampled case 3', {'dow': 30111.0, 'doi': 38.1, 'ref': 15.0, 'c': 200.0, 'k': 36.0, 'lemac': 15.26, 'mac': 4.8, 'items': [[5589.0, 17.22]]}, [100.14, 2.1]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3400.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [49.1, 37.1]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.4]]}, [81.6, 54.7]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.8]]}, [19.3, 20.6]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[10000.0, 18.0]]}, [48.0, 36.5]], ['different constants', {'dow': 36200.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 40381.0, 'doi': 38.2, 'ref': 17.2, 'c': 200.0, 'k': 35.3, 'lemac': 17.91, 'mac': 3.25, 'items': [[1141.0, 14.25], [3763.0, 12.45]]}, [-68.0, -35.9]], ['sampled case 2', {'dow': 40833.0, 'doi': 53.7, 'ref': 21.5, 'c': 2000.0, 'k': 48.5, 'lemac': 17.83, 'mac': 3.22, 'items': [[4174.0, 19.61], [2120.0, 18.46], [4779.0, 27.55], [1973.0, 12.04]]}, [51.66, 117.6]], ['sampled case 3', {'dow': 33856.0, 'doi': 31.0, 'ref': 19.9, 'c': 200.0, 'k': 36.6, 'lemac': 18.08, 'mac': 4.82, 'items': []}, [31.0, 37.1]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [48.7, 36.9]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.5]]}, [82.0, 54.9]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 10.0]]}, [20.0, 21.0]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[12500.0, 18.0]]}, [48.0, 36.6]], ['different constants', {'dow': 36250.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 34075.0, 'doi': 33.7, 'ref': 19.6, 'c': 2000.0, 'k': 36.1, 'lemac': 15.76, 'mac': 3.12, 'items': [[4801.0, 23.6], [3956.0, 16.47], [1810.0, 18.75], [1491.0, 15.01], [3514.0, 6.44]]}, [9.8, 89.1]], ['sampled case 2', {'dow': 33834.0, 'doi': 57.4, 'ref': 20.6, 'c': 500.0, 'k': 55.3, 'lemac': 15.75, 'mac': 3.95, 'items': [[3292.0, 11.8], [4846.0, 14.0], [3222.0, 25.52], [2090.0, 7.1], [168.0, 27.97]]}, [-86.76, 84.9]], ['sampled case 3', {'dow': 46921.0, 'doi': 51.0, 'ref': 17.8, 'c': 500.0, 'k': 52.3, 'lemac': 14.61, 'mac': 3.01, 'items': [[2487.0, 11.85], [4542.0, 19.68]]}, [38.48, 101.7]]]]
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 |
|---|---|---|---|
| typical cabin and hold | [50.3, 37.7] | [50.3, 37.6] | Failed |
| empty operating aircraft | [48.0, 36.3] | [48.0, 36.3] | Passed |
| aft hold heavy | [80.4, 54.0] | [80.4, 54.0] | Passed |
| forward hold heavy | [17.2, 18.0] | [17.2, 19.5] | Failed |
| item at reference arm | [48.0, 36.3] | [48.0, 36.4] | Failed |
| different constants | [34.0, 58.0] | [34.0, 58.2] | Failed |
| sampled case 1 | [120.3, 70.3] | [120.3, 68.4] | Failed |
| sampled case 2 | [-254.74, 91.4] | [-254.74, 95.7] | Failed |
| sampled case 3 | [45.2, 83.3] | [45.2, 83.3] | Passed |
SHA-256 / c7af8bbe2448ca2e9b13613b13cb82ca9d98d1ade06d88a7dad1b396078627d9
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
ref, c, k = x['ref'], x['c'], x['k']
w = x['dow']
ti = x['doi']
for iw, arm in x['items']:
w += iw
ti += iw * (arm - ref) / c
cg = ref + (ti - k) * c / w
pmac = (cg - x['lemac']) / x['mac'] * 100
return [round(ti, 2), round(pmac, 1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3100.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [50.3, 37.6]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.1]]}, [80.4, 54.0]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.2]]}, [17.2, 19.5]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[2500.0, 18.0]]}, [48.0, 36.4]], ['different constants', {'dow': 36050.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 33485.0, 'doi': 37.0, 'ref': 20.4, 'c': 500.0, 'k': 44.4, 'lemac': 18.68, 'mac': 3.58, 'items': [[4603.0, 5.73], [2919.0, 25.41], [5509.0, 29.73], [5663.0, 28.02]]}, [120.3, 68.4]], ['sampled case 2', {'dow': 45884.0, 'doi': 51.2, 'ref': 20.0, 'c': 200.0, 'k': 57.4, 'lemac': 14.39, 'mac': 4.79, 'items': [[4694.0, 15.31], [4327.0, 9.7], [185.0, 15.41], [4752.0, 22.51], [992.0, 14.27]]}, [-254.74, 95.7]], ['sampled case 3', {'dow': 36007.0, 'doi': 45.2, 'ref': 20.5, 'c': 2000.0, 'k': 46.9, 'lemac': 17.4, 'mac': 3.61, 'items': []}, [45.2, 83.3]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3200.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [49.9, 37.5]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.2]]}, [80.8, 54.2]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.4]]}, [17.9, 19.9]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[5000.0, 18.0]]}, [48.0, 36.4]], ['different constants', {'dow': 36100.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 41485.0, 'doi': 53.7, 'ref': 17.2, 'c': 500.0, 'k': 53.6, 'lemac': 14.91, 'mac': 4.7, 'items': [[323.0, 8.3], [3020.0, 17.98], [2440.0, 14.22]]}, [38.12, 45.2]], ['sampled case 2', {'dow': 36221.0, 'doi': 55.1, 'ref': 19.8, 'c': 2000.0, 'k': 56.4, 'lemac': 18.06, 'mac': 3.42, 'items': [[1053.0, 22.91]]}, [56.74, 51.4]], ['sampled case 3', {'dow': 36359.0, 'doi': 27.6, 'ref': 16.4, 'c': 200.0, 'k': 30.8, 'lemac': 14.16, 'mac': 3.79, 'items': [[2072.0, 5.02]]}, [-90.3, 42.5]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3300.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [49.5, 37.3]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.3]]}, [81.2, 54.5]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.6]]}, [18.6, 20.2]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[7500.0, 18.0]]}, [48.0, 36.5]], ['different constants', {'dow': 36150.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 33923.0, 'doi': 39.1, 'ref': 19.3, 'c': 200.0, 'k': 45.3, 'lemac': 16.18, 'mac': 4.5, 'items': [[3739.0, 10.15]]}, [-131.96, 48.4]], ['sampled case 2', {'dow': 40403.0, 'doi': 39.1, 'ref': 21.4, 'c': 1000.0, 'k': 44.8, 'lemac': 14.64, 'mac': 4.94, 'items': [[4674.0, 28.04]]}, [70.14, 148.2]], ['sampled case 3', {'dow': 30111.0, 'doi': 38.1, 'ref': 15.0, 'c': 200.0, 'k': 36.0, 'lemac': 15.26, 'mac': 4.8, 'items': [[5589.0, 17.22]]}, [100.14, 2.1]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3400.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [49.1, 37.1]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.4]]}, [81.6, 54.7]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 9.8]]}, [19.3, 20.6]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[10000.0, 18.0]]}, [48.0, 36.5]], ['different constants', {'dow': 36200.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 40381.0, 'doi': 38.2, 'ref': 17.2, 'c': 200.0, 'k': 35.3, 'lemac': 17.91, 'mac': 3.25, 'items': [[1141.0, 14.25], [3763.0, 12.45]]}, [-68.0, -35.9]], ['sampled case 2', {'dow': 40833.0, 'doi': 53.7, 'ref': 21.5, 'c': 2000.0, 'k': 48.5, 'lemac': 17.83, 'mac': 3.22, 'items': [[4174.0, 19.61], [2120.0, 18.46], [4779.0, 27.55], [1973.0, 12.04]]}, [51.66, 117.6]], ['sampled case 3', {'dow': 33856.0, 'doi': 31.0, 'ref': 19.9, 'c': 200.0, 'k': 36.6, 'lemac': 18.08, 'mac': 4.82, 'items': []}, [31.0, 37.1]]], [['typical cabin and hold', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 14.0], [5000.0, 19.5], [1200.0, 24.0]]}, [48.7, 36.9]], ['empty operating aircraft', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': []}, [48.0, 36.3]], ['aft hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[4000.0, 26.5]]}, [82.0, 54.9]], ['forward hold heavy', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[3500.0, 10.0]]}, [20.0, 21.0]], ['item at reference arm', {'dow': 42000.0, 'doi': 48.0, 'ref': 18.0, 'c': 1000.0, 'k': 50.0, 'lemac': 16.5, 'mac': 4.0, 'items': [[12500.0, 18.0]]}, [48.0, 36.6]], ['different constants', {'dow': 36250.0, 'doi': 40.0, 'ref': 20.0, 'c': 500.0, 'k': 45.0, 'lemac': 18.0, 'mac': 3.2, 'items': [[1800.0, 22.0], [2200.0, 17.0]]}, [34.0, 58.2]], ['sampled case 1', {'dow': 34075.0, 'doi': 33.7, 'ref': 19.6, 'c': 2000.0, 'k': 36.1, 'lemac': 15.76, 'mac': 3.12, 'items': [[4801.0, 23.6], [3956.0, 16.47], [1810.0, 18.75], [1491.0, 15.01], [3514.0, 6.44]]}, [9.8, 89.1]], ['sampled case 2', {'dow': 33834.0, 'doi': 57.4, 'ref': 20.6, 'c': 500.0, 'k': 55.3, 'lemac': 15.75, 'mac': 3.95, 'items': [[3292.0, 11.8], [4846.0, 14.0], [3222.0, 25.52], [2090.0, 7.1], [168.0, 27.97]]}, [-86.76, 84.9]], ['sampled case 3', {'dow': 46921.0, 'doi': 51.0, 'ref': 17.8, 'c': 500.0, 'k': 52.3, 'lemac': 14.61, 'mac': 3.01, 'items': [[2487.0, 11.85], [4542.0, 19.68]]}, [38.48, 101.7]]]]
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 |
|---|---|---|---|
| typical cabin and hold | [50.3, 37.6] | [50.3, 37.6] | Passed |
| empty operating aircraft | [48.0, 36.3] | [48.0, 36.3] | Passed |
| aft hold heavy | [80.4, 54.0] | [80.4, 54.0] | Passed |
| forward hold heavy | [17.2, 19.5] | [17.2, 19.5] | Passed |
| item at reference arm | [48.0, 36.4] | [48.0, 36.4] | Passed |
| different constants | [34.0, 58.2] | [34.0, 58.2] | Passed |
| sampled case 1 | [120.3, 68.4] | [120.3, 68.4] | Passed |
| sampled case 2 | [-254.74, 95.7] | [-254.74, 95.7] | Passed |
| sampled case 3 | [45.2, 83.3] | [45.2, 83.3] | Passed |
SHA-256 / 29e9cc4a8fe4ede3b8326c94a7b85ee7eaa307ffd8a5b9bb462fd3ae70532e71
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:38.506259+00:00.
Case digest / c3acf08ab24e272cbbc5c3a358d8aafec80fd43a7dc7f0124679e0014fd4cffc