FAILURE MAP
← Case archive

FA-66181 / Aviation weight and balance / Open access

Lateral CG exactly on the limit rejected · case 01

A load that places the lateral CG exactly at the limit is reported LAT.

Verified by executionVariant 1 · 9 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The lateral comparison treats the limit value as outside.

VERIFIED REPAIR

Reject only lateral CGs whose magnitude strictly exceeds the limit.

Unsuccessful approach: Rounding the lateral CG to 0.1 in hides exceedances smaller than 0.05 in.

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']) / 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']], ['regression: lateral limit boundary', {'items': [[1986.0, 106.6, 0.0], [221.0, 97.7, 34.8], [353.0, 158.7, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.02, 3.0, 'LAT']]], [['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']], ['regression: lateral limit boundary', {'items': [[1755.0, 107.5, 0.0], [89.0, 122.3, -29.3], [122.0, 114.3, 25.4], [176.0, 83.8, 33.9]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.55, 3.01, 'LAT']]], [['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']], ['regression: lateral limit boundary', {'items': [[1866.0, 108.0, 0.0], [310.0, 142.7, 23.8], [220.0, 84.0, 0.0], [380.0, 90.8, 0.0], [139.0, 74.1, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [106.02, 2.53, 'LAT']]], [['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']], ['regression: lateral limit boundary', {'items': [[1715.0, 108.2, 0.0], [196.0, 134.6, -30.0], [183.0, 157.8, 31.2], [273.0, 139.1, 31.1]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [117.78, 3.51, 'BOTH']]]]
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 fixtureActualExpectedOutcome
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, 'LAT'][110.0, 3.0, 'OK']Failed
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 / d5c484de15dbebf02150150576793b1b5bdfcccbe650372e33fac7d0c5f43036

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
    fwd, aft = x['long_env']
    L = x['lat_limit']
    bad_long = lon < fwd or lon > aft
    bad_lat = round(abs(lat), 1) > 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']], ['regression: lateral limit boundary', {'items': [[1986.0, 106.6, 0.0], [221.0, 97.7, 34.8], [353.0, 158.7, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.02, 3.0, 'LAT']]], [['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']], ['regression: lateral limit boundary', {'items': [[1755.0, 107.5, 0.0], [89.0, 122.3, -29.3], [122.0, 114.3, 25.4], [176.0, 83.8, 33.9]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.55, 3.01, 'LAT']]], [['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']], ['regression: lateral limit boundary', {'items': [[1866.0, 108.0, 0.0], [310.0, 142.7, 23.8], [220.0, 84.0, 0.0], [380.0, 90.8, 0.0], [139.0, 74.1, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [106.02, 2.53, 'LAT']]], [['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']], ['regression: lateral limit boundary', {'items': [[1715.0, 108.2, 0.0], [196.0, 134.6, -30.0], [183.0, 157.8, 31.2], [273.0, 139.1, 31.1]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [117.78, 3.51, 'BOTH']]]]
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 fixtureActualExpectedOutcome
pilot right seat[106.36, 1.18, 'OK'][106.36, 1.18, 'OK']Passed
heavy left hoist load[106.55, -3.01, 'OK'][106.55, -3.01, 'LAT']Failed
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 / 6c0de112c2053009ef2f5085015af544feb7d981581d9f0125d86d982114b843

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']], ['regression: lateral limit boundary', {'items': [[1986.0, 106.6, 0.0], [221.0, 97.7, 34.8], [353.0, 158.7, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [113.02, 3.0, 'LAT']]], [['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']], ['regression: lateral limit boundary', {'items': [[1755.0, 107.5, 0.0], [89.0, 122.3, -29.3], [122.0, 114.3, 25.4], [176.0, 83.8, 33.9]], 'long_env': [106.0, 114.2], 'lat_limit': 3.0}, [106.55, 3.01, 'LAT']]], [['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']], ['regression: lateral limit boundary', {'items': [[1866.0, 108.0, 0.0], [310.0, 142.7, 23.8], [220.0, 84.0, 0.0], [380.0, 90.8, 0.0], [139.0, 74.1, 0.0]], 'long_env': [106.0, 114.2], 'lat_limit': 2.5}, [106.02, 2.53, 'LAT']]], [['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']], ['regression: lateral limit boundary', {'items': [[1715.0, 108.2, 0.0], [196.0, 134.6, -30.0], [183.0, 157.8, 31.2], [273.0, 139.1, 31.1]], 'long_env': [106.0, 114.2], 'lat_limit': 3.5}, [117.78, 3.51, 'BOTH']]]]
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 fixtureActualExpectedOutcome
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 / 42184907b80952884be9433f48bb498eede38190ec2dd9fe6adc9882e65c80ba

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.927248+00:00.

Case digest / b79961c648fc501174aaad9542e0cf0356f78b07f673d8f5beafd5dba949c654