{"abstract":"Encounters exceed the three-per-type variety rule.","category":"Procedural level generation constraints","checks":8,"contract":"budget = 10 + 5*depth + 10*(depth//5). roster [name, cost, min_depth] with cost >= 1. Repeatedly pick the most expensive unlocked (min_depth <= depth) affordable enemy with fewer than 3 copies already picked, ties broken by name; stop when none qualifies. Returns {picks, left}.","evaluation_group":"w2-procedural-level-generation-constraints-difficulty-budget","failed_approach":"A global three-enemy cap truncates mixed encounters.","family":"w2-procedural-level-generation-constraints-difficulty-budget-copy-limit","id":"FA-86566","implementations":{"attempt":{"sha256":"337bd1510703a5a01dd91a138cd96969a689f7dd3a2fe2524b059e375b4b73c1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(depth, roster):\n    budget = 10 + 5 * depth + depth // 5 * 10\n    counts = {}\n    picks = []\n    while True:\n        best = None\n        for name, cost, need in roster:\n            if need > depth or cost > budget or len(picks) >= 3:\n                continue\n            if best is None or cost > best[1] or (cost == best[1] and name < best[0]):\n                best = (name, cost)\n        if best is None:\n            break\n        picks.append(best[0])\n        counts[best[0]] = counts.get(best[0], 0) + 1\n        budget -= best[1]\n    return {'picks': picks, 'left': budget}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('milestone depth bonus #1', [5, [['orc', 5, 0]]], {'picks': ['orc', 'orc', 'orc'], 'left': 30}),\n  ('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [1, [['imp', 10, 1], ['bat', 10, 10], ['orc', 1, 0]]],\n   {'picks': ['imp', 'orc', 'orc', 'orc'], 'left': 2}),\n  ('fault site copy limit #1', [15, [['ogre', 5, 1]]], {'picks': ['ogre', 'ogre', 'ogre'], 'left': 100}),\n  ('partial repair boundary #1',\n   [10, [['imp', 2, 10], ['ogre', 5, 10], ['rat', 1, 3], ['bat', 2, 0], ['orc', 5, 3], ['wyrm', 24, 10]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'ogre', 'bat', 'rat'], 'left': 0}),\n  ('regression copy limit #2',\n   [4, [['rat', 5, 5], ['ogre', 5, 0], ['wyrm', 5, 1], ['imp', 5, 3]]],\n   {'picks': ['imp', 'imp', 'imp', 'ogre', 'ogre', 'ogre'], 'left': 0}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [1, [['orc', 5, 3], ['bat', 8, 1], ['wyrm', 8, 0]]], {'picks': ['bat'], 'left': 7})],\n [('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [1, [['imp', 10, 1], ['bat', 10, 10], ['orc', 1, 0]]],\n   {'picks': ['imp', 'orc', 'orc', 'orc'], 'left': 2}),\n  ('fault site copy limit #1', [15, [['ogre', 5, 1]]], {'picks': ['ogre', 'ogre', 'ogre'], 'left': 100}),\n  ('regression copy limit #2',\n   [4, [['rat', 5, 5], ['ogre', 5, 0], ['wyrm', 5, 1], ['imp', 5, 3]]],\n   {'picks': ['imp', 'imp', 'imp', 'ogre', 'ogre', 'ogre'], 'left': 0}),\n  ('regression copy limit #3',\n   [5, [['bat', 8, 1], ['orc', 15, 10], ['wyrm', 10, 1], ['ogre', 1, 3], ['rat', 1, 3], ['imp', 2, 0]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'bat', 'imp', 'imp', 'imp', 'ogre'], 'left': 0}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [4, [['orc', 10, 10], ['wyrm', 2, 5]]], {'picks': [], 'left': 30}),\n  ('control #2', [0, [['bat', 18, 0]]], {'picks': [], 'left': 10})],\n [('milestone depth bonus #1', [5, [['orc', 5, 0]]], {'picks': ['orc', 'orc', 'orc'], 'left': 30}),\n  ('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [4, [['rat', 5, 5], ['ogre', 5, 0], ['wyrm', 5, 1], ['imp', 5, 3]]],\n   {'picks': ['imp', 'imp', 'imp', 'ogre', 'ogre', 'ogre'], 'left': 0}),\n  ('fault site copy limit #1',\n   [5, [['orc', 10, 1], ['imp', 5, 10]]],\n   {'picks': ['orc', 'orc', 'orc'], 'left': 15}),\n  ('regression copy limit #2',\n   [5, [['bat', 8, 1], ['orc', 15, 10], ['wyrm', 10, 1], ['ogre', 1, 3], ['rat', 1, 3], ['imp', 2, 0]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'bat', 'imp', 'imp', 'imp', 'ogre'], 'left': 0}),\n  ('regression copy limit #3',\n   [9, [['rat', 7, 0], ['ogre', 1, 0]]],\n   {'picks': ['rat', 'rat', 'rat', 'ogre', 'ogre', 'ogre'], 'left': 41}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [4, [['orc', 10, 10], ['wyrm', 2, 5]]], {'picks': [], 'left': 30})],\n [('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('fault site copy limit #1',\n   [1, [['imp', 10, 3], ['orc', 2, 0], ['rat', 10, 10], ['wyrm', 15, 5], ['bat', 15, 3]]],\n   {'picks': ['orc', 'orc', 'orc'], 'left': 9}),\n  ('regression copy limit #1',\n   [5, [['bat', 8, 1], ['orc', 15, 10], ['wyrm', 10, 1], ['ogre', 1, 3], ['rat', 1, 3], ['imp', 2, 0]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'bat', 'imp', 'imp', 'imp', 'ogre'], 'left': 0}),\n  ('regression copy limit #2',\n   [10, [['imp', 15, 10], ['ogre', 5, 1], ['orc', 5, 5], ['rat', 5, 0], ['wyrm', 10, 1]]],\n   {'picks': ['imp', 'imp', 'imp', 'wyrm', 'wyrm', 'wyrm', 'ogre'], 'left': 0}),\n  ('partial repair boundary #1',\n   [9, [['bat', 26, 5], ['rat', 11, 10], ['ogre', 5, 0], ['imp', 5, 0]]],\n   {'picks': ['bat', 'bat', 'imp', 'imp'], 'left': 3}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1',\n   [0, [['imp', 10, 1], ['rat', 7, 10], ['orc', 5, 10], ['ogre', 1, 1], ['wyrm', 5, 5]]],\n   {'picks': [], 'left': 10}),\n  ('control #2', [9, [['ogre', 5, 10]]], {'picks': [], 'left': 65})],\n [('milestone depth bonus #1', [5, [['orc', 5, 0]]], {'picks': ['orc', 'orc', 'orc'], 'left': 30}),\n  ('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [9, [['rat', 7, 0], ['ogre', 1, 0]]],\n   {'picks': ['rat', 'rat', 'rat', 'ogre', 'ogre', 'ogre'], 'left': 41}),\n  ('fault site copy limit #1',\n   [3, [['orc', 2, 0], ['wyrm', 2, 5]]],\n   {'picks': ['orc', 'orc', 'orc'], 'left': 19}),\n  ('partial repair boundary #1',\n   [4, [['rat', 5, 1], ['orc', 8, 0], ['imp', 5, 5]]],\n   {'picks': ['orc', 'orc', 'orc', 'rat'], 'left': 1}),\n  ('partial repair boundary #2',\n   [14, [['orc', 30, 1], ['bat', 15, 5], ['ogre', 5, 0], ['rat', 5, 5]]],\n   {'picks': ['orc', 'orc', 'orc', 'ogre', 'ogre'], 'left': 0}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [1, [['wyrm', 8, 10], ['ogre', 5, 1]]], {'picks': ['ogre', 'ogre', 'ogre'], 'left': 0})]]\nfor label, args, expected in cases[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"4cccf7470ed583ae9ba2c98fb9d41ba067ab20425936fd754d7f3a3a6125dddd","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(depth, roster):\n    budget = 10 + 5 * depth + depth // 5 * 10\n    counts = {}\n    picks = []\n    while True:\n        best = None\n        for name, cost, need in roster:\n            if need > depth or cost > budget or counts.get(name, 0) > 3:\n                continue\n            if best is None or cost > best[1] or (cost == best[1] and name < best[0]):\n                best = (name, cost)\n        if best is None:\n            break\n        picks.append(best[0])\n        counts[best[0]] = counts.get(best[0], 0) + 1\n        budget -= best[1]\n    return {'picks': picks, 'left': budget}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('milestone depth bonus #1', [5, [['orc', 5, 0]]], {'picks': ['orc', 'orc', 'orc'], 'left': 30}),\n  ('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [1, [['imp', 10, 1], ['bat', 10, 10], ['orc', 1, 0]]],\n   {'picks': ['imp', 'orc', 'orc', 'orc'], 'left': 2}),\n  ('fault site copy limit #1', [15, [['ogre', 5, 1]]], {'picks': ['ogre', 'ogre', 'ogre'], 'left': 100}),\n  ('partial repair boundary #1',\n   [10, [['imp', 2, 10], ['ogre', 5, 10], ['rat', 1, 3], ['bat', 2, 0], ['orc', 5, 3], ['wyrm', 24, 10]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'ogre', 'bat', 'rat'], 'left': 0}),\n  ('regression copy limit #2',\n   [4, [['rat', 5, 5], ['ogre', 5, 0], ['wyrm', 5, 1], ['imp', 5, 3]]],\n   {'picks': ['imp', 'imp', 'imp', 'ogre', 'ogre', 'ogre'], 'left': 0}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [1, [['orc', 5, 3], ['bat', 8, 1], ['wyrm', 8, 0]]], {'picks': ['bat'], 'left': 7})],\n [('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [1, [['imp', 10, 1], ['bat', 10, 10], ['orc', 1, 0]]],\n   {'picks': ['imp', 'orc', 'orc', 'orc'], 'left': 2}),\n  ('fault site copy limit #1', [15, [['ogre', 5, 1]]], {'picks': ['ogre', 'ogre', 'ogre'], 'left': 100}),\n  ('regression copy limit #2',\n   [4, [['rat', 5, 5], ['ogre', 5, 0], ['wyrm', 5, 1], ['imp', 5, 3]]],\n   {'picks': ['imp', 'imp', 'imp', 'ogre', 'ogre', 'ogre'], 'left': 0}),\n  ('regression copy limit #3',\n   [5, [['bat', 8, 1], ['orc', 15, 10], ['wyrm', 10, 1], ['ogre', 1, 3], ['rat', 1, 3], ['imp', 2, 0]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'bat', 'imp', 'imp', 'imp', 'ogre'], 'left': 0}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [4, [['orc', 10, 10], ['wyrm', 2, 5]]], {'picks': [], 'left': 30}),\n  ('control #2', [0, [['bat', 18, 0]]], {'picks': [], 'left': 10})],\n [('milestone depth bonus #1', [5, [['orc', 5, 0]]], {'picks': ['orc', 'orc', 'orc'], 'left': 30}),\n  ('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [4, [['rat', 5, 5], ['ogre', 5, 0], ['wyrm', 5, 1], ['imp', 5, 3]]],\n   {'picks': ['imp', 'imp', 'imp', 'ogre', 'ogre', 'ogre'], 'left': 0}),\n  ('fault site copy limit #1',\n   [5, [['orc', 10, 1], ['imp', 5, 10]]],\n   {'picks': ['orc', 'orc', 'orc'], 'left': 15}),\n  ('regression copy limit #2',\n   [5, [['bat', 8, 1], ['orc', 15, 10], ['wyrm', 10, 1], ['ogre', 1, 3], ['rat', 1, 3], ['imp', 2, 0]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'bat', 'imp', 'imp', 'imp', 'ogre'], 'left': 0}),\n  ('regression copy limit #3',\n   [9, [['rat', 7, 0], ['ogre', 1, 0]]],\n   {'picks': ['rat', 'rat', 'rat', 'ogre', 'ogre', 'ogre'], 'left': 41}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [4, [['orc', 10, 10], ['wyrm', 2, 5]]], {'picks': [], 'left': 30})],\n [('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('fault site copy limit #1',\n   [1, [['imp', 10, 3], ['orc', 2, 0], ['rat', 10, 10], ['wyrm', 15, 5], ['bat', 15, 3]]],\n   {'picks': ['orc', 'orc', 'orc'], 'left': 9}),\n  ('regression copy limit #1',\n   [5, [['bat', 8, 1], ['orc', 15, 10], ['wyrm', 10, 1], ['ogre', 1, 3], ['rat', 1, 3], ['imp', 2, 0]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'bat', 'imp', 'imp', 'imp', 'ogre'], 'left': 0}),\n  ('regression copy limit #2',\n   [10, [['imp', 15, 10], ['ogre', 5, 1], ['orc', 5, 5], ['rat', 5, 0], ['wyrm', 10, 1]]],\n   {'picks': ['imp', 'imp', 'imp', 'wyrm', 'wyrm', 'wyrm', 'ogre'], 'left': 0}),\n  ('partial repair boundary #1',\n   [9, [['bat', 26, 5], ['rat', 11, 10], ['ogre', 5, 0], ['imp', 5, 0]]],\n   {'picks': ['bat', 'bat', 'imp', 'imp'], 'left': 3}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1',\n   [0, [['imp', 10, 1], ['rat', 7, 10], ['orc', 5, 10], ['ogre', 1, 1], ['wyrm', 5, 5]]],\n   {'picks': [], 'left': 10}),\n  ('control #2', [9, [['ogre', 5, 10]]], {'picks': [], 'left': 65})],\n [('milestone depth bonus #1', [5, [['orc', 5, 0]]], {'picks': ['orc', 'orc', 'orc'], 'left': 30}),\n  ('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [9, [['rat', 7, 0], ['ogre', 1, 0]]],\n   {'picks': ['rat', 'rat', 'rat', 'ogre', 'ogre', 'ogre'], 'left': 41}),\n  ('fault site copy limit #1',\n   [3, [['orc', 2, 0], ['wyrm', 2, 5]]],\n   {'picks': ['orc', 'orc', 'orc'], 'left': 19}),\n  ('partial repair boundary #1',\n   [4, [['rat', 5, 1], ['orc', 8, 0], ['imp', 5, 5]]],\n   {'picks': ['orc', 'orc', 'orc', 'rat'], 'left': 1}),\n  ('partial repair boundary #2',\n   [14, [['orc', 30, 1], ['bat', 15, 5], ['ogre', 5, 0], ['rat', 5, 5]]],\n   {'picks': ['orc', 'orc', 'orc', 'ogre', 'ogre'], 'left': 0}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [1, [['wyrm', 8, 10], ['ogre', 5, 1]]], {'picks': ['ogre', 'ogre', 'ogre'], 'left': 0})]]\nfor label, args, expected in cases[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"8e7142180c0a290199caf5ca8030f8969d41c8ace24b778cae8f5a93a832bb3a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(depth, roster):\n    budget = 10 + 5 * depth + depth // 5 * 10\n    counts = {}\n    picks = []\n    while True:\n        best = None\n        for name, cost, need in roster:\n            if need > depth or cost > budget or counts.get(name, 0) >= 3:\n                continue\n            if best is None or cost > best[1] or (cost == best[1] and name < best[0]):\n                best = (name, cost)\n        if best is None:\n            break\n        picks.append(best[0])\n        counts[best[0]] = counts.get(best[0], 0) + 1\n        budget -= best[1]\n    return {'picks': picks, 'left': budget}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('milestone depth bonus #1', [5, [['orc', 5, 0]]], {'picks': ['orc', 'orc', 'orc'], 'left': 30}),\n  ('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [1, [['imp', 10, 1], ['bat', 10, 10], ['orc', 1, 0]]],\n   {'picks': ['imp', 'orc', 'orc', 'orc'], 'left': 2}),\n  ('fault site copy limit #1', [15, [['ogre', 5, 1]]], {'picks': ['ogre', 'ogre', 'ogre'], 'left': 100}),\n  ('partial repair boundary #1',\n   [10, [['imp', 2, 10], ['ogre', 5, 10], ['rat', 1, 3], ['bat', 2, 0], ['orc', 5, 3], ['wyrm', 24, 10]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'ogre', 'bat', 'rat'], 'left': 0}),\n  ('regression copy limit #2',\n   [4, [['rat', 5, 5], ['ogre', 5, 0], ['wyrm', 5, 1], ['imp', 5, 3]]],\n   {'picks': ['imp', 'imp', 'imp', 'ogre', 'ogre', 'ogre'], 'left': 0}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [1, [['orc', 5, 3], ['bat', 8, 1], ['wyrm', 8, 0]]], {'picks': ['bat'], 'left': 7})],\n [('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [1, [['imp', 10, 1], ['bat', 10, 10], ['orc', 1, 0]]],\n   {'picks': ['imp', 'orc', 'orc', 'orc'], 'left': 2}),\n  ('fault site copy limit #1', [15, [['ogre', 5, 1]]], {'picks': ['ogre', 'ogre', 'ogre'], 'left': 100}),\n  ('regression copy limit #2',\n   [4, [['rat', 5, 5], ['ogre', 5, 0], ['wyrm', 5, 1], ['imp', 5, 3]]],\n   {'picks': ['imp', 'imp', 'imp', 'ogre', 'ogre', 'ogre'], 'left': 0}),\n  ('regression copy limit #3',\n   [5, [['bat', 8, 1], ['orc', 15, 10], ['wyrm', 10, 1], ['ogre', 1, 3], ['rat', 1, 3], ['imp', 2, 0]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'bat', 'imp', 'imp', 'imp', 'ogre'], 'left': 0}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [4, [['orc', 10, 10], ['wyrm', 2, 5]]], {'picks': [], 'left': 30}),\n  ('control #2', [0, [['bat', 18, 0]]], {'picks': [], 'left': 10})],\n [('milestone depth bonus #1', [5, [['orc', 5, 0]]], {'picks': ['orc', 'orc', 'orc'], 'left': 30}),\n  ('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [4, [['rat', 5, 5], ['ogre', 5, 0], ['wyrm', 5, 1], ['imp', 5, 3]]],\n   {'picks': ['imp', 'imp', 'imp', 'ogre', 'ogre', 'ogre'], 'left': 0}),\n  ('fault site copy limit #1',\n   [5, [['orc', 10, 1], ['imp', 5, 10]]],\n   {'picks': ['orc', 'orc', 'orc'], 'left': 15}),\n  ('regression copy limit #2',\n   [5, [['bat', 8, 1], ['orc', 15, 10], ['wyrm', 10, 1], ['ogre', 1, 3], ['rat', 1, 3], ['imp', 2, 0]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'bat', 'imp', 'imp', 'imp', 'ogre'], 'left': 0}),\n  ('regression copy limit #3',\n   [9, [['rat', 7, 0], ['ogre', 1, 0]]],\n   {'picks': ['rat', 'rat', 'rat', 'ogre', 'ogre', 'ogre'], 'left': 41}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [4, [['orc', 10, 10], ['wyrm', 2, 5]]], {'picks': [], 'left': 30})],\n [('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('fault site copy limit #1',\n   [1, [['imp', 10, 3], ['orc', 2, 0], ['rat', 10, 10], ['wyrm', 15, 5], ['bat', 15, 3]]],\n   {'picks': ['orc', 'orc', 'orc'], 'left': 9}),\n  ('regression copy limit #1',\n   [5, [['bat', 8, 1], ['orc', 15, 10], ['wyrm', 10, 1], ['ogre', 1, 3], ['rat', 1, 3], ['imp', 2, 0]]],\n   {'picks': ['wyrm', 'wyrm', 'wyrm', 'bat', 'imp', 'imp', 'imp', 'ogre'], 'left': 0}),\n  ('regression copy limit #2',\n   [10, [['imp', 15, 10], ['ogre', 5, 1], ['orc', 5, 5], ['rat', 5, 0], ['wyrm', 10, 1]]],\n   {'picks': ['imp', 'imp', 'imp', 'wyrm', 'wyrm', 'wyrm', 'ogre'], 'left': 0}),\n  ('partial repair boundary #1',\n   [9, [['bat', 26, 5], ['rat', 11, 10], ['ogre', 5, 0], ['imp', 5, 0]]],\n   {'picks': ['bat', 'bat', 'imp', 'imp'], 'left': 3}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1',\n   [0, [['imp', 10, 1], ['rat', 7, 10], ['orc', 5, 10], ['ogre', 1, 1], ['wyrm', 5, 5]]],\n   {'picks': [], 'left': 10}),\n  ('control #2', [9, [['ogre', 5, 10]]], {'picks': [], 'left': 65})],\n [('milestone depth bonus #1', [5, [['orc', 5, 0]]], {'picks': ['orc', 'orc', 'orc'], 'left': 30}),\n  ('unlock at depth #1',\n   [3, [['ogre', 10, 3], ['rat', 1, 0]]],\n   {'picks': ['ogre', 'ogre', 'rat', 'rat', 'rat'], 'left': 2}),\n  ('regression copy limit #1',\n   [9, [['rat', 7, 0], ['ogre', 1, 0]]],\n   {'picks': ['rat', 'rat', 'rat', 'ogre', 'ogre', 'ogre'], 'left': 41}),\n  ('fault site copy limit #1',\n   [3, [['orc', 2, 0], ['wyrm', 2, 5]]],\n   {'picks': ['orc', 'orc', 'orc'], 'left': 19}),\n  ('partial repair boundary #1',\n   [4, [['rat', 5, 1], ['orc', 8, 0], ['imp', 5, 5]]],\n   {'picks': ['orc', 'orc', 'orc', 'rat'], 'left': 1}),\n  ('partial repair boundary #2',\n   [14, [['orc', 30, 1], ['bat', 15, 5], ['ogre', 5, 0], ['rat', 5, 5]]],\n   {'picks': ['orc', 'orc', 'orc', 'ogre', 'ogre'], 'left': 0}),\n  ('equal cost tie #1', [0, [['orc', 5, 0], ['imp', 5, 0]]], {'picks': ['imp', 'imp'], 'left': 0}),\n  ('control #1', [1, [['wyrm', 8, 10], ['ogre', 5, 1]]], {'picks': ['ogre', 'ogre', 'ogre'], 'left': 0})]]\nfor label, args, expected in cases[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-procedural-level-generation-constraints-difficulty-budget-copy-limit","generated_at":"2026-09-29T14:50:50.768271+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Procedural generators silently emit unplayable or unfair levels when a single constraint check uses the wrong boundary, axis, neighborhood or update order; the defect is visible in exact generated geometry.","repair":"Restore `counts.get(name, 0) >= 3` at the copy limit step.","root_cause":"The per-type cap is strict.","sha256":"b426e8d5b9dc393b208272b1f93e505430bdda2801f45814ed29d35987e73310","title":"Encounter difficulty budget: Four copies of one enemy · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.244,"exit_code":1,"observations":[{"actual":{"left":30,"picks":["orc","orc","orc"]},"check":"milestone depth bonus #1","expected":{"left":30,"picks":["orc","orc","orc"]},"passed":true},{"actual":{"left":4,"picks":["ogre","ogre","rat"]},"check":"unlock at depth #1","expected":{"left":2,"picks":["ogre","ogre","rat","rat","rat"]},"passed":false},{"actual":{"left":3,"picks":["imp","orc","orc"]},"check":"regression copy limit #1","expected":{"left":2,"picks":["imp","orc","orc","orc"]},"passed":false},{"actual":{"left":100,"picks":["ogre","ogre","ogre"]},"check":"fault site copy limit #1","expected":{"left":100,"picks":["ogre","ogre","ogre"]},"passed":true},{"actual":{"left":8,"picks":["wyrm","wyrm","wyrm"]},"check":"partial repair boundary #1","expected":{"left":0,"picks":["wyrm","wyrm","wyrm","ogre","bat","rat"]},"passed":false},{"actual":{"left":15,"picks":["imp","imp","imp"]},"check":"regression copy limit #2","expected":{"left":0,"picks":["imp","imp","imp","ogre","ogre","ogre"]},"passed":false},{"actual":{"left":0,"picks":["imp","imp"]},"check":"equal cost tie #1","expected":{"left":0,"picks":["imp","imp"]},"passed":true},{"actual":{"left":7,"picks":["bat"]},"check":"control #1","expected":{"left":7,"picks":["bat"]},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"milestone depth bonus #1\", \"actual\": {\"picks\": [\"orc\", \"orc\", \"orc\"], \"left\": 30}, \"expected\": {\"picks\": [\"orc\", \"orc\", \"orc\"], \"left\": 30}, \"passed\": true}, {\"check\": \"unlock at depth #1\", \"actual\": {\"picks\": [\"ogre\", \"ogre\", \"rat\"], \"left\": 4}, \"expected\": {\"picks\": [\"ogre\", \"ogre\", \"rat\", \"rat\", \"rat\"], \"left\": 2}, \"passed\": false}, {\"check\": \"regression copy limit #1\", \"actual\": {\"picks\": [\"imp\", \"orc\", \"orc\"], \"left\": 3}, \"expected\": {\"picks\": [\"imp\", \"orc\", \"orc\", \"orc\"], \"left\": 2}, \"passed\": false}, {\"check\": \"fault site copy limit #1\", \"actual\": {\"picks\": [\"ogre\", \"ogre\", \"ogre\"], \"left\": 100}, \"expected\": {\"picks\": [\"ogre\", \"ogre\", \"ogre\"], \"left\": 100}, \"passed\": true}, {\"check\": \"partial repair boundary #1\", \"actual\": {\"picks\": [\"wyrm\", \"wyrm\", \"wyrm\"], \"left\": 8}, \"expected\": {\"picks\": [\"wyrm\", \"wyrm\", \"wyrm\", \"ogre\", \"bat\", \"rat\"], \"left\": 0}, \"passed\": false}, {\"check\": \"regression copy limit #2\", \"actual\": {\"picks\": [\"imp\", \"imp\", \"imp\"], \"left\": 15}, \"expected\": {\"picks\": [\"imp\", \"imp\", \"imp\", \"ogre\", \"ogre\", \"ogre\"], \"left\": 0}, \"passed\": false}, {\"check\": \"equal cost tie #1\", \"actual\": {\"picks\": [\"imp\", \"imp\"], \"left\": 0}, \"expected\": {\"picks\": [\"imp\", \"imp\"], \"left\": 0}, \"passed\": true}, {\"check\": \"control #1\", \"actual\": {\"picks\": [\"bat\"], \"left\": 7}, \"expected\": {\"picks\": [\"bat\"], \"left\": 7}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.732,"exit_code":1,"observations":[{"actual":{"left":25,"picks":["orc","orc","orc","orc"]},"check":"milestone depth bonus #1","expected":{"left":30,"picks":["orc","orc","orc"]},"passed":false},{"actual":{"left":1,"picks":["ogre","ogre","rat","rat","rat","rat"]},"check":"unlock at depth #1","expected":{"left":2,"picks":["ogre","ogre","rat","rat","rat"]},"passed":false},{"actual":{"left":1,"picks":["imp","orc","orc","orc","orc"]},"check":"regression copy limit #1","expected":{"left":2,"picks":["imp","orc","orc","orc"]},"passed":false},{"actual":{"left":95,"picks":["ogre","ogre","ogre","ogre"]},"check":"fault site copy limit #1","expected":{"left":100,"picks":["ogre","ogre","ogre"]},"passed":false},{"actual":{"left":0,"picks":["wyrm","wyrm","wyrm","ogre","bat","rat"]},"check":"partial repair boundary #1","expected":{"left":0,"picks":["wyrm","wyrm","wyrm","ogre","bat","rat"]},"passed":true},{"actual":{"left":0,"picks":["imp","imp","imp","imp","ogre","ogre"]},"check":"regression copy limit #2","expected":{"left":0,"picks":["imp","imp","imp","ogre","ogre","ogre"]},"passed":false},{"actual":{"left":0,"picks":["imp","imp"]},"check":"equal cost tie #1","expected":{"left":0,"picks":["imp","imp"]},"passed":true},{"actual":{"left":7,"picks":["bat"]},"check":"control #1","expected":{"left":7,"picks":["bat"]},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"milestone depth bonus #1\", \"actual\": {\"picks\": [\"orc\", \"orc\", \"orc\", \"orc\"], \"left\": 25}, \"expected\": {\"picks\": [\"orc\", \"orc\", \"orc\"], \"left\": 30}, \"passed\": false}, {\"check\": \"unlock at depth #1\", \"actual\": {\"picks\": [\"ogre\", \"ogre\", \"rat\", \"rat\", \"rat\", \"rat\"], \"left\": 1}, \"expected\": {\"picks\": [\"ogre\", \"ogre\", \"rat\", \"rat\", \"rat\"], \"left\": 2}, \"passed\": false}, {\"check\": \"regression copy limit #1\", \"actual\": {\"picks\": [\"imp\", \"orc\", \"orc\", \"orc\", \"orc\"], \"left\": 1}, \"expected\": {\"picks\": [\"imp\", \"orc\", \"orc\", \"orc\"], \"left\": 2}, \"passed\": false}, {\"check\": \"fault site copy limit #1\", \"actual\": {\"picks\": [\"ogre\", \"ogre\", \"ogre\", \"ogre\"], \"left\": 95}, \"expected\": {\"picks\": [\"ogre\", \"ogre\", \"ogre\"], \"left\": 100}, \"passed\": false}, {\"check\": \"partial repair boundary #1\", \"actual\": {\"picks\": [\"wyrm\", \"wyrm\", \"wyrm\", \"ogre\", \"bat\", \"rat\"], \"left\": 0}, \"expected\": {\"picks\": [\"wyrm\", \"wyrm\", \"wyrm\", \"ogre\", \"bat\", \"rat\"], \"left\": 0}, \"passed\": true}, {\"check\": \"regression copy limit #2\", \"actual\": {\"picks\": [\"imp\", \"imp\", \"imp\", \"imp\", \"ogre\", \"ogre\"], \"left\": 0}, \"expected\": {\"picks\": [\"imp\", \"imp\", \"imp\", \"ogre\", \"ogre\", \"ogre\"], \"left\": 0}, \"passed\": false}, {\"check\": \"equal cost tie #1\", \"actual\": {\"picks\": [\"imp\", \"imp\"], \"left\": 0}, \"expected\": {\"picks\": [\"imp\", \"imp\"], \"left\": 0}, \"passed\": true}, {\"check\": \"control #1\", \"actual\": {\"picks\": [\"bat\"], \"left\": 7}, \"expected\": {\"picks\": [\"bat\"], \"left\": 7}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.853,"exit_code":0,"observations":[{"actual":{"left":30,"picks":["orc","orc","orc"]},"check":"milestone depth bonus #1","expected":{"left":30,"picks":["orc","orc","orc"]},"passed":true},{"actual":{"left":2,"picks":["ogre","ogre","rat","rat","rat"]},"check":"unlock at depth #1","expected":{"left":2,"picks":["ogre","ogre","rat","rat","rat"]},"passed":true},{"actual":{"left":2,"picks":["imp","orc","orc","orc"]},"check":"regression copy limit #1","expected":{"left":2,"picks":["imp","orc","orc","orc"]},"passed":true},{"actual":{"left":100,"picks":["ogre","ogre","ogre"]},"check":"fault site copy limit #1","expected":{"left":100,"picks":["ogre","ogre","ogre"]},"passed":true},{"actual":{"left":0,"picks":["wyrm","wyrm","wyrm","ogre","bat","rat"]},"check":"partial repair boundary #1","expected":{"left":0,"picks":["wyrm","wyrm","wyrm","ogre","bat","rat"]},"passed":true},{"actual":{"left":0,"picks":["imp","imp","imp","ogre","ogre","ogre"]},"check":"regression copy limit #2","expected":{"left":0,"picks":["imp","imp","imp","ogre","ogre","ogre"]},"passed":true},{"actual":{"left":0,"picks":["imp","imp"]},"check":"equal cost tie #1","expected":{"left":0,"picks":["imp","imp"]},"passed":true},{"actual":{"left":7,"picks":["bat"]},"check":"control #1","expected":{"left":7,"picks":["bat"]},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"milestone depth bonus #1\", \"actual\": {\"picks\": [\"orc\", \"orc\", \"orc\"], \"left\": 30}, \"expected\": {\"picks\": [\"orc\", \"orc\", \"orc\"], \"left\": 30}, \"passed\": true}, {\"check\": \"unlock at depth #1\", \"actual\": {\"picks\": [\"ogre\", \"ogre\", \"rat\", \"rat\", \"rat\"], \"left\": 2}, \"expected\": {\"picks\": [\"ogre\", \"ogre\", \"rat\", \"rat\", \"rat\"], \"left\": 2}, \"passed\": true}, {\"check\": \"regression copy limit #1\", \"actual\": {\"picks\": [\"imp\", \"orc\", \"orc\", \"orc\"], \"left\": 2}, \"expected\": {\"picks\": [\"imp\", \"orc\", \"orc\", \"orc\"], \"left\": 2}, \"passed\": true}, {\"check\": \"fault site copy limit #1\", \"actual\": {\"picks\": [\"ogre\", \"ogre\", \"ogre\"], \"left\": 100}, \"expected\": {\"picks\": [\"ogre\", \"ogre\", \"ogre\"], \"left\": 100}, \"passed\": true}, {\"check\": \"partial repair boundary #1\", \"actual\": {\"picks\": [\"wyrm\", \"wyrm\", \"wyrm\", \"ogre\", \"bat\", \"rat\"], \"left\": 0}, \"expected\": {\"picks\": [\"wyrm\", \"wyrm\", \"wyrm\", \"ogre\", \"bat\", \"rat\"], \"left\": 0}, \"passed\": true}, {\"check\": \"regression copy limit #2\", \"actual\": {\"picks\": [\"imp\", \"imp\", \"imp\", \"ogre\", \"ogre\", \"ogre\"], \"left\": 0}, \"expected\": {\"picks\": [\"imp\", \"imp\", \"imp\", \"ogre\", \"ogre\", \"ogre\"], \"left\": 0}, \"passed\": true}, {\"check\": \"equal cost tie #1\", \"actual\": {\"picks\": [\"imp\", \"imp\"], \"left\": 0}, \"expected\": {\"picks\": [\"imp\", \"imp\"], \"left\": 0}, \"passed\": true}, {\"check\": \"control #1\", \"actual\": {\"picks\": [\"bat\"], \"left\": 7}, \"expected\": {\"picks\": [\"bat\"], \"left\": 7}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}