{"abstract":"Replay prisoner totals are swapped for every capture.","category":"Go territory scoring","checks":8,"contract":"Input [size, moves]; each move is [colour, row, col] or [colour, \"pass\"]. Replay with captures; captured stones are prisoners of the mover; occupied or suicidal moves stop replay with [\"illegal\", index]. Return [prisoners_B, prisoners_W, final_board_rows].","evaluation_group":"w2-go-territory-scoring-replay-prisoners","failed_approach":"Counting one prisoner per captured chain undercounts multi-stone captures.","family":"w2-go-territory-scoring-replay-prisoners-prisoner-owner","id":"FA-83246","implementations":{"attempt":{"sha256":"25f7124db4526ad6c3bb636655d4bbf4eb8edcffa91e8d01b5063c6b8a00c9f0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    size, moves = x\n    g = [['.'] * size for _ in range(size)]\n    pris = {'B': 0, 'W': 0}\n    def chain(i, j):\n        col = g[i][j]\n        seen = {(i, j)}\n        todo = [(i, j)]\n        libs = 0\n        while todo:\n            a, b = todo.pop()\n            for p, q in ((a - 1, b), (a, b + 1), (a + 1, b), (a, b - 1)):\n                if 0 <= p < size and 0 <= q < size:\n                    if g[p][q] == '.':\n                        libs += 1\n                    elif g[p][q] == col and (p, q) not in seen:\n                        seen.add((p, q))\n                        todo.append((p, q))\n        return seen, libs\n    for idx, mv in enumerate(moves):\n        if mv[1] == 'pass':\n            continue\n        col, r, c = mv\n        if g[r][c] != '.':\n            return ['illegal', idx]\n        g[r][c] = col\n        opp = 'B' if col == 'W' else 'W'\n        for p, q in ((r - 1, c), (r, c + 1), (r + 1, c), (r, c - 1)):\n            if 0 <= p < size and 0 <= q < size and g[p][q] == opp:\n                dead, libs = chain(p, q)\n                if libs == 0:\n                    for s, t in dead:\n                        g[s][t] = '.'\n                    pris[col] += 1\n        own, libs = chain(r, c)\n        if libs == 0:\n            return ['illegal', idx]\n    return [pris['B'], pris['W'], [''.join(row) for row in g]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[4, [['B', 3, 0], ['W', 2, 3], ['B', 'pass']]], [0, 0, ['....', '....', '...W', 'B...']]], [[4, [['B', 2, 0], ['W', 3, 1], ['B', 2, 0], ['W', 0, 1], ['B', 2, 0], ['W', 1, 3], ['B', 'pass'], ['W', 0, 1], ['B', 2, 3], ['W', 1, 2], ['B', 1, 1], ['W', 1, 0]]], ['illegal', 2]], [[3, [['B', 1, 1], ['W', 0, 1], ['B', 1, 1], ['W', 1, 1], ['B', 'pass'], ['W', 1, 1], ['B', 2, 0], ['W', 2, 2], ['B', 2, 0], ['W', 1, 1], ['B', 2, 2], ['W', 0, 0], ['B', 'pass'], ['W', 0, 2], ['B', 2, 1]]], ['illegal', 2]], [[3, [['B', 0, 1], ['W', 1, 0], ['B', 2, 1], ['W', 1, 0], ['B', 'pass'], ['W', 0, 0], ['B', 1, 1], ['W', 1, 1], ['B', 1, 1], ['W', 1, 2], ['B', 2, 0], ['W', 1, 1], ['B', 2, 2], ['W', 2, 1], ['B', 0, 0]]], ['illegal', 3]], [[4, [['B', 3, 0], ['W', 2, 1], ['B', 3, 1], ['W', 3, 0], ['B', 0, 0], ['W', 1, 0], ['B', 'pass']]], ['illegal', 3]], [[4, [['B', 0, 3], ['W', 0, 2], ['B', 2, 0], ['W', 1, 3], ['B', 2, 3], ['W', 'pass'], ['B', 0, 1], ['W', 1, 0], ['B', 0, 2], ['W', 1, 0], ['B', 2, 1], ['W', 3, 0]]], ['illegal', 8]], [[3, [['B', 'pass'], ['W', 1, 2], ['B', 0, 0], ['W', 1, 1], ['B', 0, 2], ['W', 0, 1], ['B', 'pass'], ['W', 'pass']]], [0, 1, ['BW.', '.WW', '...']]], [[3, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], [2, 0, ['..B', 'BB.', '...']]]], [[[3, [['B', 0, 1], ['W', 2, 0], ['B', 1, 1], ['W', 1, 2], ['B', 0, 0], ['W', 2, 1], ['B', 2, 1], ['W', 'pass'], ['B', 0, 2], ['W', 1, 1], ['B', 1, 2], ['W', 0, 0], ['B', 'pass']]], ['illegal', 6]], [[4, [['B', 2, 0], ['W', 0, 2], ['B', 1, 1], ['W', 3, 0], ['B', 3, 2]]], [0, 0, ['..W.', '.B..', 'B...', 'W.B.']]], [[3, [['B', 2, 1], ['W', 2, 1], ['B', 1, 2], ['W', 2, 2], ['B', 0, 2], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], ['illegal', 1]], [[4, [['B', 0, 1], ['W', 'pass'], ['B', 1, 3], ['W', 2, 3], ['B', 0, 2], ['W', 2, 0], ['B', 2, 0], ['W', 1, 1], ['B', 'pass'], ['W', 1, 2], ['B', 1, 0], ['W', 3, 2]]], ['illegal', 6]], [[3, [['B', 1, 0], ['W', 2, 2], ['B', 'pass'], ['W', 1, 0], ['B', 1, 2]]], ['illegal', 3]], [[4, [['B', 1, 0], ['W', 2, 0], ['B', 1, 3], ['W', 0, 0], ['B', 1, 1], ['W', 2, 2], ['B', 3, 1], ['W', 1, 2], ['B', 0, 0], ['W', 0, 2], ['B', 1, 0], ['W', 0, 0]]], ['illegal', 8]], [[4, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 1, 2], ['W', 0, 2], ['B', 0, 3]]], [3, 0, ['...B', 'BBB.', '....', '....']]], [[3, [['W', 1, 0], ['B', 0, 0], ['W', 1, 1], ['B', 0, 1], ['W', 0, 2], ['B', 2, 2]]], [0, 2, ['..W', 'WW.', '..B']]]], [[[3, [['B', 2, 0], ['W', 1, 1], ['B', 'pass'], ['W', 2, 1], ['B', 0, 1], ['W', 1, 1]]], ['illegal', 5]], [[4, [['B', 3, 1], ['W', 1, 3], ['B', 2, 3], ['W', 2, 0], ['B', 0, 1], ['W', 1, 3], ['B', 'pass'], ['W', 0, 0], ['B', 3, 0], ['W', 'pass'], ['B', 'pass'], ['W', 1, 1], ['B', 0, 2], ['W', 'pass'], ['B', 0, 0]]], ['illegal', 5]], [[4, [['B', 1, 1], ['W', 0, 2], ['B', 2, 3], ['W', 'pass'], ['B', 1, 1], ['W', 0, 2], ['B', 0, 3], ['W', 2, 0], ['B', 2, 2], ['W', 3, 0], ['B', 3, 0]]], ['illegal', 4]], [[3, [['B', 0, 0], ['W', 2, 2], ['B', 2, 1], ['W', 2, 2], ['B', 1, 2], ['W', 2, 2], ['B', 1, 0]]], ['illegal', 3]], [[3, [['B', 1, 2], ['W', 2, 0], ['B', 1, 0], ['W', 0, 1], ['B', 2, 2], ['W', 2, 2], ['B', 1, 2], ['W', 2, 0], ['B', 'pass'], ['W', 2, 0], ['B', 2, 1], ['W', 2, 0], ['B', 0, 2], ['W', 0, 1], ['B', 2, 2]]], ['illegal', 5]], [[3, [['B', 'pass'], ['W', 1, 2], ['B', 0, 0], ['W', 1, 1], ['B', 0, 2], ['W', 0, 1], ['B', 'pass'], ['W', 'pass']]], [0, 1, ['BW.', '.WW', '...']]], [[4, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 1, 2], ['W', 0, 2], ['B', 0, 3]]], [3, 0, ['...B', 'BBB.', '....', '....']]], [[3, [['W', 0, 1], ['B', 0, 0], ['W', 1, 0], ['B', 'pass'], ['W', 2, 2]]], [0, 1, ['.W.', 'W..', '..W']]]], [[[4, [['B', 'pass'], ['W', 1, 0], ['B', 2, 3], ['W', 3, 2], ['B', 1, 3]]], [0, 0, ['....', 'W..B', '...B', '..W.']]], [[4, [['B', 0, 3], ['W', 'pass'], ['B', 3, 1], ['W', 3, 3], ['B', 3, 1], ['W', 0, 3], ['B', 1, 3], ['W', 'pass'], ['B', 3, 2], ['W', 'pass'], ['B', 3, 1], ['W', 0, 2], ['B', 3, 0]]], ['illegal', 4]], [[3, [['B', 1, 1], ['W', 2, 1], ['B', 2, 0], ['W', 0, 2], ['B', 0, 2], ['W', 0, 0], ['B', 2, 2], ['W', 2, 0], ['B', 2, 2], ['W', 0, 2], ['B', 2, 2], ['W', 2, 0]]], ['illegal', 4]], [[3, [['B', 1, 0], ['W', 0, 1], ['B', 0, 1], ['W', 0, 2], ['B', 2, 0], ['W', 1, 0], ['B', 0, 0], ['W', 2, 1], ['B', 2, 2], ['W', 2, 0], ['B', 1, 1], ['W', 0, 2], ['B', 1, 1], ['W', 0, 2]]], ['illegal', 2]], [[4, [['B', 0, 3], ['W', 3, 3], ['B', 1, 2], ['W', 0, 1], ['B', 3, 0]]], [0, 0, ['.W.B', '..B.', '....', 'B..W']]], [[4, [['B', 3, 0], ['W', 0, 3], ['B', 0, 2]]], [0, 0, ['..BW', '....', '....', 'B...']]], [[3, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], [2, 0, ['..B', 'BB.', '...']]], [[3, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], [2, 0, ['..B', 'BB.', '...']]]], [[[3, [['B', 2, 2], ['W', 1, 1], ['B', 1, 0], ['W', 2, 1], ['B', 0, 2]]], [0, 0, ['..B', 'BW.', '.WB']]], [[3, [['B', 0, 2], ['W', 0, 1], ['B', 1, 1], ['W', 2, 2], ['B', 0, 2], ['W', 'pass'], ['B', 1, 1], ['W', 'pass'], ['B', 0, 2], ['W', 2, 1], ['B', 'pass'], ['W', 0, 0], ['B', 'pass']]], ['illegal', 4]], [[3, [['B', 1, 1], ['W', 1, 2], ['B', 0, 2]]], [0, 0, ['..B', '.BW', '...']]], [[3, [['B', 2, 1], ['W', 'pass'], ['B', 'pass'], ['W', 0, 0], ['B', 1, 1], ['W', 0, 2], ['B', 0, 2], ['W', 2, 2], ['B', 0, 1]]], ['illegal', 6]], [[3, [['B', 2, 0], ['W', 0, 1], ['B', 1, 0], ['W', 1, 1], ['B', 2, 0], ['W', 1, 0], ['B', 0, 0], ['W', 'pass']]], ['illegal', 4]], [[4, [['B', 2, 3], ['W', 0, 2], ['B', 1, 3], ['W', 'pass'], ['B', 1, 0], ['W', 2, 1], ['B', 3, 0], ['W', 1, 1]]], [0, 0, ['..W.', 'BW.B', '.W.B', 'B...']]], [[3, [['W', 1, 0], ['B', 0, 0], ['W', 1, 1], ['B', 0, 1], ['W', 0, 2], ['B', 2, 2]]], [0, 2, ['..W', 'WW.', '..B']]], [[3, [['B', 0, 1], ['W', 0, 0], ['B', 1, 0]]], [1, 0, ['.B.', 'B..', '...']]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"replay case %d\" % i, 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":"03fe28edb3a8d1c1c97cd060bf6af9b3c95da59bed9edcda64ece327e7253101","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    size, moves = x\n    g = [['.'] * size for _ in range(size)]\n    pris = {'B': 0, 'W': 0}\n    def chain(i, j):\n        col = g[i][j]\n        seen = {(i, j)}\n        todo = [(i, j)]\n        libs = 0\n        while todo:\n            a, b = todo.pop()\n            for p, q in ((a - 1, b), (a, b + 1), (a + 1, b), (a, b - 1)):\n                if 0 <= p < size and 0 <= q < size:\n                    if g[p][q] == '.':\n                        libs += 1\n                    elif g[p][q] == col and (p, q) not in seen:\n                        seen.add((p, q))\n                        todo.append((p, q))\n        return seen, libs\n    for idx, mv in enumerate(moves):\n        if mv[1] == 'pass':\n            continue\n        col, r, c = mv\n        if g[r][c] != '.':\n            return ['illegal', idx]\n        g[r][c] = col\n        opp = 'B' if col == 'W' else 'W'\n        for p, q in ((r - 1, c), (r, c + 1), (r + 1, c), (r, c - 1)):\n            if 0 <= p < size and 0 <= q < size and g[p][q] == opp:\n                dead, libs = chain(p, q)\n                if libs == 0:\n                    for s, t in dead:\n                        g[s][t] = '.'\n                    pris[opp] += len(dead)\n        own, libs = chain(r, c)\n        if libs == 0:\n            return ['illegal', idx]\n    return [pris['B'], pris['W'], [''.join(row) for row in g]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[4, [['B', 3, 0], ['W', 2, 3], ['B', 'pass']]], [0, 0, ['....', '....', '...W', 'B...']]], [[4, [['B', 2, 0], ['W', 3, 1], ['B', 2, 0], ['W', 0, 1], ['B', 2, 0], ['W', 1, 3], ['B', 'pass'], ['W', 0, 1], ['B', 2, 3], ['W', 1, 2], ['B', 1, 1], ['W', 1, 0]]], ['illegal', 2]], [[3, [['B', 1, 1], ['W', 0, 1], ['B', 1, 1], ['W', 1, 1], ['B', 'pass'], ['W', 1, 1], ['B', 2, 0], ['W', 2, 2], ['B', 2, 0], ['W', 1, 1], ['B', 2, 2], ['W', 0, 0], ['B', 'pass'], ['W', 0, 2], ['B', 2, 1]]], ['illegal', 2]], [[3, [['B', 0, 1], ['W', 1, 0], ['B', 2, 1], ['W', 1, 0], ['B', 'pass'], ['W', 0, 0], ['B', 1, 1], ['W', 1, 1], ['B', 1, 1], ['W', 1, 2], ['B', 2, 0], ['W', 1, 1], ['B', 2, 2], ['W', 2, 1], ['B', 0, 0]]], ['illegal', 3]], [[4, [['B', 3, 0], ['W', 2, 1], ['B', 3, 1], ['W', 3, 0], ['B', 0, 0], ['W', 1, 0], ['B', 'pass']]], ['illegal', 3]], [[4, [['B', 0, 3], ['W', 0, 2], ['B', 2, 0], ['W', 1, 3], ['B', 2, 3], ['W', 'pass'], ['B', 0, 1], ['W', 1, 0], ['B', 0, 2], ['W', 1, 0], ['B', 2, 1], ['W', 3, 0]]], ['illegal', 8]], [[3, [['B', 'pass'], ['W', 1, 2], ['B', 0, 0], ['W', 1, 1], ['B', 0, 2], ['W', 0, 1], ['B', 'pass'], ['W', 'pass']]], [0, 1, ['BW.', '.WW', '...']]], [[3, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], [2, 0, ['..B', 'BB.', '...']]]], [[[3, [['B', 0, 1], ['W', 2, 0], ['B', 1, 1], ['W', 1, 2], ['B', 0, 0], ['W', 2, 1], ['B', 2, 1], ['W', 'pass'], ['B', 0, 2], ['W', 1, 1], ['B', 1, 2], ['W', 0, 0], ['B', 'pass']]], ['illegal', 6]], [[4, [['B', 2, 0], ['W', 0, 2], ['B', 1, 1], ['W', 3, 0], ['B', 3, 2]]], [0, 0, ['..W.', '.B..', 'B...', 'W.B.']]], [[3, [['B', 2, 1], ['W', 2, 1], ['B', 1, 2], ['W', 2, 2], ['B', 0, 2], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], ['illegal', 1]], [[4, [['B', 0, 1], ['W', 'pass'], ['B', 1, 3], ['W', 2, 3], ['B', 0, 2], ['W', 2, 0], ['B', 2, 0], ['W', 1, 1], ['B', 'pass'], ['W', 1, 2], ['B', 1, 0], ['W', 3, 2]]], ['illegal', 6]], [[3, [['B', 1, 0], ['W', 2, 2], ['B', 'pass'], ['W', 1, 0], ['B', 1, 2]]], ['illegal', 3]], [[4, [['B', 1, 0], ['W', 2, 0], ['B', 1, 3], ['W', 0, 0], ['B', 1, 1], ['W', 2, 2], ['B', 3, 1], ['W', 1, 2], ['B', 0, 0], ['W', 0, 2], ['B', 1, 0], ['W', 0, 0]]], ['illegal', 8]], [[4, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 1, 2], ['W', 0, 2], ['B', 0, 3]]], [3, 0, ['...B', 'BBB.', '....', '....']]], [[3, [['W', 1, 0], ['B', 0, 0], ['W', 1, 1], ['B', 0, 1], ['W', 0, 2], ['B', 2, 2]]], [0, 2, ['..W', 'WW.', '..B']]]], [[[3, [['B', 2, 0], ['W', 1, 1], ['B', 'pass'], ['W', 2, 1], ['B', 0, 1], ['W', 1, 1]]], ['illegal', 5]], [[4, [['B', 3, 1], ['W', 1, 3], ['B', 2, 3], ['W', 2, 0], ['B', 0, 1], ['W', 1, 3], ['B', 'pass'], ['W', 0, 0], ['B', 3, 0], ['W', 'pass'], ['B', 'pass'], ['W', 1, 1], ['B', 0, 2], ['W', 'pass'], ['B', 0, 0]]], ['illegal', 5]], [[4, [['B', 1, 1], ['W', 0, 2], ['B', 2, 3], ['W', 'pass'], ['B', 1, 1], ['W', 0, 2], ['B', 0, 3], ['W', 2, 0], ['B', 2, 2], ['W', 3, 0], ['B', 3, 0]]], ['illegal', 4]], [[3, [['B', 0, 0], ['W', 2, 2], ['B', 2, 1], ['W', 2, 2], ['B', 1, 2], ['W', 2, 2], ['B', 1, 0]]], ['illegal', 3]], [[3, [['B', 1, 2], ['W', 2, 0], ['B', 1, 0], ['W', 0, 1], ['B', 2, 2], ['W', 2, 2], ['B', 1, 2], ['W', 2, 0], ['B', 'pass'], ['W', 2, 0], ['B', 2, 1], ['W', 2, 0], ['B', 0, 2], ['W', 0, 1], ['B', 2, 2]]], ['illegal', 5]], [[3, [['B', 'pass'], ['W', 1, 2], ['B', 0, 0], ['W', 1, 1], ['B', 0, 2], ['W', 0, 1], ['B', 'pass'], ['W', 'pass']]], [0, 1, ['BW.', '.WW', '...']]], [[4, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 1, 2], ['W', 0, 2], ['B', 0, 3]]], [3, 0, ['...B', 'BBB.', '....', '....']]], [[3, [['W', 0, 1], ['B', 0, 0], ['W', 1, 0], ['B', 'pass'], ['W', 2, 2]]], [0, 1, ['.W.', 'W..', '..W']]]], [[[4, [['B', 'pass'], ['W', 1, 0], ['B', 2, 3], ['W', 3, 2], ['B', 1, 3]]], [0, 0, ['....', 'W..B', '...B', '..W.']]], [[4, [['B', 0, 3], ['W', 'pass'], ['B', 3, 1], ['W', 3, 3], ['B', 3, 1], ['W', 0, 3], ['B', 1, 3], ['W', 'pass'], ['B', 3, 2], ['W', 'pass'], ['B', 3, 1], ['W', 0, 2], ['B', 3, 0]]], ['illegal', 4]], [[3, [['B', 1, 1], ['W', 2, 1], ['B', 2, 0], ['W', 0, 2], ['B', 0, 2], ['W', 0, 0], ['B', 2, 2], ['W', 2, 0], ['B', 2, 2], ['W', 0, 2], ['B', 2, 2], ['W', 2, 0]]], ['illegal', 4]], [[3, [['B', 1, 0], ['W', 0, 1], ['B', 0, 1], ['W', 0, 2], ['B', 2, 0], ['W', 1, 0], ['B', 0, 0], ['W', 2, 1], ['B', 2, 2], ['W', 2, 0], ['B', 1, 1], ['W', 0, 2], ['B', 1, 1], ['W', 0, 2]]], ['illegal', 2]], [[4, [['B', 0, 3], ['W', 3, 3], ['B', 1, 2], ['W', 0, 1], ['B', 3, 0]]], [0, 0, ['.W.B', '..B.', '....', 'B..W']]], [[4, [['B', 3, 0], ['W', 0, 3], ['B', 0, 2]]], [0, 0, ['..BW', '....', '....', 'B...']]], [[3, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], [2, 0, ['..B', 'BB.', '...']]], [[3, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], [2, 0, ['..B', 'BB.', '...']]]], [[[3, [['B', 2, 2], ['W', 1, 1], ['B', 1, 0], ['W', 2, 1], ['B', 0, 2]]], [0, 0, ['..B', 'BW.', '.WB']]], [[3, [['B', 0, 2], ['W', 0, 1], ['B', 1, 1], ['W', 2, 2], ['B', 0, 2], ['W', 'pass'], ['B', 1, 1], ['W', 'pass'], ['B', 0, 2], ['W', 2, 1], ['B', 'pass'], ['W', 0, 0], ['B', 'pass']]], ['illegal', 4]], [[3, [['B', 1, 1], ['W', 1, 2], ['B', 0, 2]]], [0, 0, ['..B', '.BW', '...']]], [[3, [['B', 2, 1], ['W', 'pass'], ['B', 'pass'], ['W', 0, 0], ['B', 1, 1], ['W', 0, 2], ['B', 0, 2], ['W', 2, 2], ['B', 0, 1]]], ['illegal', 6]], [[3, [['B', 2, 0], ['W', 0, 1], ['B', 1, 0], ['W', 1, 1], ['B', 2, 0], ['W', 1, 0], ['B', 0, 0], ['W', 'pass']]], ['illegal', 4]], [[4, [['B', 2, 3], ['W', 0, 2], ['B', 1, 3], ['W', 'pass'], ['B', 1, 0], ['W', 2, 1], ['B', 3, 0], ['W', 1, 1]]], [0, 0, ['..W.', 'BW.B', '.W.B', 'B...']]], [[3, [['W', 1, 0], ['B', 0, 0], ['W', 1, 1], ['B', 0, 1], ['W', 0, 2], ['B', 2, 2]]], [0, 2, ['..W', 'WW.', '..B']]], [[3, [['B', 0, 1], ['W', 0, 0], ['B', 1, 0]]], [1, 0, ['.B.', 'B..', '...']]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"replay case %d\" % i, 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":"f1496f36a097c6d95009d0a6cf3ea56860b88ff4d6de09138791ecaf35771a9d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    size, moves = x\n    g = [['.'] * size for _ in range(size)]\n    pris = {'B': 0, 'W': 0}\n    def chain(i, j):\n        col = g[i][j]\n        seen = {(i, j)}\n        todo = [(i, j)]\n        libs = 0\n        while todo:\n            a, b = todo.pop()\n            for p, q in ((a - 1, b), (a, b + 1), (a + 1, b), (a, b - 1)):\n                if 0 <= p < size and 0 <= q < size:\n                    if g[p][q] == '.':\n                        libs += 1\n                    elif g[p][q] == col and (p, q) not in seen:\n                        seen.add((p, q))\n                        todo.append((p, q))\n        return seen, libs\n    for idx, mv in enumerate(moves):\n        if mv[1] == 'pass':\n            continue\n        col, r, c = mv\n        if g[r][c] != '.':\n            return ['illegal', idx]\n        g[r][c] = col\n        opp = 'B' if col == 'W' else 'W'\n        for p, q in ((r - 1, c), (r, c + 1), (r + 1, c), (r, c - 1)):\n            if 0 <= p < size and 0 <= q < size and g[p][q] == opp:\n                dead, libs = chain(p, q)\n                if libs == 0:\n                    for s, t in dead:\n                        g[s][t] = '.'\n                    pris[col] += len(dead)\n        own, libs = chain(r, c)\n        if libs == 0:\n            return ['illegal', idx]\n    return [pris['B'], pris['W'], [''.join(row) for row in g]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[4, [['B', 3, 0], ['W', 2, 3], ['B', 'pass']]], [0, 0, ['....', '....', '...W', 'B...']]], [[4, [['B', 2, 0], ['W', 3, 1], ['B', 2, 0], ['W', 0, 1], ['B', 2, 0], ['W', 1, 3], ['B', 'pass'], ['W', 0, 1], ['B', 2, 3], ['W', 1, 2], ['B', 1, 1], ['W', 1, 0]]], ['illegal', 2]], [[3, [['B', 1, 1], ['W', 0, 1], ['B', 1, 1], ['W', 1, 1], ['B', 'pass'], ['W', 1, 1], ['B', 2, 0], ['W', 2, 2], ['B', 2, 0], ['W', 1, 1], ['B', 2, 2], ['W', 0, 0], ['B', 'pass'], ['W', 0, 2], ['B', 2, 1]]], ['illegal', 2]], [[3, [['B', 0, 1], ['W', 1, 0], ['B', 2, 1], ['W', 1, 0], ['B', 'pass'], ['W', 0, 0], ['B', 1, 1], ['W', 1, 1], ['B', 1, 1], ['W', 1, 2], ['B', 2, 0], ['W', 1, 1], ['B', 2, 2], ['W', 2, 1], ['B', 0, 0]]], ['illegal', 3]], [[4, [['B', 3, 0], ['W', 2, 1], ['B', 3, 1], ['W', 3, 0], ['B', 0, 0], ['W', 1, 0], ['B', 'pass']]], ['illegal', 3]], [[4, [['B', 0, 3], ['W', 0, 2], ['B', 2, 0], ['W', 1, 3], ['B', 2, 3], ['W', 'pass'], ['B', 0, 1], ['W', 1, 0], ['B', 0, 2], ['W', 1, 0], ['B', 2, 1], ['W', 3, 0]]], ['illegal', 8]], [[3, [['B', 'pass'], ['W', 1, 2], ['B', 0, 0], ['W', 1, 1], ['B', 0, 2], ['W', 0, 1], ['B', 'pass'], ['W', 'pass']]], [0, 1, ['BW.', '.WW', '...']]], [[3, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], [2, 0, ['..B', 'BB.', '...']]]], [[[3, [['B', 0, 1], ['W', 2, 0], ['B', 1, 1], ['W', 1, 2], ['B', 0, 0], ['W', 2, 1], ['B', 2, 1], ['W', 'pass'], ['B', 0, 2], ['W', 1, 1], ['B', 1, 2], ['W', 0, 0], ['B', 'pass']]], ['illegal', 6]], [[4, [['B', 2, 0], ['W', 0, 2], ['B', 1, 1], ['W', 3, 0], ['B', 3, 2]]], [0, 0, ['..W.', '.B..', 'B...', 'W.B.']]], [[3, [['B', 2, 1], ['W', 2, 1], ['B', 1, 2], ['W', 2, 2], ['B', 0, 2], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], ['illegal', 1]], [[4, [['B', 0, 1], ['W', 'pass'], ['B', 1, 3], ['W', 2, 3], ['B', 0, 2], ['W', 2, 0], ['B', 2, 0], ['W', 1, 1], ['B', 'pass'], ['W', 1, 2], ['B', 1, 0], ['W', 3, 2]]], ['illegal', 6]], [[3, [['B', 1, 0], ['W', 2, 2], ['B', 'pass'], ['W', 1, 0], ['B', 1, 2]]], ['illegal', 3]], [[4, [['B', 1, 0], ['W', 2, 0], ['B', 1, 3], ['W', 0, 0], ['B', 1, 1], ['W', 2, 2], ['B', 3, 1], ['W', 1, 2], ['B', 0, 0], ['W', 0, 2], ['B', 1, 0], ['W', 0, 0]]], ['illegal', 8]], [[4, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 1, 2], ['W', 0, 2], ['B', 0, 3]]], [3, 0, ['...B', 'BBB.', '....', '....']]], [[3, [['W', 1, 0], ['B', 0, 0], ['W', 1, 1], ['B', 0, 1], ['W', 0, 2], ['B', 2, 2]]], [0, 2, ['..W', 'WW.', '..B']]]], [[[3, [['B', 2, 0], ['W', 1, 1], ['B', 'pass'], ['W', 2, 1], ['B', 0, 1], ['W', 1, 1]]], ['illegal', 5]], [[4, [['B', 3, 1], ['W', 1, 3], ['B', 2, 3], ['W', 2, 0], ['B', 0, 1], ['W', 1, 3], ['B', 'pass'], ['W', 0, 0], ['B', 3, 0], ['W', 'pass'], ['B', 'pass'], ['W', 1, 1], ['B', 0, 2], ['W', 'pass'], ['B', 0, 0]]], ['illegal', 5]], [[4, [['B', 1, 1], ['W', 0, 2], ['B', 2, 3], ['W', 'pass'], ['B', 1, 1], ['W', 0, 2], ['B', 0, 3], ['W', 2, 0], ['B', 2, 2], ['W', 3, 0], ['B', 3, 0]]], ['illegal', 4]], [[3, [['B', 0, 0], ['W', 2, 2], ['B', 2, 1], ['W', 2, 2], ['B', 1, 2], ['W', 2, 2], ['B', 1, 0]]], ['illegal', 3]], [[3, [['B', 1, 2], ['W', 2, 0], ['B', 1, 0], ['W', 0, 1], ['B', 2, 2], ['W', 2, 2], ['B', 1, 2], ['W', 2, 0], ['B', 'pass'], ['W', 2, 0], ['B', 2, 1], ['W', 2, 0], ['B', 0, 2], ['W', 0, 1], ['B', 2, 2]]], ['illegal', 5]], [[3, [['B', 'pass'], ['W', 1, 2], ['B', 0, 0], ['W', 1, 1], ['B', 0, 2], ['W', 0, 1], ['B', 'pass'], ['W', 'pass']]], [0, 1, ['BW.', '.WW', '...']]], [[4, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 1, 2], ['W', 0, 2], ['B', 0, 3]]], [3, 0, ['...B', 'BBB.', '....', '....']]], [[3, [['W', 0, 1], ['B', 0, 0], ['W', 1, 0], ['B', 'pass'], ['W', 2, 2]]], [0, 1, ['.W.', 'W..', '..W']]]], [[[4, [['B', 'pass'], ['W', 1, 0], ['B', 2, 3], ['W', 3, 2], ['B', 1, 3]]], [0, 0, ['....', 'W..B', '...B', '..W.']]], [[4, [['B', 0, 3], ['W', 'pass'], ['B', 3, 1], ['W', 3, 3], ['B', 3, 1], ['W', 0, 3], ['B', 1, 3], ['W', 'pass'], ['B', 3, 2], ['W', 'pass'], ['B', 3, 1], ['W', 0, 2], ['B', 3, 0]]], ['illegal', 4]], [[3, [['B', 1, 1], ['W', 2, 1], ['B', 2, 0], ['W', 0, 2], ['B', 0, 2], ['W', 0, 0], ['B', 2, 2], ['W', 2, 0], ['B', 2, 2], ['W', 0, 2], ['B', 2, 2], ['W', 2, 0]]], ['illegal', 4]], [[3, [['B', 1, 0], ['W', 0, 1], ['B', 0, 1], ['W', 0, 2], ['B', 2, 0], ['W', 1, 0], ['B', 0, 0], ['W', 2, 1], ['B', 2, 2], ['W', 2, 0], ['B', 1, 1], ['W', 0, 2], ['B', 1, 1], ['W', 0, 2]]], ['illegal', 2]], [[4, [['B', 0, 3], ['W', 3, 3], ['B', 1, 2], ['W', 0, 1], ['B', 3, 0]]], [0, 0, ['.W.B', '..B.', '....', 'B..W']]], [[4, [['B', 3, 0], ['W', 0, 3], ['B', 0, 2]]], [0, 0, ['..BW', '....', '....', 'B...']]], [[3, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], [2, 0, ['..B', 'BB.', '...']]], [[3, [['B', 1, 0], ['W', 0, 0], ['B', 1, 1], ['W', 0, 1], ['B', 0, 2]]], [2, 0, ['..B', 'BB.', '...']]]], [[[3, [['B', 2, 2], ['W', 1, 1], ['B', 1, 0], ['W', 2, 1], ['B', 0, 2]]], [0, 0, ['..B', 'BW.', '.WB']]], [[3, [['B', 0, 2], ['W', 0, 1], ['B', 1, 1], ['W', 2, 2], ['B', 0, 2], ['W', 'pass'], ['B', 1, 1], ['W', 'pass'], ['B', 0, 2], ['W', 2, 1], ['B', 'pass'], ['W', 0, 0], ['B', 'pass']]], ['illegal', 4]], [[3, [['B', 1, 1], ['W', 1, 2], ['B', 0, 2]]], [0, 0, ['..B', '.BW', '...']]], [[3, [['B', 2, 1], ['W', 'pass'], ['B', 'pass'], ['W', 0, 0], ['B', 1, 1], ['W', 0, 2], ['B', 0, 2], ['W', 2, 2], ['B', 0, 1]]], ['illegal', 6]], [[3, [['B', 2, 0], ['W', 0, 1], ['B', 1, 0], ['W', 1, 1], ['B', 2, 0], ['W', 1, 0], ['B', 0, 0], ['W', 'pass']]], ['illegal', 4]], [[4, [['B', 2, 3], ['W', 0, 2], ['B', 1, 3], ['W', 'pass'], ['B', 1, 0], ['W', 2, 1], ['B', 3, 0], ['W', 1, 1]]], [0, 0, ['..W.', 'BW.B', '.W.B', 'B...']]], [[3, [['W', 1, 0], ['B', 0, 0], ['W', 1, 1], ['B', 0, 1], ['W', 0, 2], ['B', 2, 2]]], [0, 2, ['..W', 'WW.', '..B']]], [[3, [['B', 0, 1], ['W', 0, 0], ['B', 1, 0]]], [1, 0, ['.B.', 'B..', '...']]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"replay case %d\" % i, 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":"Small rectangular toy boards given as strings of B, W and dot; a bounded teaching model of one scoring or bookkeeping rule, not a complete rules engine or server implementation. 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-go-territory-scoring-replay-prisoners-prisoner-owner","generated_at":"2026-09-29T14:50:19.873170+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Go servers and scoring tools compute this value automatically; a wrong answer changes a game result.","repair":"Credit captures to the moving colour.","root_cause":"The capture counter indexes the opponent colour.","sha256":"ef4d8f2cd97ad46bf858ced864dd7f229389113e2a49c49037741ba4b238a99a","title":"Captured stones are credited to the captured side · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.699,"exit_code":1,"observations":[{"actual":[0,0,["....","....","...W","B..."]],"check":"replay case 0","expected":[0,0,["....","....","...W","B..."]],"passed":true},{"actual":["illegal",2],"check":"replay case 1","expected":["illegal",2],"passed":true},{"actual":["illegal",2],"check":"replay case 2","expected":["illegal",2],"passed":true},{"actual":["illegal",3],"check":"replay case 3","expected":["illegal",3],"passed":true},{"actual":["illegal",3],"check":"replay case 4","expected":["illegal",3],"passed":true},{"actual":["illegal",8],"check":"replay case 5","expected":["illegal",8],"passed":true},{"actual":[0,1,["BW.",".WW","..."]],"check":"replay case 6","expected":[0,1,["BW.",".WW","..."]],"passed":true},{"actual":[1,0,["..B","BB.","..."]],"check":"replay case 7","expected":[2,0,["..B","BB.","..."]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"replay case 0\", \"actual\": [0, 0, [\"....\", \"....\", \"...W\", \"B...\"]], \"expected\": [0, 0, [\"....\", \"....\", \"...W\", \"B...\"]], \"passed\": true}, {\"check\": \"replay case 1\", \"actual\": [\"illegal\", 2], \"expected\": [\"illegal\", 2], \"passed\": true}, {\"check\": \"replay case 2\", \"actual\": [\"illegal\", 2], \"expected\": [\"illegal\", 2], \"passed\": true}, {\"check\": \"replay case 3\", \"actual\": [\"illegal\", 3], \"expected\": [\"illegal\", 3], \"passed\": true}, {\"check\": \"replay case 4\", \"actual\": [\"illegal\", 3], \"expected\": [\"illegal\", 3], \"passed\": true}, {\"check\": \"replay case 5\", \"actual\": [\"illegal\", 8], \"expected\": [\"illegal\", 8], \"passed\": true}, {\"check\": \"replay case 6\", \"actual\": [0, 1, [\"BW.\", \".WW\", \"...\"]], \"expected\": [0, 1, [\"BW.\", \".WW\", \"...\"]], \"passed\": true}, {\"check\": \"replay case 7\", \"actual\": [1, 0, [\"..B\", \"BB.\", \"...\"]], \"expected\": [2, 0, [\"..B\", \"BB.\", \"...\"]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.648,"exit_code":1,"observations":[{"actual":[0,0,["....","....","...W","B..."]],"check":"replay case 0","expected":[0,0,["....","....","...W","B..."]],"passed":true},{"actual":["illegal",2],"check":"replay case 1","expected":["illegal",2],"passed":true},{"actual":["illegal",2],"check":"replay case 2","expected":["illegal",2],"passed":true},{"actual":["illegal",3],"check":"replay case 3","expected":["illegal",3],"passed":true},{"actual":["illegal",3],"check":"replay case 4","expected":["illegal",3],"passed":true},{"actual":["illegal",8],"check":"replay case 5","expected":["illegal",8],"passed":true},{"actual":[1,0,["BW.",".WW","..."]],"check":"replay case 6","expected":[0,1,["BW.",".WW","..."]],"passed":false},{"actual":[0,2,["..B","BB.","..."]],"check":"replay case 7","expected":[2,0,["..B","BB.","..."]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"replay case 0\", \"actual\": [0, 0, [\"....\", \"....\", \"...W\", \"B...\"]], \"expected\": [0, 0, [\"....\", \"....\", \"...W\", \"B...\"]], \"passed\": true}, {\"check\": \"replay case 1\", \"actual\": [\"illegal\", 2], \"expected\": [\"illegal\", 2], \"passed\": true}, {\"check\": \"replay case 2\", \"actual\": [\"illegal\", 2], \"expected\": [\"illegal\", 2], \"passed\": true}, {\"check\": \"replay case 3\", \"actual\": [\"illegal\", 3], \"expected\": [\"illegal\", 3], \"passed\": true}, {\"check\": \"replay case 4\", \"actual\": [\"illegal\", 3], \"expected\": [\"illegal\", 3], \"passed\": true}, {\"check\": \"replay case 5\", \"actual\": [\"illegal\", 8], \"expected\": [\"illegal\", 8], \"passed\": true}, {\"check\": \"replay case 6\", \"actual\": [1, 0, [\"BW.\", \".WW\", \"...\"]], \"expected\": [0, 1, [\"BW.\", \".WW\", \"...\"]], \"passed\": false}, {\"check\": \"replay case 7\", \"actual\": [0, 2, [\"..B\", \"BB.\", \"...\"]], \"expected\": [2, 0, [\"..B\", \"BB.\", \"...\"]], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.063,"exit_code":0,"observations":[{"actual":[0,0,["....","....","...W","B..."]],"check":"replay case 0","expected":[0,0,["....","....","...W","B..."]],"passed":true},{"actual":["illegal",2],"check":"replay case 1","expected":["illegal",2],"passed":true},{"actual":["illegal",2],"check":"replay case 2","expected":["illegal",2],"passed":true},{"actual":["illegal",3],"check":"replay case 3","expected":["illegal",3],"passed":true},{"actual":["illegal",3],"check":"replay case 4","expected":["illegal",3],"passed":true},{"actual":["illegal",8],"check":"replay case 5","expected":["illegal",8],"passed":true},{"actual":[0,1,["BW.",".WW","..."]],"check":"replay case 6","expected":[0,1,["BW.",".WW","..."]],"passed":true},{"actual":[2,0,["..B","BB.","..."]],"check":"replay case 7","expected":[2,0,["..B","BB.","..."]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"replay case 0\", \"actual\": [0, 0, [\"....\", \"....\", \"...W\", \"B...\"]], \"expected\": [0, 0, [\"....\", \"....\", \"...W\", \"B...\"]], \"passed\": true}, {\"check\": \"replay case 1\", \"actual\": [\"illegal\", 2], \"expected\": [\"illegal\", 2], \"passed\": true}, {\"check\": \"replay case 2\", \"actual\": [\"illegal\", 2], \"expected\": [\"illegal\", 2], \"passed\": true}, {\"check\": \"replay case 3\", \"actual\": [\"illegal\", 3], \"expected\": [\"illegal\", 3], \"passed\": true}, {\"check\": \"replay case 4\", \"actual\": [\"illegal\", 3], \"expected\": [\"illegal\", 3], \"passed\": true}, {\"check\": \"replay case 5\", \"actual\": [\"illegal\", 8], \"expected\": [\"illegal\", 8], \"passed\": true}, {\"check\": \"replay case 6\", \"actual\": [0, 1, [\"BW.\", \".WW\", \"...\"]], \"expected\": [0, 1, [\"BW.\", \".WW\", \"...\"]], \"passed\": true}, {\"check\": \"replay case 7\", \"actual\": [2, 0, [\"..B\", \"BB.\", \"...\"]], \"expected\": [2, 0, [\"..B\", \"BB.\", \"...\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}