FAILURE MAP
← Case archive

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

Slot fit: stacking limit ignored · case 01

Crushable cartons are stacked to the full slot height.

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

ROOT CAUSE

The maximum stack layers are never applied to the vertical layer count.

VERIFIED REPAIR

Cap vertical layers at max_stack when a positive limit is given.

Unsuccessful approach: Comparing the total unit count with max_stack confuses layers with units and zeroes valid slots.

Case contract

slot [width, depth, height], unit [w, d, h]. Upright units may only rotate in the horizontal plane; others may take any of the 6 axis orientations. Vertical layers = height // unit height, capped at max_stack when max_stack > 0 (0 = unlimited). Units = best over orientations of (W//a)*(D//b)*layers. Utilization in basis points = floor(units*unit volume*10000/slot volume).

Why this case matters

Slot sizing converts product cube into units per location for slotting and replenishment.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import itertools
N = 1
observations = []
def solve(slot, unit, max_stack, upright):
    SW, SD, SH = slot
    uw, ud, uh = unit
    if upright:
        orients = [(uw, ud, uh), (ud, uw, uh)]
    else:
        orients = sorted(set(itertools.permutations(unit)))
    best = 0
    for a, b, c in orients:
        layers = SH // c
        if max_stack:
            pass
        best = max(best, (SW // a) * (SD // b) * layers)
    bp = best * uw * ud * uh * 10000 // (SW * SD * SH)
    return [best, bp]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['stack cap', [[48, 40, 30], [12, 10, 10], 2, True], [32, 6666]], ['generated mix 1', [[40, 40, 30], [5, 15, 7], 1, False], [40, 4375]], ['upright plane rotation', [[48, 40, 30], [12, 10, 10], 0, True], [48, 10000]], ['upright blocked', [[40, 40, 12], [10, 10, 20], 0, True], [0, 0]], ['fraction bp', [[100, 30, 45], [25, 15, 7], 0, True], [48, 9333]], ['laydown helps', [[40, 40, 12], [10, 10, 20], 0, False], [8, 8333]], ['unlimited zero', [[20, 20, 40], [10, 10, 10], 0, True], [16, 10000]], ['generated mix 9', [[48, 30, 60], [25, 10, 4], 3, False], [72, 8333]]], [['generated mix 24', [[100, 48, 45], [10, 6, 10], 1, False], [80, 2222]], ['generated mix 8', [[60, 48, 60], [25, 10, 12], 5, False], [48, 8333]], ['upright blocked', [[40, 40, 12], [10, 10, 20], 0, True], [0, 0]], ['fraction bp', [[100, 30, 45], [25, 15, 7], 0, True], [48, 9333]], ['stack cap', [[48, 40, 30], [12, 10, 10], 2, True], [32, 6666]], ['generated mix 10', [[48, 60, 45], [25, 20, 10], 0, True], [16, 6172]], ['generated mix 18', [[40, 48, 20], [25, 20, 10], 3, False], [4, 5208]], ['generated mix 27', [[60, 60, 45], [8, 20, 7], 3, False], [112, 7743]]], [['generated mix 42', [[60, 30, 30], [10, 15, 35], 1, False], [3, 2916]], ['generated mix 16', [[60, 30, 60], [25, 15, 7], 1, True], [4, 972]], ['upright plane rotation', [[48, 40, 30], [12, 10, 10], 0, True], [48, 10000]], ['laydown helps', [[40, 40, 12], [10, 10, 20], 0, False], [8, 8333]], ['unlimited zero', [[20, 20, 40], [10, 10, 10], 0, True], [16, 10000]], ['generated mix 21', [[40, 48, 45], [10, 10, 10], 2, True], [32, 3703]], ['generated mix 29', [[100, 48, 20], [8, 20, 12], 1, True], [30, 6000]], ['generated mix 37', [[40, 48, 20], [8, 6, 7], 1, False], [40, 3500]]], [['generated mix 64', [[100, 40, 45], [25, 6, 4], 5, False], [200, 6666]], ['generated mix 21', [[40, 48, 45], [10, 10, 10], 2, True], [32, 3703]], ['upright blocked', [[40, 40, 12], [10, 10, 20], 0, True], [0, 0]], ['fraction bp', [[100, 30, 45], [25, 15, 7], 0, True], [48, 9333]], ['stack cap', [[48, 40, 30], [12, 10, 10], 2, True], [32, 6666]], ['generated mix 32', [[60, 30, 45], [8, 20, 4], 3, True], [27, 2133]], ['generated mix 40', [[40, 40, 30], [5, 6, 12], 2, False], [96, 7200]], ['generated mix 48', [[60, 30, 45], [5, 20, 12], 2, False], [60, 8888]]], [['generated mix 77', [[60, 60, 60], [10, 10, 7], 1, True], [36, 1166]], ['generated mix 29', [[100, 48, 20], [8, 20, 12], 1, True], [30, 6000]], ['upright plane rotation', [[48, 40, 30], [12, 10, 10], 0, True], [48, 10000]], ['laydown helps', [[40, 40, 12], [10, 10, 20], 0, False], [8, 8333]], ['unlimited zero', [[20, 20, 40], [10, 10, 10], 0, True], [16, 10000]], ['generated mix 43', [[48, 48, 45], [25, 10, 10], 1, False], [16, 3858]], ['generated mix 51', [[60, 60, 30], [12, 10, 10], 3, True], [90, 10000]], ['generated mix 59', [[100, 48, 30], [12, 6, 35], 5, False], [40, 7000]]]]
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
stack cap[48, 10000][32, 6666]Failed
generated mix 1[80, 8750][40, 4375]Failed
upright plane rotation[48, 10000][48, 10000]Passed
upright blocked[0, 0][0, 0]Passed
fraction bp[48, 9333][48, 9333]Passed
laydown helps[8, 8333][8, 8333]Passed
unlimited zero[16, 10000][16, 10000]Passed
generated mix 9[72, 8333][72, 8333]Passed

