FA-65851 / Aviation weight and balance / Open access
Fuel moment computed from gallons instead of pounds · case 01
Adding fuel moves the computed CG forward even though the tanks are aft of the loaded CG.
ROOT CAUSE
Fuel weight is added in pounds but the fuel moment multiplies the raw gallon quantity by the tank arm.
VERIFIED REPAIR
Multiply the converted fuel weight in pounds by the fuel arm.
Unsuccessful approach: Placing the fuel weight at the empty-weight arm uses pounds but the wrong station, so tank location is lost.
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 = 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 += x['fuel_gal'] * 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, 91882.0, 38.51] | [2386.0, 101482.0, 42.53] | Failed |
| jet-A diesel conversion | [2040.7, 76640.0, 37.56] | [2040.7, 82385.6, 40.37] | Failed |
| removed seat entry | [2043.0, 75976.0, 37.19] | [2043.0, 83176.0, 40.71] | Failed |
| 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, 88451.5, 42.34] | [2089.1, 91871.5, 43.98] | Failed |
| sampled case 2 | [2113.6, 87021.1, 41.17] | [2113.6, 98514.0, 46.61] | Failed |
| sampled case 3 | [1639.2, 56679.2, 34.58] | [1639.2, 61632.4, 37.6] | Failed |
SHA-256 / 24989136e3d51ee0aee9d06b917d69047829e20ada60831015a3df58fe95c5c8
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 = 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 * ea
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, 99370.0, 41.65] | [2386.0, 101482.0, 42.53] | Failed |
| jet-A diesel conversion | [2040.7, 81274.1, 39.83] | [2040.7, 82385.6, 40.37] | Failed |
| removed seat entry | [2043.0, 81592.0, 39.94] | [2043.0, 83176.0, 40.71] | Failed |
| 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, 91343.9, 43.73] | [2089.1, 91871.5, 43.98] | Failed |
| sampled case 2 | [2113.6, 96502.0, 45.66] | [2113.6, 98514.0, 46.61] | Failed |
| sampled case 3 | [1639.2, 60158.6, 36.7] | [1639.2, 61632.4, 37.6] | Failed |
SHA-256 / 06a75623f6f09f53b313d188c227add0fbf553e7141b5f24e557f812af5c746d
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.870125+00:00.
Case digest / 4eba38110240637f18a1930d1a903c3e9b1a12d0213811d7f5d197b0f62dac49