FAILURE MAP
← Case archive

FA-94971 / Warehouse slotting and bin packing / Open access

Carton selection: rated weight treated as exclusive · case 01

An item weighing exactly the carton rating is forced into the next carton.

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

ROOT CAUSE

The weight check rejects a carton when the item equals its rated limit.

VERIFIED REPAIR

Reject a carton only when the item weight exceeds its rated limit.

Unsuccessful approach: Allowing up to one kilogram over the rating accepts fractional overweight items.

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 = 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 = [[['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'], ['generated mix 2', [[10, 13, 3], 10.5, False, [['C0', 20, 6, 12, 10, 55], ['C1', 32, 6, 6, 30, 55], ['C2', 12, 8, 12, 10, 70], ['C3', 24, 6, 20, 5, 40]]], 'NO_FIT'], ['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 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'], ['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'], ['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 57', [[2, 2, 8], 20, False, [['C0', 32, 20, 20, 30, 55], ['C1', 32, 20, 4, 20, 90], ['C2', 12, 12, 20, 30, 55]]], 'C1'], ['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'], ['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'], ['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'], ['generated mix 8', [[5, 7, 8], 10.5, False, [['C0', 10, 20, 6, 10, 70], ['C1', 12, 6, 12, 10, 40], ['C2', 10, 20, 4, 20, 40]]], 'NO_FIT'], ['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 13', [[5, 2, 14], 5, False, [['C0', 20, 20, 6, 5, 55], ['C1', 32, 16, 8, 20, 90]]], 'C0'], ['generated mix 59', [[7, 2, 2], 10.5, False, [['C0', 12, 12, 8, 30, 90], ['C1', 24, 6, 6, 30, 55], ['C2', 20, 12, 8, 5, 55], ['C3', 12, 8, 8, 10, 90], ['C4', 10, 16, 4, 5, 70]]], 'C1'], ['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 19', [[11, 3, 5], 1, False, [['C0', 6, 20, 4, 20, 90], ['C1', 20, 20, 6, 5, 40], ['C2', 32, 6, 4, 20, 55], ['C3', 12, 8, 30, 20, 90], ['C4', 32, 20, 8, 10, 55], ['C5', 20, 6, 12, 20, 40]]], '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 77', [[5, 9, 8], 10, False, [['C0', 6, 16, 6, 5, 70], ['C1', 32, 16, 20, 20, 70], ['C2', 12, 16, 4, 30, 55], ['C3', 6, 12, 6, 10, 90], ['C4', 10, 16, 12, 10, 55]]], 'C4'], ['generated mix 2', [[10, 13, 3], 10.5, False, [['C0', 20, 6, 12, 10, 55], ['C1', 32, 6, 6, 30, 55], ['C2', 12, 8, 12, 10, 70], ['C3', 24, 6, 20, 5, 40]]], 'NO_FIT'], ['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 30', [[14, 13, 10], 1, False, [['C0', 16, 8, 8, 10, 55], ['C1', 20, 20, 20, 5, 55], ['C2', 32, 20, 20, 20, 40], ['C3', 24, 20, 4, 20, 40], ['C4', 16, 12, 4, 20, 55]]], 'C1'], ['generated mix 38', [[8, 8, 5], 10, False, [['C0', 24, 16, 4, 5, 70], ['C1', 20, 16, 12, 20, 70]]], 'C1']], [['generated mix 46', [[12, 7, 5], 5, False, [['C0', 24, 16, 30, 10, 70], ['C1', 24, 16, 8, 5, 40]]], 'C1'], ['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'], ['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'], ['generated mix 41', [[11, 14, 6], 19, False, [['C0', 6, 12, 20, 30, 90], ['C1', 6, 6, 4, 20, 70]]], 'NO_FIT'], ['generated mix 50', [[4, 4, 13], 20, False, [['C0', 12, 8, 12, 10, 70], ['C1', 20, 20, 6, 30, 90], ['C2', 32, 12, 12, 5, 70], ['C3', 32, 8, 30, 5, 70], ['C4', 24, 16, 20, 20, 90], ['C5', 12, 12, 6, 5, 40]]], 'C1']]]
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
weight at limitMSFailed
generated mix 2NO_FITNO_FITPassed
rotated fitSSPassed
weight over limitMMPassed
no fitNO_FITNO_FITPassed
cheap but bulkySMALLSMALLPassed
padding pushes to MMMPassed
generated mix 6NO_FITNO_FITPassed

