FA-66186 / Aviation weight and balance / Open access
Lateral CG divided by off-centerline weight only · case 01
One passenger in a side seat produces a lateral CG equal to the seat arm.
ROOT CAUSE
Items on the centerline are excluded from the lateral divisor, so they do not dilute the lateral offset.
VERIFIED REPAIR
Divide lateral moment by total aircraft weight.
Unsuccessful approach: Excluding just the basic empty weight still omits the largest centerline mass.
Case contract
Input {'items':[[lb, longitudinal arm, lateral arm]] (first item basic empty weight; lateral right positive),'long_env':[fwd,aft],'lat_limit':L}. Longitudinal CG must be within inclusive limits; |lateral CG| <= L. Status 'BOTH','LONG','LAT' or 'OK'. Return [long CG r2, signed lateral CG r2, status].
Why this case matters
Helicopters have a lateral CG limit as well as a longitudinal one; lateral arms are signed and all weight, including centerline weight, dilutes the lateral offset.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
w = sum(i[0] for i in x['items'])
lon = sum(i[0] * i[1] for i in x['items']) / w
lat = sum(i[0] * i[2] for i in x['items']) / (sum(i[0] for i in x['items'] if i[2] != 0) or w)
fwd, aft = x['long_env']
L = x['lat_limit']
bad_long = lon < fwd or lon > aft
bad_lat = abs(lat) > L
if bad_long and bad_lat: s = 'BOTH'
elif bad_long: s = 'LONG'
elif bad_lat: s = 'LAT'
else: s = 'OK'
return [round(lon, 2), round(lat, 2), s]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [310.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.55, -3.01, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [420.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.51, 4.73, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 161.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.09, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 66.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.58, 0.0, 'LONG']], ['sampled case 1', {'items': [[1961.0, 113.2, 0.0], [371.0, 107.7, 0.3], [251.0, 126.9, -11.0], [283.0, 99.2, 3.8]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [112.31, -0.55, 'OK']], ['sampled case 2', {'items': [[2056.0, 105.5, 0.0], [244.0, 115.4, -33.1], [51.0, 86.6, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.12, -3.44, 'LAT']], ['sampled case 3', {'items': [[1573.0, 113.1, 0.0], [218.0, 100.6, 0.0], [255.0, 143.2, 0.0], [202.0, 145.5, 16.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [118.21, 1.44, 'LONG']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [320.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.58, -3.13, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [440.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.57, 4.91, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 162.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.3, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 67.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.67, 0.0, 'LONG']], ['sampled case 1', {'items': [[1956.0, 112.6, 0.0], [262.0, 87.0, 0.0], [311.0, 118.3, -13.5]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [110.65, -1.66, 'OK']], ['sampled case 2', {'items': [[1709.0, 112.8, 0.0], [205.0, 168.9, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [118.81, 0.0, 'LONG']], ['sampled case 3', {'items': [[2050.0, 107.5, 0.0], [396.0, 119.4, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [109.43, 0.0, 'OK']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [330.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.6, -3.24, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [460.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.63, 5.09, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 163.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.52, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 68.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.75, 0.0, 'LONG']], ['sampled case 1', {'items': [[1870.0, 106.8, 0.0], [263.0, 80.8, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [103.59, 0.0, 'LONG']], ['sampled case 2', {'items': [[2084.0, 112.7, 0.0], [383.0, 162.2, 0.0], [215.0, 163.9, 0.0], [379.0, 65.5, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [116.65, 0.0, 'LONG']], ['sampled case 3', {'items': [[1712.0, 106.9, 0.0], [282.0, 88.8, 29.4], [279.0, 81.2, -9.0], [165.0, 68.5, -8.2]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [99.27, 1.82, 'LONG']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [340.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.62, -3.36, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [480.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.68, 5.26, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 164.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.74, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 69.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.83, 0.0, 'LONG']], ['sampled case 1', {'items': [[2164.0, 108.0, 0.0], [331.0, 62.5, 24.8], [175.0, 152.3, -14.7], [218.0, 112.0, 12.0], [108.0, 129.6, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [106.63, 2.75, 'OK']], ['sampled case 2', {'items': [[1554.0, 108.9, 0.0], [184.0, 75.6, 28.9], [77.0, 116.1, 0.0], [358.0, 115.4, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [107.41, 2.45, 'OK']], ['sampled case 3', {'items': [[1514.0, 113.4, 0.0], [218.0, 155.2, 0.0], [117.0, 109.5, 0.0], [227.0, 101.1, 20.4]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [116.22, 2.23, 'LONG']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [350.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.65, -3.47, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [500.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.74, 5.43, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 165.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.96, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 70.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.92, 0.0, 'LONG']], ['sampled case 1', {'items': [[1717.0, 110.6, 0.0], [378.0, 92.3, -4.6], [315.0, 61.3, 28.1], [372.0, 157.6, 0.0], [66.0, 72.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [107.96, 2.5, 'OK']], ['sampled case 2', {'items': [[2148.0, 111.8, 0.0], [222.0, 97.1, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [110.42, 0.0, 'OK']], ['sampled case 3', {'items': [[1553.0, 108.8, 0.0], [213.0, 118.8, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [110.01, 0.0, 'OK']]]]
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 |
|---|---|---|---|
| pilot right seat | [106.36, 12.5, 'LAT'] | [106.36, 1.18, 'OK'] | Failed |
| heavy left hoist load | [106.55, -13.85, 'LAT'] | [106.55, -3.01, 'LAT'] | Failed |
| right side cargo | [113.51, 25.0, 'LAT'] | [113.51, 4.73, 'LAT'] | Failed |
| exactly on lateral limit | [110.0, 23.0, 'LAT'] | [110.0, 3.0, 'OK'] | Failed |
| longitudinal and lateral out | [121.09, -20.0, 'BOTH'] | [121.09, -4.35, 'BOTH'] | Failed |
| balanced pair | [102.58, 0.0, 'LONG'] | [102.58, 0.0, 'LONG'] | Passed |
| sampled case 1 | [112.31, -1.74, 'OK'] | [112.31, -0.55, 'OK'] | Failed |
| sampled case 2 | [106.12, -33.1, 'LAT'] | [106.12, -3.44, 'LAT'] | Failed |
| sampled case 3 | [118.21, 16.0, 'BOTH'] | [118.21, 1.44, 'LONG'] | Failed |
SHA-256 / 0996a548a190ac8b680a9c6e82226fbafc1b7c7cb77326e66ad4e26b120e968d
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
w = sum(i[0] for i in x['items'])
lon = sum(i[0] * i[1] for i in x['items']) / w
lat = sum(i[0] * i[2] for i in x['items']) / (w - x['items'][0][0])
fwd, aft = x['long_env']
L = x['lat_limit']
bad_long = lon < fwd or lon > aft
bad_lat = abs(lat) > L
if bad_long and bad_lat: s = 'BOTH'
elif bad_long: s = 'LONG'
elif bad_lat: s = 'LAT'
else: s = 'OK'
return [round(lon, 2), round(lat, 2), s]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [310.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.55, -3.01, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [420.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.51, 4.73, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 161.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.09, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 66.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.58, 0.0, 'LONG']], ['sampled case 1', {'items': [[1961.0, 113.2, 0.0], [371.0, 107.7, 0.3], [251.0, 126.9, -11.0], [283.0, 99.2, 3.8]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [112.31, -0.55, 'OK']], ['sampled case 2', {'items': [[2056.0, 105.5, 0.0], [244.0, 115.4, -33.1], [51.0, 86.6, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.12, -3.44, 'LAT']], ['sampled case 3', {'items': [[1573.0, 113.1, 0.0], [218.0, 100.6, 0.0], [255.0, 143.2, 0.0], [202.0, 145.5, 16.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [118.21, 1.44, 'LONG']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [320.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.58, -3.13, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [440.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.57, 4.91, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 162.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.3, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 67.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.67, 0.0, 'LONG']], ['sampled case 1', {'items': [[1956.0, 112.6, 0.0], [262.0, 87.0, 0.0], [311.0, 118.3, -13.5]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [110.65, -1.66, 'OK']], ['sampled case 2', {'items': [[1709.0, 112.8, 0.0], [205.0, 168.9, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [118.81, 0.0, 'LONG']], ['sampled case 3', {'items': [[2050.0, 107.5, 0.0], [396.0, 119.4, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [109.43, 0.0, 'OK']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [330.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.6, -3.24, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [460.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.63, 5.09, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 163.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.52, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 68.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.75, 0.0, 'LONG']], ['sampled case 1', {'items': [[1870.0, 106.8, 0.0], [263.0, 80.8, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [103.59, 0.0, 'LONG']], ['sampled case 2', {'items': [[2084.0, 112.7, 0.0], [383.0, 162.2, 0.0], [215.0, 163.9, 0.0], [379.0, 65.5, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [116.65, 0.0, 'LONG']], ['sampled case 3', {'items': [[1712.0, 106.9, 0.0], [282.0, 88.8, 29.4], [279.0, 81.2, -9.0], [165.0, 68.5, -8.2]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [99.27, 1.82, 'LONG']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [340.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.62, -3.36, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [480.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.68, 5.26, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 164.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.74, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 69.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.83, 0.0, 'LONG']], ['sampled case 1', {'items': [[2164.0, 108.0, 0.0], [331.0, 62.5, 24.8], [175.0, 152.3, -14.7], [218.0, 112.0, 12.0], [108.0, 129.6, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [106.63, 2.75, 'OK']], ['sampled case 2', {'items': [[1554.0, 108.9, 0.0], [184.0, 75.6, 28.9], [77.0, 116.1, 0.0], [358.0, 115.4, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [107.41, 2.45, 'OK']], ['sampled case 3', {'items': [[1514.0, 113.4, 0.0], [218.0, 155.2, 0.0], [117.0, 109.5, 0.0], [227.0, 101.1, 20.4]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [116.22, 2.23, 'LONG']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [350.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.65, -3.47, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [500.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.74, 5.43, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 165.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.96, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 70.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.92, 0.0, 'LONG']], ['sampled case 1', {'items': [[1717.0, 110.6, 0.0], [378.0, 92.3, -4.6], [315.0, 61.3, 28.1], [372.0, 157.6, 0.0], [66.0, 72.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [107.96, 2.5, 'OK']], ['sampled case 2', {'items': [[2148.0, 111.8, 0.0], [222.0, 97.1, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [110.42, 0.0, 'OK']], ['sampled case 3', {'items': [[1553.0, 108.8, 0.0], [213.0, 118.8, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [110.01, 0.0, 'OK']]]]
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 |
|---|---|---|---|
| pilot right seat | [106.36, 10.8, 'LAT'] | [106.36, 1.18, 'OK'] | Failed |
| heavy left hoist load | [106.55, -13.85, 'LAT'] | [106.55, -3.01, 'LAT'] | Failed |
| right side cargo | [113.51, 25.0, 'LAT'] | [113.51, 4.73, 'LAT'] | Failed |
| exactly on lateral limit | [110.0, 23.0, 'LAT'] | [110.0, 3.0, 'OK'] | Failed |
| longitudinal and lateral out | [121.09, -20.0, 'BOTH'] | [121.09, -4.35, 'BOTH'] | Failed |
| balanced pair | [102.58, 0.0, 'LONG'] | [102.58, 0.0, 'LONG'] | Passed |
| sampled case 1 | [112.31, -1.74, 'OK'] | [112.31, -0.55, 'OK'] | Failed |
| sampled case 2 | [106.12, -27.38, 'LAT'] | [106.12, -3.44, 'LAT'] | Failed |
| sampled case 3 | [118.21, 4.79, 'BOTH'] | [118.21, 1.44, 'LONG'] | Failed |
SHA-256 / f0aab77acda864e2f62451e58dace1eb1672972aa236fc6d21632ca68f738799
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
w = sum(i[0] for i in x['items'])
lon = sum(i[0] * i[1] for i in x['items']) / w
lat = sum(i[0] * i[2] for i in x['items']) / w
fwd, aft = x['long_env']
L = x['lat_limit']
bad_long = lon < fwd or lon > aft
bad_lat = abs(lat) > L
if bad_long and bad_lat: s = 'BOTH'
elif bad_long: s = 'LONG'
elif bad_lat: s = 'LAT'
else: s = 'OK'
return [round(lon, 2), round(lat, 2), s]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [310.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.55, -3.01, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [420.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.51, 4.73, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 161.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.09, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 66.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.58, 0.0, 'LONG']], ['sampled case 1', {'items': [[1961.0, 113.2, 0.0], [371.0, 107.7, 0.3], [251.0, 126.9, -11.0], [283.0, 99.2, 3.8]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [112.31, -0.55, 'OK']], ['sampled case 2', {'items': [[2056.0, 105.5, 0.0], [244.0, 115.4, -33.1], [51.0, 86.6, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.12, -3.44, 'LAT']], ['sampled case 3', {'items': [[1573.0, 113.1, 0.0], [218.0, 100.6, 0.0], [255.0, 143.2, 0.0], [202.0, 145.5, 16.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [118.21, 1.44, 'LONG']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [320.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.58, -3.13, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [440.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.57, 4.91, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 162.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.3, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 67.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.67, 0.0, 'LONG']], ['sampled case 1', {'items': [[1956.0, 112.6, 0.0], [262.0, 87.0, 0.0], [311.0, 118.3, -13.5]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [110.65, -1.66, 'OK']], ['sampled case 2', {'items': [[1709.0, 112.8, 0.0], [205.0, 168.9, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [118.81, 0.0, 'LONG']], ['sampled case 3', {'items': [[2050.0, 107.5, 0.0], [396.0, 119.4, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [109.43, 0.0, 'OK']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [330.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.6, -3.24, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [460.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.63, 5.09, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 163.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.52, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 68.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.75, 0.0, 'LONG']], ['sampled case 1', {'items': [[1870.0, 106.8, 0.0], [263.0, 80.8, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [103.59, 0.0, 'LONG']], ['sampled case 2', {'items': [[2084.0, 112.7, 0.0], [383.0, 162.2, 0.0], [215.0, 163.9, 0.0], [379.0, 65.5, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [116.65, 0.0, 'LONG']], ['sampled case 3', {'items': [[1712.0, 106.9, 0.0], [282.0, 88.8, 29.4], [279.0, 81.2, -9.0], [165.0, 68.5, -8.2]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [99.27, 1.82, 'LONG']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [340.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.62, -3.36, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [480.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.68, 5.26, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 164.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.74, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 69.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.83, 0.0, 'LONG']], ['sampled case 1', {'items': [[2164.0, 108.0, 0.0], [331.0, 62.5, 24.8], [175.0, 152.3, -14.7], [218.0, 112.0, 12.0], [108.0, 129.6, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [106.63, 2.75, 'OK']], ['sampled case 2', {'items': [[1554.0, 108.9, 0.0], [184.0, 75.6, 28.9], [77.0, 116.1, 0.0], [358.0, 115.4, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [107.41, 2.45, 'OK']], ['sampled case 3', {'items': [[1514.0, 113.4, 0.0], [218.0, 155.2, 0.0], [117.0, 109.5, 0.0], [227.0, 101.1, 20.4]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [116.22, 2.23, 'LONG']]], [['pilot right seat', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [30.0, 150.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.36, 1.18, 'OK']], ['heavy left hoist load', {'items': [[1800.0, 110.0, 0.0], [190.0, 65.0, 12.5], [350.0, 112.0, -30.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.65, -3.47, 'LAT']], ['right side cargo', {'items': [[1800.0, 112.0, 0.0], [500.0, 120.0, 25.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.74, 5.43, 'LAT']], ['exactly on lateral limit', {'items': [[2000.0, 110.0, 0.0], [300.0, 110.0, 23.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [110.0, 3.0, 'OK']], ['longitudinal and lateral out', {'items': [[1800.0, 110.0, 0.0], [500.0, 165.0, -20.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [121.96, -4.35, 'BOTH']], ['balanced pair', {'items': [[1800.0, 110.0, 0.0], [180.0, 65.0, 12.5], [180.0, 70.0, -12.5]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [102.92, 0.0, 'LONG']], ['sampled case 1', {'items': [[1717.0, 110.6, 0.0], [378.0, 92.3, -4.6], [315.0, 61.3, 28.1], [372.0, 157.6, 0.0], [66.0, 72.0, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [107.96, 2.5, 'OK']], ['sampled case 2', {'items': [[2148.0, 111.8, 0.0], [222.0, 97.1, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [110.42, 0.0, 'OK']], ['sampled case 3', {'items': [[1553.0, 108.8, 0.0], [213.0, 118.8, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [110.01, 0.0, 'OK']]]]
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 |
|---|---|---|---|
| pilot right seat | [106.36, 1.18, 'OK'] | [106.36, 1.18, 'OK'] | Passed |
| heavy left hoist load | [106.55, -3.01, 'LAT'] | [106.55, -3.01, 'LAT'] | Passed |
| right side cargo | [113.51, 4.73, 'LAT'] | [113.51, 4.73, 'LAT'] | Passed |
| exactly on lateral limit | [110.0, 3.0, 'OK'] | [110.0, 3.0, 'OK'] | Passed |
| longitudinal and lateral out | [121.09, -4.35, 'BOTH'] | [121.09, -4.35, 'BOTH'] | Passed |
| balanced pair | [102.58, 0.0, 'LONG'] | [102.58, 0.0, 'LONG'] | Passed |
| sampled case 1 | [112.31, -0.55, 'OK'] | [112.31, -0.55, 'OK'] | Passed |
| sampled case 2 | [106.12, -3.44, 'LAT'] | [106.12, -3.44, 'LAT'] | Passed |
| sampled case 3 | [118.21, 1.44, 'LONG'] | [118.21, 1.44, 'LONG'] | Passed |
SHA-256 / f251f871d9341c97c6ec55f0689ee9dd95fe8cfd74b2f38b10fe8aa70e5ecd6c
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:40.972628+00:00.
Case digest / 22ecddfe1ec63e56da250c06b864fc2f27491dc3d2edb3d9aac893e5a83a6828