FAILURE MAP
← Case archive

FA-85846 / Game economy crafting balance / Open access

Batch crafting: Bonus yield gate excludes the qualifying skill · case 01

A crafter at exactly the bonus skill receives no bonus items.

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

ROOT CAUSE

The skill gate for bonus items is a strict comparison, excluding the threshold value itself.

THE FAILURE

The skill gate for bonus items is a strict comparison, excluding the threshold value itself.

Unsuccessful approach: The patched gate also stops granting the bonus to grandmasters at skill 100 and above.

Case contract

recipe = {inputs:{material:qty}, output, yield, stack}. Crafts = min(requested, floor(have/qty) per input), 0 when requested <= 0. With skill in [50, inf) every 5th craft adds one bonus item (bonus = crafts//5). made = crafts*yield + bonus, split into full stacks of size stack plus one partial stack. left = whole inventory (all materials) after consuming crafts*qty of each input, sorted by name.

Why this case matters

Game economies leak or destroy currency when one crafting or pricing rule is off by one boundary, rounding stage or state update; the defect is observable in exact integer outcomes.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(recipe, inventory, requested, skill):
    if requested <= 0:
        crafts = 0
    else:
        crafts = requested
        for mat, qty in recipe['inputs'].items():
            crafts = min(crafts, inventory.get(mat, 0) // qty)
    bonus = crafts // 5 if skill > 50 else 0
    made = crafts * recipe['yield'] + bonus
    cap = recipe['stack']
    stacks = [cap] * (made // cap)
    if made % cap:
        stacks.append(made % cap)
    left = dict(inventory)
    for mat, qty in recipe['inputs'].items():
        left[mat] = left.get(mat, 0) - crafts * qty
    return {'crafts': crafts, 'made': made, 'stacks': stacks, 'left': dict(sorted(left.items()))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('exact material multiple #1',
   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],
   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),
  ('fault site bonus skill gate #1',
   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],
   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),
  ('fault site bonus skill gate #2',
   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 19, 'ore': 25},
    9,
    50],
   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),
  ('partial repair boundary #1',
   [{'inputs': {'hide': 1, 'gem': 2, 'wood': 1}, 'output': 'blade', 'yield': 3, 'stack': 10},
    {'hide': 28, 'gem': 10, 'wood': 23, 'herb': 6},
    8,
    120],
   {'crafts': 5, 'made': 16, 'stacks': [10, 6], 'left': {'gem': 0, 'herb': 6, 'hide': 23, 'wood': 18}}),
  ('partial repair boundary #2',
   [{'inputs': {'gem': 1}, 'output': 'blade', 'yield': 3, 'stack': 6}, {'gem': 27, 'herb': 8}, 7, 101],
   {'crafts': 7, 'made': 22, 'stacks': [6, 6, 6, 4], 'left': {'gem': 20, 'herb': 8}}),
  ('one short of a batch #1',
   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},
    {'ore': 14, 'wood': 9, 'herb': 2},
    9,
    10],
   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),
  ('zero request #1',
   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],
   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),
  ('control #1',
   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],
   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],
 [('exact material multiple #1',
   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],
   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),
  ('fault site bonus skill gate #1',
   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 19, 'ore': 25},
    9,
    50],
   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),
  ('fault site bonus skill gate #2',
   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],
   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),
  ('partial repair boundary #1',
   [{'inputs': {'ore': 2}, 'output': 'blade', 'yield': 2, 'stack': 8}, {'ore': 28}, 5, 100],
   {'crafts': 5, 'made': 11, 'stacks': [8, 3], 'left': {'ore': 18}}),
  ('partial repair boundary #2',
   [{'inputs': {'wood': 1}, 'output': 'blade', 'yield': 3, 'stack': 7}, {'wood': 7}, 12, 120],
   {'crafts': 7, 'made': 22, 'stacks': [7, 7, 7, 1], 'left': {'wood': 0}}),
  ('one short of a batch #1',
   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},
    {'ore': 14, 'wood': 9, 'herb': 2},
    9,
    10],
   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),
  ('zero request #1',
   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],
   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),
  ('control #1',
   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],
   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],
 [('exact material multiple #1',
   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],
   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),
  ('fault site bonus skill gate #1',
   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],
   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),
  ('fault site bonus skill gate #2',
   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 19, 'ore': 25},
    9,
    50],
   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),
  ('partial repair boundary #1',
   [{'inputs': {'hide': 3}, 'output': 'blade', 'yield': 1, 'stack': 6}, {'hide': 22}, 8, 100],
   {'crafts': 7, 'made': 8, 'stacks': [6, 2], 'left': {'hide': 1}}),
  ('partial repair boundary #2',
   [{'inputs': {'gem': 4, 'hide': 1, 'ore': 1}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 29, 'hide': 25, 'ore': 26},
    8,
    120],
   {'crafts': 7, 'made': 15, 'stacks': [9, 6], 'left': {'gem': 1, 'hide': 18, 'ore': 19}}),
  ('one short of a batch #1',
   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},
    {'ore': 14, 'wood': 9, 'herb': 2},
    9,
    10],
   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),
  ('zero request #1',
   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],
   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),
  ('control #1',
   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],
   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],
 [('exact material multiple #1',
   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],
   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),
  ('fault site bonus skill gate #1',
   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],
   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),
  ('fault site bonus skill gate #2',
   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 19, 'ore': 25},
    9,
    50],
   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),
  ('partial repair boundary #1',
   [{'inputs': {'hide': 3, 'wood': 2}, 'output': 'blade', 'yield': 2, 'stack': 10},
    {'hide': 29, 'wood': 21, 'herb': 6},
    7,
    101],
   {'crafts': 7, 'made': 15, 'stacks': [10, 5], 'left': {'herb': 6, 'hide': 8, 'wood': 7}}),
  ('partial repair boundary #2',
   [{'inputs': {'gem': 2, 'wood': 3}, 'output': 'blade', 'yield': 1, 'stack': 3},
    {'gem': 30, 'wood': 19},
    10,
    101],
   {'crafts': 6, 'made': 7, 'stacks': [3, 3, 1], 'left': {'gem': 18, 'wood': 1}}),
  ('one short of a batch #1',
   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},
    {'ore': 14, 'wood': 9, 'herb': 2},
    9,
    10],
   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),
  ('zero request #1',
   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],
   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),
  ('control #1',
   [{'inputs': {'hide': 3, 'ore': 1}, 'output': 'blade', 'yield': 1, 'stack': 5},
    {'hide': 21, 'ore': 5},
    3,
    99],
   {'crafts': 3, 'made': 3, 'stacks': [3], 'left': {'hide': 12, 'ore': 2}})],
 [('exact material multiple #1',
   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],
   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),
  ('fault site bonus skill gate #1',
   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 19, 'ore': 25},
    9,
    50],
   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),
  ('fault site bonus skill gate #2',
   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],
   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),
  ('partial repair boundary #1',
   [{'inputs': {'hide': 3}, 'output': 'blade', 'yield': 3, 'stack': 6}, {'hide': 25}, 12, 100],
   {'crafts': 8, 'made': 25, 'stacks': [6, 6, 6, 6, 1], 'left': {'hide': 1}}),
  ('partial repair boundary #2',
   [{'inputs': {'hide': 2, 'ore': 1, 'gem': 3}, 'output': 'blade', 'yield': 2, 'stack': 7},
    {'hide': 23, 'ore': 8, 'gem': 26, 'herb': 2},
    8,
    120],
   {'crafts': 8, 'made': 17, 'stacks': [7, 7, 3], 'left': {'gem': 2, 'herb': 2, 'hide': 7, 'ore': 0}}),
  ('one short of a batch #1',
   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},
    {'ore': 14, 'wood': 9, 'herb': 2},
    9,
    10],
   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),
  ('zero request #1',
   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],
   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),
  ('control #1',
   [{'inputs': {'wood': 2, 'hide': 3, 'gem': 3}, 'output': 'blade', 'yield': 3, 'stack': 7},
    {'wood': 12, 'hide': 23, 'gem': 11},
    4,
    51],
   {'crafts': 3, 'made': 9, 'stacks': [7, 2], 'left': {'gem': 2, 'hide': 14, 'wood': 6}})]]
