FAILURE MAP
← Case archive

FA-66171 / Aviation weight and balance / Open access

Lateral limit enforced only to the right · case 01

A heavy left-side hoist load is reported within limits.

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

ROOT CAUSE

The lateral check compares the signed CG against the positive limit only.

VERIFIED REPAIR

Compare the magnitude of the lateral CG against the limit.

Unsuccessful approach: The chained comparison -L < lat > L only ever tests the right-hand limit.

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 = 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 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, 'LONG'][121.09, -4.35, 'BOTH']Failed
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, 'OK'][106.12, -3.44, 'LAT']Failed
sampled case 3[118.21, 1.44, 'LONG'][118.21, 1.44, 'LONG']Passed

SHA-256 / 8f73d3a3bdb51630fe02f8db124c2ded1da3d3058ff3b51d9c0b041762bfdaae

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 = -L < 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 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, 'LONG'][121.09, -4.35, 'BOTH']Failed
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, 'OK'][106.12, -3.44, 'LAT']Failed
sampled case 3[118.21, 1.44, 'LONG'][118.21, 1.44, 'LONG']Passed

SHA-256 / 19134c51e1197f4125fbcaaf779d4014b75013689dc507fc2725825c238faf8f

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

Case digest / e3569ff3f61e6b1b725cf732db6bbb64c8f0c05cb47f7d4aa501a414b46adb0d