FAILURE MAP
← Case archive

FA-65876 / Aviation weight and balance / Open access

Sloped forward limit interpolated from the wrong end · case 01

Heavy aircraft get a forward limit near 35 in and light aircraft near 41 in on the sloped segment.

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

ROOT CAUSE

The interpolation parameter measures distance from max gross instead of from the 1950 lb break point.

VERIFIED REPAIR

Interpolate with (w - 1950) over the 1950-2550 lb span.

Unsuccessful approach: Measuring from 1500 lb starts the slope at the minimum weight instead of the break point, so the line no longer passes through 35.0 at 1950.

Case contract

Input [weight lb, CG in, 'normal'|'utility']. Below 1500 lb -> 'ERR_BELOW_EMPTY'. Max weight 2550 normal / 2200 utility -> 'OVERWEIGHT' first. Forward limit 35.0 in up to 1950 lb then linear to 41.0 in at 2550 lb; aft limit 47.3 normal / 40.5 utility. Limits inclusive; else 'FWD','AFT','IN'.

Why this case matters

A category-dependent CG envelope with a sloped forward boundary; limit lines are part of the approved envelope.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    w, cg, cat = x
    if w < 1500: return 'ERR_BELOW_EMPTY'
    maxw = 2550 if cat == 'normal' else 2200
    if w > maxw: return 'OVERWEIGHT'
    if w <= 1950:
        fwd = 35.0
    else:
        fwd = 35.0 + (2550 - w) * (41.0 - 35.0) / (2550 - 1950)
    aft = 47.3 if cat == 'normal' else 40.5
    if cg < fwd - 1e-9: return 'FWD'
    if cg > aft + 1e-9: return 'AFT'
    return 'IN'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['mid-envelope normal', [2110, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2301, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.1, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.1, 'utility'], 'AFT'], ['below empty weight', [1499, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [2415, 48.96, 'normal'], 'AFT'], ['sampled case 2', [2550, 34.9, 'normal'], 'FWD'], ['sampled case 3', [1950, 42.86, 'utility'], 'AFT']], [['mid-envelope normal', [2120, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2302, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.2, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.2, 'utility'], 'AFT'], ['below empty weight', [1498, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [1950, 37.89, 'utility'], 'IN'], ['sampled case 2', [2561, 48.01, 'normal'], 'OVERWEIGHT'], ['sampled case 3', [2550, 45.7, 'normal'], 'IN']], [['mid-envelope normal', [2130, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2303, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.3, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.3, 'utility'], 'AFT'], ['below empty weight', [1497, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [1950, 34.67, 'utility'], 'FWD'], ['sampled case 2', [1500, 42.58, 'utility'], 'AFT'], ['sampled case 3', [2200, 48.0, 'utility'], 'AFT']], [['mid-envelope normal', [2140, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2304, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.4, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.4, 'utility'], 'AFT'], ['below empty weight', [1496, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [2200, 42.7, 'normal'], 'IN'], ['sampled case 2', [1969, 47.53, 'normal'], 'AFT'], ['sampled case 3', [1500, 48.2, 'normal'], 'AFT']], [['mid-envelope normal', [2150, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2305, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.5, 'normal'], 'IN'], ['aft of utility limit', [2100, 41.5, 'utility'], 'AFT'], ['below empty weight', [1495, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [1950, 45.06, 'normal'], 'IN'], ['sampled case 2', [2200, 43.63, 'utility'], 'AFT'], ['sampled case 3', [2200, 41.43, 'normal'], 'IN'], ['regression: forward limit interpolation', [2200, 37.9, 'utility'], 'IN']]]
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
mid-envelope normalININPassed
on sloped forward lineININPassed
on aft limit utilityININPassed
utility overweight but normal legalOVERWEIGHTOVERWEIGHTPassed
exactly max gross normalININPassed
forward of sloped lineINFWDFailed
aft of utility limitAFTAFTPassed
below empty weightERR_BELOW_EMPTYERR_BELOW_EMPTYPassed
exactly empty weightININPassed
sampled case 1AFTAFTPassed
sampled case 2FWDFWDPassed
sampled case 3AFTAFTPassed

SHA-256 / 09ca88939746a3bf9ae98f4eaa2fefc82068639222ad1412daa89894056e2b01

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    w, cg, cat = x
    if w < 1500: return 'ERR_BELOW_EMPTY'
    maxw = 2550 if cat == 'normal' else 2200
    if w > maxw: return 'OVERWEIGHT'
    if w <= 1950:
        fwd = 35.0
    else:
        fwd = 35.0 + (w - 1500) * (41.0 - 35.0) / (2550 - 1950)
    aft = 47.3 if cat == 'normal' else 40.5
    if cg < fwd - 1e-9: return 'FWD'
    if cg > aft + 1e-9: return 'AFT'
    return 'IN'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['mid-envelope normal', [2110, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2301, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.1, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.1, 'utility'], 'AFT'], ['below empty weight', [1499, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [2415, 48.96, 'normal'], 'AFT'], ['sampled case 2', [2550, 34.9, 'normal'], 'FWD'], ['sampled case 3', [1950, 42.86, 'utility'], 'AFT']], [['mid-envelope normal', [2120, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2302, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.2, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.2, 'utility'], 'AFT'], ['below empty weight', [1498, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [1950, 37.89, 'utility'], 'IN'], ['sampled case 2', [2561, 48.01, 'normal'], 'OVERWEIGHT'], ['sampled case 3', [2550, 45.7, 'normal'], 'IN']], [['mid-envelope normal', [2130, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2303, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.3, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.3, 'utility'], 'AFT'], ['below empty weight', [1497, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [1950, 34.67, 'utility'], 'FWD'], ['sampled case 2', [1500, 42.58, 'utility'], 'AFT'], ['sampled case 3', [2200, 48.0, 'utility'], 'AFT']], [['mid-envelope normal', [2140, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2304, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.4, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.4, 'utility'], 'AFT'], ['below empty weight', [1496, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [2200, 42.7, 'normal'], 'IN'], ['sampled case 2', [1969, 47.53, 'normal'], 'AFT'], ['sampled case 3', [1500, 48.2, 'normal'], 'AFT']], [['mid-envelope normal', [2150, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2305, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.5, 'normal'], 'IN'], ['aft of utility limit', [2100, 41.5, 'utility'], 'AFT'], ['below empty weight', [1495, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [1950, 45.06, 'normal'], 'IN'], ['sampled case 2', [2200, 43.63, 'utility'], 'AFT'], ['sampled case 3', [2200, 41.43, 'normal'], 'IN'], ['regression: forward limit interpolation', [2200, 37.9, 'utility'], 'IN']]]
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
mid-envelope normalININPassed
on sloped forward lineFWDINFailed
on aft limit utilityININPassed
utility overweight but normal legalOVERWEIGHTOVERWEIGHTPassed
exactly max gross normalFWDINFailed
forward of sloped lineFWDFWDPassed
aft of utility limitAFTAFTPassed
below empty weightERR_BELOW_EMPTYERR_BELOW_EMPTYPassed
exactly empty weightININPassed
sampled case 1AFTAFTPassed
sampled case 2FWDFWDPassed
sampled case 3AFTAFTPassed

SHA-256 / 07d1256ed0c99ad8a4c0877708d49692ca4b7c763d297a537114512a96b7f7d4

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    w, cg, cat = x
    if w < 1500: return 'ERR_BELOW_EMPTY'
    maxw = 2550 if cat == 'normal' else 2200
    if w > maxw: return 'OVERWEIGHT'
    if w <= 1950:
        fwd = 35.0
    else:
        fwd = 35.0 + (w - 1950) * (41.0 - 35.0) / (2550 - 1950)
    aft = 47.3 if cat == 'normal' else 40.5
    if cg < fwd - 1e-9: return 'FWD'
    if cg > aft + 1e-9: return 'AFT'
    return 'IN'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['mid-envelope normal', [2110, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2301, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.1, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.1, 'utility'], 'AFT'], ['below empty weight', [1499, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [2415, 48.96, 'normal'], 'AFT'], ['sampled case 2', [2550, 34.9, 'normal'], 'FWD'], ['sampled case 3', [1950, 42.86, 'utility'], 'AFT']], [['mid-envelope normal', [2120, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2302, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.2, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.2, 'utility'], 'AFT'], ['below empty weight', [1498, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [1950, 37.89, 'utility'], 'IN'], ['sampled case 2', [2561, 48.01, 'normal'], 'OVERWEIGHT'], ['sampled case 3', [2550, 45.7, 'normal'], 'IN']], [['mid-envelope normal', [2130, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2303, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.3, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.3, 'utility'], 'AFT'], ['below empty weight', [1497, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [1950, 34.67, 'utility'], 'FWD'], ['sampled case 2', [1500, 42.58, 'utility'], 'AFT'], ['sampled case 3', [2200, 48.0, 'utility'], 'AFT']], [['mid-envelope normal', [2140, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2304, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.4, 'normal'], 'FWD'], ['aft of utility limit', [2100, 41.4, 'utility'], 'AFT'], ['below empty weight', [1496, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [2200, 42.7, 'normal'], 'IN'], ['sampled case 2', [1969, 47.53, 'normal'], 'AFT'], ['sampled case 3', [1500, 48.2, 'normal'], 'AFT']], [['mid-envelope normal', [2150, 42.0, 'normal'], 'IN'], ['on sloped forward line', [2250, 38.0, 'normal'], 'IN'], ['on aft limit utility', [2000, 40.5, 'utility'], 'IN'], ['utility overweight but normal legal', [2305, 42.0, 'utility'], 'OVERWEIGHT'], ['exactly max gross normal', [2550, 41.0, 'normal'], 'IN'], ['forward of sloped line', [2400, 39.5, 'normal'], 'IN'], ['aft of utility limit', [2100, 41.5, 'utility'], 'AFT'], ['below empty weight', [1495, 40.0, 'normal'], 'ERR_BELOW_EMPTY'], ['exactly empty weight', [1500, 36.0, 'utility'], 'IN'], ['sampled case 1', [1950, 45.06, 'normal'], 'IN'], ['sampled case 2', [2200, 43.63, 'utility'], 'AFT'], ['sampled case 3', [2200, 41.43, 'normal'], 'IN'], ['regression: forward limit interpolation', [2200, 37.9, 'utility'], 'IN']]]
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
mid-envelope normalININPassed
on sloped forward lineININPassed
on aft limit utilityININPassed
utility overweight but normal legalOVERWEIGHTOVERWEIGHTPassed
exactly max gross normalININPassed
forward of sloped lineFWDFWDPassed
aft of utility limitAFTAFTPassed
below empty weightERR_BELOW_EMPTYERR_BELOW_EMPTYPassed
exactly empty weightININPassed
sampled case 1AFTAFTPassed
sampled case 2FWDFWDPassed
sampled case 3AFTAFTPassed

SHA-256 / 6674a1b69a1954012ab8d85ffbfffcde09aae50a7d1d7887b16596bda0256d9b

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

Case digest / 68c4c9a14274faeb715496f6742f1304e8e12ba80bde626eae299ff9567c0971