FAILURE MAP
← Case archive

FA-65976 / Aviation weight and balance / Open access

Binary float noise bumps exact shifts up a pound · case 01

A shift that should be exactly 18 lb is reported as 19 lb.

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

ROOT CAUSE

The ceiling is applied directly to a float such as 18.000000000000004 produced by decimal CG inputs.

VERIFIED REPAIR

Clear representation noise (round at 6 decimals) before taking the ceiling.

Unsuccessful approach: Subtracting a half before the ceiling turns the operation into nearest rounding and undershoots fractional requirements.

Case contract

Input [total lb, current CG, target CG, from-station arm, to-station arm]. Weight to move = W*dCG/dArm, rounded UP to a whole pound after clearing float noise at 6 decimals. Same station -> 'ERR_SAME_STATION'; zero dCG -> 0; a move that shifts CG the wrong way -> 'ERR_DIRECTION'.

Why this case matters

The weight-shift formula moves existing load between stations without changing total weight; the answer must be conservative (rounded up).

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    W, cg0, cg1, a_from, a_to = x
    if a_from == a_to: return 'ERR_SAME_STATION'
    dcg = cg1 - cg0
    darm = a_to - a_from
    if dcg == 0: return 0
    if (dcg > 0) != (darm > 0): return 'ERR_DIRECTION'
    moved = W * dcg / darm
    return math.ceil(moved)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['baggage moved aft', [2400, 40.0, 41.1, 70.0, 120.0], 53], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2610, 46.5, 45.0, 140.0, 60.0], 49], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 69.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [3980, 45.3, 44.23, 41.8, 92.7], 'ERR_DIRECTION'], ['sampled case 2', [2707, 38.32, 40.1, 125.8, 85.0], 'ERR_DIRECTION'], ['sampled case 3', [3239, 40.39, 40.5, 103.2, 113.0], 37], ['regression: float noise before ceiling', [3630, 45.66, 47.26, 137.4, 146.2], 660]], [['baggage moved aft', [2400, 40.0, 41.2, 70.0, 120.0], 58], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2620, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 68.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [2415, 40.34, 38.4, 91.5, 122.3], 'ERR_DIRECTION'], ['sampled case 2', [3730, 42.18, 40.8, 132.4, 79.3], 97], ['sampled case 3', [2931, 40.9, 40.9, 127.0, 108.6], 0], ['regression: float noise before ceiling', [3960, 40.4, 41.08, 102.2, 105.6], 792]], [['baggage moved aft', [2400, 40.0, 41.3, 70.0, 120.0], 63], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2630, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 67.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [3390, 43.8, 43.8, 81.2, 142.7], 0], ['sampled case 2', [2280, 42.43, 43.6, 91.3, 32.9], 'ERR_DIRECTION'], ['sampled case 3', [3550, 38.5, 38.5, 60.9, 57.1], 0], ['regression: float noise before ceiling', [3770, 43.33, 44.47, 81.2, 83.8], 1653]], [['baggage moved aft', [2400, 40.0, 41.4, 70.0, 120.0], 68], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2640, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 66.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [2103, 45.94, 44.79, 82.0, 59.6], 108], ['sampled case 2', [1930, 43.1, 41.2, 104.4, 84.0], 180], ['sampled case 3', [2160, 40.97, 40.7, 113.1, 93.1], 30], ['regression: float noise before ceiling', [1821, 44.3, 45.1, 123.3, 125.7], 607]], [['baggage moved aft', [2400, 40.0, 41.5, 70.0, 120.0], 72], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2650, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 65.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [2243, 42.7, 42.6, 141.2, 133.0], 28], ['sampled case 2', [3954, 45.3, 43.62, 97.4, 126.8], 'ERR_DIRECTION'], ['sampled case 3', [3960, 41.6, 42.67, 35.8, 103.5], 63], ['regression: float noise before ceiling', [1860, 45.08, 46.26, 51.2, 51.3], 21948]]]
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
baggage moved aft5353Passed
exact whole-pound shift1010Passed
shift forward4949Passed
wrong direction requestERR_DIRECTIONERR_DIRECTIONPassed
already at target00Passed
same stationERR_SAME_STATIONERR_SAME_STATIONPassed
sampled case 1ERR_DIRECTIONERR_DIRECTIONPassed
sampled case 2ERR_DIRECTIONERR_DIRECTIONPassed
sampled case 33737Passed
regression: float noise before ceiling661660Failed

