FAILURE MAP
← Case archive

FA-95796 / Shipping rate zone lookup / Open access

Ounce tiers: exact multiples pushed up a tier · case 01

Parcels of exactly 4, 8 or 12 oz are priced one tier high.

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

ROOT CAUSE

Tier is floor plus one instead of ceiling.

VERIFIED REPAIR

Tier = ceil(oz / 4).

Unsuccessful approach: Rounding to nearest underprices 5 and 9 oz parcels.

Case contract

Parcels under 16 oz are priced in ounce tiers: ounces rounded up to a whole ounce, tier = ceil(oz/4) capped at 4. 16 oz and above price by pounds = ceil(ounces/16). Zones 1 and 2 share price group 1; zone z >= 3 is group z-1. Return [kind, n, group].

Why this case matters

Lightweight services price by ounce tier before switching to pounds.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(ounces, zone):
    group = 1 if zone <= 2 else zone - 1
    if ounces < 16:
        oz = math.ceil(ounces)
        return ['OZ', min(4, oz // 4 + 1), group]
    return ['LB', math.ceil(ounces / 16), group]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['small', [3.2, 2], ['OZ', 1, 1]], ['rounded to 13', [12.4, 4], ['OZ', 4, 3]], ['tier two', [4.2, 5], ['OZ', 2, 4]], ['one pound', [16, 3], ['LB', 1, 2]], ['two pounds', [32, 9], ['LB', 2, 8]], ['almost a pound', [15.5, 1], ['OZ', 4, 1]], ['generated mix 6', [15.99, 6], ['OZ', 4, 5]], ['generated mix 14', [8.4, 5], ['OZ', 3, 4]]], [['generated mix 35', [4, 9], ['OZ', 1, 8]], ['generated mix 16', [4.6, 9], ['OZ', 2, 8]], ['one pound', [16, 3], ['LB', 1, 2]], ['two pounds', [32, 9], ['LB', 2, 8]], ['rounded to 13', [12.4, 4], ['OZ', 4, 3]], ['tier two', [4.2, 5], ['OZ', 2, 4]], ['generated mix 8', [12.4, 5], ['OZ', 4, 4]], ['generated mix 17', [4.6, 6], ['OZ', 2, 5]]], [['generated mix 78', [3.2, 7], ['OZ', 1, 6]], ['generated mix 27', [4.6, 6], ['OZ', 2, 5]], ['tier edge', [8, 2], ['OZ', 2, 1]], ['small', [3.2, 2], ['OZ', 1, 1]], ['almost a pound', [15.5, 1], ['OZ', 4, 1]], ['just over a pound', [17, 8], ['LB', 2, 7]], ['generated mix 19', [8, 8], ['OZ', 2, 7]], ['generated mix 28', [16, 7], ['LB', 1, 6]]], [['generated mix 21', [11.5, 6], ['OZ', 3, 5]], ['generated mix 50', [12.4, 5], ['OZ', 4, 4]], ['tier two', [4.2, 5], ['OZ', 2, 4]], ['one pound', [16, 3], ['LB', 1, 2]], ['two pounds', [32, 9], ['LB', 2, 8]], ['rounded to 13', [12.4, 4], ['OZ', 4, 3]], ['generated mix 31', [15.5, 3], ['OZ', 4, 2]], ['generated mix 39', [24, 3], ['LB', 2, 2]]], [['generated mix 68', [3.2, 2], ['OZ', 1, 1]], ['generated mix 70', [0.3, 7], ['OZ', 1, 6]], ['just over a pound', [17, 8], ['LB', 2, 7]], ['tier edge', [8, 2], ['OZ', 2, 1]], ['small', [3.2, 2], ['OZ', 1, 1]], ['almost a pound', [15.5, 1], ['OZ', 4, 1]], ['generated mix 41', [8, 8], ['OZ', 2, 7]], ['generated mix 49', [12.4, 8], ['OZ', 4, 7]]]]
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
small['OZ', 2, 1]['OZ', 1, 1]Failed
rounded to 13['OZ', 4, 3]['OZ', 4, 3]Passed
tier two['OZ', 2, 4]['OZ', 2, 4]Passed
one pound['LB', 1, 2]['LB', 1, 2]Passed
two pounds['LB', 2, 8]['LB', 2, 8]Passed
almost a pound['OZ', 4, 1]['OZ', 4, 1]Passed
generated mix 6['OZ', 4, 5]['OZ', 4, 5]Passed
generated mix 14['OZ', 3, 4]['OZ', 3, 4]Passed

