FAILURE MAP
← Case archive

FA-95831 / Shipping rate zone lookup / Open access

LTL breaks: minimum charge skipped · case 01

Small shipments are billed below the lane minimum.

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

ROOT CAUSE

The minimum charge floor is not applied.

THE FAILURE

The minimum charge floor is not applied.

Unsuccessful approach: Applying the floor to the pre-deficit cost bills the actual-weight charge after a cheaper deficit was chosen.

Case contract

Weight breaks 0, 500, 1000, 2000, 5000, 10000 lb with cents-per-cwt rates for the lane. Weight rounds up to a whole lb (min 1) and is rated at its break: ceil(w * rate / 100). Deficit rating: if billing any heavier break minimum at that break rate is strictly cheaper, use the cheapest such. Charge is at least min_charge. Return [charge, break index, rated weight].

Why this case matters

LTL lane rates use weight breaks with deficit weight rating.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(weight, rates, min_charge):
    BREAKS = [0, 500, 1000, 2000, 5000, 10000]
    w = max(1, math.ceil(weight))
    idx = max(i for i, b in enumerate(BREAKS) if w >= b)
    cost = -(-w * rates[idx] // 100)
    best = [cost, idx, w]
    for j in range(idx + 1, len(BREAKS)):
        alt = BREAKS[j] * rates[j] // 100
        if alt < best[0]:
            best = [alt, j, BREAKS[j]]
    return [best[0], best[1], best[2]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['minimum', [100, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [9000, 0, 100]], ['deficit to 1000', [850, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [30000, 2, 1000]], ['deficit to 500', [450, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['fraction', [800.5, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [28836, 1, 801]], ['skip a break', [400, [5000, 4900, 1000, 900, 800, 700], 0], [10000, 2, 1000]], ['on break', [500, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['tie keeps actual', [450, [4000, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 0, 450]], ['generated mix 8', [450, [5000, 4900, 1000, 900, 800, 700], 9000], [10000, 2, 1000]]], [['generated mix 31', [100, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [9000, 0, 100]], ['generated mix 7', [480, [4200, 3600, 3000, 2500, 2100, 1800], 0], [18000, 1, 500]], ['fraction', [800.5, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [28836, 1, 801]], ['tie keeps actual', [450, [4000, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 0, 450]], ['deficit to 500', [450, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['minimum', [100, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [9000, 0, 100]], ['generated mix 10', [9000, [4200, 3600, 3000, 2500, 2100, 1800], 20000], [180000, 5, 10000]], ['generated mix 18', [850, [5000, 4900, 1000, 900, 800, 700], 9000], [10000, 2, 1000]]], [['generated mix 53', [500, [4200, 3600, 3000, 2500, 2100, 1800], 20000], [20000, 1, 500]], ['generated mix 14', [9000, [4237, 3611, 3044, 2517, 2150, 1833], 0], [183300, 5, 10000]], ['skip a break', [400, [5000, 4900, 1000, 900, 800, 700], 0], [10000, 2, 1000]], ['on break', [500, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['fraction', [800.5, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [28836, 1, 801]], ['tie keeps actual', [450, [4000, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 0, 450]], ['generated mix 21', [1700, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [50000, 3, 2000]], ['generated mix 29', [499.5, [4237, 3611, 3044, 2517, 2150, 1833], 20000], [20000, 1, 500]]], [['generated mix 17', [333.3, [4237, 3611, 3044, 2517, 2150, 1833], 20000], [20000, 0, 334]], ['generated mix 26', [850, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [30000, 2, 1000]], ['minimum', [100, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [9000, 0, 100]], ['deficit to 1000', [850, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [30000, 2, 1000]], ['skip a break', [400, [5000, 4900, 1000, 900, 800, 700], 0], [10000, 2, 1000]], ['on break', [500, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['generated mix 33', [480, [4237, 3611, 3044, 2517, 2150, 1833], 20000], [20000, 1, 500]], ['generated mix 41', [4200, [5000, 4900, 1000, 900, 800, 700], 9000], [37800, 3, 4200]]], [['generated mix 36', [500, [4200, 3600, 3000, 2500, 2100, 1800], 20000], [20000, 1, 500]], ['generated mix 40', [9000, [4237, 3611, 3044, 2517, 2150, 1833], 0], [183300, 5, 10000]], ['tie keeps actual', [450, [4000, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 0, 450]], ['deficit to 500', [450, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['minimum', [100, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [9000, 0, 100]], ['deficit to 1000', [850, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [30000, 2, 1000]], ['generated mix 44', [450, [4237, 3611, 3044, 2517, 2150, 1833], 9000], [18055, 1, 500]], ['generated mix 52', [850, [4200, 3600, 3000, 2500, 2100, 1800], 20000], [30000, 2, 1000]]]]
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
minimum[4200, 0, 100][9000, 0, 100]Failed
deficit to 1000[30000, 2, 1000][30000, 2, 1000]Passed
deficit to 500[18000, 1, 500][18000, 1, 500]Passed
fraction[28836, 1, 801][28836, 1, 801]Passed
skip a break[10000, 2, 1000][10000, 2, 1000]Passed
on break[18000, 1, 500][18000, 1, 500]Passed
tie keeps actual[18000, 0, 450][18000, 0, 450]Passed
generated mix 8[10000, 2, 1000][10000, 2, 1000]Passed

SHA-256 / 5fa112b84bed1b3ac5a7a4774bb976855d893bc04457a78c8075d91d663ec136

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(weight, rates, min_charge):
    BREAKS = [0, 500, 1000, 2000, 5000, 10000]
    w = max(1, math.ceil(weight))
    idx = max(i for i, b in enumerate(BREAKS) if w >= b)
    cost = -(-w * rates[idx] // 100)
    best = [cost, idx, w]
    for j in range(idx + 1, len(BREAKS)):
        alt = BREAKS[j] * rates[j] // 100
        if alt < best[0]:
            best = [alt, j, BREAKS[j]]
    return [max(cost, min_charge), best[1], best[2]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['minimum', [100, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [9000, 0, 100]], ['deficit to 1000', [850, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [30000, 2, 1000]], ['deficit to 500', [450, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['fraction', [800.5, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [28836, 1, 801]], ['skip a break', [400, [5000, 4900, 1000, 900, 800, 700], 0], [10000, 2, 1000]], ['on break', [500, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['tie keeps actual', [450, [4000, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 0, 450]], ['generated mix 8', [450, [5000, 4900, 1000, 900, 800, 700], 9000], [10000, 2, 1000]]], [['generated mix 31', [100, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [9000, 0, 100]], ['generated mix 7', [480, [4200, 3600, 3000, 2500, 2100, 1800], 0], [18000, 1, 500]], ['fraction', [800.5, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [28836, 1, 801]], ['tie keeps actual', [450, [4000, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 0, 450]], ['deficit to 500', [450, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['minimum', [100, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [9000, 0, 100]], ['generated mix 10', [9000, [4200, 3600, 3000, 2500, 2100, 1800], 20000], [180000, 5, 10000]], ['generated mix 18', [850, [5000, 4900, 1000, 900, 800, 700], 9000], [10000, 2, 1000]]], [['generated mix 53', [500, [4200, 3600, 3000, 2500, 2100, 1800], 20000], [20000, 1, 500]], ['generated mix 14', [9000, [4237, 3611, 3044, 2517, 2150, 1833], 0], [183300, 5, 10000]], ['skip a break', [400, [5000, 4900, 1000, 900, 800, 700], 0], [10000, 2, 1000]], ['on break', [500, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['fraction', [800.5, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [28836, 1, 801]], ['tie keeps actual', [450, [4000, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 0, 450]], ['generated mix 21', [1700, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [50000, 3, 2000]], ['generated mix 29', [499.5, [4237, 3611, 3044, 2517, 2150, 1833], 20000], [20000, 1, 500]]], [['generated mix 17', [333.3, [4237, 3611, 3044, 2517, 2150, 1833], 20000], [20000, 0, 334]], ['generated mix 26', [850, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [30000, 2, 1000]], ['minimum', [100, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [9000, 0, 100]], ['deficit to 1000', [850, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [30000, 2, 1000]], ['skip a break', [400, [5000, 4900, 1000, 900, 800, 700], 0], [10000, 2, 1000]], ['on break', [500, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['generated mix 33', [480, [4237, 3611, 3044, 2517, 2150, 1833], 20000], [20000, 1, 500]], ['generated mix 41', [4200, [5000, 4900, 1000, 900, 800, 700], 9000], [37800, 3, 4200]]], [['generated mix 36', [500, [4200, 3600, 3000, 2500, 2100, 1800], 20000], [20000, 1, 500]], ['generated mix 40', [9000, [4237, 3611, 3044, 2517, 2150, 1833], 0], [183300, 5, 10000]], ['tie keeps actual', [450, [4000, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 0, 450]], ['deficit to 500', [450, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [18000, 1, 500]], ['minimum', [100, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [9000, 0, 100]], ['deficit to 1000', [850, [4200, 3600, 3000, 2500, 2100, 1800], 9000], [30000, 2, 1000]], ['generated mix 44', [450, [4237, 3611, 3044, 2517, 2150, 1833], 9000], [18055, 1, 500]], ['generated mix 52', [850, [4200, 3600, 3000, 2500, 2100, 1800], 20000], [30000, 2, 1000]]]]
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
minimum[9000, 0, 100][9000, 0, 100]Passed
deficit to 1000[30600, 2, 1000][30000, 2, 1000]Failed
deficit to 500[18900, 1, 500][18000, 1, 500]Failed
fraction[28836, 1, 801][28836, 1, 801]Passed
skip a break[20000, 2, 1000][10000, 2, 1000]Failed
on break[18000, 1, 500][18000, 1, 500]Passed
tie keeps actual[18000, 0, 450][18000, 0, 450]Passed
generated mix 8[22500, 2, 1000][10000, 2, 1000]Failed

SHA-256 / 8d1abdd96da5f96db8fb8182dfd1482d429d9518499ac8f279599fd206ccb29e

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Stipulated break table; no freight class or accessorials. 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:52:17.321791+00:00.

Case digest / 88857aa1552421084cb2c2e21c01464d723a94a737ad23460f936c0571190709