FA-95376 / Shipping rate zone lookup / Open access
Billable weight: dim weight truncated · case 01
Dimensional weight is a pound short whenever cube is not an exact multiple of the divisor.
ROOT CAUSE
Cube divided by the divisor is floored instead of rounded up.
VERIFIED REPAIR
Round dimensional weight up to the next pound.
Unsuccessful approach: Rounding to nearest still drops fractions below one half.
Case contract
dims inches (each rounded half up to a whole inch), actual lb rounded up (minimum 1). Dim weight = ceil(L*W*H/divisor) using rounded dims, only when the rounded cube exceeds 1728 cubic inches. Return [billable, "DIM"] if dim weight strictly exceeds rounded actual, else [actual, "ACTUAL"].
Why this case matters
Carriers bill the greater of actual and dimensional weight before zone rating.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(dims, actual, divisor):
r = [int(math.floor(d + 0.5)) for d in dims]
cube = r[0] * r[1] * r[2]
act = max(1, math.ceil(actual))
dimw = cube // divisor if cube > 1728 else 0
if dimw > act:
return [dimw, 'DIM']
return [act, 'ACTUAL']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['half inch rounds up', [[12.5, 12, 12], 5, 139], [14, 'DIM']], ['just above threshold', [[12, 12, 13], 1, 166], [12, 'DIM']], ['cube threshold exact', [[12, 12, 12], 1, 139], [1, 'ACTUAL']], ['tie goes actual', [[20, 20, 20], 58, 139], [58, 'ACTUAL']], ['actual fraction up', [[10, 10, 10], 7.2, 139], [8, 'ACTUAL']], ['generated mix 7', [[16, 13.5, 12], 5, 139], [20, 'DIM']], ['generated mix 15', [[16, 10, 10], 9, 139], [9, 'ACTUAL']], ['generated mix 23', [[12, 10, 20], 9, 166], [15, 'DIM']]], [['generated mix 7', [[16, 13.5, 12], 5, 139], [20, 'DIM']], ['generated mix 12', [[12, 20, 12.5], 2.1, 139], [23, 'DIM']], ['actual fraction up', [[10, 10, 10], 7.2, 139], [8, 'ACTUAL']], ['dim ceil', [[18, 12, 10], 1, 166], [14, 'DIM']], ['cube threshold exact', [[12, 12, 12], 1, 139], [1, 'ACTUAL']], ['generated mix 10', [[12.5, 12, 16], 1, 139], [18, 'DIM']], ['generated mix 19', [[24.5, 20, 16], 7.5, 139], [58, 'DIM']], ['generated mix 27', [[10.5, 12.5, 24.5], 1, 139], [26, 'DIM']]], [['generated mix 19', [[24.5, 20, 16], 7.5, 139], [58, 'DIM']], ['generated mix 28', [[18.5, 12, 11.4], 2.1, 166], [16, 'DIM']], ['half inch rounds up', [[12.5, 12, 12], 5, 139], [14, 'DIM']], ['just above threshold', [[12, 12, 13], 1, 166], [12, 'DIM']], ['tie goes actual', [[20, 20, 20], 58, 139], [58, 'ACTUAL']], ['generated mix 21', [[12.5, 20, 10], 30, 166], [30, 'ACTUAL']], ['generated mix 30', [[13.5, 18.5, 12], 5, 139], [23, 'DIM']], ['generated mix 38', [[24.5, 11.4, 10.5], 9, 139], [22, 'DIM']]], [['generated mix 29', [[12, 10, 24.5], 0.2, 166], [19, 'DIM']], ['generated mix 36', [[20, 18.5, 12], 2.1, 166], [28, 'DIM']], ['actual fraction up', [[10, 10, 10], 7.2, 139], [8, 'ACTUAL']], ['dim ceil', [[18, 12, 10], 1, 166], [14, 'DIM']], ['cube threshold exact', [[12, 12, 12], 1, 139], [1, 'ACTUAL']], ['generated mix 32', [[12, 12, 18.5], 7.5, 166], [17, 'DIM']], ['generated mix 41', [[10, 16, 10], 14, 139], [14, 'ACTUAL']], ['generated mix 49', [[12, 12, 10.5], 7.5, 139], [8, 'ACTUAL']]], [['generated mix 38', [[24.5, 11.4, 10.5], 9, 139], [22, 'DIM']], ['generated mix 51', [[10, 11.4, 18.5], 2.1, 139], [16, 'DIM']], ['half inch rounds up', [[12.5, 12, 12], 5, 139], [14, 'DIM']], ['just above threshold', [[12, 12, 13], 1, 166], [12, 'DIM']], ['tie goes actual', [[20, 20, 20], 58, 139], [58, 'ACTUAL']], ['generated mix 43', [[20, 10.5, 24.5], 7.5, 139], [40, 'DIM']], ['generated mix 52', [[20, 10.5, 11.4], 0.2, 166], [15, 'DIM']], ['generated mix 60', [[18.5, 11.4, 18.5], 14, 139], [29, 'DIM']]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| half inch rounds up | [13, 'DIM'] | [14, 'DIM'] | Failed |
| just above threshold | [11, 'DIM'] | [12, 'DIM'] | Failed |
| cube threshold exact | [1, 'ACTUAL'] | [1, 'ACTUAL'] | Passed |
| tie goes actual | [58, 'ACTUAL'] | [58, 'ACTUAL'] | Passed |
| actual fraction up | [8, 'ACTUAL'] | [8, 'ACTUAL'] | Passed |
| generated mix 7 | [19, 'DIM'] | [20, 'DIM'] | Failed |
| generated mix 15 | [9, 'ACTUAL'] | [9, 'ACTUAL'] | Passed |
| generated mix 23 | [14, 'DIM'] | [15, 'DIM'] | Failed |
SHA-256 / 7e0ee0da79468393246c50c98cee68b190a341f472af37a50ff5077a5670e533
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(dims, actual, divisor):
r = [int(math.floor(d + 0.5)) for d in dims]
cube = r[0] * r[1] * r[2]
act = max(1, math.ceil(actual))
dimw = round(cube / divisor) if cube > 1728 else 0
if dimw > act:
return [dimw, 'DIM']
return [act, 'ACTUAL']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['half inch rounds up', [[12.5, 12, 12], 5, 139], [14, 'DIM']], ['just above threshold', [[12, 12, 13], 1, 166], [12, 'DIM']], ['cube threshold exact', [[12, 12, 12], 1, 139], [1, 'ACTUAL']], ['tie goes actual', [[20, 20, 20], 58, 139], [58, 'ACTUAL']], ['actual fraction up', [[10, 10, 10], 7.2, 139], [8, 'ACTUAL']], ['generated mix 7', [[16, 13.5, 12], 5, 139], [20, 'DIM']], ['generated mix 15', [[16, 10, 10], 9, 139], [9, 'ACTUAL']], ['generated mix 23', [[12, 10, 20], 9, 166], [15, 'DIM']]], [['generated mix 7', [[16, 13.5, 12], 5, 139], [20, 'DIM']], ['generated mix 12', [[12, 20, 12.5], 2.1, 139], [23, 'DIM']], ['actual fraction up', [[10, 10, 10], 7.2, 139], [8, 'ACTUAL']], ['dim ceil', [[18, 12, 10], 1, 166], [14, 'DIM']], ['cube threshold exact', [[12, 12, 12], 1, 139], [1, 'ACTUAL']], ['generated mix 10', [[12.5, 12, 16], 1, 139], [18, 'DIM']], ['generated mix 19', [[24.5, 20, 16], 7.5, 139], [58, 'DIM']], ['generated mix 27', [[10.5, 12.5, 24.5], 1, 139], [26, 'DIM']]], [['generated mix 19', [[24.5, 20, 16], 7.5, 139], [58, 'DIM']], ['generated mix 28', [[18.5, 12, 11.4], 2.1, 166], [16, 'DIM']], ['half inch rounds up', [[12.5, 12, 12], 5, 139], [14, 'DIM']], ['just above threshold', [[12, 12, 13], 1, 166], [12, 'DIM']], ['tie goes actual', [[20, 20, 20], 58, 139], [58, 'ACTUAL']], ['generated mix 21', [[12.5, 20, 10], 30, 166], [30, 'ACTUAL']], ['generated mix 30', [[13.5, 18.5, 12], 5, 139], [23, 'DIM']], ['generated mix 38', [[24.5, 11.4, 10.5], 9, 139], [22, 'DIM']]], [['generated mix 29', [[12, 10, 24.5], 0.2, 166], [19, 'DIM']], ['generated mix 36', [[20, 18.5, 12], 2.1, 166], [28, 'DIM']], ['actual fraction up', [[10, 10, 10], 7.2, 139], [8, 'ACTUAL']], ['dim ceil', [[18, 12, 10], 1, 166], [14, 'DIM']], ['cube threshold exact', [[12, 12, 12], 1, 139], [1, 'ACTUAL']], ['generated mix 32', [[12, 12, 18.5], 7.5, 166], [17, 'DIM']], ['generated mix 41', [[10, 16, 10], 14, 139], [14, 'ACTUAL']], ['generated mix 49', [[12, 12, 10.5], 7.5, 139], [8, 'ACTUAL']]], [['generated mix 38', [[24.5, 11.4, 10.5], 9, 139], [22, 'DIM']], ['generated mix 51', [[10, 11.4, 18.5], 2.1, 139], [16, 'DIM']], ['half inch rounds up', [[12.5, 12, 12], 5, 139], [14, 'DIM']], ['just above threshold', [[12, 12, 13], 1, 166], [12, 'DIM']], ['tie goes actual', [[20, 20, 20], 58, 139], [58, 'ACTUAL']], ['generated mix 43', [[20, 10.5, 24.5], 7.5, 139], [40, 'DIM']], ['generated mix 52', [[20, 10.5, 11.4], 0.2, 166], [15, 'DIM']], ['generated mix 60', [[18.5, 11.4, 18.5], 14, 139], [29, 'DIM']]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| half inch rounds up | [13, 'DIM'] | [14, 'DIM'] | Failed |
| just above threshold | [11, 'DIM'] | [12, 'DIM'] | Failed |
| cube threshold exact | [1, 'ACTUAL'] | [1, 'ACTUAL'] | Passed |
| tie goes actual | [58, 'ACTUAL'] | [58, 'ACTUAL'] | Passed |
| actual fraction up | [8, 'ACTUAL'] | [8, 'ACTUAL'] | Passed |
| generated mix 7 | [19, 'DIM'] | [20, 'DIM'] | Failed |
| generated mix 15 | [9, 'ACTUAL'] | [9, 'ACTUAL'] | Passed |
| generated mix 23 | [14, 'DIM'] | [15, 'DIM'] | Failed |
SHA-256 / ef58b3e6a49fa9e5c6632475d7e287bb9c19d18e3490e77764267d7e5e9223d5
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(dims, actual, divisor):
r = [int(math.floor(d + 0.5)) for d in dims]
cube = r[0] * r[1] * r[2]
act = max(1, math.ceil(actual))
dimw = -(-cube // divisor) if cube > 1728 else 0
if dimw > act:
return [dimw, 'DIM']
return [act, 'ACTUAL']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['half inch rounds up', [[12.5, 12, 12], 5, 139], [14, 'DIM']], ['just above threshold', [[12, 12, 13], 1, 166], [12, 'DIM']], ['cube threshold exact', [[12, 12, 12], 1, 139], [1, 'ACTUAL']], ['tie goes actual', [[20, 20, 20], 58, 139], [58, 'ACTUAL']], ['actual fraction up', [[10, 10, 10], 7.2, 139], [8, 'ACTUAL']], ['generated mix 7', [[16, 13.5, 12], 5, 139], [20, 'DIM']], ['generated mix 15', [[16, 10, 10], 9, 139], [9, 'ACTUAL']], ['generated mix 23', [[12, 10, 20], 9, 166], [15, 'DIM']]], [['generated mix 7', [[16, 13.5, 12], 5, 139], [20, 'DIM']], ['generated mix 12', [[12, 20, 12.5], 2.1, 139], [23, 'DIM']], ['actual fraction up', [[10, 10, 10], 7.2, 139], [8, 'ACTUAL']], ['dim ceil', [[18, 12, 10], 1, 166], [14, 'DIM']], ['cube threshold exact', [[12, 12, 12], 1, 139], [1, 'ACTUAL']], ['generated mix 10', [[12.5, 12, 16], 1, 139], [18, 'DIM']], ['generated mix 19', [[24.5, 20, 16], 7.5, 139], [58, 'DIM']], ['generated mix 27', [[10.5, 12.5, 24.5], 1, 139], [26, 'DIM']]], [['generated mix 19', [[24.5, 20, 16], 7.5, 139], [58, 'DIM']], ['generated mix 28', [[18.5, 12, 11.4], 2.1, 166], [16, 'DIM']], ['half inch rounds up', [[12.5, 12, 12], 5, 139], [14, 'DIM']], ['just above threshold', [[12, 12, 13], 1, 166], [12, 'DIM']], ['tie goes actual', [[20, 20, 20], 58, 139], [58, 'ACTUAL']], ['generated mix 21', [[12.5, 20, 10], 30, 166], [30, 'ACTUAL']], ['generated mix 30', [[13.5, 18.5, 12], 5, 139], [23, 'DIM']], ['generated mix 38', [[24.5, 11.4, 10.5], 9, 139], [22, 'DIM']]], [['generated mix 29', [[12, 10, 24.5], 0.2, 166], [19, 'DIM']], ['generated mix 36', [[20, 18.5, 12], 2.1, 166], [28, 'DIM']], ['actual fraction up', [[10, 10, 10], 7.2, 139], [8, 'ACTUAL']], ['dim ceil', [[18, 12, 10], 1, 166], [14, 'DIM']], ['cube threshold exact', [[12, 12, 12], 1, 139], [1, 'ACTUAL']], ['generated mix 32', [[12, 12, 18.5], 7.5, 166], [17, 'DIM']], ['generated mix 41', [[10, 16, 10], 14, 139], [14, 'ACTUAL']], ['generated mix 49', [[12, 12, 10.5], 7.5, 139], [8, 'ACTUAL']]], [['generated mix 38', [[24.5, 11.4, 10.5], 9, 139], [22, 'DIM']], ['generated mix 51', [[10, 11.4, 18.5], 2.1, 139], [16, 'DIM']], ['half inch rounds up', [[12.5, 12, 12], 5, 139], [14, 'DIM']], ['just above threshold', [[12, 12, 13], 1, 166], [12, 'DIM']], ['tie goes actual', [[20, 20, 20], 58, 139], [58, 'ACTUAL']], ['generated mix 43', [[20, 10.5, 24.5], 7.5, 139], [40, 'DIM']], ['generated mix 52', [[20, 10.5, 11.4], 0.2, 166], [15, 'DIM']], ['generated mix 60', [[18.5, 11.4, 18.5], 14, 139], [29, 'DIM']]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| half inch rounds up | [14, 'DIM'] | [14, 'DIM'] | Passed |
| just above threshold | [12, 'DIM'] | [12, 'DIM'] | Passed |
| cube threshold exact | [1, 'ACTUAL'] | [1, 'ACTUAL'] | Passed |
| tie goes actual | [58, 'ACTUAL'] | [58, 'ACTUAL'] | Passed |
| actual fraction up | [8, 'ACTUAL'] | [8, 'ACTUAL'] | Passed |
| generated mix 7 | [20, 'DIM'] | [20, 'DIM'] | Passed |
| generated mix 15 | [9, 'ACTUAL'] | [9, 'ACTUAL'] | Passed |
| generated mix 23 | [15, 'DIM'] | [15, 'DIM'] | Passed |
SHA-256 / 2f0eddaff8ff1be37c2128bf9cb6ed22b16421a349a370c0129ba5b5c15ac199
Verification & scope
Stipulated divisor and threshold; no carrier specific exceptions. 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:13.076025+00:00.
Case digest / 379cefc71d488c729dbae8342c4a182878b2e625d8a1ff375550aebf97e8296b