SHA-256 / 06be5ad01e8892766bb5db61969a9837088860afbcb731e7ffe6bbb6bbdc096c

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    W, cg0, cg1, a_from, a_to = x
    if a_from == a_to: return 'ERR_SAME_STATION'
    dcg = cg1 - cg0
    darm = a_to - a_from
    if dcg == 0: return 0
    if (dcg > 0) != (darm > 0): return 'ERR_DIRECTION'
    moved = W * dcg / darm
    return math.ceil(moved - 0.5)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['baggage moved aft', [2400, 40.0, 41.1, 70.0, 120.0], 53], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2610, 46.5, 45.0, 140.0, 60.0], 49], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 69.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [3980, 45.3, 44.23, 41.8, 92.7], 'ERR_DIRECTION'], ['sampled case 2', [2707, 38.32, 40.1, 125.8, 85.0], 'ERR_DIRECTION'], ['sampled case 3', [3239, 40.39, 40.5, 103.2, 113.0], 37], ['regression: float noise before ceiling', [3630, 45.66, 47.26, 137.4, 146.2], 660]], [['baggage moved aft', [2400, 40.0, 41.2, 70.0, 120.0], 58], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2620, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 68.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [2415, 40.34, 38.4, 91.5, 122.3], 'ERR_DIRECTION'], ['sampled case 2', [3730, 42.18, 40.8, 132.4, 79.3], 97], ['sampled case 3', [2931, 40.9, 40.9, 127.0, 108.6], 0], ['regression: float noise before ceiling', [3960, 40.4, 41.08, 102.2, 105.6], 792]], [['baggage moved aft', [2400, 40.0, 41.3, 70.0, 120.0], 63], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2630, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 67.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [3390, 43.8, 43.8, 81.2, 142.7], 0], ['sampled case 2', [2280, 42.43, 43.6, 91.3, 32.9], 'ERR_DIRECTION'], ['sampled case 3', [3550, 38.5, 38.5, 60.9, 57.1], 0], ['regression: float noise before ceiling', [3770, 43.33, 44.47, 81.2, 83.8], 1653]], [['baggage moved aft', [2400, 40.0, 41.4, 70.0, 120.0], 68], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2640, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 66.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [2103, 45.94, 44.79, 82.0, 59.6], 108], ['sampled case 2', [1930, 43.1, 41.2, 104.4, 84.0], 180], ['sampled case 3', [2160, 40.97, 40.7, 113.1, 93.1], 30], ['regression: float noise before ceiling', [1821, 44.3, 45.1, 123.3, 125.7], 607]], [['baggage moved aft', [2400, 40.0, 41.5, 70.0, 120.0], 72], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2650, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 65.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [2243, 42.7, 42.6, 141.2, 133.0], 28], ['sampled case 2', [3954, 45.3, 43.62, 97.4, 126.8], 'ERR_DIRECTION'], ['sampled case 3', [3960, 41.6, 42.67, 35.8, 103.5], 63], ['regression: float noise before ceiling', [1860, 45.08, 46.26, 51.2, 51.3], 21948]]]
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
baggage moved aft5353Passed
exact whole-pound shift1010Passed
shift forward4949Passed
wrong direction requestERR_DIRECTIONERR_DIRECTIONPassed
already at target00Passed
same stationERR_SAME_STATIONERR_SAME_STATIONPassed
sampled case 1ERR_DIRECTIONERR_DIRECTIONPassed
sampled case 2ERR_DIRECTIONERR_DIRECTIONPassed
sampled case 33637Failed
regression: float noise before ceiling660660Passed

