FA-66016 / Aviation weight and balance / Open access
Lap infants charged at the child standard weight · case 01
Rows with lap infants report extra weight that is already included in the adult standard.
ROOT CAUSE
Infants are added to the child count when weighing the row.
VERIFIED REPAIR
Give lap infants zero weight; their mass is in the adult standard weight.
Unsuccessful approach: Charging half a child weight still double-counts infant mass.
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 + inf) * 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 | [1690, 273720.0] | [1526, 246660.0] | Failed |
| winter family rows | [1219, 173400.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 | [872, 123696.0] | [626, 91470.0] | Failed |
| empty cabin bags only | [280, 78400.0] | [280, 78400.0] | Passed |
| sampled case 1 | [3043, 489253.4] | [2434, 382956.8] | Failed |
| sampled case 2 | [1584, 267620.4] | [1497, 253117.5] | Failed |
| sampled case 3 | [738, 124803.6] | [651, 108212.7] | Failed |
SHA-256 / eea34785a58aa9956b1bc7068ae4d2c78395d805506bcd4450dbc233380e0c82
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 + inf * cw // 2
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 | [1608, 260190.0] | [1526, 246660.0] | Failed |
| winter family rows | [1088, 156360.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 | [749, 107583.0] | [626, 91470.0] | Failed |
| empty cabin bags only | [280, 78400.0] | [280, 78400.0] | Passed |
| sampled case 1 | [2737, 435826.4] | [2434, 382956.8] | Failed |
| sampled case 2 | [1540, 260285.6] | [1497, 253117.5] | Failed |
| sampled case 3 | [694, 116412.8] | [651, 108212.7] | Failed |
SHA-256 / 4fc8a467b20e1adc2d67c21308113de2ebff4e52a5c88f243c9b38504c747996
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.211815+00:00.
Case digest / 4a4400da3635402a1264d0a5c292c5063dc76afdd4fb9e0e48f276fa0e9ecaf7