SHA-256 / a42a208da734c0fbc903876c27f3f00c3e73d0ded20d23e44c8204dfcc6a8b20

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(ounces, zone):
    group = 1 if zone <= 2 else zone - 1
    if ounces < 16:
        oz = math.ceil(ounces)
        return ['OZ', min(4, round(oz / 4)), group]
    return ['LB', math.ceil(ounces / 16), group]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['small', [3.2, 2], ['OZ', 1, 1]], ['rounded to 13', [12.4, 4], ['OZ', 4, 3]], ['tier two', [4.2, 5], ['OZ', 2, 4]], ['one pound', [16, 3], ['LB', 1, 2]], ['two pounds', [32, 9], ['LB', 2, 8]], ['almost a pound', [15.5, 1], ['OZ', 4, 1]], ['generated mix 6', [15.99, 6], ['OZ', 4, 5]], ['generated mix 14', [8.4, 5], ['OZ', 3, 4]]], [['generated mix 35', [4, 9], ['OZ', 1, 8]], ['generated mix 16', [4.6, 9], ['OZ', 2, 8]], ['one pound', [16, 3], ['LB', 1, 2]], ['two pounds', [32, 9], ['LB', 2, 8]], ['rounded to 13', [12.4, 4], ['OZ', 4, 3]], ['tier two', [4.2, 5], ['OZ', 2, 4]], ['generated mix 8', [12.4, 5], ['OZ', 4, 4]], ['generated mix 17', [4.6, 6], ['OZ', 2, 5]]], [['generated mix 78', [3.2, 7], ['OZ', 1, 6]], ['generated mix 27', [4.6, 6], ['OZ', 2, 5]], ['tier edge', [8, 2], ['OZ', 2, 1]], ['small', [3.2, 2], ['OZ', 1, 1]], ['almost a pound', [15.5, 1], ['OZ', 4, 1]], ['just over a pound', [17, 8], ['LB', 2, 7]], ['generated mix 19', [8, 8], ['OZ', 2, 7]], ['generated mix 28', [16, 7], ['LB', 1, 6]]], [['generated mix 21', [11.5, 6], ['OZ', 3, 5]], ['generated mix 50', [12.4, 5], ['OZ', 4, 4]], ['tier two', [4.2, 5], ['OZ', 2, 4]], ['one pound', [16, 3], ['LB', 1, 2]], ['two pounds', [32, 9], ['LB', 2, 8]], ['rounded to 13', [12.4, 4], ['OZ', 4, 3]], ['generated mix 31', [15.5, 3], ['OZ', 4, 2]], ['generated mix 39', [24, 3], ['LB', 2, 2]]], [['generated mix 68', [3.2, 2], ['OZ', 1, 1]], ['generated mix 70', [0.3, 7], ['OZ', 1, 6]], ['just over a pound', [17, 8], ['LB', 2, 7]], ['tier edge', [8, 2], ['OZ', 2, 1]], ['small', [3.2, 2], ['OZ', 1, 1]], ['almost a pound', [15.5, 1], ['OZ', 4, 1]], ['generated mix 41', [8, 8], ['OZ', 2, 7]], ['generated mix 49', [12.4, 8], ['OZ', 4, 7]]]]
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
small['OZ', 1, 1]['OZ', 1, 1]Passed
rounded to 13['OZ', 3, 3]['OZ', 4, 3]Failed
tier two['OZ', 1, 4]['OZ', 2, 4]Failed
one pound['LB', 1, 2]['LB', 1, 2]Passed
two pounds['LB', 2, 8]['LB', 2, 8]Passed
almost a pound['OZ', 4, 1]['OZ', 4, 1]Passed
generated mix 6['OZ', 4, 5]['OZ', 4, 5]Passed
generated mix 14['OZ', 2, 4]['OZ', 3, 4]Failed

