FA-94956 / Warehouse slotting and bin packing / Open access
Carton selection: carton dims not normalized · case 01
Items that fit a carton lying on their side are reported as needing a larger carton.
ROOT CAUSE
Carton inner dimensions are compared in catalogue order while item dims are sorted.
VERIFIED REPAIR
Sort both the padded item dims and the carton inner dims before comparing.
Unsuccessful approach: Leaving the item dims unsorted while carton dims are sorted still depends on catalogue orientation.
Case contract
Item dims [a,b,c], weight kg, sioc flag (ships in own container). cartons [[id, L, W, H, max_kg, cost]]. SIOC items return "SIOC". Otherwise add 1 unit of dunnage per side (2 per dimension); the item fits a carton if the sorted padded dims are each <= the sorted inner dims (any orientation) and kg <= max_kg. Choose the smallest inner volume, then cost, then id. None -> "NO_FIT".
Why this case matters
Cartonization picks the shipping box, which drives material cost and dimensional weight.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(dims, kg, sioc, cartons):
if sioc:
return 'SIOC'
need = sorted(d + 2 for d in dims)
best = None
for cid, L, W, H, max_kg, cost in cartons:
inner = [L, W, H]
if any(n > c for n, c in zip(need, inner)):
continue
if kg > max_kg:
continue
key = (L * W * H, cost, cid)
if best is None or key < best[0]:
best = (key, cid)
return best[1] if best else 'NO_FIT'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['padding pushes to M', [[11, 3, 3], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['weight at limit', [[3, 3, 3], 10, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['sioc', [[3, 3, 3], 1, True, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'SIOC'], ['volume tie by cost', [[3, 3, 3], 1, False, [['A', 10, 10, 10, 9, 60], ['B', 20, 10, 5, 9, 55]]], 'B'], ['long thin carton', [[3, 3, 3], 1, False, [['LONG', 40, 6, 6, 30, 50], ['CUBE', 12, 12, 12, 30, 60]]], 'LONG'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['generated mix 6', [[13, 6, 9], 19, False, [['C0', 16, 6, 30, 5, 55], ['C1', 6, 12, 6, 5, 70], ['C2', 6, 8, 12, 20, 90], ['C3', 10, 20, 6, 20, 70], ['C4', 24, 8, 30, 10, 70]]], 'NO_FIT']], [['generated mix 18', [[10, 14, 4], 4.5, False, [['C0', 32, 16, 20, 10, 55], ['C1', 32, 6, 8, 30, 90], ['C2', 16, 6, 6, 20, 40], ['C3', 6, 8, 30, 5, 55], ['C4', 10, 6, 20, 20, 40], ['C5', 32, 20, 6, 20, 90]]], 'C5'], ['generated mix 13', [[5, 2, 14], 5, False, [['C0', 20, 20, 6, 5, 55], ['C1', 32, 16, 8, 20, 90]]], 'C0'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['no fit', [[40, 3, 3], 1, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'NO_FIT'], ['cheap but bulky', [[3, 3, 3], 1, False, [['BIG', 30, 30, 30, 30, 40], ['SMALL', 10, 10, 10, 30, 60]]], 'SMALL'], ['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['generated mix 7', [[7, 9, 14], 5, True, [['C0', 16, 16, 4, 20, 55], ['C1', 20, 16, 8, 10, 70], ['C2', 24, 6, 4, 5, 40], ['C3', 10, 8, 30, 10, 90], ['C4', 20, 8, 30, 5, 90], ['C5', 24, 12, 12, 10, 90]]], 'SIOC'], ['generated mix 16', [[6, 4, 3], 19, False, [['C0', 12, 16, 4, 5, 40], ['C1', 32, 16, 4, 10, 90], ['C2', 20, 16, 20, 10, 70], ['C3', 20, 12, 8, 10, 90]]], 'NO_FIT']], [['generated mix 34', [[2, 2, 10], 5, False, [['C0', 6, 6, 4, 20, 55], ['C1', 12, 20, 4, 30, 90]]], 'C1'], ['generated mix 26', [[14, 4, 3], 19, False, [['C0', 32, 12, 8, 10, 70], ['C1', 6, 8, 4, 10, 55], ['C2', 20, 20, 8, 5, 55], ['C3', 12, 6, 12, 20, 55], ['C4', 16, 8, 20, 10, 40], ['C5', 6, 6, 20, 20, 40]]], 'C5'], ['volume tie by cost', [[3, 3, 3], 1, False, [['A', 10, 10, 10, 9, 60], ['B', 20, 10, 5, 9, 55]]], 'B'], ['long thin carton', [[3, 3, 3], 1, False, [['LONG', 40, 6, 6, 30, 50], ['CUBE', 12, 12, 12, 30, 60]]], 'LONG'], ['padding pushes to M', [[11, 3, 3], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['generated mix 18', [[10, 14, 4], 4.5, False, [['C0', 32, 16, 20, 10, 55], ['C1', 32, 6, 8, 30, 90], ['C2', 16, 6, 6, 20, 40], ['C3', 6, 8, 30, 5, 55], ['C4', 10, 6, 20, 20, 40], ['C5', 32, 20, 6, 20, 90]]], 'C5'], ['generated mix 27', [[10, 11, 6], 10, False, [['C0', 20, 20, 8, 30, 90], ['C1', 24, 20, 20, 5, 90], ['C2', 32, 16, 4, 5, 55], ['C3', 10, 16, 30, 5, 55], ['C4', 10, 6, 4, 10, 90], ['C5', 16, 20, 30, 5, 70]]], 'C0']], [['generated mix 55', [[14, 7, 5], 9.5, False, [['C0', 16, 8, 6, 30, 55], ['C1', 12, 16, 4, 30, 90], ['C2', 32, 8, 20, 30, 70]]], 'C2'], ['generated mix 39', [[13, 2, 3], 9.5, False, [['C0', 24, 12, 6, 5, 90], ['C1', 32, 8, 6, 30, 90]]], 'C1'], ['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['weight at limit', [[3, 3, 3], 10, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['sioc', [[3, 3, 3], 1, True, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'SIOC'], ['volume tie by cost', [[3, 3, 3], 1, False, [['A', 10, 10, 10, 9, 60], ['B', 20, 10, 5, 9, 55]]], 'B'], ['generated mix 29', [[2, 4, 9], 9.5, False, [['C0', 32, 20, 6, 10, 40], ['C1', 32, 8, 30, 10, 55]]], 'C0'], ['generated mix 37', [[2, 4, 13], 1, True, [['C0', 32, 12, 6, 30, 55], ['C1', 16, 6, 30, 30, 70], ['C2', 6, 8, 6, 5, 55], ['C3', 32, 16, 30, 10, 40], ['C4', 16, 16, 12, 30, 70], ['C5', 16, 8, 6, 10, 90]]], 'SIOC']], [['generated mix 67', [[13, 6, 8], 9.5, False, [['C0', 12, 12, 8, 30, 40], ['C1', 24, 12, 8, 5, 55], ['C2', 24, 20, 8, 30, 40], ['C3', 6, 8, 12, 10, 55]]], 'C2'], ['generated mix 53', [[13, 7, 9], 1, False, [['C0', 32, 16, 30, 30, 70], ['C1', 24, 12, 12, 20, 70], ['C2', 10, 12, 20, 10, 40], ['C3', 12, 12, 30, 10, 40]]], 'C2'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['no fit', [[40, 3, 3], 1, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'NO_FIT'], ['cheap but bulky', [[3, 3, 3], 1, False, [['BIG', 30, 30, 30, 30, 40], ['SMALL', 10, 10, 10, 30, 60]]], 'SMALL'], ['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['generated mix 40', [[5, 12, 11], 9.5, False, [['C0', 20, 20, 20, 5, 40], ['C1', 6, 8, 12, 30, 70], ['C2', 10, 16, 12, 5, 40]]], 'NO_FIT'], ['generated mix 48', [[14, 11, 11], 19, False, [['C0', 20, 16, 4, 5, 40], ['C1', 24, 20, 6, 10, 55], ['C2', 32, 6, 6, 10, 90]]], 'NO_FIT']]]
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 |
|---|---|---|---|
| rotated fit | L | S | Failed |
| padding pushes to M | L | M | Failed |
| weight at limit | S | S | Passed |
| sioc | SIOC | SIOC | Passed |
| volume tie by cost | B | B | Passed |
| long thin carton | LONG | LONG | Passed |
| weight over limit | M | M | Passed |
| generated mix 6 | NO_FIT | NO_FIT | Passed |
SHA-256 / 7f7027114cdd52d785f1b1a4e2a8c59ea11fbff403515fa86b8412ba20aab897
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(dims, kg, sioc, cartons):
if sioc:
return 'SIOC'
need = [d + 2 for d in dims]
best = None
for cid, L, W, H, max_kg, cost in cartons:
inner = sorted([L, W, H])
if any(n > c for n, c in zip(need, inner)):
continue
if kg > max_kg:
continue
key = (L * W * H, cost, cid)
if best is None or key < best[0]:
best = (key, cid)
return best[1] if best else 'NO_FIT'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['padding pushes to M', [[11, 3, 3], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['weight at limit', [[3, 3, 3], 10, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['sioc', [[3, 3, 3], 1, True, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'SIOC'], ['volume tie by cost', [[3, 3, 3], 1, False, [['A', 10, 10, 10, 9, 60], ['B', 20, 10, 5, 9, 55]]], 'B'], ['long thin carton', [[3, 3, 3], 1, False, [['LONG', 40, 6, 6, 30, 50], ['CUBE', 12, 12, 12, 30, 60]]], 'LONG'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['generated mix 6', [[13, 6, 9], 19, False, [['C0', 16, 6, 30, 5, 55], ['C1', 6, 12, 6, 5, 70], ['C2', 6, 8, 12, 20, 90], ['C3', 10, 20, 6, 20, 70], ['C4', 24, 8, 30, 10, 70]]], 'NO_FIT']], [['generated mix 18', [[10, 14, 4], 4.5, False, [['C0', 32, 16, 20, 10, 55], ['C1', 32, 6, 8, 30, 90], ['C2', 16, 6, 6, 20, 40], ['C3', 6, 8, 30, 5, 55], ['C4', 10, 6, 20, 20, 40], ['C5', 32, 20, 6, 20, 90]]], 'C5'], ['generated mix 13', [[5, 2, 14], 5, False, [['C0', 20, 20, 6, 5, 55], ['C1', 32, 16, 8, 20, 90]]], 'C0'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['no fit', [[40, 3, 3], 1, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'NO_FIT'], ['cheap but bulky', [[3, 3, 3], 1, False, [['BIG', 30, 30, 30, 30, 40], ['SMALL', 10, 10, 10, 30, 60]]], 'SMALL'], ['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['generated mix 7', [[7, 9, 14], 5, True, [['C0', 16, 16, 4, 20, 55], ['C1', 20, 16, 8, 10, 70], ['C2', 24, 6, 4, 5, 40], ['C3', 10, 8, 30, 10, 90], ['C4', 20, 8, 30, 5, 90], ['C5', 24, 12, 12, 10, 90]]], 'SIOC'], ['generated mix 16', [[6, 4, 3], 19, False, [['C0', 12, 16, 4, 5, 40], ['C1', 32, 16, 4, 10, 90], ['C2', 20, 16, 20, 10, 70], ['C3', 20, 12, 8, 10, 90]]], 'NO_FIT']], [['generated mix 34', [[2, 2, 10], 5, False, [['C0', 6, 6, 4, 20, 55], ['C1', 12, 20, 4, 30, 90]]], 'C1'], ['generated mix 26', [[14, 4, 3], 19, False, [['C0', 32, 12, 8, 10, 70], ['C1', 6, 8, 4, 10, 55], ['C2', 20, 20, 8, 5, 55], ['C3', 12, 6, 12, 20, 55], ['C4', 16, 8, 20, 10, 40], ['C5', 6, 6, 20, 20, 40]]], 'C5'], ['volume tie by cost', [[3, 3, 3], 1, False, [['A', 10, 10, 10, 9, 60], ['B', 20, 10, 5, 9, 55]]], 'B'], ['long thin carton', [[3, 3, 3], 1, False, [['LONG', 40, 6, 6, 30, 50], ['CUBE', 12, 12, 12, 30, 60]]], 'LONG'], ['padding pushes to M', [[11, 3, 3], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['generated mix 18', [[10, 14, 4], 4.5, False, [['C0', 32, 16, 20, 10, 55], ['C1', 32, 6, 8, 30, 90], ['C2', 16, 6, 6, 20, 40], ['C3', 6, 8, 30, 5, 55], ['C4', 10, 6, 20, 20, 40], ['C5', 32, 20, 6, 20, 90]]], 'C5'], ['generated mix 27', [[10, 11, 6], 10, False, [['C0', 20, 20, 8, 30, 90], ['C1', 24, 20, 20, 5, 90], ['C2', 32, 16, 4, 5, 55], ['C3', 10, 16, 30, 5, 55], ['C4', 10, 6, 4, 10, 90], ['C5', 16, 20, 30, 5, 70]]], 'C0']], [['generated mix 55', [[14, 7, 5], 9.5, False, [['C0', 16, 8, 6, 30, 55], ['C1', 12, 16, 4, 30, 90], ['C2', 32, 8, 20, 30, 70]]], 'C2'], ['generated mix 39', [[13, 2, 3], 9.5, False, [['C0', 24, 12, 6, 5, 90], ['C1', 32, 8, 6, 30, 90]]], 'C1'], ['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['weight at limit', [[3, 3, 3], 10, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['sioc', [[3, 3, 3], 1, True, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'SIOC'], ['volume tie by cost', [[3, 3, 3], 1, False, [['A', 10, 10, 10, 9, 60], ['B', 20, 10, 5, 9, 55]]], 'B'], ['generated mix 29', [[2, 4, 9], 9.5, False, [['C0', 32, 20, 6, 10, 40], ['C1', 32, 8, 30, 10, 55]]], 'C0'], ['generated mix 37', [[2, 4, 13], 1, True, [['C0', 32, 12, 6, 30, 55], ['C1', 16, 6, 30, 30, 70], ['C2', 6, 8, 6, 5, 55], ['C3', 32, 16, 30, 10, 40], ['C4', 16, 16, 12, 30, 70], ['C5', 16, 8, 6, 10, 90]]], 'SIOC']], [['generated mix 67', [[13, 6, 8], 9.5, False, [['C0', 12, 12, 8, 30, 40], ['C1', 24, 12, 8, 5, 55], ['C2', 24, 20, 8, 30, 40], ['C3', 6, 8, 12, 10, 55]]], 'C2'], ['generated mix 53', [[13, 7, 9], 1, False, [['C0', 32, 16, 30, 30, 70], ['C1', 24, 12, 12, 20, 70], ['C2', 10, 12, 20, 10, 40], ['C3', 12, 12, 30, 10, 40]]], 'C2'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['no fit', [[40, 3, 3], 1, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'NO_FIT'], ['cheap but bulky', [[3, 3, 3], 1, False, [['BIG', 30, 30, 30, 30, 40], ['SMALL', 10, 10, 10, 30, 60]]], 'SMALL'], ['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['generated mix 40', [[5, 12, 11], 9.5, False, [['C0', 20, 20, 20, 5, 40], ['C1', 6, 8, 12, 30, 70], ['C2', 10, 16, 12, 5, 40]]], 'NO_FIT'], ['generated mix 48', [[14, 11, 11], 19, False, [['C0', 20, 16, 4, 5, 40], ['C1', 24, 20, 6, 10, 55], ['C2', 32, 6, 6, 10, 90]]], 'NO_FIT']]]
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 |
|---|---|---|---|
| rotated fit | M | S | Failed |
| padding pushes to M | L | M | Failed |
| weight at limit | S | S | Passed |
| sioc | SIOC | SIOC | Passed |
| volume tie by cost | B | B | Passed |
| long thin carton | LONG | LONG | Passed |
| weight over limit | M | M | Passed |
| generated mix 6 | NO_FIT | NO_FIT | Passed |
SHA-256 / 35bb61a220098eb04c7ac77ea8f239b416d149ba8b2277c685808286c438769a
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(dims, kg, sioc, cartons):
if sioc:
return 'SIOC'
need = sorted(d + 2 for d in dims)
best = None
for cid, L, W, H, max_kg, cost in cartons:
inner = sorted([L, W, H])
if any(n > c for n, c in zip(need, inner)):
continue
if kg > max_kg:
continue
key = (L * W * H, cost, cid)
if best is None or key < best[0]:
best = (key, cid)
return best[1] if best else 'NO_FIT'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['padding pushes to M', [[11, 3, 3], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['weight at limit', [[3, 3, 3], 10, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['sioc', [[3, 3, 3], 1, True, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'SIOC'], ['volume tie by cost', [[3, 3, 3], 1, False, [['A', 10, 10, 10, 9, 60], ['B', 20, 10, 5, 9, 55]]], 'B'], ['long thin carton', [[3, 3, 3], 1, False, [['LONG', 40, 6, 6, 30, 50], ['CUBE', 12, 12, 12, 30, 60]]], 'LONG'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['generated mix 6', [[13, 6, 9], 19, False, [['C0', 16, 6, 30, 5, 55], ['C1', 6, 12, 6, 5, 70], ['C2', 6, 8, 12, 20, 90], ['C3', 10, 20, 6, 20, 70], ['C4', 24, 8, 30, 10, 70]]], 'NO_FIT']], [['generated mix 18', [[10, 14, 4], 4.5, False, [['C0', 32, 16, 20, 10, 55], ['C1', 32, 6, 8, 30, 90], ['C2', 16, 6, 6, 20, 40], ['C3', 6, 8, 30, 5, 55], ['C4', 10, 6, 20, 20, 40], ['C5', 32, 20, 6, 20, 90]]], 'C5'], ['generated mix 13', [[5, 2, 14], 5, False, [['C0', 20, 20, 6, 5, 55], ['C1', 32, 16, 8, 20, 90]]], 'C0'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['no fit', [[40, 3, 3], 1, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'NO_FIT'], ['cheap but bulky', [[3, 3, 3], 1, False, [['BIG', 30, 30, 30, 30, 40], ['SMALL', 10, 10, 10, 30, 60]]], 'SMALL'], ['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['generated mix 7', [[7, 9, 14], 5, True, [['C0', 16, 16, 4, 20, 55], ['C1', 20, 16, 8, 10, 70], ['C2', 24, 6, 4, 5, 40], ['C3', 10, 8, 30, 10, 90], ['C4', 20, 8, 30, 5, 90], ['C5', 24, 12, 12, 10, 90]]], 'SIOC'], ['generated mix 16', [[6, 4, 3], 19, False, [['C0', 12, 16, 4, 5, 40], ['C1', 32, 16, 4, 10, 90], ['C2', 20, 16, 20, 10, 70], ['C3', 20, 12, 8, 10, 90]]], 'NO_FIT']], [['generated mix 34', [[2, 2, 10], 5, False, [['C0', 6, 6, 4, 20, 55], ['C1', 12, 20, 4, 30, 90]]], 'C1'], ['generated mix 26', [[14, 4, 3], 19, False, [['C0', 32, 12, 8, 10, 70], ['C1', 6, 8, 4, 10, 55], ['C2', 20, 20, 8, 5, 55], ['C3', 12, 6, 12, 20, 55], ['C4', 16, 8, 20, 10, 40], ['C5', 6, 6, 20, 20, 40]]], 'C5'], ['volume tie by cost', [[3, 3, 3], 1, False, [['A', 10, 10, 10, 9, 60], ['B', 20, 10, 5, 9, 55]]], 'B'], ['long thin carton', [[3, 3, 3], 1, False, [['LONG', 40, 6, 6, 30, 50], ['CUBE', 12, 12, 12, 30, 60]]], 'LONG'], ['padding pushes to M', [[11, 3, 3], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['generated mix 18', [[10, 14, 4], 4.5, False, [['C0', 32, 16, 20, 10, 55], ['C1', 32, 6, 8, 30, 90], ['C2', 16, 6, 6, 20, 40], ['C3', 6, 8, 30, 5, 55], ['C4', 10, 6, 20, 20, 40], ['C5', 32, 20, 6, 20, 90]]], 'C5'], ['generated mix 27', [[10, 11, 6], 10, False, [['C0', 20, 20, 8, 30, 90], ['C1', 24, 20, 20, 5, 90], ['C2', 32, 16, 4, 5, 55], ['C3', 10, 16, 30, 5, 55], ['C4', 10, 6, 4, 10, 90], ['C5', 16, 20, 30, 5, 70]]], 'C0']], [['generated mix 55', [[14, 7, 5], 9.5, False, [['C0', 16, 8, 6, 30, 55], ['C1', 12, 16, 4, 30, 90], ['C2', 32, 8, 20, 30, 70]]], 'C2'], ['generated mix 39', [[13, 2, 3], 9.5, False, [['C0', 24, 12, 6, 5, 90], ['C1', 32, 8, 6, 30, 90]]], 'C1'], ['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['weight at limit', [[3, 3, 3], 10, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['sioc', [[3, 3, 3], 1, True, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'SIOC'], ['volume tie by cost', [[3, 3, 3], 1, False, [['A', 10, 10, 10, 9, 60], ['B', 20, 10, 5, 9, 55]]], 'B'], ['generated mix 29', [[2, 4, 9], 9.5, False, [['C0', 32, 20, 6, 10, 40], ['C1', 32, 8, 30, 10, 55]]], 'C0'], ['generated mix 37', [[2, 4, 13], 1, True, [['C0', 32, 12, 6, 30, 55], ['C1', 16, 6, 30, 30, 70], ['C2', 6, 8, 6, 5, 55], ['C3', 32, 16, 30, 10, 40], ['C4', 16, 16, 12, 30, 70], ['C5', 16, 8, 6, 10, 90]]], 'SIOC']], [['generated mix 67', [[13, 6, 8], 9.5, False, [['C0', 12, 12, 8, 30, 40], ['C1', 24, 12, 8, 5, 55], ['C2', 24, 20, 8, 30, 40], ['C3', 6, 8, 12, 10, 55]]], 'C2'], ['generated mix 53', [[13, 7, 9], 1, False, [['C0', 32, 16, 30, 30, 70], ['C1', 24, 12, 12, 20, 70], ['C2', 10, 12, 20, 10, 40], ['C3', 12, 12, 30, 10, 40]]], 'C2'], ['weight over limit', [[3, 3, 3], 10.5, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'M'], ['no fit', [[40, 3, 3], 1, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'NO_FIT'], ['cheap but bulky', [[3, 3, 3], 1, False, [['BIG', 30, 30, 30, 30, 40], ['SMALL', 10, 10, 10, 30, 60]]], 'SMALL'], ['rotated fit', [[4, 10, 8], 3, False, [['S', 12, 10, 6, 10, 50], ['M', 16, 12, 10, 20, 70], ['L', 24, 18, 14, 30, 95]]], 'S'], ['generated mix 40', [[5, 12, 11], 9.5, False, [['C0', 20, 20, 20, 5, 40], ['C1', 6, 8, 12, 30, 70], ['C2', 10, 16, 12, 5, 40]]], 'NO_FIT'], ['generated mix 48', [[14, 11, 11], 19, False, [['C0', 20, 16, 4, 5, 40], ['C1', 24, 20, 6, 10, 55], ['C2', 32, 6, 6, 10, 90]]], 'NO_FIT']]]
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 |
|---|---|---|---|
| rotated fit | S | S | Passed |
| padding pushes to M | M | M | Passed |
| weight at limit | S | S | Passed |
| sioc | SIOC | SIOC | Passed |
| volume tie by cost | B | B | Passed |
| long thin carton | LONG | LONG | Passed |
| weight over limit | M | M | Passed |
| generated mix 6 | NO_FIT | NO_FIT | Passed |
SHA-256 / d8937a1f4457e19927145aa1613ace7df82631b4903649b5bc9c3145ef9a9ef8
Verification & scope
Stipulated fit rule with uniform dunnage; no void-fill or multi-item cartonization. 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:09.235222+00:00.
Case digest / d8e74bfc90d50595355b76707308196c0879a46218bcf4ffde4c11f4d76ffcfc