FA-94936 / Warehouse slotting and bin packing / Open access
Tote packing: tote weight limit ignored · case 01
Totes are loaded beyond the conveyor weight limit when many dense items are small.
ROOT CAUSE
The per-tote fit check only tests volume; accumulated weight is never compared with the limit.
VERIFIED REPAIR
Reject a tote when its running weight plus the item exceeds the weight limit.
Unsuccessful approach: Checking the item weight alone against the limit does not bound the accumulated tote weight.
Case contract
items [[id, volume, kg, fragile]]. Sort by volume desc, kg desc, id. Place each in the first open tote (creation order) where volume and weight stay within limits (inclusive) and no fragile item shares a tote with an item over 10 kg (either direction). Items exceeding a tote alone go to oversize. Return [list of tote id lists, sorted oversize ids].
Why this case matters
Packing picked units into conveyor totes is bounded by volume, weight, and damage rules.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(items, tote_vol, tote_wt):
order = sorted(items, key=lambda it: (-it[1], -it[2], it[0]))
totes = []
oversize = []
for iid, vol, wt, fragile in order:
if vol > tote_vol or wt > tote_wt:
oversize.append(iid)
continue
placed = False
for t in totes:
if t['v'] + vol > tote_vol or False:
continue
if fragile and t['heavy']:
continue
if wt > 10 and t['fragile']:
continue
t['ids'].append(iid)
t['v'] += vol
t['w'] += wt
t['heavy'] = t['heavy'] or wt > 10
t['fragile'] = t['fragile'] or fragile
placed = True
break
if not placed:
totes.append({'ids': [iid], 'v': vol, 'w': wt, 'heavy': wt > 10, 'fragile': fragile})
return [[t['ids'] for t in totes], sorted(oversize)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['weight limit splits', [[['a', 10, 15, False], ['b', 10, 6, False]], 50, 20], [[['a'], ['b']], []]], ['generated mix 1', [[['i0', 60, 10, False], ['i1', 25, 1, False], ['i2', 60, 3, False], ['i3', 5, 10, True], ['i4', 10, 10, True]], 60, 20], [[['i0'], ['i2'], ['i1', 'i4'], ['i3']], []]], ['exact fill', [[['a', 30, 5, False], ['b', 20, 5, False]], 50, 20], [[['a', 'b']], []]], ['heavy after fragile', [[['f', 30, 1, True], ['h', 10, 12, False]], 50, 20], [[['f'], ['h']], []]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['generated mix 9', [[['i0', 60, 8, False], ['i1', 30, 10, False], ['i2', 50, 11, True], ['i3', 10, 15, True]], 50, 20], [[['i2'], ['i1'], ['i3']], ['i0']]]], [['generated mix 16', [[['i0', 50, 10, False], ['i1', 40, 10, False], ['i2', 5, 11, False], ['i3', 10, 15, False], ['i4', 60, 1, False], ['i5', 20, 8, True]], 60, 20], [[['i4'], ['i0'], ['i1', 'i5'], ['i3'], ['i2']], []]], ['generated mix 15', [[['i0', 5, 3, False], ['i1', 10, 1, False], ['i2', 20, 15, False], ['i3', 60, 15, False], ['i4', 20, 10, True], ['i5', 50, 3, False], ['i6', 30, 3, False], ['i7', 60, 8, False]], 60, 20], [[['i3'], ['i7'], ['i5', 'i1'], ['i6', 'i2'], ['i4', 'i0']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['generated mix 9', [[['i0', 60, 8, False], ['i1', 30, 10, False], ['i2', 50, 11, True], ['i3', 10, 15, True]], 50, 20], [[['i2'], ['i1'], ['i3']], ['i0']]], ['generated mix 19', [[['i0', 30, 3, False], ['i1', 5, 11, True], ['i2', 50, 15, False], ['i3', 40, 11, False], ['i4', 60, 15, False], ['i5', 10, 15, False], ['i6', 25, 10, False], ['i7', 60, 8, True]], 50, 20], [[['i2'], ['i3'], ['i0', 'i5'], ['i6'], ['i1']], ['i4', 'i7']]], ['generated mix 27', [[['i0', 20, 10, False], ['i1', 25, 1, False], ['i2', 5, 11, True], ['i3', 20, 8, False], ['i4', 5, 10, False]], 60, 20], [[['i1', 'i0'], ['i3', 'i2'], ['i4']], []]]], [['generated mix 35', [[['i0', 40, 10, False], ['i1', 50, 1, False], ['i2', 10, 10, True], ['i3', 20, 10, True], ['i4', 60, 3, False], ['i5', 40, 15, False], ['i6', 25, 3, True], ['i7', 5, 10, False]], 50, 20], [[['i1'], ['i5'], ['i0', 'i2'], ['i6', 'i3'], ['i7']], ['i4']]], ['generated mix 26', [[['i0', 40, 1, False], ['i1', 50, 10, False], ['i2', 30, 3, True], ['i3', 10, 15, False], ['i4', 40, 10, False], ['i5', 5, 8, False]], 60, 20], [[['i1', 'i5'], ['i4'], ['i0', 'i3'], ['i2']], []]], ['exact fill', [[['a', 30, 5, False], ['b', 20, 5, False]], 50, 20], [[['a', 'b']], []]], ['heavy after fragile', [[['f', 30, 1, True], ['h', 10, 12, False]], 50, 20], [[['f'], ['h']], []]], ['weight limit splits', [[['a', 10, 15, False], ['b', 10, 6, False]], 50, 20], [[['a'], ['b']], []]], ['generated mix 20', [[['i0', 25, 3, True], ['i1', 50, 11, False], ['i2', 10, 10, True]], 60, 20], [[['i1'], ['i0', 'i2']], []]], ['generated mix 29', [[['i0', 60, 1, False], ['i1', 30, 11, True], ['i2', 60, 15, False], ['i3', 60, 3, False], ['i4', 20, 3, True], ['i5', 30, 10, False], ['i6', 20, 1, True]], 50, 20], [[['i1'], ['i5', 'i4'], ['i6']], ['i0', 'i2', 'i3']]], ['generated mix 38', [[['i0', 40, 10, False], ['i1', 60, 3, True], ['i2', 25, 10, True], ['i3', 10, 8, False], ['i4', 60, 11, True], ['i5', 40, 1, False]], 50, 20], [[['i0', 'i3'], ['i5'], ['i2']], ['i1', 'i4']]]], [['generated mix 52', [[['i0', 10, 11, False], ['i1', 25, 1, False], ['i2', 5, 15, False]], 60, 25], [[['i1', 'i0'], ['i2']], []]], ['generated mix 43', [[['i0', 5, 8, False], ['i1', 10, 3, False], ['i2', 40, 15, False], ['i3', 40, 15, False], ['i4', 20, 1, False], ['i5', 50, 11, False], ['i6', 20, 3, False]], 50, 20], [[['i5'], ['i2', 'i1'], ['i3'], ['i6', 'i4', 'i0']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['generated mix 31', [[['i0', 5, 11, False], ['i1', 30, 11, False], ['i2', 20, 1, False], ['i3', 25, 11, False], ['i4', 40, 3, False]], 50, 25], [[['i4', 'i0'], ['i1', 'i2'], ['i3']], []]], ['generated mix 39', [[['i0', 60, 15, True], ['i1', 25, 15, False], ['i2', 60, 10, True], ['i3', 10, 11, True], ['i4', 60, 8, False], ['i5', 20, 15, False], ['i6', 60, 1, False], ['i7', 40, 3, True]], 60, 25], [[['i0'], ['i2'], ['i4'], ['i6'], ['i7'], ['i1'], ['i5'], ['i3']], []]], ['generated mix 48', [[['i0', 30, 3, False], ['i1', 5, 3, False], ['i2', 5, 10, False], ['i3', 60, 10, True]], 60, 20], [[['i3'], ['i0', 'i2', 'i1']], []]]], [['weight limit splits', [[['a', 10, 15, False], ['b', 10, 6, False]], 50, 20], [[['a'], ['b']], []]], ['generated mix 52', [[['i0', 10, 11, False], ['i1', 25, 1, False], ['i2', 5, 15, False]], 60, 25], [[['i1', 'i0'], ['i2']], []]], ['heavy after fragile', [[['f', 30, 1, True], ['h', 10, 12, False]], 50, 20], [[['f'], ['h']], []]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['generated mix 44', [[['i0', 50, 3, True], ['i1', 60, 11, False], ['i2', 40, 3, False], ['i3', 40, 10, True], ['i4', 30, 1, False], ['i5', 5, 15, False], ['i6', 40, 11, False]], 50, 25], [[['i0'], ['i6'], ['i3'], ['i2', 'i5'], ['i4']], ['i1']]], ['generated mix 53', [[['i0', 5, 11, False], ['i1', 50, 1, True], ['i2', 5, 1, False], ['i3', 30, 10, False], ['i4', 40, 1, False], ['i5', 40, 11, False], ['i6', 60, 11, False]], 50, 25], [[['i1'], ['i5', 'i0', 'i2'], ['i4'], ['i3']], ['i6']]]]]
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 |
|---|---|---|---|
| weight limit splits | [[['a', 'b']], []] | [[['a'], ['b']], []] | Failed |
| generated mix 1 | [[['i0'], ['i2'], ['i1', 'i4', 'i3']], []] | [[['i0'], ['i2'], ['i1', 'i4'], ['i3']], []] | Failed |
| exact fill | [[['a', 'b']], []] | [[['a', 'b']], []] | Passed |
| heavy after fragile | [[['f'], ['h']], []] | [[['f'], ['h']], []] | Passed |
| first fit not best fit | [[['a', 'c'], ['b']], []] | [[['a', 'c'], ['b']], []] | Passed |
| fragile vs heavy | [[['h'], ['f']], []] | [[['h'], ['f']], []] | Passed |
| oversize weight | [[['y']], ['x']] | [[['y']], ['x']] | Passed |
| generated mix 9 | [[['i2'], ['i1', 'i3']], ['i0']] | [[['i2'], ['i1'], ['i3']], ['i0']] | Failed |
SHA-256 / ca8299e2601f1e2b79b55aec150d05f7c48db510f9f3bb7b14bce92147135477
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(items, tote_vol, tote_wt):
order = sorted(items, key=lambda it: (-it[1], -it[2], it[0]))
totes = []
oversize = []
for iid, vol, wt, fragile in order:
if vol > tote_vol or wt > tote_wt:
oversize.append(iid)
continue
placed = False
for t in totes:
if t['v'] + vol > tote_vol or wt > tote_wt:
continue
if fragile and t['heavy']:
continue
if wt > 10 and t['fragile']:
continue
t['ids'].append(iid)
t['v'] += vol
t['w'] += wt
t['heavy'] = t['heavy'] or wt > 10
t['fragile'] = t['fragile'] or fragile
placed = True
break
if not placed:
totes.append({'ids': [iid], 'v': vol, 'w': wt, 'heavy': wt > 10, 'fragile': fragile})
return [[t['ids'] for t in totes], sorted(oversize)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['weight limit splits', [[['a', 10, 15, False], ['b', 10, 6, False]], 50, 20], [[['a'], ['b']], []]], ['generated mix 1', [[['i0', 60, 10, False], ['i1', 25, 1, False], ['i2', 60, 3, False], ['i3', 5, 10, True], ['i4', 10, 10, True]], 60, 20], [[['i0'], ['i2'], ['i1', 'i4'], ['i3']], []]], ['exact fill', [[['a', 30, 5, False], ['b', 20, 5, False]], 50, 20], [[['a', 'b']], []]], ['heavy after fragile', [[['f', 30, 1, True], ['h', 10, 12, False]], 50, 20], [[['f'], ['h']], []]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['generated mix 9', [[['i0', 60, 8, False], ['i1', 30, 10, False], ['i2', 50, 11, True], ['i3', 10, 15, True]], 50, 20], [[['i2'], ['i1'], ['i3']], ['i0']]]], [['generated mix 16', [[['i0', 50, 10, False], ['i1', 40, 10, False], ['i2', 5, 11, False], ['i3', 10, 15, False], ['i4', 60, 1, False], ['i5', 20, 8, True]], 60, 20], [[['i4'], ['i0'], ['i1', 'i5'], ['i3'], ['i2']], []]], ['generated mix 15', [[['i0', 5, 3, False], ['i1', 10, 1, False], ['i2', 20, 15, False], ['i3', 60, 15, False], ['i4', 20, 10, True], ['i5', 50, 3, False], ['i6', 30, 3, False], ['i7', 60, 8, False]], 60, 20], [[['i3'], ['i7'], ['i5', 'i1'], ['i6', 'i2'], ['i4', 'i0']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['generated mix 9', [[['i0', 60, 8, False], ['i1', 30, 10, False], ['i2', 50, 11, True], ['i3', 10, 15, True]], 50, 20], [[['i2'], ['i1'], ['i3']], ['i0']]], ['generated mix 19', [[['i0', 30, 3, False], ['i1', 5, 11, True], ['i2', 50, 15, False], ['i3', 40, 11, False], ['i4', 60, 15, False], ['i5', 10, 15, False], ['i6', 25, 10, False], ['i7', 60, 8, True]], 50, 20], [[['i2'], ['i3'], ['i0', 'i5'], ['i6'], ['i1']], ['i4', 'i7']]], ['generated mix 27', [[['i0', 20, 10, False], ['i1', 25, 1, False], ['i2', 5, 11, True], ['i3', 20, 8, False], ['i4', 5, 10, False]], 60, 20], [[['i1', 'i0'], ['i3', 'i2'], ['i4']], []]]], [['generated mix 35', [[['i0', 40, 10, False], ['i1', 50, 1, False], ['i2', 10, 10, True], ['i3', 20, 10, True], ['i4', 60, 3, False], ['i5', 40, 15, False], ['i6', 25, 3, True], ['i7', 5, 10, False]], 50, 20], [[['i1'], ['i5'], ['i0', 'i2'], ['i6', 'i3'], ['i7']], ['i4']]], ['generated mix 26', [[['i0', 40, 1, False], ['i1', 50, 10, False], ['i2', 30, 3, True], ['i3', 10, 15, False], ['i4', 40, 10, False], ['i5', 5, 8, False]], 60, 20], [[['i1', 'i5'], ['i4'], ['i0', 'i3'], ['i2']], []]], ['exact fill', [[['a', 30, 5, False], ['b', 20, 5, False]], 50, 20], [[['a', 'b']], []]], ['heavy after fragile', [[['f', 30, 1, True], ['h', 10, 12, False]], 50, 20], [[['f'], ['h']], []]], ['weight limit splits', [[['a', 10, 15, False], ['b', 10, 6, False]], 50, 20], [[['a'], ['b']], []]], ['generated mix 20', [[['i0', 25, 3, True], ['i1', 50, 11, False], ['i2', 10, 10, True]], 60, 20], [[['i1'], ['i0', 'i2']], []]], ['generated mix 29', [[['i0', 60, 1, False], ['i1', 30, 11, True], ['i2', 60, 15, False], ['i3', 60, 3, False], ['i4', 20, 3, True], ['i5', 30, 10, False], ['i6', 20, 1, True]], 50, 20], [[['i1'], ['i5', 'i4'], ['i6']], ['i0', 'i2', 'i3']]], ['generated mix 38', [[['i0', 40, 10, False], ['i1', 60, 3, True], ['i2', 25, 10, True], ['i3', 10, 8, False], ['i4', 60, 11, True], ['i5', 40, 1, False]], 50, 20], [[['i0', 'i3'], ['i5'], ['i2']], ['i1', 'i4']]]], [['generated mix 52', [[['i0', 10, 11, False], ['i1', 25, 1, False], ['i2', 5, 15, False]], 60, 25], [[['i1', 'i0'], ['i2']], []]], ['generated mix 43', [[['i0', 5, 8, False], ['i1', 10, 3, False], ['i2', 40, 15, False], ['i3', 40, 15, False], ['i4', 20, 1, False], ['i5', 50, 11, False], ['i6', 20, 3, False]], 50, 20], [[['i5'], ['i2', 'i1'], ['i3'], ['i6', 'i4', 'i0']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['generated mix 31', [[['i0', 5, 11, False], ['i1', 30, 11, False], ['i2', 20, 1, False], ['i3', 25, 11, False], ['i4', 40, 3, False]], 50, 25], [[['i4', 'i0'], ['i1', 'i2'], ['i3']], []]], ['generated mix 39', [[['i0', 60, 15, True], ['i1', 25, 15, False], ['i2', 60, 10, True], ['i3', 10, 11, True], ['i4', 60, 8, False], ['i5', 20, 15, False], ['i6', 60, 1, False], ['i7', 40, 3, True]], 60, 25], [[['i0'], ['i2'], ['i4'], ['i6'], ['i7'], ['i1'], ['i5'], ['i3']], []]], ['generated mix 48', [[['i0', 30, 3, False], ['i1', 5, 3, False], ['i2', 5, 10, False], ['i3', 60, 10, True]], 60, 20], [[['i3'], ['i0', 'i2', 'i1']], []]]], [['weight limit splits', [[['a', 10, 15, False], ['b', 10, 6, False]], 50, 20], [[['a'], ['b']], []]], ['generated mix 52', [[['i0', 10, 11, False], ['i1', 25, 1, False], ['i2', 5, 15, False]], 60, 25], [[['i1', 'i0'], ['i2']], []]], ['heavy after fragile', [[['f', 30, 1, True], ['h', 10, 12, False]], 50, 20], [[['f'], ['h']], []]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['generated mix 44', [[['i0', 50, 3, True], ['i1', 60, 11, False], ['i2', 40, 3, False], ['i3', 40, 10, True], ['i4', 30, 1, False], ['i5', 5, 15, False], ['i6', 40, 11, False]], 50, 25], [[['i0'], ['i6'], ['i3'], ['i2', 'i5'], ['i4']], ['i1']]], ['generated mix 53', [[['i0', 5, 11, False], ['i1', 50, 1, True], ['i2', 5, 1, False], ['i3', 30, 10, False], ['i4', 40, 1, False], ['i5', 40, 11, False], ['i6', 60, 11, False]], 50, 25], [[['i1'], ['i5', 'i0', 'i2'], ['i4'], ['i3']], ['i6']]]]]
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 |
|---|---|---|---|
| weight limit splits | [[['a', 'b']], []] | [[['a'], ['b']], []] | Failed |
| generated mix 1 | [[['i0'], ['i2'], ['i1', 'i4', 'i3']], []] | [[['i0'], ['i2'], ['i1', 'i4'], ['i3']], []] | Failed |
| exact fill | [[['a', 'b']], []] | [[['a', 'b']], []] | Passed |
| heavy after fragile | [[['f'], ['h']], []] | [[['f'], ['h']], []] | Passed |
| first fit not best fit | [[['a', 'c'], ['b']], []] | [[['a', 'c'], ['b']], []] | Passed |
| fragile vs heavy | [[['h'], ['f']], []] | [[['h'], ['f']], []] | Passed |
| oversize weight | [[['y']], ['x']] | [[['y']], ['x']] | Passed |
| generated mix 9 | [[['i2'], ['i1', 'i3']], ['i0']] | [[['i2'], ['i1'], ['i3']], ['i0']] | Failed |
SHA-256 / a2a7d525f398d80ab34b2dce5e597282de12c5182bde4082d619349676629379
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(items, tote_vol, tote_wt):
order = sorted(items, key=lambda it: (-it[1], -it[2], it[0]))
totes = []
oversize = []
for iid, vol, wt, fragile in order:
if vol > tote_vol or wt > tote_wt:
oversize.append(iid)
continue
placed = False
for t in totes:
if t['v'] + vol > tote_vol or t['w'] + wt > tote_wt:
continue
if fragile and t['heavy']:
continue
if wt > 10 and t['fragile']:
continue
t['ids'].append(iid)
t['v'] += vol
t['w'] += wt
t['heavy'] = t['heavy'] or wt > 10
t['fragile'] = t['fragile'] or fragile
placed = True
break
if not placed:
totes.append({'ids': [iid], 'v': vol, 'w': wt, 'heavy': wt > 10, 'fragile': fragile})
return [[t['ids'] for t in totes], sorted(oversize)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['weight limit splits', [[['a', 10, 15, False], ['b', 10, 6, False]], 50, 20], [[['a'], ['b']], []]], ['generated mix 1', [[['i0', 60, 10, False], ['i1', 25, 1, False], ['i2', 60, 3, False], ['i3', 5, 10, True], ['i4', 10, 10, True]], 60, 20], [[['i0'], ['i2'], ['i1', 'i4'], ['i3']], []]], ['exact fill', [[['a', 30, 5, False], ['b', 20, 5, False]], 50, 20], [[['a', 'b']], []]], ['heavy after fragile', [[['f', 30, 1, True], ['h', 10, 12, False]], 50, 20], [[['f'], ['h']], []]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['generated mix 9', [[['i0', 60, 8, False], ['i1', 30, 10, False], ['i2', 50, 11, True], ['i3', 10, 15, True]], 50, 20], [[['i2'], ['i1'], ['i3']], ['i0']]]], [['generated mix 16', [[['i0', 50, 10, False], ['i1', 40, 10, False], ['i2', 5, 11, False], ['i3', 10, 15, False], ['i4', 60, 1, False], ['i5', 20, 8, True]], 60, 20], [[['i4'], ['i0'], ['i1', 'i5'], ['i3'], ['i2']], []]], ['generated mix 15', [[['i0', 5, 3, False], ['i1', 10, 1, False], ['i2', 20, 15, False], ['i3', 60, 15, False], ['i4', 20, 10, True], ['i5', 50, 3, False], ['i6', 30, 3, False], ['i7', 60, 8, False]], 60, 20], [[['i3'], ['i7'], ['i5', 'i1'], ['i6', 'i2'], ['i4', 'i0']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['generated mix 9', [[['i0', 60, 8, False], ['i1', 30, 10, False], ['i2', 50, 11, True], ['i3', 10, 15, True]], 50, 20], [[['i2'], ['i1'], ['i3']], ['i0']]], ['generated mix 19', [[['i0', 30, 3, False], ['i1', 5, 11, True], ['i2', 50, 15, False], ['i3', 40, 11, False], ['i4', 60, 15, False], ['i5', 10, 15, False], ['i6', 25, 10, False], ['i7', 60, 8, True]], 50, 20], [[['i2'], ['i3'], ['i0', 'i5'], ['i6'], ['i1']], ['i4', 'i7']]], ['generated mix 27', [[['i0', 20, 10, False], ['i1', 25, 1, False], ['i2', 5, 11, True], ['i3', 20, 8, False], ['i4', 5, 10, False]], 60, 20], [[['i1', 'i0'], ['i3', 'i2'], ['i4']], []]]], [['generated mix 35', [[['i0', 40, 10, False], ['i1', 50, 1, False], ['i2', 10, 10, True], ['i3', 20, 10, True], ['i4', 60, 3, False], ['i5', 40, 15, False], ['i6', 25, 3, True], ['i7', 5, 10, False]], 50, 20], [[['i1'], ['i5'], ['i0', 'i2'], ['i6', 'i3'], ['i7']], ['i4']]], ['generated mix 26', [[['i0', 40, 1, False], ['i1', 50, 10, False], ['i2', 30, 3, True], ['i3', 10, 15, False], ['i4', 40, 10, False], ['i5', 5, 8, False]], 60, 20], [[['i1', 'i5'], ['i4'], ['i0', 'i3'], ['i2']], []]], ['exact fill', [[['a', 30, 5, False], ['b', 20, 5, False]], 50, 20], [[['a', 'b']], []]], ['heavy after fragile', [[['f', 30, 1, True], ['h', 10, 12, False]], 50, 20], [[['f'], ['h']], []]], ['weight limit splits', [[['a', 10, 15, False], ['b', 10, 6, False]], 50, 20], [[['a'], ['b']], []]], ['generated mix 20', [[['i0', 25, 3, True], ['i1', 50, 11, False], ['i2', 10, 10, True]], 60, 20], [[['i1'], ['i0', 'i2']], []]], ['generated mix 29', [[['i0', 60, 1, False], ['i1', 30, 11, True], ['i2', 60, 15, False], ['i3', 60, 3, False], ['i4', 20, 3, True], ['i5', 30, 10, False], ['i6', 20, 1, True]], 50, 20], [[['i1'], ['i5', 'i4'], ['i6']], ['i0', 'i2', 'i3']]], ['generated mix 38', [[['i0', 40, 10, False], ['i1', 60, 3, True], ['i2', 25, 10, True], ['i3', 10, 8, False], ['i4', 60, 11, True], ['i5', 40, 1, False]], 50, 20], [[['i0', 'i3'], ['i5'], ['i2']], ['i1', 'i4']]]], [['generated mix 52', [[['i0', 10, 11, False], ['i1', 25, 1, False], ['i2', 5, 15, False]], 60, 25], [[['i1', 'i0'], ['i2']], []]], ['generated mix 43', [[['i0', 5, 8, False], ['i1', 10, 3, False], ['i2', 40, 15, False], ['i3', 40, 15, False], ['i4', 20, 1, False], ['i5', 50, 11, False], ['i6', 20, 3, False]], 50, 20], [[['i5'], ['i2', 'i1'], ['i3'], ['i6', 'i4', 'i0']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['generated mix 31', [[['i0', 5, 11, False], ['i1', 30, 11, False], ['i2', 20, 1, False], ['i3', 25, 11, False], ['i4', 40, 3, False]], 50, 25], [[['i4', 'i0'], ['i1', 'i2'], ['i3']], []]], ['generated mix 39', [[['i0', 60, 15, True], ['i1', 25, 15, False], ['i2', 60, 10, True], ['i3', 10, 11, True], ['i4', 60, 8, False], ['i5', 20, 15, False], ['i6', 60, 1, False], ['i7', 40, 3, True]], 60, 25], [[['i0'], ['i2'], ['i4'], ['i6'], ['i7'], ['i1'], ['i5'], ['i3']], []]], ['generated mix 48', [[['i0', 30, 3, False], ['i1', 5, 3, False], ['i2', 5, 10, False], ['i3', 60, 10, True]], 60, 20], [[['i3'], ['i0', 'i2', 'i1']], []]]], [['weight limit splits', [[['a', 10, 15, False], ['b', 10, 6, False]], 50, 20], [[['a'], ['b']], []]], ['generated mix 52', [[['i0', 10, 11, False], ['i1', 25, 1, False], ['i2', 5, 15, False]], 60, 25], [[['i1', 'i0'], ['i2']], []]], ['heavy after fragile', [[['f', 30, 1, True], ['h', 10, 12, False]], 50, 20], [[['f'], ['h']], []]], ['first fit not best fit', [[['a', 40, 1, False], ['b', 30, 1, False], ['c', 10, 1, False]], 50, 20], [[['a', 'c'], ['b']], []]], ['fragile vs heavy', [[['h', 30, 12, False], ['f', 10, 1, True]], 50, 20], [[['h'], ['f']], []]], ['oversize weight', [[['x', 10, 30, False], ['y', 10, 1, False]], 50, 20], [[['y']], ['x']]], ['generated mix 44', [[['i0', 50, 3, True], ['i1', 60, 11, False], ['i2', 40, 3, False], ['i3', 40, 10, True], ['i4', 30, 1, False], ['i5', 5, 15, False], ['i6', 40, 11, False]], 50, 25], [[['i0'], ['i6'], ['i3'], ['i2', 'i5'], ['i4']], ['i1']]], ['generated mix 53', [[['i0', 5, 11, False], ['i1', 50, 1, True], ['i2', 5, 1, False], ['i3', 30, 10, False], ['i4', 40, 1, False], ['i5', 40, 11, False], ['i6', 60, 11, False]], 50, 25], [[['i1'], ['i5', 'i0', 'i2'], ['i4'], ['i3']], ['i6']]]]]
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 |
|---|---|---|---|
| weight limit splits | [[['a'], ['b']], []] | [[['a'], ['b']], []] | Passed |
| generated mix 1 | [[['i0'], ['i2'], ['i1', 'i4'], ['i3']], []] | [[['i0'], ['i2'], ['i1', 'i4'], ['i3']], []] | Passed |
| exact fill | [[['a', 'b']], []] | [[['a', 'b']], []] | Passed |
| heavy after fragile | [[['f'], ['h']], []] | [[['f'], ['h']], []] | Passed |
| first fit not best fit | [[['a', 'c'], ['b']], []] | [[['a', 'c'], ['b']], []] | Passed |
| fragile vs heavy | [[['h'], ['f']], []] | [[['h'], ['f']], []] | Passed |
| oversize weight | [[['y']], ['x']] | [[['y']], ['x']] | Passed |
| generated mix 9 | [[['i2'], ['i1'], ['i3']], ['i0']] | [[['i2'], ['i1'], ['i3']], ['i0']] | Passed |
SHA-256 / 7d6f35d39634fd285cd8675a0da24627f4d839736c0765ad744fa3d338cb62d5
Verification & scope
Stipulated first-fit rule; 10 kg heavy threshold is a toy contract constant. 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.142156+00:00.
Case digest / 9a7d6cc8091d76f486cb350323a868c45cc6e19c083146bbfd97222042bc61d3