SHA-256 / ff6bd173e516f599142c6b98162dea06af6bb61c65e41475554e15b01349403f

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 = 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 + 1:
            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 = [[['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'], ['generated mix 2', [[10, 13, 3], 10.5, False, [['C0', 20, 6, 12, 10, 55], ['C1', 32, 6, 6, 30, 55], ['C2', 12, 8, 12, 10, 70], ['C3', 24, 6, 20, 5, 40]]], 'NO_FIT'], ['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 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'], ['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'], ['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 57', [[2, 2, 8], 20, False, [['C0', 32, 20, 20, 30, 55], ['C1', 32, 20, 4, 20, 90], ['C2', 12, 12, 20, 30, 55]]], 'C1'], ['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'], ['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'], ['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'], ['generated mix 8', [[5, 7, 8], 10.5, False, [['C0', 10, 20, 6, 10, 70], ['C1', 12, 6, 12, 10, 40], ['C2', 10, 20, 4, 20, 40]]], 'NO_FIT'], ['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 13', [[5, 2, 14], 5, False, [['C0', 20, 20, 6, 5, 55], ['C1', 32, 16, 8, 20, 90]]], 'C0'], ['generated mix 59', [[7, 2, 2], 10.5, False, [['C0', 12, 12, 8, 30, 90], ['C1', 24, 6, 6, 30, 55], ['C2', 20, 12, 8, 5, 55], ['C3', 12, 8, 8, 10, 90], ['C4', 10, 16, 4, 5, 70]]], 'C1'], ['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 19', [[11, 3, 5], 1, False, [['C0', 6, 20, 4, 20, 90], ['C1', 20, 20, 6, 5, 40], ['C2', 32, 6, 4, 20, 55], ['C3', 12, 8, 30, 20, 90], ['C4', 32, 20, 8, 10, 55], ['C5', 20, 6, 12, 20, 40]]], '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 77', [[5, 9, 8], 10, False, [['C0', 6, 16, 6, 5, 70], ['C1', 32, 16, 20, 20, 70], ['C2', 12, 16, 4, 30, 55], ['C3', 6, 12, 6, 10, 90], ['C4', 10, 16, 12, 10, 55]]], 'C4'], ['generated mix 2', [[10, 13, 3], 10.5, False, [['C0', 20, 6, 12, 10, 55], ['C1', 32, 6, 6, 30, 55], ['C2', 12, 8, 12, 10, 70], ['C3', 24, 6, 20, 5, 40]]], 'NO_FIT'], ['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 30', [[14, 13, 10], 1, False, [['C0', 16, 8, 8, 10, 55], ['C1', 20, 20, 20, 5, 55], ['C2', 32, 20, 20, 20, 40], ['C3', 24, 20, 4, 20, 40], ['C4', 16, 12, 4, 20, 55]]], 'C1'], ['generated mix 38', [[8, 8, 5], 10, False, [['C0', 24, 16, 4, 5, 70], ['C1', 20, 16, 12, 20, 70]]], 'C1']], [['generated mix 46', [[12, 7, 5], 5, False, [['C0', 24, 16, 30, 10, 70], ['C1', 24, 16, 8, 5, 40]]], 'C1'], ['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'], ['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'], ['generated mix 41', [[11, 14, 6], 19, False, [['C0', 6, 12, 20, 30, 90], ['C1', 6, 6, 4, 20, 70]]], 'NO_FIT'], ['generated mix 50', [[4, 4, 13], 20, False, [['C0', 12, 8, 12, 10, 70], ['C1', 20, 20, 6, 30, 90], ['C2', 32, 12, 12, 5, 70], ['C3', 32, 8, 30, 5, 70], ['C4', 24, 16, 20, 20, 90], ['C5', 12, 12, 6, 5, 40]]], 'C1']]]
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
weight at limitSSPassed
generated mix 2C0NO_FITFailed
rotated fitSSPassed
weight over limitSMFailed
no fitNO_FITNO_FITPassed
cheap but bulkySMALLSMALLPassed
padding pushes to MMMPassed
generated mix 6NO_FITNO_FITPassed

