{"abstract":"Quotas above one are ignored.","category":"Procedural level generation constraints","checks":8,"contract":"Candidates [x, y] (grid[y][x]) are tried in order. Accept when in bounds on '.', its quadrant (x*2//w, y*2//h) holds fewer than per_quadrant accepted props, and its squared Euclidean distance to every accepted prop is at least radius*radius. Returns accepted [x, y].","evaluation_group":"w2-procedural-level-generation-constraints-scatter-quota","failed_approach":"Storing the global count mixes quadrants.","family":"w2-procedural-level-generation-constraints-scatter-quota-quota-increment","id":"FA-86696","implementations":{"attempt":{"sha256":"9f4e6522ab23abb5d5e2c868e2f1ec2a98326bee82373bf43d0e78ae91d5e75d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(grid, candidates, radius, per_quadrant):\n    h = len(grid)\n    w = len(grid[0])\n    placed = []\n    quota = {}\n    for x, y in candidates:\n        if not (0 <= y < h and 0 <= x < w) or grid[y][x] != '.':\n            continue\n        q = (x * 2 // w, y * 2 // h)\n        if quota.get(q, 0) >= per_quadrant:\n            continue\n        if any((x - px) ** 2 + (y - py) ** 2 < radius * radius for px, py in placed):\n            continue\n        placed.append([x, y])\n        quota[q] = len(placed)\n    return placed\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('fault site quota increment #1',\n   [['.....#..', '..#..~~.', '~.~...~.', '.~~..~.#', '.~~.~~..'],\n    [[1, 1], [0, 1], [0, 0], [4, 2], [2, 4]],\n    1,\n    2],\n   [[1, 1], [0, 1], [4, 2]]),\n  ('fault site quota increment #2',\n   [['......#', '#...#..'], [[2, 1], [3, 1], [7, 2], [6, 2], [7, 1], [1, 1], [5, 0], [3, 1]], 1, 2],\n   [[2, 1], [3, 1], [5, 0]]),\n  ('partial repair boundary #1',\n   [['......~.', '#..~.#.#', '~#..~..#', '..~...~#', '~.......', '....#~..'],\n    [[0, 2], [7, 4], [6, 2], [5, 1], [4, 1], [5, 0], [6, 5], [7, 1], [2, 5], [4, 5], [2, 6]],\n    1,\n    3],\n   [[7, 4], [6, 2], [4, 1], [5, 0], [6, 5], [2, 5]]),\n  ('partial repair boundary #2',\n   [['.~~...'], [[2, 0], [0, 0], [4, 0], [4, 0], [3, 1], [6, 1], [5, 0], [3, 1]], 1, 2],\n   [[0, 0], [4, 0], [5, 0]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('control #1',\n   [['~~..#', '.....', '....#'], [[3, 1], [1, 2], [5, 2], [2, 3], [0, 3], [3, 0], [1, 1], [0, 1]], 1, 1],\n   [[3, 1], [1, 2], [1, 1]])],\n [('regression quota increment #1',\n   [['...~.#..', '~#.###~.', '.#.#..~#', '...#.#~.', '~.~.~..#', '.#...#.#', '#..~#...'],\n    [[4, 2], [6, 0], [7, 3], [5, 4], [7, 6], [5, 6], [7, 4], [0, 2], [4, 0], [5, 2], [1, 2]],\n    2,\n    2],\n   [[4, 2], [6, 0], [5, 4], [7, 6], [0, 2]]),\n  ('regression quota increment #2',\n   [['~#...##', '...##..', '~..~~..', '#.#.~..', '..#...#', '~#.~~~.'],\n    [[0, 0], [1, 3], [3, 0], [7, 1], [6, 3], [5, 2], [2, 0], [2, 6], [1, 1], [7, 1], [1, 2], [7, 4]],\n    1,\n    2],\n   [[1, 3], [3, 0], [6, 3], [5, 2], [2, 0]]),\n  ('partial repair boundary #1',\n   [['#..~.##', '..~.#..', '#.~#..~'],\n    [[3, 1], [7, 1], [4, 1], [0, 3], [6, 0], [5, 2], [5, 3], [6, 3], [1, 0], [6, 1], [2, 0], [6, 1]],\n    1,\n    3],\n   [[3, 1], [5, 2], [1, 0], [6, 1], [2, 0]]),\n  ('partial repair boundary #2',\n   [['~..#.#', '~.#~..', '......', '.~.#.#', '..~...', '....#.', '..~~.#'],\n    [[1, 5], [0, 0], [0, 4], [1, 3], [1, 0], [5, 1], [2, 6], [3, 0], [1, 1], [5, 1]],\n    1,\n    3],\n   [[1, 5], [0, 4], [1, 0], [5, 1], [1, 1]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('control #1',\n   [['~~..#', '.....', '....#'], [[3, 1], [1, 2], [5, 2], [2, 3], [0, 3], [3, 0], [1, 1], [0, 1]], 1, 1],\n   [[3, 1], [1, 2], [1, 1]]),\n  ('control #2',\n   [['~..~.', '.#...', '~..#.', '..~#.'], [[1, 2], [4, 3], [1, 2], [4, 3], [1, 1]], 2, 3],\n   [[1, 2], [4, 3]])],\n [('fault site quota increment #1',\n   [['.....#..', '..#..~~.', '~.~...~.', '.~~..~.#', '.~~.~~..'],\n    [[1, 1], [0, 1], [0, 0], [4, 2], [2, 4]],\n    1,\n    2],\n   [[1, 1], [0, 1], [4, 2]]),\n  ('fault site quota increment #2',\n   [['......#', '#...#..'], [[2, 1], [3, 1], [7, 2], [6, 2], [7, 1], [1, 1], [5, 0], [3, 1]], 1, 2],\n   [[2, 1], [3, 1], [5, 0]]),\n  ('partial repair boundary #1',\n   [['.~....', '...~..'], [[0, 0], [5, 1], [6, 0], [4, 1], [0, 1], [3, 2], [1, 0]], 1, 2],\n   [[0, 0], [5, 1], [4, 1], [0, 1]]),\n  ('partial repair boundary #2',\n   [['#.~', '.~#', '.~.', '...', '#..', '..~'],\n    [[3, 5], [2, 2], [2, 6], [0, 2], [3, 1], [1, 2], [2, 2], [1, 0], [2, 1]],\n    2,\n    2],\n   [[2, 2], [0, 2], [1, 0]]),\n  ('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('control #1',\n   [['~..~.', '.#...', '~..#.', '..~#.'], [[1, 2], [4, 3], [1, 2], [4, 3], [1, 1]], 2, 3],\n   [[1, 2], [4, 3]]),\n  ('control #2', [['#..', '..#'], [[1, 1]], 1, 1], [[1, 1]])],\n [('regression quota increment #1',\n   [['...~.#..', '~#.###~.', '.#.#..~#', '...#.#~.', '~.~.~..#', '.#...#.#', '#..~#...'],\n    [[4, 2], [6, 0], [7, 3], [5, 4], [7, 6], [5, 6], [7, 4], [0, 2], [4, 0], [5, 2], [1, 2]],\n    2,\n    2],\n   [[4, 2], [6, 0], [5, 4], [7, 6], [0, 2]]),\n  ('regression quota increment #2',\n   [['~#...##', '...##..', '~..~~..', '#.#.~..', '..#...#', '~#.~~~.'],\n    [[0, 0], [1, 3], [3, 0], [7, 1], [6, 3], [5, 2], [2, 0], [2, 6], [1, 1], [7, 1], [1, 2], [7, 4]],\n    1,\n    2],\n   [[1, 3], [3, 0], [6, 3], [5, 2], [2, 0]]),\n  ('partial repair boundary #1',\n   [['......#', '~~..#~.', '.~.~~..', '#......', '..~..~#'],\n    [[5, 3], [1, 2], [0, 3], [4, 0], [1, 4], [4, 3], [0, 3], [3, 4], [1, 3], [7, 5]],\n    1,\n    3],\n   [[5, 3], [4, 0], [1, 4], [4, 3], [3, 4], [1, 3]]),\n  ('partial repair boundary #2',\n   [['~.#...', '......', '.~#~~#', '..~..~', '~#~#~#', '.~~...', '......'],\n    [[4, 0], [3, 1], [1, 1], [1, 3], [3, 1], [5, 2], [3, 4]],\n    1,\n    2],\n   [[4, 0], [3, 1], [1, 1], [1, 3]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),\n  ('control #1',\n   [['..', '~.'],\n    [[2, 1], [1, 2], [2, 0], [2, 0], [0, 1], [2, 1], [0, 0], [2, 2], [0, 0], [1, 1], [2, 0]],\n    3,\n    2],\n   [[0, 0]]),\n  ('control #2', [['.'], [[0, 0], [0, 0], [1, 0], [1, 1]], 1, 2], [[0, 0]])],\n [('fault site quota increment #1',\n   [['.....#..', '..#..~~.', '~.~...~.', '.~~..~.#', '.~~.~~..'],\n    [[1, 1], [0, 1], [0, 0], [4, 2], [2, 4]],\n    1,\n    2],\n   [[1, 1], [0, 1], [4, 2]]),\n  ('fault site quota increment #2',\n   [['......#', '#...#..'], [[2, 1], [3, 1], [7, 2], [6, 2], [7, 1], [1, 1], [5, 0], [3, 1]], 1, 2],\n   [[2, 1], [3, 1], [5, 0]]),\n  ('partial repair boundary #1',\n   [['.#..#..', '.#.~...', '.###..~', '~#..#.#', '.......', '...##~.'],\n    [[2, 4], [6, 3], [0, 2], [6, 0], [2, 1], [4, 3], [4, 4], [0, 0], [4, 3], [0, 3]],\n    1,\n    3],\n   [[2, 4], [0, 2], [6, 0], [2, 1], [4, 4], [0, 0]]),\n  ('partial repair boundary #2',\n   [['~~.....', '..#...~', '....#..', '.~.....', '#...~~~', '....~..'],\n    [[1, 1], [3, 5], [5, 5], [5, 4], [4, 4], [1, 0], [0, 0], [1, 4], [3, 1], [4, 1], [6, 0], [3, 4]],\n    2,\n    2],\n   [[1, 1], [3, 5], [5, 5], [1, 4], [3, 1], [6, 0]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('control #1', [['....', '..#.'], [[0, 1], [3, 0], [1, 0]], 3, 2], [[0, 1], [3, 0]]),\n  ('control #2',\n   [['..', '.#', '..', '~~', '..', '..', '..'],\n    [[1, 6], [1, 1], [0, 7], [0, 0], [2, 1], [2, 5], [2, 0], [0, 4], [1, 1], [0, 0], [0, 3], [2, 6]],\n    3,\n    3],\n   [[1, 6], [0, 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":"3feec1047667f53ef915654e171d605f89d133d7fe25446b6578731bb6d05160","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(grid, candidates, radius, per_quadrant):\n    h = len(grid)\n    w = len(grid[0])\n    placed = []\n    quota = {}\n    for x, y in candidates:\n        if not (0 <= y < h and 0 <= x < w) or grid[y][x] != '.':\n            continue\n        q = (x * 2 // w, y * 2 // h)\n        if quota.get(q, 0) >= per_quadrant:\n            continue\n        if any((x - px) ** 2 + (y - py) ** 2 < radius * radius for px, py in placed):\n            continue\n        placed.append([x, y])\n        quota[q] = 1\n    return placed\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('fault site quota increment #1',\n   [['.....#..', '..#..~~.', '~.~...~.', '.~~..~.#', '.~~.~~..'],\n    [[1, 1], [0, 1], [0, 0], [4, 2], [2, 4]],\n    1,\n    2],\n   [[1, 1], [0, 1], [4, 2]]),\n  ('fault site quota increment #2',\n   [['......#', '#...#..'], [[2, 1], [3, 1], [7, 2], [6, 2], [7, 1], [1, 1], [5, 0], [3, 1]], 1, 2],\n   [[2, 1], [3, 1], [5, 0]]),\n  ('partial repair boundary #1',\n   [['......~.', '#..~.#.#', '~#..~..#', '..~...~#', '~.......', '....#~..'],\n    [[0, 2], [7, 4], [6, 2], [5, 1], [4, 1], [5, 0], [6, 5], [7, 1], [2, 5], [4, 5], [2, 6]],\n    1,\n    3],\n   [[7, 4], [6, 2], [4, 1], [5, 0], [6, 5], [2, 5]]),\n  ('partial repair boundary #2',\n   [['.~~...'], [[2, 0], [0, 0], [4, 0], [4, 0], [3, 1], [6, 1], [5, 0], [3, 1]], 1, 2],\n   [[0, 0], [4, 0], [5, 0]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('control #1',\n   [['~~..#', '.....', '....#'], [[3, 1], [1, 2], [5, 2], [2, 3], [0, 3], [3, 0], [1, 1], [0, 1]], 1, 1],\n   [[3, 1], [1, 2], [1, 1]])],\n [('regression quota increment #1',\n   [['...~.#..', '~#.###~.', '.#.#..~#', '...#.#~.', '~.~.~..#', '.#...#.#', '#..~#...'],\n    [[4, 2], [6, 0], [7, 3], [5, 4], [7, 6], [5, 6], [7, 4], [0, 2], [4, 0], [5, 2], [1, 2]],\n    2,\n    2],\n   [[4, 2], [6, 0], [5, 4], [7, 6], [0, 2]]),\n  ('regression quota increment #2',\n   [['~#...##', '...##..', '~..~~..', '#.#.~..', '..#...#', '~#.~~~.'],\n    [[0, 0], [1, 3], [3, 0], [7, 1], [6, 3], [5, 2], [2, 0], [2, 6], [1, 1], [7, 1], [1, 2], [7, 4]],\n    1,\n    2],\n   [[1, 3], [3, 0], [6, 3], [5, 2], [2, 0]]),\n  ('partial repair boundary #1',\n   [['#..~.##', '..~.#..', '#.~#..~'],\n    [[3, 1], [7, 1], [4, 1], [0, 3], [6, 0], [5, 2], [5, 3], [6, 3], [1, 0], [6, 1], [2, 0], [6, 1]],\n    1,\n    3],\n   [[3, 1], [5, 2], [1, 0], [6, 1], [2, 0]]),\n  ('partial repair boundary #2',\n   [['~..#.#', '~.#~..', '......', '.~.#.#', '..~...', '....#.', '..~~.#'],\n    [[1, 5], [0, 0], [0, 4], [1, 3], [1, 0], [5, 1], [2, 6], [3, 0], [1, 1], [5, 1]],\n    1,\n    3],\n   [[1, 5], [0, 4], [1, 0], [5, 1], [1, 1]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('control #1',\n   [['~~..#', '.....', '....#'], [[3, 1], [1, 2], [5, 2], [2, 3], [0, 3], [3, 0], [1, 1], [0, 1]], 1, 1],\n   [[3, 1], [1, 2], [1, 1]]),\n  ('control #2',\n   [['~..~.', '.#...', '~..#.', '..~#.'], [[1, 2], [4, 3], [1, 2], [4, 3], [1, 1]], 2, 3],\n   [[1, 2], [4, 3]])],\n [('fault site quota increment #1',\n   [['.....#..', '..#..~~.', '~.~...~.', '.~~..~.#', '.~~.~~..'],\n    [[1, 1], [0, 1], [0, 0], [4, 2], [2, 4]],\n    1,\n    2],\n   [[1, 1], [0, 1], [4, 2]]),\n  ('fault site quota increment #2',\n   [['......#', '#...#..'], [[2, 1], [3, 1], [7, 2], [6, 2], [7, 1], [1, 1], [5, 0], [3, 1]], 1, 2],\n   [[2, 1], [3, 1], [5, 0]]),\n  ('partial repair boundary #1',\n   [['.~....', '...~..'], [[0, 0], [5, 1], [6, 0], [4, 1], [0, 1], [3, 2], [1, 0]], 1, 2],\n   [[0, 0], [5, 1], [4, 1], [0, 1]]),\n  ('partial repair boundary #2',\n   [['#.~', '.~#', '.~.', '...', '#..', '..~'],\n    [[3, 5], [2, 2], [2, 6], [0, 2], [3, 1], [1, 2], [2, 2], [1, 0], [2, 1]],\n    2,\n    2],\n   [[2, 2], [0, 2], [1, 0]]),\n  ('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('control #1',\n   [['~..~.', '.#...', '~..#.', '..~#.'], [[1, 2], [4, 3], [1, 2], [4, 3], [1, 1]], 2, 3],\n   [[1, 2], [4, 3]]),\n  ('control #2', [['#..', '..#'], [[1, 1]], 1, 1], [[1, 1]])],\n [('regression quota increment #1',\n   [['...~.#..', '~#.###~.', '.#.#..~#', '...#.#~.', '~.~.~..#', '.#...#.#', '#..~#...'],\n    [[4, 2], [6, 0], [7, 3], [5, 4], [7, 6], [5, 6], [7, 4], [0, 2], [4, 0], [5, 2], [1, 2]],\n    2,\n    2],\n   [[4, 2], [6, 0], [5, 4], [7, 6], [0, 2]]),\n  ('regression quota increment #2',\n   [['~#...##', '...##..', '~..~~..', '#.#.~..', '..#...#', '~#.~~~.'],\n    [[0, 0], [1, 3], [3, 0], [7, 1], [6, 3], [5, 2], [2, 0], [2, 6], [1, 1], [7, 1], [1, 2], [7, 4]],\n    1,\n    2],\n   [[1, 3], [3, 0], [6, 3], [5, 2], [2, 0]]),\n  ('partial repair boundary #1',\n   [['......#', '~~..#~.', '.~.~~..', '#......', '..~..~#'],\n    [[5, 3], [1, 2], [0, 3], [4, 0], [1, 4], [4, 3], [0, 3], [3, 4], [1, 3], [7, 5]],\n    1,\n    3],\n   [[5, 3], [4, 0], [1, 4], [4, 3], [3, 4], [1, 3]]),\n  ('partial repair boundary #2',\n   [['~.#...', '......', '.~#~~#', '..~..~', '~#~#~#', '.~~...', '......'],\n    [[4, 0], [3, 1], [1, 1], [1, 3], [3, 1], [5, 2], [3, 4]],\n    1,\n    2],\n   [[4, 0], [3, 1], [1, 1], [1, 3]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),\n  ('control #1',\n   [['..', '~.'],\n    [[2, 1], [1, 2], [2, 0], [2, 0], [0, 1], [2, 1], [0, 0], [2, 2], [0, 0], [1, 1], [2, 0]],\n    3,\n    2],\n   [[0, 0]]),\n  ('control #2', [['.'], [[0, 0], [0, 0], [1, 0], [1, 1]], 1, 2], [[0, 0]])],\n [('fault site quota increment #1',\n   [['.....#..', '..#..~~.', '~.~...~.', '.~~..~.#', '.~~.~~..'],\n    [[1, 1], [0, 1], [0, 0], [4, 2], [2, 4]],\n    1,\n    2],\n   [[1, 1], [0, 1], [4, 2]]),\n  ('fault site quota increment #2',\n   [['......#', '#...#..'], [[2, 1], [3, 1], [7, 2], [6, 2], [7, 1], [1, 1], [5, 0], [3, 1]], 1, 2],\n   [[2, 1], [3, 1], [5, 0]]),\n  ('partial repair boundary #1',\n   [['.#..#..', '.#.~...', '.###..~', '~#..#.#', '.......', '...##~.'],\n    [[2, 4], [6, 3], [0, 2], [6, 0], [2, 1], [4, 3], [4, 4], [0, 0], [4, 3], [0, 3]],\n    1,\n    3],\n   [[2, 4], [0, 2], [6, 0], [2, 1], [4, 4], [0, 0]]),\n  ('partial repair boundary #2',\n   [['~~.....', '..#...~', '....#..', '.~.....', '#...~~~', '....~..'],\n    [[1, 1], [3, 5], [5, 5], [5, 4], [4, 4], [1, 0], [0, 0], [1, 4], [3, 1], [4, 1], [6, 0], [3, 4]],\n    2,\n    2],\n   [[1, 1], [3, 5], [5, 5], [1, 4], [3, 1], [6, 0]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('control #1', [['....', '..#.'], [[0, 1], [3, 0], [1, 0]], 3, 2], [[0, 1], [3, 0]]),\n  ('control #2',\n   [['..', '.#', '..', '~~', '..', '..', '..'],\n    [[1, 6], [1, 1], [0, 7], [0, 0], [2, 1], [2, 5], [2, 0], [0, 4], [1, 1], [0, 0], [0, 3], [2, 6]],\n    3,\n    3],\n   [[1, 6], [0, 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":"6d1fe659f31e111cd658b0493e4065fd1ac9e58c75fa14ddfc8b465c0614965d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(grid, candidates, radius, per_quadrant):\n    h = len(grid)\n    w = len(grid[0])\n    placed = []\n    quota = {}\n    for x, y in candidates:\n        if not (0 <= y < h and 0 <= x < w) or grid[y][x] != '.':\n            continue\n        q = (x * 2 // w, y * 2 // h)\n        if quota.get(q, 0) >= per_quadrant:\n            continue\n        if any((x - px) ** 2 + (y - py) ** 2 < radius * radius for px, py in placed):\n            continue\n        placed.append([x, y])\n        quota[q] = quota.get(q, 0) + 1\n    return placed\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('fault site quota increment #1',\n   [['.....#..', '..#..~~.', '~.~...~.', '.~~..~.#', '.~~.~~..'],\n    [[1, 1], [0, 1], [0, 0], [4, 2], [2, 4]],\n    1,\n    2],\n   [[1, 1], [0, 1], [4, 2]]),\n  ('fault site quota increment #2',\n   [['......#', '#...#..'], [[2, 1], [3, 1], [7, 2], [6, 2], [7, 1], [1, 1], [5, 0], [3, 1]], 1, 2],\n   [[2, 1], [3, 1], [5, 0]]),\n  ('partial repair boundary #1',\n   [['......~.', '#..~.#.#', '~#..~..#', '..~...~#', '~.......', '....#~..'],\n    [[0, 2], [7, 4], [6, 2], [5, 1], [4, 1], [5, 0], [6, 5], [7, 1], [2, 5], [4, 5], [2, 6]],\n    1,\n    3],\n   [[7, 4], [6, 2], [4, 1], [5, 0], [6, 5], [2, 5]]),\n  ('partial repair boundary #2',\n   [['.~~...'], [[2, 0], [0, 0], [4, 0], [4, 0], [3, 1], [6, 1], [5, 0], [3, 1]], 1, 2],\n   [[0, 0], [4, 0], [5, 0]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('control #1',\n   [['~~..#', '.....', '....#'], [[3, 1], [1, 2], [5, 2], [2, 3], [0, 3], [3, 0], [1, 1], [0, 1]], 1, 1],\n   [[3, 1], [1, 2], [1, 1]])],\n [('regression quota increment #1',\n   [['...~.#..', '~#.###~.', '.#.#..~#', '...#.#~.', '~.~.~..#', '.#...#.#', '#..~#...'],\n    [[4, 2], [6, 0], [7, 3], [5, 4], [7, 6], [5, 6], [7, 4], [0, 2], [4, 0], [5, 2], [1, 2]],\n    2,\n    2],\n   [[4, 2], [6, 0], [5, 4], [7, 6], [0, 2]]),\n  ('regression quota increment #2',\n   [['~#...##', '...##..', '~..~~..', '#.#.~..', '..#...#', '~#.~~~.'],\n    [[0, 0], [1, 3], [3, 0], [7, 1], [6, 3], [5, 2], [2, 0], [2, 6], [1, 1], [7, 1], [1, 2], [7, 4]],\n    1,\n    2],\n   [[1, 3], [3, 0], [6, 3], [5, 2], [2, 0]]),\n  ('partial repair boundary #1',\n   [['#..~.##', '..~.#..', '#.~#..~'],\n    [[3, 1], [7, 1], [4, 1], [0, 3], [6, 0], [5, 2], [5, 3], [6, 3], [1, 0], [6, 1], [2, 0], [6, 1]],\n    1,\n    3],\n   [[3, 1], [5, 2], [1, 0], [6, 1], [2, 0]]),\n  ('partial repair boundary #2',\n   [['~..#.#', '~.#~..', '......', '.~.#.#', '..~...', '....#.', '..~~.#'],\n    [[1, 5], [0, 0], [0, 4], [1, 3], [1, 0], [5, 1], [2, 6], [3, 0], [1, 1], [5, 1]],\n    1,\n    3],\n   [[1, 5], [0, 4], [1, 0], [5, 1], [1, 1]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('control #1',\n   [['~~..#', '.....', '....#'], [[3, 1], [1, 2], [5, 2], [2, 3], [0, 3], [3, 0], [1, 1], [0, 1]], 1, 1],\n   [[3, 1], [1, 2], [1, 1]]),\n  ('control #2',\n   [['~..~.', '.#...', '~..#.', '..~#.'], [[1, 2], [4, 3], [1, 2], [4, 3], [1, 1]], 2, 3],\n   [[1, 2], [4, 3]])],\n [('fault site quota increment #1',\n   [['.....#..', '..#..~~.', '~.~...~.', '.~~..~.#', '.~~.~~..'],\n    [[1, 1], [0, 1], [0, 0], [4, 2], [2, 4]],\n    1,\n    2],\n   [[1, 1], [0, 1], [4, 2]]),\n  ('fault site quota increment #2',\n   [['......#', '#...#..'], [[2, 1], [3, 1], [7, 2], [6, 2], [7, 1], [1, 1], [5, 0], [3, 1]], 1, 2],\n   [[2, 1], [3, 1], [5, 0]]),\n  ('partial repair boundary #1',\n   [['.~....', '...~..'], [[0, 0], [5, 1], [6, 0], [4, 1], [0, 1], [3, 2], [1, 0]], 1, 2],\n   [[0, 0], [5, 1], [4, 1], [0, 1]]),\n  ('partial repair boundary #2',\n   [['#.~', '.~#', '.~.', '...', '#..', '..~'],\n    [[3, 5], [2, 2], [2, 6], [0, 2], [3, 1], [1, 2], [2, 2], [1, 0], [2, 1]],\n    2,\n    2],\n   [[2, 2], [0, 2], [1, 0]]),\n  ('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('control #1',\n   [['~..~.', '.#...', '~..#.', '..~#.'], [[1, 2], [4, 3], [1, 2], [4, 3], [1, 1]], 2, 3],\n   [[1, 2], [4, 3]]),\n  ('control #2', [['#..', '..#'], [[1, 1]], 1, 1], [[1, 1]])],\n [('regression quota increment #1',\n   [['...~.#..', '~#.###~.', '.#.#..~#', '...#.#~.', '~.~.~..#', '.#...#.#', '#..~#...'],\n    [[4, 2], [6, 0], [7, 3], [5, 4], [7, 6], [5, 6], [7, 4], [0, 2], [4, 0], [5, 2], [1, 2]],\n    2,\n    2],\n   [[4, 2], [6, 0], [5, 4], [7, 6], [0, 2]]),\n  ('regression quota increment #2',\n   [['~#...##', '...##..', '~..~~..', '#.#.~..', '..#...#', '~#.~~~.'],\n    [[0, 0], [1, 3], [3, 0], [7, 1], [6, 3], [5, 2], [2, 0], [2, 6], [1, 1], [7, 1], [1, 2], [7, 4]],\n    1,\n    2],\n   [[1, 3], [3, 0], [6, 3], [5, 2], [2, 0]]),\n  ('partial repair boundary #1',\n   [['......#', '~~..#~.', '.~.~~..', '#......', '..~..~#'],\n    [[5, 3], [1, 2], [0, 3], [4, 0], [1, 4], [4, 3], [0, 3], [3, 4], [1, 3], [7, 5]],\n    1,\n    3],\n   [[5, 3], [4, 0], [1, 4], [4, 3], [3, 4], [1, 3]]),\n  ('partial repair boundary #2',\n   [['~.#...', '......', '.~#~~#', '..~..~', '~#~#~#', '.~~...', '......'],\n    [[4, 0], [3, 1], [1, 1], [1, 3], [3, 1], [5, 2], [3, 4]],\n    1,\n    2],\n   [[4, 0], [3, 1], [1, 1], [1, 3]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('diagonal within radius #1', [['...', '...', '...'], [[0, 0], [1, 1]], 2, 3], [[0, 0]]),\n  ('control #1',\n   [['..', '~.'],\n    [[2, 1], [1, 2], [2, 0], [2, 0], [0, 1], [2, 1], [0, 0], [2, 2], [0, 0], [1, 1], [2, 0]],\n    3,\n    2],\n   [[0, 0]]),\n  ('control #2', [['.'], [[0, 0], [0, 0], [1, 0], [1, 1]], 1, 2], [[0, 0]])],\n [('fault site quota increment #1',\n   [['.....#..', '..#..~~.', '~.~...~.', '.~~..~.#', '.~~.~~..'],\n    [[1, 1], [0, 1], [0, 0], [4, 2], [2, 4]],\n    1,\n    2],\n   [[1, 1], [0, 1], [4, 2]]),\n  ('fault site quota increment #2',\n   [['......#', '#...#..'], [[2, 1], [3, 1], [7, 2], [6, 2], [7, 1], [1, 1], [5, 0], [3, 1]], 1, 2],\n   [[2, 1], [3, 1], [5, 0]]),\n  ('partial repair boundary #1',\n   [['.#..#..', '.#.~...', '.###..~', '~#..#.#', '.......', '...##~.'],\n    [[2, 4], [6, 3], [0, 2], [6, 0], [2, 1], [4, 3], [4, 4], [0, 0], [4, 3], [0, 3]],\n    1,\n    3],\n   [[2, 4], [0, 2], [6, 0], [2, 1], [4, 4], [0, 0]]),\n  ('partial repair boundary #2',\n   [['~~.....', '..#...~', '....#..', '.~.....', '#...~~~', '....~..'],\n    [[1, 1], [3, 5], [5, 5], [5, 4], [4, 4], [1, 0], [0, 0], [1, 4], [3, 1], [4, 1], [6, 0], [3, 4]],\n    2,\n    2],\n   [[1, 1], [3, 5], [5, 5], [1, 4], [3, 1], [6, 0]]),\n  ('quadrant full #1', [['....', '....'], [[0, 0], [1, 0], [3, 0]], 1, 1], [[0, 0], [3, 0]]),\n  ('exact radius spacing #1', [['.....'], [[0, 0], [2, 0]], 2, 3], [[0, 0], [2, 0]]),\n  ('control #1', [['....', '..#.'], [[0, 1], [3, 0], [1, 0]], 3, 2], [[0, 1], [3, 0]]),\n  ('control #2',\n   [['..', '.#', '..', '~~', '..', '..', '..'],\n    [[1, 6], [1, 1], [0, 7], [0, 0], [2, 1], [2, 5], [2, 0], [0, 4], [1, 1], [0, 0], [0, 3], [2, 6]],\n    3,\n    3],\n   [[1, 6], [0, 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-scatter-quota-quota-increment","generated_at":"2026-09-29T14:50:51.952493+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 `quota[q] = quota.get(q, 0) + 1` at the quota increment step.","root_cause":"The quadrant counter is reset to one on each placement.","sha256":"43c05b41294e38bf7ca059e42cd40ebbbb7b31b4935a312c220124955c4457d6","title":"Decoration scatter with quadrant quota: Quadrant counter never exceeds one · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.942,"exit_code":1,"observations":[{"actual":[[1,1],[0,1],[4,2]],"check":"fault site quota increment #1","expected":[[1,1],[0,1],[4,2]],"passed":true},{"actual":[[2,1],[3,1],[5,0]],"check":"fault site quota increment #2","expected":[[2,1],[3,1],[5,0]],"passed":true},{"actual":[[7,4],[6,2],[4,1],[6,5],[2,5]],"check":"partial repair boundary #1","expected":[[7,4],[6,2],[4,1],[5,0],[6,5],[2,5]],"passed":false},{"actual":[[0,0],[4,0]],"check":"partial repair boundary #2","expected":[[0,0],[4,0],[5,0]],"passed":false},{"actual":[[0,0],[2,0]],"check":"exact radius spacing #1","expected":[[0,0],[2,0]],"passed":true},{"actual":[[0,0]],"check":"diagonal within radius #1","expected":[[0,0]],"passed":true},{"actual":[[0,0],[3,0]],"check":"quadrant full #1","expected":[[0,0],[3,0]],"passed":true},{"actual":[[3,1],[1,2],[1,1]],"check":"control #1","expected":[[3,1],[1,2],[1,1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fault site quota increment #1\", \"actual\": [[1, 1], [0, 1], [4, 2]], \"expected\": [[1, 1], [0, 1], [4, 2]], \"passed\": true}, {\"check\": \"fault site quota increment #2\", \"actual\": [[2, 1], [3, 1], [5, 0]], \"expected\": [[2, 1], [3, 1], [5, 0]], \"passed\": true}, {\"check\": \"partial repair boundary #1\", \"actual\": [[7, 4], [6, 2], [4, 1], [6, 5], [2, 5]], \"expected\": [[7, 4], [6, 2], [4, 1], [5, 0], [6, 5], [2, 5]], \"passed\": false}, {\"check\": \"partial repair boundary #2\", \"actual\": [[0, 0], [4, 0]], \"expected\": [[0, 0], [4, 0], [5, 0]], \"passed\": false}, {\"check\": \"exact radius spacing #1\", \"actual\": [[0, 0], [2, 0]], \"expected\": [[0, 0], [2, 0]], \"passed\": true}, {\"check\": \"diagonal within radius #1\", \"actual\": [[0, 0]], \"expected\": [[0, 0]], \"passed\": true}, {\"check\": \"quadrant full #1\", \"actual\": [[0, 0], [3, 0]], \"expected\": [[0, 0], [3, 0]], \"passed\": true}, {\"check\": \"control #1\", \"actual\": [[3, 1], [1, 2], [1, 1]], \"expected\": [[3, 1], [1, 2], [1, 1]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.432,"exit_code":1,"observations":[{"actual":[[1,1],[0,1],[0,0],[4,2]],"check":"fault site quota increment #1","expected":[[1,1],[0,1],[4,2]],"passed":false},{"actual":[[2,1],[3,1],[1,1],[5,0]],"check":"fault site quota increment #2","expected":[[2,1],[3,1],[5,0]],"passed":false},{"actual":[[7,4],[6,2],[4,1],[5,0],[6,5],[2,5]],"check":"partial repair boundary #1","expected":[[7,4],[6,2],[4,1],[5,0],[6,5],[2,5]],"passed":true},{"actual":[[0,0],[4,0],[5,0]],"check":"partial repair boundary #2","expected":[[0,0],[4,0],[5,0]],"passed":true},{"actual":[[0,0],[2,0]],"check":"exact radius spacing #1","expected":[[0,0],[2,0]],"passed":true},{"actual":[[0,0]],"check":"diagonal within radius #1","expected":[[0,0]],"passed":true},{"actual":[[0,0],[3,0]],"check":"quadrant full #1","expected":[[0,0],[3,0]],"passed":true},{"actual":[[3,1],[1,2],[1,1]],"check":"control #1","expected":[[3,1],[1,2],[1,1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fault site quota increment #1\", \"actual\": [[1, 1], [0, 1], [0, 0], [4, 2]], \"expected\": [[1, 1], [0, 1], [4, 2]], \"passed\": false}, {\"check\": \"fault site quota increment #2\", \"actual\": [[2, 1], [3, 1], [1, 1], [5, 0]], \"expected\": [[2, 1], [3, 1], [5, 0]], \"passed\": false}, {\"check\": \"partial repair boundary #1\", \"actual\": [[7, 4], [6, 2], [4, 1], [5, 0], [6, 5], [2, 5]], \"expected\": [[7, 4], [6, 2], [4, 1], [5, 0], [6, 5], [2, 5]], \"passed\": true}, {\"check\": \"partial repair boundary #2\", \"actual\": [[0, 0], [4, 0], [5, 0]], \"expected\": [[0, 0], [4, 0], [5, 0]], \"passed\": true}, {\"check\": \"exact radius spacing #1\", \"actual\": [[0, 0], [2, 0]], \"expected\": [[0, 0], [2, 0]], \"passed\": true}, {\"check\": \"diagonal within radius #1\", \"actual\": [[0, 0]], \"expected\": [[0, 0]], \"passed\": true}, {\"check\": \"quadrant full #1\", \"actual\": [[0, 0], [3, 0]], \"expected\": [[0, 0], [3, 0]], \"passed\": true}, {\"check\": \"control #1\", \"actual\": [[3, 1], [1, 2], [1, 1]], \"expected\": [[3, 1], [1, 2], [1, 1]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.866,"exit_code":0,"observations":[{"actual":[[1,1],[0,1],[4,2]],"check":"fault site quota increment #1","expected":[[1,1],[0,1],[4,2]],"passed":true},{"actual":[[2,1],[3,1],[5,0]],"check":"fault site quota increment #2","expected":[[2,1],[3,1],[5,0]],"passed":true},{"actual":[[7,4],[6,2],[4,1],[5,0],[6,5],[2,5]],"check":"partial repair boundary #1","expected":[[7,4],[6,2],[4,1],[5,0],[6,5],[2,5]],"passed":true},{"actual":[[0,0],[4,0],[5,0]],"check":"partial repair boundary #2","expected":[[0,0],[4,0],[5,0]],"passed":true},{"actual":[[0,0],[2,0]],"check":"exact radius spacing #1","expected":[[0,0],[2,0]],"passed":true},{"actual":[[0,0]],"check":"diagonal within radius #1","expected":[[0,0]],"passed":true},{"actual":[[0,0],[3,0]],"check":"quadrant full #1","expected":[[0,0],[3,0]],"passed":true},{"actual":[[3,1],[1,2],[1,1]],"check":"control #1","expected":[[3,1],[1,2],[1,1]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fault site quota increment #1\", \"actual\": [[1, 1], [0, 1], [4, 2]], \"expected\": [[1, 1], [0, 1], [4, 2]], \"passed\": true}, {\"check\": \"fault site quota increment #2\", \"actual\": [[2, 1], [3, 1], [5, 0]], \"expected\": [[2, 1], [3, 1], [5, 0]], \"passed\": true}, {\"check\": \"partial repair boundary #1\", \"actual\": [[7, 4], [6, 2], [4, 1], [5, 0], [6, 5], [2, 5]], \"expected\": [[7, 4], [6, 2], [4, 1], [5, 0], [6, 5], [2, 5]], \"passed\": true}, {\"check\": \"partial repair boundary #2\", \"actual\": [[0, 0], [4, 0], [5, 0]], \"expected\": [[0, 0], [4, 0], [5, 0]], \"passed\": true}, {\"check\": \"exact radius spacing #1\", \"actual\": [[0, 0], [2, 0]], \"expected\": [[0, 0], [2, 0]], \"passed\": true}, {\"check\": \"diagonal within radius #1\", \"actual\": [[0, 0]], \"expected\": [[0, 0]], \"passed\": true}, {\"check\": \"quadrant full #1\", \"actual\": [[0, 0], [3, 0]], \"expected\": [[0, 0], [3, 0]], \"passed\": true}, {\"check\": \"control #1\", \"actual\": [[3, 1], [1, 2], [1, 1]], \"expected\": [[3, 1], [1, 2], [1, 1]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}