FA-65841 / Aviation weight and balance / Open access
Empty aircraft weight counted without its moment · case 01
Loaded CG sits far forward of any realistic value while total weight looks right.
ROOT CAUSE
The moment accumulator starts at zero, so the basic empty weight enters the weight sum but contributes no moment at its empty-weight arm.
VERIFIED REPAIR
Seed the moment accumulator with empty weight times empty-weight arm.
Unsuccessful approach: Seeding the moment with the empty arm alone confuses an arm (inches) with a moment (lb-in).
Case contract
Input {'empty':[lb,in],'items':[[name,lb,in]],'fuel_gal','fuel_arm','fuel_type'}; fuel density 6.0 lb/gal for 100LL and 6.7 for JETA, other grades return 'ERR_FUEL_TYPE'; negative item weights are removals at that arm; return [total lb, total lb-in, CG in] rounded 1/1/2.
Why this case matters
Loaded-aircraft CG is the sum of station moments divided by total weight; every station, including the empty aircraft and fuel, must contribute both weight and moment.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
dens = {'100LL': 6.0, 'JETA': 6.7}
if x['fuel_type'] not in dens: return 'ERR_FUEL_TYPE'
ew, ea = x['empty']
w = ew
m = 0
for name, iw, ia in x['items']:
w += iw
m += iw * ia
fw = x['fuel_gal'] * dens[x['fuel_type']]
w += fw
m += fw * x['fuel_arm']
cg = m / w
return [round(w, 1), round(m, 1), round(cg, 2)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 171.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 45.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2386.0, 101482.0, 42.53]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 21.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2040.7, 82385.6, 40.37]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 61.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2043.0, 83176.0, 40.71]], ['zero fuel ferry check', {'empty': [1510.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1510.0, 58135.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 10.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1750.5, 41.7], 'items': [['st0', -61.9, 71.4], ['st1', 81.5, 64.2], ['st2', -41.5, 55.2], ['st3', 103.0, 80.5], ['st4', 173.7, 46.3]], 'fuel_gal': 12.5, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2089.1, 91871.5, 43.98]], ['sampled case 2', {'empty': [1408.8, 40.0], 'items': [['st0', 205.1, 51.5], ['st1', 170.5, 96.0], ['st2', 41.8, 41.2]], 'fuel_gal': 42.9, 'fuel_arm': 47.0, 'fuel_type': 'JETA'}, [2113.6, 98514.0, 46.61]], ['sampled case 3', {'empty': [1517.4, 36.7], 'items': [], 'fuel_gal': 20.3, 'fuel_arm': 48.8, 'fuel_type': '100LL'}, [1639.2, 61632.4, 37.6]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 172.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 50.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2392.0, 101994.0, 42.64]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 22.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2047.4, 82707.2, 40.4]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 62.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2044.0, 83256.0, 40.73]], ['zero fuel ferry check', {'empty': [1520.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1520.0, 58520.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 20.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1464.4, 41.7], 'items': [['st0', 205.5, 74.6], ['st1', -137.9, 94.7], ['st2', -78.1, 107.4], ['st3', 7.4, 81.9], ['st4', 48.8, 73.0]], 'fuel_gal': 39.2, 'fuel_arm': 45.3, 'fuel_type': '100LL'}, [1745.3, 69771.7, 39.98]], ['sampled case 2', {'empty': [1609.7, 41.4], 'items': [['st0', 37.0, 68.4], ['st1', 210.3, 87.2]], 'fuel_gal': 9.1, 'fuel_arm': 49.5, 'fuel_type': 'JETA'}, [1918.0, 90528.6, 47.2]], ['sampled case 3', {'empty': [1748.1, 40.4], 'items': [['st0', 142.1, 66.6], ['st1', 114.2, 115.9], ['st2', 214.0, 53.3], ['st3', -210.5, 58.6]], 'fuel_gal': 56.2, 'fuel_arm': 46.6, 'fuel_type': '100LL'}, [2345.1, 108107.3, 46.1]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 173.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 55.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2398.0, 102506.0, 42.75]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 23.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2054.1, 83028.8, 40.42]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 63.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2045.0, 83336.0, 40.75]], ['zero fuel ferry check', {'empty': [1530.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1530.0, 58905.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1793.8, 36.7], 'items': [], 'fuel_gal': 47.3, 'fuel_arm': 49.2, 'fuel_type': '100LL'}, [2077.6, 79795.4, 38.41]], ['sampled case 2', {'empty': [1887.8, 37.9], 'items': [['st0', 210.1, 118.7], ['st1', 160.5, 39.3], ['st2', 183.9, 81.3], ['st3', 75.5, 51.6]], 'fuel_gal': 29.0, 'fuel_arm': 48.1, 'fuel_type': '100LL'}, [2691.8, 130010.4, 48.3]], ['sampled case 3', {'empty': [1787.9, 37.7], 'items': [['st0', 26.8, 31.1], ['st1', -138.4, 66.2], ['st2', 96.1, 66.7], ['st3', 86.1, 100.9], ['st4', 40.8, 92.5]], 'fuel_gal': 44.1, 'fuel_arm': 48.5, 'fuel_type': '100LL'}, [2163.9, 90779.7, 41.95]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 174.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 60.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2404.0, 103018.0, 42.85]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 24.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2060.8, 83350.4, 40.45]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 64.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2046.0, 83416.0, 40.77]], ['zero fuel ferry check', {'empty': [1540.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1540.0, 59290.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1894.8, 39.9], 'items': [['st0', 16.4, 61.4], ['st1', 169.2, 77.5], ['st2', 185.9, 31.1], ['st3', -205.6, 115.1]], 'fuel_gal': 3.1, 'fuel_arm': 49.7, 'fuel_type': '100LL'}, [2079.3, 72763.8, 34.99]], ['sampled case 2', {'empty': [1972.5, 36.6], 'items': [], 'fuel_gal': 22.2, 'fuel_arm': 47.9, 'fuel_type': 'JETA'}, [2121.2, 79318.1, 37.39]], ['sampled case 3', {'empty': [1953.0, 37.4], 'items': [['st0', 15.5, 119.0], ['st1', 86.7, 76.1], ['st2', 189.4, 96.4]], 'fuel_gal': 53.7, 'fuel_arm': 49.2, 'fuel_type': '100LL'}, [2566.8, 115595.0, 45.03]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 175.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 65.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2410.0, 103530.0, 42.96]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 25.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2067.5, 83672.0, 40.47]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 65.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2047.0, 83496.0, 40.79]], ['zero fuel ferry check', {'empty': [1550.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1550.0, 59675.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 50.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1931.2, 41.1], 'items': [], 'fuel_gal': 38.2, 'fuel_arm': 45.5, 'fuel_type': '100LL'}, [2160.4, 89800.9, 41.57]], ['sampled case 2', {'empty': [1766.5, 40.9], 'items': [['st0', -27.8, 60.1], ['st1', 183.8, 57.4], ['st2', 133.5, 84.7], ['st3', 87.9, 53.2], ['st4', -91.2, 76.1]], 'fuel_gal': 53.4, 'fuel_arm': 49.4, 'fuel_type': '100LL'}, [2373.1, 106000.4, 44.67]], ['sampled case 3', {'empty': [1875.6, 41.2], 'items': [['st0', 162.6, 70.4], ['st1', 185.1, 108.0]], 'fuel_gal': 22.0, 'fuel_arm': 47.1, 'fuel_type': 'JETA'}, [2370.7, 115655.1, 48.79]]]]
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 |
|---|---|---|---|
| four-seat normal load | [2386.0, 36802.0, 15.42] | [2386.0, 101482.0, 42.53] | Failed |
| jet-A diesel conversion | [2040.7, 13413.6, 6.57] | [2040.7, 82385.6, 40.37] | Failed |
| removed seat entry | [2043.0, 18496.0, 9.05] | [2043.0, 83176.0, 40.71] | Failed |
| zero fuel ferry check | [1510.0, 0.0, 0.0] | [1510.0, 58135.0, 38.5] | Failed |
| unknown fuel grade | ERR_FUEL_TYPE | ERR_FUEL_TYPE | Passed |
| sampled case 1 | [2089.1, 18875.6, 9.04] | [2089.1, 91871.5, 43.98] | Failed |
| sampled case 2 | [2113.6, 42162.0, 19.95] | [2113.6, 98514.0, 46.61] | Failed |
| sampled case 3 | [1639.2, 5943.8, 3.63] | [1639.2, 61632.4, 37.6] | Failed |
SHA-256 / 1d3acd6ef07d77f6fc9b350e3260a18842d9fb6dabd2166a9b97f7f6f866ba74
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
dens = {'100LL': 6.0, 'JETA': 6.7}
if x['fuel_type'] not in dens: return 'ERR_FUEL_TYPE'
ew, ea = x['empty']
w = ew
m = ea
for name, iw, ia in x['items']:
w += iw
m += iw * ia
fw = x['fuel_gal'] * dens[x['fuel_type']]
w += fw
m += fw * x['fuel_arm']
cg = m / w
return [round(w, 1), round(m, 1), round(cg, 2)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 171.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 45.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2386.0, 101482.0, 42.53]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 21.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2040.7, 82385.6, 40.37]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 61.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2043.0, 83176.0, 40.71]], ['zero fuel ferry check', {'empty': [1510.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1510.0, 58135.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 10.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1750.5, 41.7], 'items': [['st0', -61.9, 71.4], ['st1', 81.5, 64.2], ['st2', -41.5, 55.2], ['st3', 103.0, 80.5], ['st4', 173.7, 46.3]], 'fuel_gal': 12.5, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2089.1, 91871.5, 43.98]], ['sampled case 2', {'empty': [1408.8, 40.0], 'items': [['st0', 205.1, 51.5], ['st1', 170.5, 96.0], ['st2', 41.8, 41.2]], 'fuel_gal': 42.9, 'fuel_arm': 47.0, 'fuel_type': 'JETA'}, [2113.6, 98514.0, 46.61]], ['sampled case 3', {'empty': [1517.4, 36.7], 'items': [], 'fuel_gal': 20.3, 'fuel_arm': 48.8, 'fuel_type': '100LL'}, [1639.2, 61632.4, 37.6]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 172.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 50.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2392.0, 101994.0, 42.64]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 22.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2047.4, 82707.2, 40.4]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 62.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2044.0, 83256.0, 40.73]], ['zero fuel ferry check', {'empty': [1520.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1520.0, 58520.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 20.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1464.4, 41.7], 'items': [['st0', 205.5, 74.6], ['st1', -137.9, 94.7], ['st2', -78.1, 107.4], ['st3', 7.4, 81.9], ['st4', 48.8, 73.0]], 'fuel_gal': 39.2, 'fuel_arm': 45.3, 'fuel_type': '100LL'}, [1745.3, 69771.7, 39.98]], ['sampled case 2', {'empty': [1609.7, 41.4], 'items': [['st0', 37.0, 68.4], ['st1', 210.3, 87.2]], 'fuel_gal': 9.1, 'fuel_arm': 49.5, 'fuel_type': 'JETA'}, [1918.0, 90528.6, 47.2]], ['sampled case 3', {'empty': [1748.1, 40.4], 'items': [['st0', 142.1, 66.6], ['st1', 114.2, 115.9], ['st2', 214.0, 53.3], ['st3', -210.5, 58.6]], 'fuel_gal': 56.2, 'fuel_arm': 46.6, 'fuel_type': '100LL'}, [2345.1, 108107.3, 46.1]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 173.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 55.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2398.0, 102506.0, 42.75]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 23.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2054.1, 83028.8, 40.42]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 63.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2045.0, 83336.0, 40.75]], ['zero fuel ferry check', {'empty': [1530.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1530.0, 58905.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1793.8, 36.7], 'items': [], 'fuel_gal': 47.3, 'fuel_arm': 49.2, 'fuel_type': '100LL'}, [2077.6, 79795.4, 38.41]], ['sampled case 2', {'empty': [1887.8, 37.9], 'items': [['st0', 210.1, 118.7], ['st1', 160.5, 39.3], ['st2', 183.9, 81.3], ['st3', 75.5, 51.6]], 'fuel_gal': 29.0, 'fuel_arm': 48.1, 'fuel_type': '100LL'}, [2691.8, 130010.4, 48.3]], ['sampled case 3', {'empty': [1787.9, 37.7], 'items': [['st0', 26.8, 31.1], ['st1', -138.4, 66.2], ['st2', 96.1, 66.7], ['st3', 86.1, 100.9], ['st4', 40.8, 92.5]], 'fuel_gal': 44.1, 'fuel_arm': 48.5, 'fuel_type': '100LL'}, [2163.9, 90779.7, 41.95]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 174.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 60.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2404.0, 103018.0, 42.85]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 24.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2060.8, 83350.4, 40.45]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 64.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2046.0, 83416.0, 40.77]], ['zero fuel ferry check', {'empty': [1540.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1540.0, 59290.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1894.8, 39.9], 'items': [['st0', 16.4, 61.4], ['st1', 169.2, 77.5], ['st2', 185.9, 31.1], ['st3', -205.6, 115.1]], 'fuel_gal': 3.1, 'fuel_arm': 49.7, 'fuel_type': '100LL'}, [2079.3, 72763.8, 34.99]], ['sampled case 2', {'empty': [1972.5, 36.6], 'items': [], 'fuel_gal': 22.2, 'fuel_arm': 47.9, 'fuel_type': 'JETA'}, [2121.2, 79318.1, 37.39]], ['sampled case 3', {'empty': [1953.0, 37.4], 'items': [['st0', 15.5, 119.0], ['st1', 86.7, 76.1], ['st2', 189.4, 96.4]], 'fuel_gal': 53.7, 'fuel_arm': 49.2, 'fuel_type': '100LL'}, [2566.8, 115595.0, 45.03]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 175.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 65.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2410.0, 103530.0, 42.96]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 25.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2067.5, 83672.0, 40.47]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 65.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2047.0, 83496.0, 40.79]], ['zero fuel ferry check', {'empty': [1550.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1550.0, 59675.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 50.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1931.2, 41.1], 'items': [], 'fuel_gal': 38.2, 'fuel_arm': 45.5, 'fuel_type': '100LL'}, [2160.4, 89800.9, 41.57]], ['sampled case 2', {'empty': [1766.5, 40.9], 'items': [['st0', -27.8, 60.1], ['st1', 183.8, 57.4], ['st2', 133.5, 84.7], ['st3', 87.9, 53.2], ['st4', -91.2, 76.1]], 'fuel_gal': 53.4, 'fuel_arm': 49.4, 'fuel_type': '100LL'}, [2373.1, 106000.4, 44.67]], ['sampled case 3', {'empty': [1875.6, 41.2], 'items': [['st0', 162.6, 70.4], ['st1', 185.1, 108.0]], 'fuel_gal': 22.0, 'fuel_arm': 47.1, 'fuel_type': 'JETA'}, [2370.7, 115655.1, 48.79]]]]
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 |
|---|---|---|---|
| four-seat normal load | [2386.0, 36841.2, 15.44] | [2386.0, 101482.0, 42.53] | Failed |
| jet-A diesel conversion | [2040.7, 13453.7, 6.59] | [2040.7, 82385.6, 40.37] | Failed |
| removed seat entry | [2043.0, 18535.2, 9.07] | [2043.0, 83176.0, 40.71] | Failed |
| zero fuel ferry check | [1510.0, 38.5, 0.03] | [1510.0, 58135.0, 38.5] | Failed |
| unknown fuel grade | ERR_FUEL_TYPE | ERR_FUEL_TYPE | Passed |
| sampled case 1 | [2089.1, 18917.3, 9.06] | [2089.1, 91871.5, 43.98] | Failed |
| sampled case 2 | [2113.6, 42202.0, 19.97] | [2113.6, 98514.0, 46.61] | Failed |
| sampled case 3 | [1639.2, 5980.5, 3.65] | [1639.2, 61632.4, 37.6] | Failed |
SHA-256 / 9ee001af3721f8d6528baaca561e34efab9da82568bf714ad6c06a114ca27c32
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
dens = {'100LL': 6.0, 'JETA': 6.7}
if x['fuel_type'] not in dens: return 'ERR_FUEL_TYPE'
ew, ea = x['empty']
w = ew
m = ew * ea
for name, iw, ia in x['items']:
w += iw
m += iw * ia
fw = x['fuel_gal'] * dens[x['fuel_type']]
w += fw
m += fw * x['fuel_arm']
cg = m / w
return [round(w, 1), round(m, 1), round(cg, 2)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 171.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 45.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2386.0, 101482.0, 42.53]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 21.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2040.7, 82385.6, 40.37]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 61.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2043.0, 83176.0, 40.71]], ['zero fuel ferry check', {'empty': [1510.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1510.0, 58135.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 10.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1750.5, 41.7], 'items': [['st0', -61.9, 71.4], ['st1', 81.5, 64.2], ['st2', -41.5, 55.2], ['st3', 103.0, 80.5], ['st4', 173.7, 46.3]], 'fuel_gal': 12.5, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2089.1, 91871.5, 43.98]], ['sampled case 2', {'empty': [1408.8, 40.0], 'items': [['st0', 205.1, 51.5], ['st1', 170.5, 96.0], ['st2', 41.8, 41.2]], 'fuel_gal': 42.9, 'fuel_arm': 47.0, 'fuel_type': 'JETA'}, [2113.6, 98514.0, 46.61]], ['sampled case 3', {'empty': [1517.4, 36.7], 'items': [], 'fuel_gal': 20.3, 'fuel_arm': 48.8, 'fuel_type': '100LL'}, [1639.2, 61632.4, 37.6]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 172.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 50.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2392.0, 101994.0, 42.64]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 22.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2047.4, 82707.2, 40.4]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 62.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2044.0, 83256.0, 40.73]], ['zero fuel ferry check', {'empty': [1520.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1520.0, 58520.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 20.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1464.4, 41.7], 'items': [['st0', 205.5, 74.6], ['st1', -137.9, 94.7], ['st2', -78.1, 107.4], ['st3', 7.4, 81.9], ['st4', 48.8, 73.0]], 'fuel_gal': 39.2, 'fuel_arm': 45.3, 'fuel_type': '100LL'}, [1745.3, 69771.7, 39.98]], ['sampled case 2', {'empty': [1609.7, 41.4], 'items': [['st0', 37.0, 68.4], ['st1', 210.3, 87.2]], 'fuel_gal': 9.1, 'fuel_arm': 49.5, 'fuel_type': 'JETA'}, [1918.0, 90528.6, 47.2]], ['sampled case 3', {'empty': [1748.1, 40.4], 'items': [['st0', 142.1, 66.6], ['st1', 114.2, 115.9], ['st2', 214.0, 53.3], ['st3', -210.5, 58.6]], 'fuel_gal': 56.2, 'fuel_arm': 46.6, 'fuel_type': '100LL'}, [2345.1, 108107.3, 46.1]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 173.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 55.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2398.0, 102506.0, 42.75]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 23.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2054.1, 83028.8, 40.42]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 63.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2045.0, 83336.0, 40.75]], ['zero fuel ferry check', {'empty': [1530.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1530.0, 58905.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1793.8, 36.7], 'items': [], 'fuel_gal': 47.3, 'fuel_arm': 49.2, 'fuel_type': '100LL'}, [2077.6, 79795.4, 38.41]], ['sampled case 2', {'empty': [1887.8, 37.9], 'items': [['st0', 210.1, 118.7], ['st1', 160.5, 39.3], ['st2', 183.9, 81.3], ['st3', 75.5, 51.6]], 'fuel_gal': 29.0, 'fuel_arm': 48.1, 'fuel_type': '100LL'}, [2691.8, 130010.4, 48.3]], ['sampled case 3', {'empty': [1787.9, 37.7], 'items': [['st0', 26.8, 31.1], ['st1', -138.4, 66.2], ['st2', 96.1, 66.7], ['st3', 86.1, 100.9], ['st4', 40.8, 92.5]], 'fuel_gal': 44.1, 'fuel_arm': 48.5, 'fuel_type': '100LL'}, [2163.9, 90779.7, 41.95]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 174.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 60.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2404.0, 103018.0, 42.85]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 24.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2060.8, 83350.4, 40.45]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 64.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2046.0, 83416.0, 40.77]], ['zero fuel ferry check', {'empty': [1540.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1540.0, 59290.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1894.8, 39.9], 'items': [['st0', 16.4, 61.4], ['st1', 169.2, 77.5], ['st2', 185.9, 31.1], ['st3', -205.6, 115.1]], 'fuel_gal': 3.1, 'fuel_arm': 49.7, 'fuel_type': '100LL'}, [2079.3, 72763.8, 34.99]], ['sampled case 2', {'empty': [1972.5, 36.6], 'items': [], 'fuel_gal': 22.2, 'fuel_arm': 47.9, 'fuel_type': 'JETA'}, [2121.2, 79318.1, 37.39]], ['sampled case 3', {'empty': [1953.0, 37.4], 'items': [['st0', 15.5, 119.0], ['st1', 86.7, 76.1], ['st2', 189.4, 96.4]], 'fuel_gal': 53.7, 'fuel_arm': 49.2, 'fuel_type': '100LL'}, [2566.8, 115595.0, 45.03]]], [['four-seat normal load', {'empty': [1650.0, 39.2], 'items': [['pilot', 175.0, 37.0], ['front pax', 160.0, 37.0], ['rear pax', 120.0, 73.0], ['baggage', 65.0, 95.0]], 'fuel_gal': 40.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2410.0, 103530.0, 42.96]], ['jet-A diesel conversion', {'empty': [1720.0, 40.1], 'items': [['pilot', 180.0, 37.0]], 'fuel_gal': 25.0, 'fuel_arm': 48.0, 'fuel_type': 'JETA'}, [2067.5, 83672.0, 40.47]], ['removed seat entry', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0], ['rear seat removed', -18.0, 73.0], ['cargo', 65.0, 80.0]], 'fuel_gal': 30.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [2047.0, 83496.0, 40.79]], ['zero fuel ferry check', {'empty': [1550.0, 38.5], 'items': [], 'fuel_gal': 0.0, 'fuel_arm': 48.0, 'fuel_type': '100LL'}, [1550.0, 59675.0, 38.5]], ['unknown fuel grade', {'empty': [1650.0, 39.2], 'items': [['pilot', 170.0, 37.0]], 'fuel_gal': 50.0, 'fuel_arm': 48.0, 'fuel_type': 'MOGAS'}, 'ERR_FUEL_TYPE'], ['sampled case 1', {'empty': [1931.2, 41.1], 'items': [], 'fuel_gal': 38.2, 'fuel_arm': 45.5, 'fuel_type': '100LL'}, [2160.4, 89800.9, 41.57]], ['sampled case 2', {'empty': [1766.5, 40.9], 'items': [['st0', -27.8, 60.1], ['st1', 183.8, 57.4], ['st2', 133.5, 84.7], ['st3', 87.9, 53.2], ['st4', -91.2, 76.1]], 'fuel_gal': 53.4, 'fuel_arm': 49.4, 'fuel_type': '100LL'}, [2373.1, 106000.4, 44.67]], ['sampled case 3', {'empty': [1875.6, 41.2], 'items': [['st0', 162.6, 70.4], ['st1', 185.1, 108.0]], 'fuel_gal': 22.0, 'fuel_arm': 47.1, 'fuel_type': 'JETA'}, [2370.7, 115655.1, 48.79]]]]
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 |
|---|---|---|---|
| four-seat normal load | [2386.0, 101482.0, 42.53] | [2386.0, 101482.0, 42.53] | Passed |
| jet-A diesel conversion | [2040.7, 82385.6, 40.37] | [2040.7, 82385.6, 40.37] | Passed |
| removed seat entry | [2043.0, 83176.0, 40.71] | [2043.0, 83176.0, 40.71] | Passed |
| zero fuel ferry check | [1510.0, 58135.0, 38.5] | [1510.0, 58135.0, 38.5] | Passed |
| unknown fuel grade | ERR_FUEL_TYPE | ERR_FUEL_TYPE | Passed |
| sampled case 1 | [2089.1, 91871.5, 43.98] | [2089.1, 91871.5, 43.98] | Passed |
| sampled case 2 | [2113.6, 98514.0, 46.61] | [2113.6, 98514.0, 46.61] | Passed |
| sampled case 3 | [1639.2, 61632.4, 37.6] | [1639.2, 61632.4, 37.6] | Passed |
SHA-256 / 01a0e70ffa8e5e159c00c562f309dedb36d822b23c5fd17c94d3a13bee87fa88
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:37.861056+00:00.
Case digest / 09302526bc891f8e4a431ed3d41302d9fac429f5411253d987ead91f04b3078a