for label, args, expected in cases[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
exact material multiple #1{'crafts': 5, 'left': {'ore': 0}, 'made': 5, 'stacks': [5]}{'crafts': 5, 'left': {'ore': 0}, 'made': 6, 'stacks': [5, 1]}Failed
fault site bonus skill gate #1{'crafts': 9, 'left': {'hide': 5}, 'made': 27, 'stacks': [8, 8, 8, 3]}{'crafts': 9, 'left': {'hide': 5}, 'made': 28, 'stacks': [8, 8, 8, 4]}Failed
fault site bonus skill gate #2{'crafts': 8, 'left': {'gem': 3, 'ore': 1}, 'made': 16, 'stacks': [9, 7]}{'crafts': 8, 'left': {'gem': 3, 'ore': 1}, 'made': 17, 'stacks': [9, 8]}Failed
partial repair boundary #1{'crafts': 5, 'left': {'gem': 0, 'herb': 6, 'hide': 23, 'wood': 18}, 'made': 16, 'stacks': [10, 6]}{'crafts': 5, 'left': {'gem': 0, 'herb': 6, 'hide': 23, 'wood': 18}, 'made': 16, 'stacks': [10, 6]}Passed
partial repair boundary #2{'crafts': 7, 'left': {'gem': 20, 'herb': 8}, 'made': 22, 'stacks': [6, 6, 6, 4]}{'crafts': 7, 'left': {'gem': 20, 'herb': 8}, 'made': 22, 'stacks': [6, 6, 6, 4]}Passed
one short of a batch #1{'crafts': 4, 'left': {'herb': 2, 'ore': 2, 'wood': 1}, 'made': 8, 'stacks': [4, 4]}{'crafts': 4, 'left': {'herb': 2, 'ore': 2, 'wood': 1}, 'made': 8, 'stacks': [4, 4]}Passed
zero request #1{'crafts': 0, 'left': {'hide': 8}, 'made': 0, 'stacks': []}{'crafts': 0, 'left': {'hide': 8}, 'made': 0, 'stacks': []}Passed
control #1{'crafts': 1, 'left': {'ore': 2}, 'made': 3, 'stacks': [3]}{'crafts': 1, 'left': {'ore': 2}, 'made': 3, 'stacks': [3]}Passed

SHA-256 / fbd32a9290807dd0f90b0abba6d1296c51240ed3f8444f07bd0e3cd9795d50dc

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(recipe, inventory, requested, skill):
    if requested <= 0:
        crafts = 0
    else:
        crafts = requested
        for mat, qty in recipe['inputs'].items():
            crafts = min(crafts, inventory.get(mat, 0) // qty)
    bonus = crafts // 5 if skill > 49 and skill < 100 else 0
    made = crafts * recipe['yield'] + bonus
    cap = recipe['stack']
    stacks = [cap] * (made // cap)
    if made % cap:
        stacks.append(made % cap)
    left = dict(inventory)
    for mat, qty in recipe['inputs'].items():
        left[mat] = left.get(mat, 0) - crafts * qty
    return {'crafts': crafts, 'made': made, 'stacks': stacks, 'left': dict(sorted(left.items()))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('exact material multiple #1',
   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],
   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),
  ('fault site bonus skill gate #1',
   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],
   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),
  ('fault site bonus skill gate #2',
   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 19, 'ore': 25},
    9,
    50],
   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),
  ('partial repair boundary #1',
   [{'inputs': {'hide': 1, 'gem': 2, 'wood': 1}, 'output': 'blade', 'yield': 3, 'stack': 10},
    {'hide': 28, 'gem': 10, 'wood': 23, 'herb': 6},
    8,
    120],
   {'crafts': 5, 'made': 16, 'stacks': [10, 6], 'left': {'gem': 0, 'herb': 6, 'hide': 23, 'wood': 18}}),
  ('partial repair boundary #2',
   [{'inputs': {'gem': 1}, 'output': 'blade', 'yield': 3, 'stack': 6}, {'gem': 27, 'herb': 8}, 7, 101],
   {'crafts': 7, 'made': 22, 'stacks': [6, 6, 6, 4], 'left': {'gem': 20, 'herb': 8}}),
  ('one short of a batch #1',
   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},
    {'ore': 14, 'wood': 9, 'herb': 2},
    9,
    10],
   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),
  ('zero request #1',
   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],
   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),
  ('control #1',
   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],
   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],
 [('exact material multiple #1',
   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],
   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),
  ('fault site bonus skill gate #1',
   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 19, 'ore': 25},
    9,
    50],
   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),
  ('fault site bonus skill gate #2',
   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],
   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),
  ('partial repair boundary #1',
   [{'inputs': {'ore': 2}, 'output': 'blade', 'yield': 2, 'stack': 8}, {'ore': 28}, 5, 100],
   {'crafts': 5, 'made': 11, 'stacks': [8, 3], 'left': {'ore': 18}}),
  ('partial repair boundary #2',
   [{'inputs': {'wood': 1}, 'output': 'blade', 'yield': 3, 'stack': 7}, {'wood': 7}, 12, 120],
   {'crafts': 7, 'made': 22, 'stacks': [7, 7, 7, 1], 'left': {'wood': 0}}),
  ('one short of a batch #1',
   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},
    {'ore': 14, 'wood': 9, 'herb': 2},
    9,
    10],
   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),
  ('zero request #1',
   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],
   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),
  ('control #1',
   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],
   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],
 [('exact material multiple #1',
   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],
   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),
  ('fault site bonus skill gate #1',
   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],
   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),
  ('fault site bonus skill gate #2',
   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 19, 'ore': 25},
    9,
    50],
   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),
  ('partial repair boundary #1',
   [{'inputs': {'hide': 3}, 'output': 'blade', 'yield': 1, 'stack': 6}, {'hide': 22}, 8, 100],
   {'crafts': 7, 'made': 8, 'stacks': [6, 2], 'left': {'hide': 1}}),
  ('partial repair boundary #2',
   [{'inputs': {'gem': 4, 'hide': 1, 'ore': 1}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 29, 'hide': 25, 'ore': 26},
    8,
    120],
   {'crafts': 7, 'made': 15, 'stacks': [9, 6], 'left': {'gem': 1, 'hide': 18, 'ore': 19}}),
  ('one short of a batch #1',
   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},
    {'ore': 14, 'wood': 9, 'herb': 2},
    9,
    10],
   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),
  ('zero request #1',
   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],
   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),
  ('control #1',
   [{'inputs': {'ore': 4}, 'output': 'blade', 'yield': 3, 'stack': 10}, {'ore': 6}, 2, 51],
   {'crafts': 1, 'made': 3, 'stacks': [3], 'left': {'ore': 2}})],
 [('exact material multiple #1',
   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],
   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),
  ('fault site bonus skill gate #1',
   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],
   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),
  ('fault site bonus skill gate #2',
   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 19, 'ore': 25},
    9,
    50],
   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),
  ('partial repair boundary #1',
   [{'inputs': {'hide': 3, 'wood': 2}, 'output': 'blade', 'yield': 2, 'stack': 10},
    {'hide': 29, 'wood': 21, 'herb': 6},
    7,
    101],
   {'crafts': 7, 'made': 15, 'stacks': [10, 5], 'left': {'herb': 6, 'hide': 8, 'wood': 7}}),
  ('partial repair boundary #2',
   [{'inputs': {'gem': 2, 'wood': 3}, 'output': 'blade', 'yield': 1, 'stack': 3},
    {'gem': 30, 'wood': 19},
    10,
    101],
   {'crafts': 6, 'made': 7, 'stacks': [3, 3, 1], 'left': {'gem': 18, 'wood': 1}}),
  ('one short of a batch #1',
   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},
    {'ore': 14, 'wood': 9, 'herb': 2},
    9,
    10],
   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),
  ('zero request #1',
   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],
   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),
  ('control #1',
   [{'inputs': {'hide': 3, 'ore': 1}, 'output': 'blade', 'yield': 1, 'stack': 5},
    {'hide': 21, 'ore': 5},
    3,
    99],
   {'crafts': 3, 'made': 3, 'stacks': [3], 'left': {'hide': 12, 'ore': 2}})],
 [('exact material multiple #1',
   [{'inputs': {'ore': 3}, 'output': 'bar', 'yield': 1, 'stack': 5}, {'ore': 15}, 10, 50],
   {'crafts': 5, 'made': 6, 'stacks': [5, 1], 'left': {'ore': 0}}),
  ('fault site bonus skill gate #1',
   [{'inputs': {'gem': 2, 'ore': 3}, 'output': 'blade', 'yield': 2, 'stack': 9},
    {'gem': 19, 'ore': 25},
    9,
    50],
   {'crafts': 8, 'made': 17, 'stacks': [9, 8], 'left': {'gem': 3, 'ore': 1}}),
  ('fault site bonus skill gate #2',
   [{'inputs': {'hide': 2}, 'output': 'blade', 'yield': 3, 'stack': 8}, {'hide': 23}, 9, 50],
   {'crafts': 9, 'made': 28, 'stacks': [8, 8, 8, 4], 'left': {'hide': 5}}),
  ('partial repair boundary #1',
   [{'inputs': {'hide': 3}, 'output': 'blade', 'yield': 3, 'stack': 6}, {'hide': 25}, 12, 100],
   {'crafts': 8, 'made': 25, 'stacks': [6, 6, 6, 6, 1], 'left': {'hide': 1}}),
  ('partial repair boundary #2',
   [{'inputs': {'hide': 2, 'ore': 1, 'gem': 3}, 'output': 'blade', 'yield': 2, 'stack': 7},
    {'hide': 23, 'ore': 8, 'gem': 26, 'herb': 2},
    8,
    120],
   {'crafts': 8, 'made': 17, 'stacks': [7, 7, 3], 'left': {'gem': 2, 'herb': 2, 'hide': 7, 'ore': 0}}),
  ('one short of a batch #1',
   [{'inputs': {'ore': 3, 'wood': 2}, 'output': 'axe', 'yield': 2, 'stack': 4},
    {'ore': 14, 'wood': 9, 'herb': 2},
    9,
    10],
   {'crafts': 4, 'made': 8, 'stacks': [4, 4], 'left': {'herb': 2, 'ore': 2, 'wood': 1}}),
  ('zero request #1',
   [{'inputs': {'hide': 2}, 'output': 'belt', 'yield': 1, 'stack': 3}, {'hide': 8}, 0, 80],
   {'crafts': 0, 'made': 0, 'stacks': [], 'left': {'hide': 8}}),
  ('control #1',
   [{'inputs': {'wood': 2, 'hide': 3, 'gem': 3}, 'output': 'blade', 'yield': 3, 'stack': 7},
    {'wood': 12, 'hide': 23, 'gem': 11},
    4,
    51],
   {'crafts': 3, 'made': 9, 'stacks': [7, 2], 'left': {'gem': 2, 'hide': 14, 'wood': 6}})]]