SHA-256 / 46b22c5d10c225c16a4a777d8829ec7ae30854323508d22e71979271f716bdc3

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import itertools
N = 1
observations = []
def solve(slot, unit, max_stack, upright):
    SW, SD, SH = slot
    uw, ud, uh = unit
    if upright:
        orients = [(uw, ud, uh), (ud, uw, uh)]
    else:
        orients = sorted(set(itertools.permutations(unit)))
    best = 0
    for a, b, c in orients:
        layers = SH // c
        if max_stack:
            layers = layers
        if max_stack and (SW // a) * (SD // b) * layers > max_stack:
            layers = 0
        best = max(best, (SW // a) * (SD // b) * layers)
    bp = best * uw * ud * uh * 10000 // (SW * SD * SH)
    return [best, bp]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['stack cap', [[48, 40, 30], [12, 10, 10], 2, True], [32, 6666]], ['generated mix 1', [[40, 40, 30], [5, 15, 7], 1, False], [40, 4375]], ['upright plane rotation', [[48, 40, 30], [12, 10, 10], 0, True], [48, 10000]], ['upright blocked', [[40, 40, 12], [10, 10, 20], 0, True], [0, 0]], ['fraction bp', [[100, 30, 45], [25, 15, 7], 0, True], [48, 9333]], ['laydown helps', [[40, 40, 12], [10, 10, 20], 0, False], [8, 8333]], ['unlimited zero', [[20, 20, 40], [10, 10, 10], 0, True], [16, 10000]], ['generated mix 9', [[48, 30, 60], [25, 10, 4], 3, False], [72, 8333]]], [['generated mix 24', [[100, 48, 45], [10, 6, 10], 1, False], [80, 2222]], ['generated mix 8', [[60, 48, 60], [25, 10, 12], 5, False], [48, 8333]], ['upright blocked', [[40, 40, 12], [10, 10, 20], 0, True], [0, 0]], ['fraction bp', [[100, 30, 45], [25, 15, 7], 0, True], [48, 9333]], ['stack cap', [[48, 40, 30], [12, 10, 10], 2, True], [32, 6666]], ['generated mix 10', [[48, 60, 45], [25, 20, 10], 0, True], [16, 6172]], ['generated mix 18', [[40, 48, 20], [25, 20, 10], 3, False], [4, 5208]], ['generated mix 27', [[60, 60, 45], [8, 20, 7], 3, False], [112, 7743]]], [['generated mix 42', [[60, 30, 30], [10, 15, 35], 1, False], [3, 2916]], ['generated mix 16', [[60, 30, 60], [25, 15, 7], 1, True], [4, 972]], ['upright plane rotation', [[48, 40, 30], [12, 10, 10], 0, True], [48, 10000]], ['laydown helps', [[40, 40, 12], [10, 10, 20], 0, False], [8, 8333]], ['unlimited zero', [[20, 20, 40], [10, 10, 10], 0, True], [16, 10000]], ['generated mix 21', [[40, 48, 45], [10, 10, 10], 2, True], [32, 3703]], ['generated mix 29', [[100, 48, 20], [8, 20, 12], 1, True], [30, 6000]], ['generated mix 37', [[40, 48, 20], [8, 6, 7], 1, False], [40, 3500]]], [['generated mix 64', [[100, 40, 45], [25, 6, 4], 5, False], [200, 6666]], ['generated mix 21', [[40, 48, 45], [10, 10, 10], 2, True], [32, 3703]], ['upright blocked', [[40, 40, 12], [10, 10, 20], 0, True], [0, 0]], ['fraction bp', [[100, 30, 45], [25, 15, 7], 0, True], [48, 9333]], ['stack cap', [[48, 40, 30], [12, 10, 10], 2, True], [32, 6666]], ['generated mix 32', [[60, 30, 45], [8, 20, 4], 3, True], [27, 2133]], ['generated mix 40', [[40, 40, 30], [5, 6, 12], 2, False], [96, 7200]], ['generated mix 48', [[60, 30, 45], [5, 20, 12], 2, False], [60, 8888]]], [['generated mix 77', [[60, 60, 60], [10, 10, 7], 1, True], [36, 1166]], ['generated mix 29', [[100, 48, 20], [8, 20, 12], 1, True], [30, 6000]], ['upright plane rotation', [[48, 40, 30], [12, 10, 10], 0, True], [48, 10000]], ['laydown helps', [[40, 40, 12], [10, 10, 20], 0, False], [8, 8333]], ['unlimited zero', [[20, 20, 40], [10, 10, 10], 0, True], [16, 10000]], ['generated mix 43', [[48, 48, 45], [25, 10, 10], 1, False], [16, 3858]], ['generated mix 51', [[60, 60, 30], [12, 10, 10], 3, True], [90, 10000]], ['generated mix 59', [[100, 48, 30], [12, 6, 35], 5, False], [40, 7000]]]]
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
stack cap[0, 0][32, 6666]Failed
generated mix 1[0, 0][40, 4375]Failed
upright plane rotation[48, 10000][48, 10000]Passed
upright blocked[0, 0][0, 0]Passed
fraction bp[48, 9333][48, 9333]Passed
laydown helps[8, 8333][8, 8333]Passed
unlimited zero[16, 10000][16, 10000]Passed
generated mix 9[0, 0][72, 8333]Failed

SHA-256 / ae1c448cf312b4ea274f5b36bde743b9afd59e51adc3922f9074728fe94208c9

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import itertools
N = 1
observations = []
def solve(slot, unit, max_stack, upright):
    SW, SD, SH = slot
    uw, ud, uh = unit
    if upright:
        orients = [(uw, ud, uh), (ud, uw, uh)]
    else:
        orients = sorted(set(itertools.permutations(unit)))
    best = 0
    for a, b, c in orients:
        layers = SH // c
        if max_stack:
            layers = min(layers, max_stack)
        best = max(best, (SW // a) * (SD // b) * layers)
    bp = best * uw * ud * uh * 10000 // (SW * SD * SH)
    return [best, bp]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['stack cap', [[48, 40, 30], [12, 10, 10], 2, True], [32, 6666]], ['generated mix 1', [[40, 40, 30], [5, 15, 7], 1, False], [40, 4375]], ['upright plane rotation', [[48, 40, 30], [12, 10, 10], 0, True], [48, 10000]], ['upright blocked', [[40, 40, 12], [10, 10, 20], 0, True], [0, 0]], ['fraction bp', [[100, 30, 45], [25, 15, 7], 0, True], [48, 9333]], ['laydown helps', [[40, 40, 12], [10, 10, 20], 0, False], [8, 8333]], ['unlimited zero', [[20, 20, 40], [10, 10, 10], 0, True], [16, 10000]], ['generated mix 9', [[48, 30, 60], [25, 10, 4], 3, False], [72, 8333]]], [['generated mix 24', [[100, 48, 45], [10, 6, 10], 1, False], [80, 2222]], ['generated mix 8', [[60, 48, 60], [25, 10, 12], 5, False], [48, 8333]], ['upright blocked', [[40, 40, 12], [10, 10, 20], 0, True], [0, 0]], ['fraction bp', [[100, 30, 45], [25, 15, 7], 0, True], [48, 9333]], ['stack cap', [[48, 40, 30], [12, 10, 10], 2, True], [32, 6666]], ['generated mix 10', [[48, 60, 45], [25, 20, 10], 0, True], [16, 6172]], ['generated mix 18', [[40, 48, 20], [25, 20, 10], 3, False], [4, 5208]], ['generated mix 27', [[60, 60, 45], [8, 20, 7], 3, False], [112, 7743]]], [['generated mix 42', [[60, 30, 30], [10, 15, 35], 1, False], [3, 2916]], ['generated mix 16', [[60, 30, 60], [25, 15, 7], 1, True], [4, 972]], ['upright plane rotation', [[48, 40, 30], [12, 10, 10], 0, True], [48, 10000]], ['laydown helps', [[40, 40, 12], [10, 10, 20], 0, False], [8, 8333]], ['unlimited zero', [[20, 20, 40], [10, 10, 10], 0, True], [16, 10000]], ['generated mix 21', [[40, 48, 45], [10, 10, 10], 2, True], [32, 3703]], ['generated mix 29', [[100, 48, 20], [8, 20, 12], 1, True], [30, 6000]], ['generated mix 37', [[40, 48, 20], [8, 6, 7], 1, False], [40, 3500]]], [['generated mix 64', [[100, 40, 45], [25, 6, 4], 5, False], [200, 6666]], ['generated mix 21', [[40, 48, 45], [10, 10, 10], 2, True], [32, 3703]], ['upright blocked', [[40, 40, 12], [10, 10, 20], 0, True], [0, 0]], ['fraction bp', [[100, 30, 45], [25, 15, 7], 0, True], [48, 9333]], ['stack cap', [[48, 40, 30], [12, 10, 10], 2, True], [32, 6666]], ['generated mix 32', [[60, 30, 45], [8, 20, 4], 3, True], [27, 2133]], ['generated mix 40', [[40, 40, 30], [5, 6, 12], 2, False], [96, 7200]], ['generated mix 48', [[60, 30, 45], [5, 20, 12], 2, False], [60, 8888]]], [['generated mix 77', [[60, 60, 60], [10, 10, 7], 1, True], [36, 1166]], ['generated mix 29', [[100, 48, 20], [8, 20, 12], 1, True], [30, 6000]], ['upright plane rotation', [[48, 40, 30], [12, 10, 10], 0, True], [48, 10000]], ['laydown helps', [[40, 40, 12], [10, 10, 20], 0, False], [8, 8333]], ['unlimited zero', [[20, 20, 40], [10, 10, 10], 0, True], [16, 10000]], ['generated mix 43', [[48, 48, 45], [25, 10, 10], 1, False], [16, 3858]], ['generated mix 51', [[60, 60, 30], [12, 10, 10], 3, True], [90, 10000]], ['generated mix 59', [[100, 48, 30], [12, 6, 35], 5, False], [40, 7000]]]]
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
stack cap[32, 6666][32, 6666]Passed
generated mix 1[40, 4375][40, 4375]Passed
upright plane rotation[48, 10000][48, 10000]Passed
upright blocked[0, 0][0, 0]Passed
fraction bp[48, 9333][48, 9333]Passed
laydown helps[8, 8333][8, 8333]Passed
unlimited zero[16, 10000][16, 10000]Passed
generated mix 9[72, 8333][72, 8333]Passed

SHA-256 / 824fa95d8366ae15f2d7534a5e96191700b74ee5418f04c70a83ab6f76993eda

Verification & scope

Uniform unit, single orientation per slot; no mixed orientation packing. 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:10.397847+00:00.

Case digest / 0c55dac7d8ff8674d22233ac8a58e7c7b7cfbeab2c306ac6049c4bd4ed9990dc