FA-66031 / Aviation weight and balance / Open access
Baggage moment computed from bag count · case 01
Bag weight appears in the total but the hold barely moves the moment.
ROOT CAUSE
The baggage moment multiplies the bag count by the arm and omits the standard bag weight.
VERIFIED REPAIR
Multiply bag count by 28 lb and by the hold arm.
Unsuccessful approach: Using one bag weight per hold entry ignores how many bags are loaded.
Case contract
Input {'season','rows':[[arm, adults, children, lap infants]],'bags':[[arm,count]]}. Standard weights: adult 190/195, child 82/87 (summer/winter); lap infants weigh 0 (included with the adult); bags 28 lb. Rows are numbered from 1; more than 3 seated (adults+children) -> 'ERR_ROW_<n>_SEATS'; more infants than adults -> 'ERR_ROW_<n>_INFANTS'. Return [weight, moment r1].
Why this case matters
Standard passenger weights vary by season and passenger type; lap infants do not occupy seats but require an accompanying adult.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
std = {'summer': (190, 82), 'winter': (195, 87)}
aw, cw = std[x['season']]
w = 0
m = 0.0
for i, (arm, ad, ch, inf) in enumerate(x['rows'], 1):
if ad + ch > 3: return 'ERR_ROW_%d_SEATS' % i
if inf > ad: return 'ERR_ROW_%d_INFANTS' % i
rw = ad * aw + ch * cw
w += rw
m += rw * arm
for arm, count in x['bags']:
w += count * 28
m += count * arm
return [w, round(m, 1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 2, 1]], 'bags': [[300.0, 5]]}, [1526, 246660.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 1]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[131.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 91470.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 10]]}, [280, 78400.0]], ['sampled case 1', {'season': 'winter', 'rows': [[123.2, 3, 0, 2], [224.7, 2, 0, 1], [209.0, 3, 0, 3], [101.5, 0, 3, 0], [123.7, 3, 0, 1]], 'bags': [[76.1, 1], [114.8, 0]]}, [2434, 382956.8]], ['sampled case 2', {'season': 'winter', 'rows': [[232.3, 0, 3, 0], [166.7, 1, 2, 1], [113.6, 2, 0, 0], [181.7, 2, 1, 0]], 'bags': []}, [1497, 253117.5]], ['sampled case 3', {'season': 'winter', 'rows': [[190.7, 1, 2, 1], [134.2, 1, 1, 0]], 'bags': []}, [651, 108212.7]]], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 1, 1]], 'bags': [[300.0, 6]]}, [1472, 240300.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 2]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[132.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 92040.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 20]]}, [560, 156800.0]], ['sampled case 1', {'season': 'winter', 'rows': [[207.9, 3, 3, 2], [166.6, 2, 1, 1], [191.5, 2, 1, 3]], 'bags': [[191.7, 3]]}, 'ERR_ROW_1_SEATS'], ['sampled case 2', {'season': 'summer', 'rows': [[239.0, 3, 0, 3], [126.1, 3, 0, 0], [248.5, 0, 3, 0], [203.8, 0, 1, 0]], 'bags': []}, [1468, 285949.6]], ['sampled case 3', {'season': 'summer', 'rows': [[112.7, 1, 0, 2], [246.6, 1, 1, 0]], 'bags': []}, 'ERR_ROW_1_INFANTS']], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 2, 1]], 'bags': [[300.0, 7]]}, [1582, 263460.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 3]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[133.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 92610.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 30]]}, [840, 235200.0]], ['sampled case 1', {'season': 'winter', 'rows': [[247.7, 2, 3, 0]], 'bags': [[219.7, 7]]}, 'ERR_ROW_1_SEATS'], ['sampled case 2', {'season': 'winter', 'rows': [[186.6, 3, 0, 2]], 'bags': [[127.2, 7]]}, [781, 134092.2]], ['sampled case 3', {'season': 'winter', 'rows': [[112.7, 0, 3, 0], [159.8, 1, 0, 1], [131.3, 2, 1, 2], [112.7, 3, 0, 0]], 'bags': []}, [1518, 189135.3]]], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 1, 1]], 'bags': [[300.0, 8]]}, [1528, 257100.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 4]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[134.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 93180.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 40]]}, [1120, 313600.0]], ['sampled case 1', {'season': 'winter', 'rows': [[121.9, 2, 0, 0], [208.1, 0, 0, 0]], 'bags': [[285.3, 11]]}, [698, 135413.4]], ['sampled case 2', {'season': 'summer', 'rows': [[192.5, 1, 2, 1], [210.4, 0, 1, 0], [164.1, 3, 0, 3], [177.2, 1, 1, 1]], 'bags': []}, [1278, 227133.2]], ['sampled case 3', {'season': 'summer', 'rows': [[129.9, 2, 1, 0], [217.8, 2, 0, 1], [102.4, 0, 1, 0], [102.1, 2, 0, 0], [219.8, 2, 1, 2]], 'bags': []}, [1766, 291520.2]]], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 2, 1]], 'bags': [[300.0, 9]]}, [1638, 280260.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 5]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[135.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 93750.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 50]]}, [1400, 392000.0]], ['sampled case 1', {'season': 'summer', 'rows': [[127.4, 1, 0, 1], [239.5, 1, 2, 1], [187.1, 3, 3, 3]], 'bags': [[167.2, 12], [227.4, 2]]}, 'ERR_ROW_3_SEATS'], ['sampled case 2', {'season': 'summer', 'rows': [[134.7, 0, 2, 0], [113.2, 2, 1, 1], [126.4, 0, 0, 3], [248.9, 2, 1, 1], [227.0, 1, 1, 1]], 'bags': []}, 'ERR_ROW_3_INFANTS'], ['sampled case 3', {'season': 'summer', 'rows': [[227.7, 2, 0, 2], [101.0, 1, 2, 0], [158.6, 3, 0, 3], [211.0, 1, 0, 1]], 'bags': [[271.3, 10]]}, [1774, 328736.0]]]]
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 |
|---|---|---|---|
| summer mixed cabin | [1526, 206160.0] | [1526, 246660.0] | Failed |
| winter family rows | [958, 113550.0] | [958, 139470.0] | Failed |
| row full of seats | ERR_ROW_1_SEATS | ERR_ROW_1_SEATS | Passed |
| two lap infants one adult | ERR_ROW_2_INFANTS | ERR_ROW_2_INFANTS | Passed |
| three adults three infants | [626, 75270.0] | [626, 91470.0] | Failed |
| empty cabin bags only | [280, 2800.0] | [280, 78400.0] | Failed |
| sampled case 1 | [2434, 380902.1] | [2434, 382956.8] | Failed |
| sampled case 2 | [1497, 253117.5] | [1497, 253117.5] | Passed |
| sampled case 3 | [651, 108212.7] | [651, 108212.7] | Passed |
SHA-256 / 21936b74ebf2f9f2a602c2ebedbebc3e7637a77af93f4a3894d165d195c6c177
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
std = {'summer': (190, 82), 'winter': (195, 87)}
aw, cw = std[x['season']]
w = 0
m = 0.0
for i, (arm, ad, ch, inf) in enumerate(x['rows'], 1):
if ad + ch > 3: return 'ERR_ROW_%d_SEATS' % i
if inf > ad: return 'ERR_ROW_%d_INFANTS' % i
rw = ad * aw + ch * cw
w += rw
m += rw * arm
for arm, count in x['bags']:
w += count * 28
m += 28 * arm
return [w, round(m, 1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 2, 1]], 'bags': [[300.0, 5]]}, [1526, 246660.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 1]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[131.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 91470.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 10]]}, [280, 78400.0]], ['sampled case 1', {'season': 'winter', 'rows': [[123.2, 3, 0, 2], [224.7, 2, 0, 1], [209.0, 3, 0, 3], [101.5, 0, 3, 0], [123.7, 3, 0, 1]], 'bags': [[76.1, 1], [114.8, 0]]}, [2434, 382956.8]], ['sampled case 2', {'season': 'winter', 'rows': [[232.3, 0, 3, 0], [166.7, 1, 2, 1], [113.6, 2, 0, 0], [181.7, 2, 1, 0]], 'bags': []}, [1497, 253117.5]], ['sampled case 3', {'season': 'winter', 'rows': [[190.7, 1, 2, 1], [134.2, 1, 1, 0]], 'bags': []}, [651, 108212.7]]], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 1, 1]], 'bags': [[300.0, 6]]}, [1472, 240300.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 2]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[132.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 92040.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 20]]}, [560, 156800.0]], ['sampled case 1', {'season': 'winter', 'rows': [[207.9, 3, 3, 2], [166.6, 2, 1, 1], [191.5, 2, 1, 3]], 'bags': [[191.7, 3]]}, 'ERR_ROW_1_SEATS'], ['sampled case 2', {'season': 'summer', 'rows': [[239.0, 3, 0, 3], [126.1, 3, 0, 0], [248.5, 0, 3, 0], [203.8, 0, 1, 0]], 'bags': []}, [1468, 285949.6]], ['sampled case 3', {'season': 'summer', 'rows': [[112.7, 1, 0, 2], [246.6, 1, 1, 0]], 'bags': []}, 'ERR_ROW_1_INFANTS']], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 2, 1]], 'bags': [[300.0, 7]]}, [1582, 263460.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 3]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[133.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 92610.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 30]]}, [840, 235200.0]], ['sampled case 1', {'season': 'winter', 'rows': [[247.7, 2, 3, 0]], 'bags': [[219.7, 7]]}, 'ERR_ROW_1_SEATS'], ['sampled case 2', {'season': 'winter', 'rows': [[186.6, 3, 0, 2]], 'bags': [[127.2, 7]]}, [781, 134092.2]], ['sampled case 3', {'season': 'winter', 'rows': [[112.7, 0, 3, 0], [159.8, 1, 0, 1], [131.3, 2, 1, 2], [112.7, 3, 0, 0]], 'bags': []}, [1518, 189135.3]]], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 1, 1]], 'bags': [[300.0, 8]]}, [1528, 257100.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 4]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[134.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 93180.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 40]]}, [1120, 313600.0]], ['sampled case 1', {'season': 'winter', 'rows': [[121.9, 2, 0, 0], [208.1, 0, 0, 0]], 'bags': [[285.3, 11]]}, [698, 135413.4]], ['sampled case 2', {'season': 'summer', 'rows': [[192.5, 1, 2, 1], [210.4, 0, 1, 0], [164.1, 3, 0, 3], [177.2, 1, 1, 1]], 'bags': []}, [1278, 227133.2]], ['sampled case 3', {'season': 'summer', 'rows': [[129.9, 2, 1, 0], [217.8, 2, 0, 1], [102.4, 0, 1, 0], [102.1, 2, 0, 0], [219.8, 2, 1, 2]], 'bags': []}, [1766, 291520.2]]], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 2, 1]], 'bags': [[300.0, 9]]}, [1638, 280260.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 5]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[135.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 93750.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 50]]}, [1400, 392000.0]], ['sampled case 1', {'season': 'summer', 'rows': [[127.4, 1, 0, 1], [239.5, 1, 2, 1], [187.1, 3, 3, 3]], 'bags': [[167.2, 12], [227.4, 2]]}, 'ERR_ROW_3_SEATS'], ['sampled case 2', {'season': 'summer', 'rows': [[134.7, 0, 2, 0], [113.2, 2, 1, 1], [126.4, 0, 0, 3], [248.9, 2, 1, 1], [227.0, 1, 1, 1]], 'bags': []}, 'ERR_ROW_3_INFANTS'], ['sampled case 3', {'season': 'summer', 'rows': [[227.7, 2, 0, 2], [101.0, 1, 2, 0], [158.6, 3, 0, 3], [211.0, 1, 0, 1]], 'bags': [[271.3, 10]]}, [1774, 328736.0]]]]
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 |
|---|---|---|---|
| summer mixed cabin | [1526, 213060.0] | [1526, 246660.0] | Failed |
| winter family rows | [958, 122670.0] | [958, 139470.0] | Failed |
| row full of seats | ERR_ROW_1_SEATS | ERR_ROW_1_SEATS | Passed |
| two lap infants one adult | ERR_ROW_2_INFANTS | ERR_ROW_2_INFANTS | Passed |
| three adults three infants | [626, 83070.0] | [626, 91470.0] | Failed |
| empty cabin bags only | [280, 7840.0] | [280, 78400.0] | Failed |
| sampled case 1 | [2434, 386171.2] | [2434, 382956.8] | Failed |
| sampled case 2 | [1497, 253117.5] | [1497, 253117.5] | Passed |
| sampled case 3 | [651, 108212.7] | [651, 108212.7] | Passed |
SHA-256 / b339f642ae095839ecdf7c7874680d710167b237195bf43922e81799b932409f
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
std = {'summer': (190, 82), 'winter': (195, 87)}
aw, cw = std[x['season']]
w = 0
m = 0.0
for i, (arm, ad, ch, inf) in enumerate(x['rows'], 1):
if ad + ch > 3: return 'ERR_ROW_%d_SEATS' % i
if inf > ad: return 'ERR_ROW_%d_INFANTS' % i
rw = ad * aw + ch * cw
w += rw
m += rw * arm
for arm, count in x['bags']:
w += count * 28
m += count * 28 * arm
return [w, round(m, 1)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 2, 1]], 'bags': [[300.0, 5]]}, [1526, 246660.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 1]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[131.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 91470.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 10]]}, [280, 78400.0]], ['sampled case 1', {'season': 'winter', 'rows': [[123.2, 3, 0, 2], [224.7, 2, 0, 1], [209.0, 3, 0, 3], [101.5, 0, 3, 0], [123.7, 3, 0, 1]], 'bags': [[76.1, 1], [114.8, 0]]}, [2434, 382956.8]], ['sampled case 2', {'season': 'winter', 'rows': [[232.3, 0, 3, 0], [166.7, 1, 2, 1], [113.6, 2, 0, 0], [181.7, 2, 1, 0]], 'bags': []}, [1497, 253117.5]], ['sampled case 3', {'season': 'winter', 'rows': [[190.7, 1, 2, 1], [134.2, 1, 1, 0]], 'bags': []}, [651, 108212.7]]], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 1, 1]], 'bags': [[300.0, 6]]}, [1472, 240300.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 2]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[132.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 92040.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 20]]}, [560, 156800.0]], ['sampled case 1', {'season': 'winter', 'rows': [[207.9, 3, 3, 2], [166.6, 2, 1, 1], [191.5, 2, 1, 3]], 'bags': [[191.7, 3]]}, 'ERR_ROW_1_SEATS'], ['sampled case 2', {'season': 'summer', 'rows': [[239.0, 3, 0, 3], [126.1, 3, 0, 0], [248.5, 0, 3, 0], [203.8, 0, 1, 0]], 'bags': []}, [1468, 285949.6]], ['sampled case 3', {'season': 'summer', 'rows': [[112.7, 1, 0, 2], [246.6, 1, 1, 0]], 'bags': []}, 'ERR_ROW_1_INFANTS']], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 2, 1]], 'bags': [[300.0, 7]]}, [1582, 263460.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 3]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[133.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 92610.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 30]]}, [840, 235200.0]], ['sampled case 1', {'season': 'winter', 'rows': [[247.7, 2, 3, 0]], 'bags': [[219.7, 7]]}, 'ERR_ROW_1_SEATS'], ['sampled case 2', {'season': 'winter', 'rows': [[186.6, 3, 0, 2]], 'bags': [[127.2, 7]]}, [781, 134092.2]], ['sampled case 3', {'season': 'winter', 'rows': [[112.7, 0, 3, 0], [159.8, 1, 0, 1], [131.3, 2, 1, 2], [112.7, 3, 0, 0]], 'bags': []}, [1518, 189135.3]]], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 1, 1]], 'bags': [[300.0, 8]]}, [1528, 257100.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 4]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[134.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 93180.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 40]]}, [1120, 313600.0]], ['sampled case 1', {'season': 'winter', 'rows': [[121.9, 2, 0, 0], [208.1, 0, 0, 0]], 'bags': [[285.3, 11]]}, [698, 135413.4]], ['sampled case 2', {'season': 'summer', 'rows': [[192.5, 1, 2, 1], [210.4, 0, 1, 0], [164.1, 3, 0, 3], [177.2, 1, 1, 1]], 'bags': []}, [1278, 227133.2]], ['sampled case 3', {'season': 'summer', 'rows': [[129.9, 2, 1, 0], [217.8, 2, 0, 1], [102.4, 0, 1, 0], [102.1, 2, 0, 0], [219.8, 2, 1, 2]], 'bags': []}, [1766, 291520.2]]], [['summer mixed cabin', {'season': 'summer', 'rows': [[120.0, 2, 1, 0], [150.0, 3, 0, 1], [180.0, 1, 2, 1]], 'bags': [[300.0, 9]]}, [1638, 280260.0]], ['winter family rows', {'season': 'winter', 'rows': [[120.0, 2, 1, 2], [150.0, 1, 2, 1]], 'bags': [[300.0, 3], [60.0, 1]]}, [958, 139470.0]], ['row full of seats', {'season': 'summer', 'rows': [[120.0, 2, 2, 0], [150.0, 1, 0, 0]], 'bags': []}, 'ERR_ROW_1_SEATS'], ['two lap infants one adult', {'season': 'winter', 'rows': [[120.0, 1, 1, 0], [150.0, 1, 1, 2]], 'bags': [[300.0, 5]]}, 'ERR_ROW_2_INFANTS'], ['three adults three infants', {'season': 'summer', 'rows': [[135.0, 3, 0, 3]], 'bags': [[300.0, 2]]}, [626, 93750.0]], ['empty cabin bags only', {'season': 'winter', 'rows': [], 'bags': [[280.0, 50]]}, [1400, 392000.0]], ['sampled case 1', {'season': 'summer', 'rows': [[127.4, 1, 0, 1], [239.5, 1, 2, 1], [187.1, 3, 3, 3]], 'bags': [[167.2, 12], [227.4, 2]]}, 'ERR_ROW_3_SEATS'], ['sampled case 2', {'season': 'summer', 'rows': [[134.7, 0, 2, 0], [113.2, 2, 1, 1], [126.4, 0, 0, 3], [248.9, 2, 1, 1], [227.0, 1, 1, 1]], 'bags': []}, 'ERR_ROW_3_INFANTS'], ['sampled case 3', {'season': 'summer', 'rows': [[227.7, 2, 0, 2], [101.0, 1, 2, 0], [158.6, 3, 0, 3], [211.0, 1, 0, 1]], 'bags': [[271.3, 10]]}, [1774, 328736.0]]]]
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 |
|---|---|---|---|
| summer mixed cabin | [1526, 246660.0] | [1526, 246660.0] | Passed |
| winter family rows | [958, 139470.0] | [958, 139470.0] | Passed |
| row full of seats | ERR_ROW_1_SEATS | ERR_ROW_1_SEATS | Passed |
| two lap infants one adult | ERR_ROW_2_INFANTS | ERR_ROW_2_INFANTS | Passed |
| three adults three infants | [626, 91470.0] | [626, 91470.0] | Passed |
| empty cabin bags only | [280, 78400.0] | [280, 78400.0] | Passed |
| sampled case 1 | [2434, 382956.8] | [2434, 382956.8] | Passed |
| sampled case 2 | [1497, 253117.5] | [1497, 253117.5] | Passed |
| sampled case 3 | [651, 108212.7] | [651, 108212.7] | Passed |
SHA-256 / 2cf53b9a8ca49b48b50e50e6af946027a844c7450dad6c7fd3acc895c393ebeb
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:39.299371+00:00.
Case digest / d8d8b46effa2686633b2b330ab4b5b4569995861418c2c58d3a43c26dce2fa12