SHA-256 / 478ff64342938920ac12ee47c492f21867862e92def674fdadf9d75db2b0071c

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x):
    W, cg0, cg1, a_from, a_to = x
    if a_from == a_to: return 'ERR_SAME_STATION'
    dcg = cg1 - cg0
    darm = a_to - a_from
    if dcg == 0: return 0
    if (dcg > 0) != (darm > 0): return 'ERR_DIRECTION'
    moved = W * dcg / darm
    return math.ceil(round(moved, 6))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['baggage moved aft', [2400, 40.0, 41.1, 70.0, 120.0], 53], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2610, 46.5, 45.0, 140.0, 60.0], 49], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 69.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [3980, 45.3, 44.23, 41.8, 92.7], 'ERR_DIRECTION'], ['sampled case 2', [2707, 38.32, 40.1, 125.8, 85.0], 'ERR_DIRECTION'], ['sampled case 3', [3239, 40.39, 40.5, 103.2, 113.0], 37], ['regression: float noise before ceiling', [3630, 45.66, 47.26, 137.4, 146.2], 660]], [['baggage moved aft', [2400, 40.0, 41.2, 70.0, 120.0], 58], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2620, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 68.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [2415, 40.34, 38.4, 91.5, 122.3], 'ERR_DIRECTION'], ['sampled case 2', [3730, 42.18, 40.8, 132.4, 79.3], 97], ['sampled case 3', [2931, 40.9, 40.9, 127.0, 108.6], 0], ['regression: float noise before ceiling', [3960, 40.4, 41.08, 102.2, 105.6], 792]], [['baggage moved aft', [2400, 40.0, 41.3, 70.0, 120.0], 63], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2630, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 67.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [3390, 43.8, 43.8, 81.2, 142.7], 0], ['sampled case 2', [2280, 42.43, 43.6, 91.3, 32.9], 'ERR_DIRECTION'], ['sampled case 3', [3550, 38.5, 38.5, 60.9, 57.1], 0], ['regression: float noise before ceiling', [3770, 43.33, 44.47, 81.2, 83.8], 1653]], [['baggage moved aft', [2400, 40.0, 41.4, 70.0, 120.0], 68], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2640, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 66.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [2103, 45.94, 44.79, 82.0, 59.6], 108], ['sampled case 2', [1930, 43.1, 41.2, 104.4, 84.0], 180], ['sampled case 3', [2160, 40.97, 40.7, 113.1, 93.1], 30], ['regression: float noise before ceiling', [1821, 44.3, 45.1, 123.3, 125.7], 607]], [['baggage moved aft', [2400, 40.0, 41.5, 70.0, 120.0], 72], ['exact whole-pound shift', [3000, 42.0, 42.3, 50.0, 140.0], 10], ['shift forward', [2650, 46.5, 45.0, 140.0, 60.0], 50], ['wrong direction request', [2500, 40.0, 41.0, 120.0, 65.0], 'ERR_DIRECTION'], ['already at target', [2300, 43.2, 43.2, 70.0, 120.0], 0], ['same station', [2300, 43.2, 44.0, 95.0, 95.0], 'ERR_SAME_STATION'], ['sampled case 1', [2243, 42.7, 42.6, 141.2, 133.0], 28], ['sampled case 2', [3954, 45.3, 43.62, 97.4, 126.8], 'ERR_DIRECTION'], ['sampled case 3', [3960, 41.6, 42.67, 35.8, 103.5], 63], ['regression: float noise before ceiling', [1860, 45.08, 46.26, 51.2, 51.3], 21948]]]
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
baggage moved aft5353Passed
exact whole-pound shift1010Passed
shift forward4949Passed
wrong direction requestERR_DIRECTIONERR_DIRECTIONPassed
already at target00Passed
same stationERR_SAME_STATIONERR_SAME_STATIONPassed
sampled case 1ERR_DIRECTIONERR_DIRECTIONPassed
sampled case 2ERR_DIRECTIONERR_DIRECTIONPassed
sampled case 33737Passed
regression: float noise before ceiling660660Passed

SHA-256 / 18709b642346d1ca3520e1d214d8a46f3c507adae17a546dcdae36aa72fb47cd

Verification & scope

A deterministic toy loading model with stipulated constants; it is not an approved aircraft flight manual procedure and makes no claim of regulatory conformance. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:47:39.030295+00:00.

Case digest / 27fe1cc50927153cc0872e60373f00d0508816ea9a9ea39ec1c1166f6e39c4b7