SHA-256 / 1ab60d8cba64bc4b4721ae7b4f9c7b628920ec09a773e7ae4aea8323e5fbcafb

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(ounces, zone):
    group = 1 if zone <= 2 else zone - 1
    if ounces < 16:
        oz = math.ceil(ounces)
        return ['OZ', min(4, -(-oz // 4)), group]
    return ['LB', math.ceil(ounces / 16), group]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['small', [3.2, 2], ['OZ', 1, 1]], ['rounded to 13', [12.4, 4], ['OZ', 4, 3]], ['tier two', [4.2, 5], ['OZ', 2, 4]], ['one pound', [16, 3], ['LB', 1, 2]], ['two pounds', [32, 9], ['LB', 2, 8]], ['almost a pound', [15.5, 1], ['OZ', 4, 1]], ['generated mix 6', [15.99, 6], ['OZ', 4, 5]], ['generated mix 14', [8.4, 5], ['OZ', 3, 4]]], [['generated mix 35', [4, 9], ['OZ', 1, 8]], ['generated mix 16', [4.6, 9], ['OZ', 2, 8]], ['one pound', [16, 3], ['LB', 1, 2]], ['two pounds', [32, 9], ['LB', 2, 8]], ['rounded to 13', [12.4, 4], ['OZ', 4, 3]], ['tier two', [4.2, 5], ['OZ', 2, 4]], ['generated mix 8', [12.4, 5], ['OZ', 4, 4]], ['generated mix 17', [4.6, 6], ['OZ', 2, 5]]], [['generated mix 78', [3.2, 7], ['OZ', 1, 6]], ['generated mix 27', [4.6, 6], ['OZ', 2, 5]], ['tier edge', [8, 2], ['OZ', 2, 1]], ['small', [3.2, 2], ['OZ', 1, 1]], ['almost a pound', [15.5, 1], ['OZ', 4, 1]], ['just over a pound', [17, 8], ['LB', 2, 7]], ['generated mix 19', [8, 8], ['OZ', 2, 7]], ['generated mix 28', [16, 7], ['LB', 1, 6]]], [['generated mix 21', [11.5, 6], ['OZ', 3, 5]], ['generated mix 50', [12.4, 5], ['OZ', 4, 4]], ['tier two', [4.2, 5], ['OZ', 2, 4]], ['one pound', [16, 3], ['LB', 1, 2]], ['two pounds', [32, 9], ['LB', 2, 8]], ['rounded to 13', [12.4, 4], ['OZ', 4, 3]], ['generated mix 31', [15.5, 3], ['OZ', 4, 2]], ['generated mix 39', [24, 3], ['LB', 2, 2]]], [['generated mix 68', [3.2, 2], ['OZ', 1, 1]], ['generated mix 70', [0.3, 7], ['OZ', 1, 6]], ['just over a pound', [17, 8], ['LB', 2, 7]], ['tier edge', [8, 2], ['OZ', 2, 1]], ['small', [3.2, 2], ['OZ', 1, 1]], ['almost a pound', [15.5, 1], ['OZ', 4, 1]], ['generated mix 41', [8, 8], ['OZ', 2, 7]], ['generated mix 49', [12.4, 8], ['OZ', 4, 7]]]]
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
small['OZ', 1, 1]['OZ', 1, 1]Passed
rounded to 13['OZ', 4, 3]['OZ', 4, 3]Passed
tier two['OZ', 2, 4]['OZ', 2, 4]Passed
one pound['LB', 1, 2]['LB', 1, 2]Passed
two pounds['LB', 2, 8]['LB', 2, 8]Passed
almost a pound['OZ', 4, 1]['OZ', 4, 1]Passed
generated mix 6['OZ', 4, 5]['OZ', 4, 5]Passed
generated mix 14['OZ', 3, 4]['OZ', 3, 4]Passed

SHA-256 / 6806d0e0bc0dd32278511dca57a2c38cbe3a7151d80533e90d9b39f807306db7

Verification & scope

Stipulated tier sizes and zone groups. 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:16.899603+00:00.

Case digest / 94e2ea1c4fd5b4982ce5f2e951192935b14a3aa6e73a81604936865b847d80dd