SHA-256 / cdadd5e14447b60726bf3d7cfe9f50b57bc411013cd8c69b76306bb788d21346

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 = [[['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'], ['generated mix 2', [[10, 13, 3], 10.5, False, [['C0', 20, 6, 12, 10, 55], ['C1', 32, 6, 6, 30, 55], ['C2', 12, 8, 12, 10, 70], ['C3', 24, 6, 20, 5, 40]]], 'NO_FIT'], ['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 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'], ['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'], ['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 57', [[2, 2, 8], 20, False, [['C0', 32, 20, 20, 30, 55], ['C1', 32, 20, 4, 20, 90], ['C2', 12, 12, 20, 30, 55]]], 'C1'], ['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'], ['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'], ['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'], ['generated mix 8', [[5, 7, 8], 10.5, False, [['C0', 10, 20, 6, 10, 70], ['C1', 12, 6, 12, 10, 40], ['C2', 10, 20, 4, 20, 40]]], 'NO_FIT'], ['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 13', [[5, 2, 14], 5, False, [['C0', 20, 20, 6, 5, 55], ['C1', 32, 16, 8, 20, 90]]], 'C0'], ['generated mix 59', [[7, 2, 2], 10.5, False, [['C0', 12, 12, 8, 30, 90], ['C1', 24, 6, 6, 30, 55], ['C2', 20, 12, 8, 5, 55], ['C3', 12, 8, 8, 10, 90], ['C4', 10, 16, 4, 5, 70]]], 'C1'], ['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 19', [[11, 3, 5], 1, False, [['C0', 6, 20, 4, 20, 90], ['C1', 20, 20, 6, 5, 40], ['C2', 32, 6, 4, 20, 55], ['C3', 12, 8, 30, 20, 90], ['C4', 32, 20, 8, 10, 55], ['C5', 20, 6, 12, 20, 40]]], '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 77', [[5, 9, 8], 10, False, [['C0', 6, 16, 6, 5, 70], ['C1', 32, 16, 20, 20, 70], ['C2', 12, 16, 4, 30, 55], ['C3', 6, 12, 6, 10, 90], ['C4', 10, 16, 12, 10, 55]]], 'C4'], ['generated mix 2', [[10, 13, 3], 10.5, False, [['C0', 20, 6, 12, 10, 55], ['C1', 32, 6, 6, 30, 55], ['C2', 12, 8, 12, 10, 70], ['C3', 24, 6, 20, 5, 40]]], 'NO_FIT'], ['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 30', [[14, 13, 10], 1, False, [['C0', 16, 8, 8, 10, 55], ['C1', 20, 20, 20, 5, 55], ['C2', 32, 20, 20, 20, 40], ['C3', 24, 20, 4, 20, 40], ['C4', 16, 12, 4, 20, 55]]], 'C1'], ['generated mix 38', [[8, 8, 5], 10, False, [['C0', 24, 16, 4, 5, 70], ['C1', 20, 16, 12, 20, 70]]], 'C1']], [['generated mix 46', [[12, 7, 5], 5, False, [['C0', 24, 16, 30, 10, 70], ['C1', 24, 16, 8, 5, 40]]], 'C1'], ['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'], ['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'], ['generated mix 41', [[11, 14, 6], 19, False, [['C0', 6, 12, 20, 30, 90], ['C1', 6, 6, 4, 20, 70]]], 'NO_FIT'], ['generated mix 50', [[4, 4, 13], 20, False, [['C0', 12, 8, 12, 10, 70], ['C1', 20, 20, 6, 30, 90], ['C2', 32, 12, 12, 5, 70], ['C3', 32, 8, 30, 5, 70], ['C4', 24, 16, 20, 20, 90], ['C5', 12, 12, 6, 5, 40]]], 'C1']]]
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
weight at limitSSPassed
generated mix 2NO_FITNO_FITPassed
rotated fitSSPassed
weight over limitMMPassed
no fitNO_FITNO_FITPassed
cheap but bulkySMALLSMALLPassed
padding pushes to MMMPassed
generated mix 6NO_FITNO_FITPassed

SHA-256 / e6fbf107396da24727d6d42c79af2e4f29e2db7e959a8700d8b80d722be280cd

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.392030+00:00.

Case digest / 67538df40ff29ad15c8f339c029e3dcb27376ec41b298ce8c12bd80420ebf177