{"abstract":"Wall tops render as if the wall continued below.","category":"Procedural level generation constraints","checks":8,"contract":"For each '#' cell the mask sums N=1, E=2, S=4, W=8 for 4-neighbours that are '#' (row 0 is north). Out-of-bounds neighbours count as walls when same_oob. Non-wall cells get -1. Returns rows of integers.","contract_signature":"grid, same_oob","evaluation_group":"w2-procedural-level-generation-constraints-autotile-mask","failed_approach":"Swapping north and south bits mirrors every vertical wall piece.","family":"w2-procedural-level-generation-constraints-autotile-mask-north-offset","id":"FA-86661","implementations":{"attempt":{"sha256":"b554f8bd5153669ceb33349d2a53158a21aaa6f19fd23b8b46abf93558235108","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(grid, same_oob):\n    h = len(grid)\n    w = len(grid[0])\n    out = []\n    for r in range(h):\n        row = []\n        for c in range(w):\n            if grid[r][c] != '#':\n                row.append(-1)\n                continue\n            m = 0\n            for bit, (dr, dc) in ((1, (1, 0)), (2, (0, 1)), (4, (-1, 0)), (8, (0, -1))):\n                rr, cc = r + dr, c + dc\n                if 0 <= rr < h and 0 <= cc < w:\n                    if grid[rr][cc] == '#':\n                        m |= bit\n                elif same_oob:\n                    m |= bit\n            row.append(m)\n        out.append(row)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('vertical wall pair #1', [['#', '#'], False], [[4], [1]]),\n  ('regression north offset #1', [['.#D', '#.~'], True], [[-1, 1, -1], [12, -1, -1]]),\n  ('regression north offset #2',\n   [['~###', '##~.', 'D~~.', '#D#.', '#..#'], True],\n   [[-1, 7, 11, 11], [10, 9, -1, -1], [-1, -1, -1, -1], [12, -1, 0, -1], [13, -1, -1, 6]]),\n  ('regression north offset #3', [['##D', '..#', '##D'], True], [[11, 9, -1], [-1, -1, 2], [14, 12, -1]]),\n  ('regression north offset #4',\n   [['##.D', '.D#~', '##..', '#.#~', '~D.#'], True],\n   [[11, 9, -1, -1], [-1, -1, 0, -1], [14, 8, -1, -1], [9, -1, 0, -1], [-1, -1, -1, 6]]),\n  ('door next to wall #1', [['#D'], False], [[0, -1]]),\n  ('lone wall at edge #1', [['#'], True], [[15]]),\n  ('control #1', [['####D'], False], [[2, 10, 10, 8, -1]])],\n [('vertical wall pair #1', [['#', '#'], False], [[4], [1]]),\n  ('regression north offset #1',\n   [['~###', '##~.', 'D~~.', '#D#.', '#..#'], True],\n   [[-1, 7, 11, 11], [10, 9, -1, -1], [-1, -1, -1, -1], [12, -1, 0, -1], [13, -1, -1, 6]]),\n  ('regression north offset #2', [['##D', '..#', '##D'], True], [[11, 9, -1], [-1, -1, 2], [14, 12, -1]]),\n  ('regression north offset #3',\n   [['##.D', '.D#~', '##..', '#.#~', '~D.#'], True],\n   [[11, 9, -1, -1], [-1, -1, 0, -1], [14, 8, -1, -1], [9, -1, 0, -1], [-1, -1, -1, 6]]),\n  ('regression north offset #4',\n   [['#..D.', '.##.#', '..##D', 'D.#.D'], False],\n   [[0, -1, -1, -1, -1], [-1, 2, 12, -1, 0], [-1, -1, 7, 8, -1], [-1, -1, 1, -1, -1]]),\n  ('door next to wall #1', [['#D'], False], [[0, -1]]),\n  ('lone wall at edge #1', [['#'], True], [[15]]),\n  ('control #1', [['####D'], False], [[2, 10, 10, 8, -1]])],\n [('vertical wall pair #1', [['#', '#'], False], [[4], [1]]),\n  ('regression north offset #1',\n   [['##.D', '.D#~', '##..', '#.#~', '~D.#'], True],\n   [[11, 9, -1, -1], [-1, -1, 0, -1], [14, 8, -1, -1], [9, -1, 0, -1], [-1, -1, -1, 6]]),\n  ('regression north offset #2',\n   [['#..D.', '.##.#', '..##D', 'D.#.D'], False],\n   [[0, -1, -1, -1, -1], [-1, 2, 12, -1, 0], [-1, -1, 7, 8, -1], [-1, -1, 1, -1, -1]]),\n  ('regression north offset #3', [['~#', '.~', '.#'], True], [[-1, 3], [-1, -1], [-1, 6]]),\n  ('regression north offset #4', [['~.#', '##D'], True], [[-1, -1, 3], [14, 12, -1]]),\n  ('door next to wall #1', [['#D'], False], [[0, -1]]),\n  ('lone wall at edge #1', [['#'], True], [[15]]),\n  ('control #1', [['####D'], False], [[2, 10, 10, 8, -1]])],\n [('vertical wall pair #1', [['#', '#'], False], [[4], [1]]),\n  ('regression north offset #1', [['~#', '.~', '.#'], True], [[-1, 3], [-1, -1], [-1, 6]]),\n  ('regression north offset #2', [['~.#', '##D'], True], [[-1, -1, 3], [14, 12, -1]]),\n  ('regression north offset #3', [['#', '#', '#'], False], [[4], [5], [1]]),\n  ('regression north offset #4', [['~D.D#', '#~.#D'], True], [[-1, -1, -1, -1, 3], [12, -1, -1, 4, -1]]),\n  ('door next to wall #1', [['#D'], False], [[0, -1]]),\n  ('lone wall at edge #1', [['#'], True], [[15]]),\n  ('control #1', [['D~#', '#~.'], False], [[-1, -1, 0], [0, -1, -1]])],\n [('vertical wall pair #1', [['#', '#'], False], [[4], [1]]),\n  ('regression north offset #1', [['#', '#', '#'], False], [[4], [5], [1]]),\n  ('regression north offset #2', [['~D.D#', '#~.#D'], True], [[-1, -1, -1, -1, 3], [12, -1, -1, 4, -1]]),\n  ('regression north offset #3',\n   [['~#.~', '.D~#', '###~', '#~#D', '.##.'], False],\n   [[-1, 0, -1, -1], [-1, -1, -1, 0], [6, 10, 12, -1], [1, -1, 5, -1], [-1, 2, 9, -1]]),\n  ('regression north offset #4',\n   [['D#DD', '#D.~', '###~', '#~##'], False],\n   [[-1, 0, -1, -1], [4, -1, -1, -1], [7, 10, 12, -1], [1, -1, 3, 8]]),\n  ('door next to wall #1', [['#D'], False], [[0, -1]]),\n  ('lone wall at edge #1', [['#'], True], [[15]]),\n  ('control #1', [['~', '~'], True], [[-1], [-1]])]]\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":"f92e8011073b178b92fd0ad0e2e2663548af3de1d96b55a34013c344856d7751","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(grid, same_oob):\n    h = len(grid)\n    w = len(grid[0])\n    out = []\n    for r in range(h):\n        row = []\n        for c in range(w):\n            if grid[r][c] != '#':\n                row.append(-1)\n                continue\n            m = 0\n            for bit, (dr, dc) in ((1, (1, 0)), (2, (0, 1)), (4, (1, 0)), (8, (0, -1))):\n                rr, cc = r + dr, c + dc\n                if 0 <= rr < h and 0 <= cc < w:\n                    if grid[rr][cc] == '#':\n                        m |= bit\n                elif same_oob:\n                    m |= bit\n            row.append(m)\n        out.append(row)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('vertical wall pair #1', [['#', '#'], False], [[4], [1]]),\n  ('regression north offset #1', [['.#D', '#.~'], True], [[-1, 1, -1], [12, -1, -1]]),\n  ('regression north offset #2',\n   [['~###', '##~.', 'D~~.', '#D#.', '#..#'], True],\n   [[-1, 7, 11, 11], [10, 9, -1, -1], [-1, -1, -1, -1], [12, -1, 0, -1], [13, -1, -1, 6]]),\n  ('regression north offset #3', [['##D', '..#', '##D'], True], [[11, 9, -1], [-1, -1, 2], [14, 12, -1]]),\n  ('regression north offset #4',\n   [['##.D', '.D#~', '##..', '#.#~', '~D.#'], True],\n   [[11, 9, -1, -1], [-1, -1, 0, -1], [14, 8, -1, -1], [9, -1, 0, -1], [-1, -1, -1, 6]]),\n  ('door next to wall #1', [['#D'], False], [[0, -1]]),\n  ('lone wall at edge #1', [['#'], True], [[15]]),\n  ('control #1', [['####D'], False], [[2, 10, 10, 8, -1]])],\n [('vertical wall pair #1', [['#', '#'], False], [[4], [1]]),\n  ('regression north offset #1',\n   [['~###', '##~.', 'D~~.', '#D#.', '#..#'], True],\n   [[-1, 7, 11, 11], [10, 9, -1, -1], [-1, -1, -1, -1], [12, -1, 0, -1], [13, -1, -1, 6]]),\n  ('regression north offset #2', [['##D', '..#', '##D'], True], [[11, 9, -1], [-1, -1, 2], [14, 12, -1]]),\n  ('regression north offset #3',\n   [['##.D', '.D#~', '##..', '#.#~', '~D.#'], True],\n   [[11, 9, -1, -1], [-1, -1, 0, -1], [14, 8, -1, -1], [9, -1, 0, -1], [-1, -1, -1, 6]]),\n  ('regression north offset #4',\n   [['#..D.', '.##.#', '..##D', 'D.#.D'], False],\n   [[0, -1, -1, -1, -1], [-1, 2, 12, -1, 0], [-1, -1, 7, 8, -1], [-1, -1, 1, -1, -1]]),\n  ('door next to wall #1', [['#D'], False], [[0, -1]]),\n  ('lone wall at edge #1', [['#'], True], [[15]]),\n  ('control #1', [['####D'], False], [[2, 10, 10, 8, -1]])],\n [('vertical wall pair #1', [['#', '#'], False], [[4], [1]]),\n  ('regression north offset #1',\n   [['##.D', '.D#~', '##..', '#.#~', '~D.#'], True],\n   [[11, 9, -1, -1], [-1, -1, 0, -1], [14, 8, -1, -1], [9, -1, 0, -1], [-1, -1, -1, 6]]),\n  ('regression north offset #2',\n   [['#..D.', '.##.#', '..##D', 'D.#.D'], False],\n   [[0, -1, -1, -1, -1], [-1, 2, 12, -1, 0], [-1, -1, 7, 8, -1], [-1, -1, 1, -1, -1]]),\n  ('regression north offset #3', [['~#', '.~', '.#'], True], [[-1, 3], [-1, -1], [-1, 6]]),\n  ('regression north offset #4', [['~.#', '##D'], True], [[-1, -1, 3], [14, 12, -1]]),\n  ('door next to wall #1', [['#D'], False], [[0, -1]]),\n  ('lone wall at edge #1', [['#'], True], [[15]]),\n  ('control #1', [['####D'], False], [[2, 10, 10, 8, -1]])],\n [('vertical wall pair #1', [['#', '#'], False], [[4], [1]]),\n  ('regression north offset #1', [['~#', '.~', '.#'], True], [[-1, 3], [-1, -1], [-1, 6]]),\n  ('regression north offset #2', [['~.#', '##D'], True], [[-1, -1, 3], [14, 12, -1]]),\n  ('regression north offset #3', [['#', '#', '#'], False], [[4], [5], [1]]),\n  ('regression north offset #4', [['~D.D#', '#~.#D'], True], [[-1, -1, -1, -1, 3], [12, -1, -1, 4, -1]]),\n  ('door next to wall #1', [['#D'], False], [[0, -1]]),\n  ('lone wall at edge #1', [['#'], True], [[15]]),\n  ('control #1', [['D~#', '#~.'], False], [[-1, -1, 0], [0, -1, -1]])],\n [('vertical wall pair #1', [['#', '#'], False], [[4], [1]]),\n  ('regression north offset #1', [['#', '#', '#'], False], [[4], [5], [1]]),\n  ('regression north offset #2', [['~D.D#', '#~.#D'], True], [[-1, -1, -1, -1, 3], [12, -1, -1, 4, -1]]),\n  ('regression north offset #3',\n   [['~#.~', '.D~#', '###~', '#~#D', '.##.'], False],\n   [[-1, 0, -1, -1], [-1, -1, -1, 0], [6, 10, 12, -1], [1, -1, 5, -1], [-1, 2, 9, -1]]),\n  ('regression north offset #4',\n   [['D#DD', '#D.~', '###~', '#~##'], False],\n   [[-1, 0, -1, -1], [4, -1, -1, -1], [7, 10, 12, -1], [1, -1, 3, 8]]),\n  ('door next to wall #1', [['#D'], False], [[0, -1]]),\n  ('lone wall at edge #1', [['#'], True], [[15]]),\n  ('control #1', [['~', '~'], True], [[-1], [-1]])]]\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-autotile-mask-north-offset","generated_at":"2026-09-29T14:50:51.497961+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.","root_cause":"The north bit uses a +1 row offset (y-up assumption) on a row-0-north grid.","sha256":"26e92f1cdcd7335d1728c150e66fa082b473332afcc6f8df5589013d9ed87138","title":"Wall autotile bitmask: North bit samples the south neighbour · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":38.905,"exit_code":1,"observations":[{"actual":[[1],[4]],"check":"vertical wall pair #1","expected":[[4],[1]],"passed":false},{"actual":[[-1,4,-1],[9,-1,-1]],"check":"regression north offset #1","expected":[[-1,1,-1],[12,-1,-1]],"passed":false},{"actual":[[-1,7,14,14],[10,12,-1,-1],[-1,-1,-1,-1],[9,-1,0,-1],[13,-1,-1,3]],"check":"regression north offset #2","expected":[[-1,7,11,11],[10,9,-1,-1],[-1,-1,-1,-1],[12,-1,0,-1],[13,-1,-1,6]],"passed":false},{"actual":[[14,12,-1],[-1,-1,2],[11,9,-1]],"check":"regression north offset #3","expected":[[11,9,-1],[-1,-1,2],[14,12,-1]],"passed":false},{"actual":[[14,12,-1,-1],[-1,-1,0,-1],[11,8,-1,-1],[12,-1,0,-1],[-1,-1,-1,3]],"check":"regression north offset #4","expected":[[11,9,-1,-1],[-1,-1,0,-1],[14,8,-1,-1],[9,-1,0,-1],[-1,-1,-1,6]],"passed":false},{"actual":[[0,-1]],"check":"door next to wall #1","expected":[[0,-1]],"passed":true},{"actual":[[15]],"check":"lone wall at edge #1","expected":[[15]],"passed":true},{"actual":[[2,10,10,8,-1]],"check":"control #1","expected":[[2,10,10,8,-1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"vertical wall pair #1\", \"actual\": [[1], [4]], \"expected\": [[4], [1]], \"passed\": false}, {\"check\": \"regression north offset #1\", \"actual\": [[-1, 4, -1], [9, -1, -1]], \"expected\": [[-1, 1, -1], [12, -1, -1]], \"passed\": false}, {\"check\": \"regression north offset #2\", \"actual\": [[-1, 7, 14, 14], [10, 12, -1, -1], [-1, -1, -1, -1], [9, -1, 0, -1], [13, -1, -1, 3]], \"expected\": [[-1, 7, 11, 11], [10, 9, -1, -1], [-1, -1, -1, -1], [12, -1, 0, -1], [13, -1, -1, 6]], \"passed\": false}, {\"check\": \"regression north offset #3\", \"actual\": [[14, 12, -1], [-1, -1, 2], [11, 9, -1]], \"expected\": [[11, 9, -1], [-1, -1, 2], [14, 12, -1]], \"passed\": false}, {\"check\": \"regression north offset #4\", \"actual\": [[14, 12, -1, -1], [-1, -1, 0, -1], [11, 8, -1, -1], [12, -1, 0, -1], [-1, -1, -1, 3]], \"expected\": [[11, 9, -1, -1], [-1, -1, 0, -1], [14, 8, -1, -1], [9, -1, 0, -1], [-1, -1, -1, 6]], \"passed\": false}, {\"check\": \"door next to wall #1\", \"actual\": [[0, -1]], \"expected\": [[0, -1]], \"passed\": true}, {\"check\": \"lone wall at edge #1\", \"actual\": [[15]], \"expected\": [[15]], \"passed\": true}, {\"check\": \"control #1\", \"actual\": [[2, 10, 10, 8, -1]], \"expected\": [[2, 10, 10, 8, -1]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.298,"exit_code":1,"observations":[{"actual":[[5],[0]],"check":"vertical wall pair #1","expected":[[4],[1]],"passed":false},{"actual":[[-1,0,-1],[13,-1,-1]],"check":"regression north offset #1","expected":[[-1,1,-1],[12,-1,-1]],"passed":false},{"actual":[[-1,7,10,10],[10,8,-1,-1],[-1,-1,-1,-1],[13,-1,0,-1],[13,-1,-1,7]],"check":"regression north offset #2","expected":[[-1,7,11,11],[10,9,-1,-1],[-1,-1,-1,-1],[12,-1,0,-1],[13,-1,-1,6]],"passed":false},{"actual":[[10,8,-1],[-1,-1,2],[15,13,-1]],"check":"regression north offset #3","expected":[[11,9,-1],[-1,-1,2],[14,12,-1]],"passed":false},{"actual":[[10,8,-1,-1],[-1,-1,0,-1],[15,8,-1,-1],[8,-1,0,-1],[-1,-1,-1,7]],"check":"regression north offset #4","expected":[[11,9,-1,-1],[-1,-1,0,-1],[14,8,-1,-1],[9,-1,0,-1],[-1,-1,-1,6]],"passed":false},{"actual":[[0,-1]],"check":"door next to wall #1","expected":[[0,-1]],"passed":true},{"actual":[[15]],"check":"lone wall at edge #1","expected":[[15]],"passed":true},{"actual":[[2,10,10,8,-1]],"check":"control #1","expected":[[2,10,10,8,-1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"vertical wall pair #1\", \"actual\": [[5], [0]], \"expected\": [[4], [1]], \"passed\": false}, {\"check\": \"regression north offset #1\", \"actual\": [[-1, 0, -1], [13, -1, -1]], \"expected\": [[-1, 1, -1], [12, -1, -1]], \"passed\": false}, {\"check\": \"regression north offset #2\", \"actual\": [[-1, 7, 10, 10], [10, 8, -1, -1], [-1, -1, -1, -1], [13, -1, 0, -1], [13, -1, -1, 7]], \"expected\": [[-1, 7, 11, 11], [10, 9, -1, -1], [-1, -1, -1, -1], [12, -1, 0, -1], [13, -1, -1, 6]], \"passed\": false}, {\"check\": \"regression north offset #3\", \"actual\": [[10, 8, -1], [-1, -1, 2], [15, 13, -1]], \"expected\": [[11, 9, -1], [-1, -1, 2], [14, 12, -1]], \"passed\": false}, {\"check\": \"regression north offset #4\", \"actual\": [[10, 8, -1, -1], [-1, -1, 0, -1], [15, 8, -1, -1], [8, -1, 0, -1], [-1, -1, -1, 7]], \"expected\": [[11, 9, -1, -1], [-1, -1, 0, -1], [14, 8, -1, -1], [9, -1, 0, -1], [-1, -1, -1, 6]], \"passed\": false}, {\"check\": \"door next to wall #1\", \"actual\": [[0, -1]], \"expected\": [[0, -1]], \"passed\": true}, {\"check\": \"lone wall at edge #1\", \"actual\": [[15]], \"expected\": [[15]], \"passed\": true}, {\"check\": \"control #1\", \"actual\": [[2, 10, 10, 8, -1]], \"expected\": [[2, 10, 10, 8, -1]], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}