FA-95166 / Warehouse slotting and bin packing / Open access
Nested bin fill: exactly full bin rejected · case 01
A bin filled exactly to its volume is reported as not fitting.
ROOT CAUSE
The capacity test is strict at the bin volume.
VERIFIED REPAIR
Accept totals equal to the bin volume.
Unsuccessful approach: Applying an unstated 95% fill factor rejects bins the contract allows.
Case contract
lines [[sku, qty, unit_volume, nest_increment]]. Lines for the same SKU are merged. A nesting SKU (increment > 0) occupies unit_volume + (qty-1)*increment; others qty*unit_volume; qty 0 contributes nothing and is not counted. Bin fits when total <= bin_vol and distinct stocked SKUs <= max_skus. Return [total, fits].
Why this case matters
Nesting products such as cups and trays occupy far less space than unit cube suggests.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(lines, bin_vol, max_skus):
merged = {}
for sku, qty, uv, nv in lines:
if sku in merged:
merged[sku][0] += qty
else:
merged[sku] = [qty, uv, nv]
total = 0
count = 0
for sku, (qty, uv, nv) in merged.items():
if qty <= 0:
continue
count += 1
if nv > 0:
total += uv + (qty - 1) * nv
else:
total += qty * uv
return [total, total < bin_vol and count <= max_skus]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['nesting', [[['CUP', 10, 10, 2]], 30, 1], [28, True]], ['zero line', [[['CUP', 1, 10, 2], ['BOX', 0, 40, 0]], 30, 1], [10, True]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['generated mix 7', [[['TRY', 2, 25, 5]], 120, 2], [30, True]], ['generated mix 15', [[['CUP', 2, 10, 2], ['BWL', 1, 30, 6], ['BOX', 2, 40, 0], ['BWL', 1, 30, 6]], 150, 3], [128, True]], ['generated mix 23', [[['TRY', 2, 25, 5], ['CUP', 10, 10, 2], ['TRY', 0, 25, 5]], 150, 2], [58, True]]], [['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['sku limit', [[['CUP', 1, 10, 2], ['LID', 1, 4, 0]], 100, 1], [14, False]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['generated mix 10', [[['CUP', 10, 10, 2], ['BOX', 0, 40, 0], ['BOX', 1, 40, 0]], 80, 1], [68, False]], ['generated mix 18', [[['CUP', 10, 10, 2]], 150, 2], [28, True]], ['generated mix 26', [[['CUP', 5, 10, 2], ['BOX', 1, 40, 0], ['BOX', 2, 40, 0]], 50, 3], [138, False]], ['generated mix 34', [[['BWL', 10, 30, 6], ['BOX', 1, 40, 0], ['TRY', 2, 25, 5], ['LID', 10, 4, 0], ['BOX', 10, 40, 0]], 100, 1], [594, False]]], [['generated mix 19', [[['BOX', 2, 40, 0], ['TRY', 0, 25, 5]], 80, 3], [80, True]], ['nesting', [[['CUP', 10, 10, 2]], 30, 1], [28, True]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['generated mix 21', [[['BWL', 1, 30, 6], ['CUP', 5, 10, 2], ['BOX', 0, 40, 0], ['TRY', 5, 25, 5], ['BWL', 2, 30, 6]], 100, 2], [105, False]], ['generated mix 29', [[['TRY', 0, 25, 5], ['LID', 2, 4, 0], ['BOX', 5, 40, 0]], 150, 2], [208, False]], ['generated mix 37', [[['BWL', 5, 30, 6], ['BOX', 5, 40, 0], ['LID', 1, 4, 0], ['LID', 2, 4, 0]], 100, 2], [266, False]], ['generated mix 45', [[['TRY', 1, 25, 5], ['BOX', 2, 40, 0], ['BWL', 2, 30, 6]], 150, 3], [141, True]]], [['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['sku limit', [[['CUP', 1, 10, 2], ['LID', 1, 4, 0]], 100, 1], [14, False]], ['generated mix 32', [[['CUP', 10, 10, 2], ['CUP', 0, 10, 2]], 50, 2], [28, True]], ['generated mix 40', [[['BOX', 10, 40, 0], ['CUP', 5, 10, 2], ['CUP', 1, 10, 2], ['BWL', 5, 30, 6], ['BWL', 0, 30, 6]], 100, 2], [474, False]], ['generated mix 48', [[['BWL', 2, 30, 6], ['TRY', 2, 25, 5], ['BOX', 0, 40, 0], ['BWL', 1, 30, 6]], 80, 3], [72, True]], ['generated mix 56', [[['LID', 5, 4, 0], ['CUP', 1, 10, 2], ['BOX', 0, 40, 0], ['LID', 5, 4, 0]], 80, 2], [50, True]]], [['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['nesting', [[['CUP', 10, 10, 2]], 30, 1], [28, True]], ['zero line', [[['CUP', 1, 10, 2], ['BOX', 0, 40, 0]], 30, 1], [10, True]], ['generated mix 43', [[['LID', 2, 4, 0], ['TRY', 5, 25, 5]], 100, 2], [53, True]], ['generated mix 51', [[['LID', 10, 4, 0], ['TRY', 0, 25, 5], ['BWL', 10, 30, 6]], 150, 2], [124, True]], ['generated mix 59', [[['LID', 0, 4, 0], ['BOX', 2, 40, 0], ['LID', 10, 4, 0], ['BWL', 5, 30, 6]], 50, 3], [174, False]], ['generated mix 67', [[['TRY', 2, 25, 5], ['BOX', 10, 40, 0], ['LID', 0, 4, 0], ['TRY', 0, 25, 5]], 100, 1], [430, False]]]]
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 |
|---|---|---|---|
| capacity equal | [30, False] | [30, True] | Failed |
| non nesting | [80, False] | [80, True] | Failed |
| nesting | [28, True] | [28, True] | Passed |
| zero line | [10, True] | [10, True] | Passed |
| merged lines nest together | [28, True] | [28, True] | Passed |
| generated mix 7 | [30, True] | [30, True] | Passed |
| generated mix 15 | [128, True] | [128, True] | Passed |
| generated mix 23 | [58, True] | [58, True] | Passed |
SHA-256 / f5fe1f4515a0fb89bda8a82a79142e155e6bc75a51a42d5c424d4ee4d0d882d0
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(lines, bin_vol, max_skus):
merged = {}
for sku, qty, uv, nv in lines:
if sku in merged:
merged[sku][0] += qty
else:
merged[sku] = [qty, uv, nv]
total = 0
count = 0
for sku, (qty, uv, nv) in merged.items():
if qty <= 0:
continue
count += 1
if nv > 0:
total += uv + (qty - 1) * nv
else:
total += qty * uv
return [total, total <= bin_vol * 95 // 100 and count <= max_skus]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['nesting', [[['CUP', 10, 10, 2]], 30, 1], [28, True]], ['zero line', [[['CUP', 1, 10, 2], ['BOX', 0, 40, 0]], 30, 1], [10, True]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['generated mix 7', [[['TRY', 2, 25, 5]], 120, 2], [30, True]], ['generated mix 15', [[['CUP', 2, 10, 2], ['BWL', 1, 30, 6], ['BOX', 2, 40, 0], ['BWL', 1, 30, 6]], 150, 3], [128, True]], ['generated mix 23', [[['TRY', 2, 25, 5], ['CUP', 10, 10, 2], ['TRY', 0, 25, 5]], 150, 2], [58, True]]], [['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['sku limit', [[['CUP', 1, 10, 2], ['LID', 1, 4, 0]], 100, 1], [14, False]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['generated mix 10', [[['CUP', 10, 10, 2], ['BOX', 0, 40, 0], ['BOX', 1, 40, 0]], 80, 1], [68, False]], ['generated mix 18', [[['CUP', 10, 10, 2]], 150, 2], [28, True]], ['generated mix 26', [[['CUP', 5, 10, 2], ['BOX', 1, 40, 0], ['BOX', 2, 40, 0]], 50, 3], [138, False]], ['generated mix 34', [[['BWL', 10, 30, 6], ['BOX', 1, 40, 0], ['TRY', 2, 25, 5], ['LID', 10, 4, 0], ['BOX', 10, 40, 0]], 100, 1], [594, False]]], [['generated mix 19', [[['BOX', 2, 40, 0], ['TRY', 0, 25, 5]], 80, 3], [80, True]], ['nesting', [[['CUP', 10, 10, 2]], 30, 1], [28, True]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['generated mix 21', [[['BWL', 1, 30, 6], ['CUP', 5, 10, 2], ['BOX', 0, 40, 0], ['TRY', 5, 25, 5], ['BWL', 2, 30, 6]], 100, 2], [105, False]], ['generated mix 29', [[['TRY', 0, 25, 5], ['LID', 2, 4, 0], ['BOX', 5, 40, 0]], 150, 2], [208, False]], ['generated mix 37', [[['BWL', 5, 30, 6], ['BOX', 5, 40, 0], ['LID', 1, 4, 0], ['LID', 2, 4, 0]], 100, 2], [266, False]], ['generated mix 45', [[['TRY', 1, 25, 5], ['BOX', 2, 40, 0], ['BWL', 2, 30, 6]], 150, 3], [141, True]]], [['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['sku limit', [[['CUP', 1, 10, 2], ['LID', 1, 4, 0]], 100, 1], [14, False]], ['generated mix 32', [[['CUP', 10, 10, 2], ['CUP', 0, 10, 2]], 50, 2], [28, True]], ['generated mix 40', [[['BOX', 10, 40, 0], ['CUP', 5, 10, 2], ['CUP', 1, 10, 2], ['BWL', 5, 30, 6], ['BWL', 0, 30, 6]], 100, 2], [474, False]], ['generated mix 48', [[['BWL', 2, 30, 6], ['TRY', 2, 25, 5], ['BOX', 0, 40, 0], ['BWL', 1, 30, 6]], 80, 3], [72, True]], ['generated mix 56', [[['LID', 5, 4, 0], ['CUP', 1, 10, 2], ['BOX', 0, 40, 0], ['LID', 5, 4, 0]], 80, 2], [50, True]]], [['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['nesting', [[['CUP', 10, 10, 2]], 30, 1], [28, True]], ['zero line', [[['CUP', 1, 10, 2], ['BOX', 0, 40, 0]], 30, 1], [10, True]], ['generated mix 43', [[['LID', 2, 4, 0], ['TRY', 5, 25, 5]], 100, 2], [53, True]], ['generated mix 51', [[['LID', 10, 4, 0], ['TRY', 0, 25, 5], ['BWL', 10, 30, 6]], 150, 2], [124, True]], ['generated mix 59', [[['LID', 0, 4, 0], ['BOX', 2, 40, 0], ['LID', 10, 4, 0], ['BWL', 5, 30, 6]], 50, 3], [174, False]], ['generated mix 67', [[['TRY', 2, 25, 5], ['BOX', 10, 40, 0], ['LID', 0, 4, 0], ['TRY', 0, 25, 5]], 100, 1], [430, False]]]]
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 |
|---|---|---|---|
| capacity equal | [30, False] | [30, True] | Failed |
| non nesting | [80, False] | [80, True] | Failed |
| nesting | [28, True] | [28, True] | Passed |
| zero line | [10, True] | [10, True] | Passed |
| merged lines nest together | [28, True] | [28, True] | Passed |
| generated mix 7 | [30, True] | [30, True] | Passed |
| generated mix 15 | [128, True] | [128, True] | Passed |
| generated mix 23 | [58, True] | [58, True] | Passed |
SHA-256 / bcf077c8ab2f190a7fe4f5dcc5c05459e36be195d5bd13650768a653df4672ef
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(lines, bin_vol, max_skus):
merged = {}
for sku, qty, uv, nv in lines:
if sku in merged:
merged[sku][0] += qty
else:
merged[sku] = [qty, uv, nv]
total = 0
count = 0
for sku, (qty, uv, nv) in merged.items():
if qty <= 0:
continue
count += 1
if nv > 0:
total += uv + (qty - 1) * nv
else:
total += qty * uv
return [total, total <= bin_vol and count <= max_skus]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['nesting', [[['CUP', 10, 10, 2]], 30, 1], [28, True]], ['zero line', [[['CUP', 1, 10, 2], ['BOX', 0, 40, 0]], 30, 1], [10, True]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['generated mix 7', [[['TRY', 2, 25, 5]], 120, 2], [30, True]], ['generated mix 15', [[['CUP', 2, 10, 2], ['BWL', 1, 30, 6], ['BOX', 2, 40, 0], ['BWL', 1, 30, 6]], 150, 3], [128, True]], ['generated mix 23', [[['TRY', 2, 25, 5], ['CUP', 10, 10, 2], ['TRY', 0, 25, 5]], 150, 2], [58, True]]], [['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['sku limit', [[['CUP', 1, 10, 2], ['LID', 1, 4, 0]], 100, 1], [14, False]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['generated mix 10', [[['CUP', 10, 10, 2], ['BOX', 0, 40, 0], ['BOX', 1, 40, 0]], 80, 1], [68, False]], ['generated mix 18', [[['CUP', 10, 10, 2]], 150, 2], [28, True]], ['generated mix 26', [[['CUP', 5, 10, 2], ['BOX', 1, 40, 0], ['BOX', 2, 40, 0]], 50, 3], [138, False]], ['generated mix 34', [[['BWL', 10, 30, 6], ['BOX', 1, 40, 0], ['TRY', 2, 25, 5], ['LID', 10, 4, 0], ['BOX', 10, 40, 0]], 100, 1], [594, False]]], [['generated mix 19', [[['BOX', 2, 40, 0], ['TRY', 0, 25, 5]], 80, 3], [80, True]], ['nesting', [[['CUP', 10, 10, 2]], 30, 1], [28, True]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['generated mix 21', [[['BWL', 1, 30, 6], ['CUP', 5, 10, 2], ['BOX', 0, 40, 0], ['TRY', 5, 25, 5], ['BWL', 2, 30, 6]], 100, 2], [105, False]], ['generated mix 29', [[['TRY', 0, 25, 5], ['LID', 2, 4, 0], ['BOX', 5, 40, 0]], 150, 2], [208, False]], ['generated mix 37', [[['BWL', 5, 30, 6], ['BOX', 5, 40, 0], ['LID', 1, 4, 0], ['LID', 2, 4, 0]], 100, 2], [266, False]], ['generated mix 45', [[['TRY', 1, 25, 5], ['BOX', 2, 40, 0], ['BWL', 2, 30, 6]], 150, 3], [141, True]]], [['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['merged lines nest together', [[['CUP', 5, 10, 2], ['CUP', 5, 10, 2]], 30, 1], [28, True]], ['sku limit', [[['CUP', 1, 10, 2], ['LID', 1, 4, 0]], 100, 1], [14, False]], ['generated mix 32', [[['CUP', 10, 10, 2], ['CUP', 0, 10, 2]], 50, 2], [28, True]], ['generated mix 40', [[['BOX', 10, 40, 0], ['CUP', 5, 10, 2], ['CUP', 1, 10, 2], ['BWL', 5, 30, 6], ['BWL', 0, 30, 6]], 100, 2], [474, False]], ['generated mix 48', [[['BWL', 2, 30, 6], ['TRY', 2, 25, 5], ['BOX', 0, 40, 0], ['BWL', 1, 30, 6]], 80, 3], [72, True]], ['generated mix 56', [[['LID', 5, 4, 0], ['CUP', 1, 10, 2], ['BOX', 0, 40, 0], ['LID', 5, 4, 0]], 80, 2], [50, True]]], [['non nesting', [[['BOX', 2, 40, 0]], 80, 1], [80, True]], ['capacity equal', [[['CUP', 11, 10, 2]], 30, 1], [30, True]], ['nesting', [[['CUP', 10, 10, 2]], 30, 1], [28, True]], ['zero line', [[['CUP', 1, 10, 2], ['BOX', 0, 40, 0]], 30, 1], [10, True]], ['generated mix 43', [[['LID', 2, 4, 0], ['TRY', 5, 25, 5]], 100, 2], [53, True]], ['generated mix 51', [[['LID', 10, 4, 0], ['TRY', 0, 25, 5], ['BWL', 10, 30, 6]], 150, 2], [124, True]], ['generated mix 59', [[['LID', 0, 4, 0], ['BOX', 2, 40, 0], ['LID', 10, 4, 0], ['BWL', 5, 30, 6]], 50, 3], [174, False]], ['generated mix 67', [[['TRY', 2, 25, 5], ['BOX', 10, 40, 0], ['LID', 0, 4, 0], ['TRY', 0, 25, 5]], 100, 1], [430, False]]]]
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 |
|---|---|---|---|
| capacity equal | [30, True] | [30, True] | Passed |
| non nesting | [80, True] | [80, True] | Passed |
| nesting | [28, True] | [28, True] | Passed |
| zero line | [10, True] | [10, True] | Passed |
| merged lines nest together | [28, True] | [28, True] | Passed |
| generated mix 7 | [30, True] | [30, True] | Passed |
| generated mix 15 | [128, True] | [128, True] | Passed |
| generated mix 23 | [58, True] | [58, True] | Passed |
SHA-256 / 605ae0761a07534bc664c1398f5eacbb8f97c5f47cf0fb76df8ba54cabf3d088
Verification & scope
Stipulated linear nesting model; no orientation or partial stacks. 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:11.174433+00:00.
Case digest / 3b7db26748c0b1c7fb497732a2125ee6b93b5b807d78788acb0f1fd048954f45