for label, args, expected in cases[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
exact material multiple #1{'crafts': 5, 'left': {'ore': 0}, 'made': 6, 'stacks': [5, 1]}{'crafts': 5, 'left': {'ore': 0}, 'made': 6, 'stacks': [5, 1]}Passed
fault site bonus skill gate #1{'crafts': 9, 'left': {'hide': 5}, 'made': 28, 'stacks': [8, 8, 8, 4]}{'crafts': 9, 'left': {'hide': 5}, 'made': 28, 'stacks': [8, 8, 8, 4]}Passed
fault site bonus skill gate #2{'crafts': 8, 'left': {'gem': 3, 'ore': 1}, 'made': 17, 'stacks': [9, 8]}{'crafts': 8, 'left': {'gem': 3, 'ore': 1}, 'made': 17, 'stacks': [9, 8]}Passed
partial repair boundary #1{'crafts': 5, 'left': {'gem': 0, 'herb': 6, 'hide': 23, 'wood': 18}, 'made': 15, 'stacks': [10, 5]}{'crafts': 5, 'left': {'gem': 0, 'herb': 6, 'hide': 23, 'wood': 18}, 'made': 16, 'stacks': [10, 6]}Failed
partial repair boundary #2{'crafts': 7, 'left': {'gem': 20, 'herb': 8}, 'made': 21, 'stacks': [6, 6, 6, 3]}{'crafts': 7, 'left': {'gem': 20, 'herb': 8}, 'made': 22, 'stacks': [6, 6, 6, 4]}Failed
one short of a batch #1{'crafts': 4, 'left': {'herb': 2, 'ore': 2, 'wood': 1}, 'made': 8, 'stacks': [4, 4]}{'crafts': 4, 'left': {'herb': 2, 'ore': 2, 'wood': 1}, 'made': 8, 'stacks': [4, 4]}Passed
zero request #1{'crafts': 0, 'left': {'hide': 8}, 'made': 0, 'stacks': []}{'crafts': 0, 'left': {'hide': 8}, 'made': 0, 'stacks': []}Passed
control #1{'crafts': 1, 'left': {'ore': 2}, 'made': 3, 'stacks': [3]}{'crafts': 1, 'left': {'ore': 2}, 'made': 3, 'stacks': [3]}Passed

SHA-256 / 49275180a725049c3c903a193ff75e7260e5f0794d2a295db11cefbb195a7a5f

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Deterministic toy contract stipulated for this model; integer or exact arithmetic only, not a reproduction of any specific game engine. 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:50:44.183740+00:00.

Case digest / 3f48a1fe6408e3815c3d3bd7f72aff86f7674d427c20a865d0cc62df14ad4d16