FA-82896 / Go territory scoring / Open access
Only one of several simultaneously captured chains is removed · case 01
A move that removes the last liberty of two opponent chains leaves one of them on the board.
ROOT CAUSE
The capture loop stops after the first captured chain.
THE FAILURE
The capture loop stops after the first captured chain.
Unsuccessful approach: Removing every chain but assigning the counter instead of accumulating reports only the last chain size.
Case contract
Input [board, colour, row, col]. Occupied point -> ["illegal", "occupied"]. Otherwise place the stone, remove every adjacent opponent chain left without liberties, then reject the move as ["illegal", "suicide"] only if the placed chain still has no liberty. Return [new_board, captured_stone_count].
Why this case matters
Go servers and scoring tools compute this value automatically; a wrong answer changes a game result.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
board, color, r, c = x
g = [list(row) for row in board]
n = len(g)
m = len(g[0])
if g[r][c] != '.':
return ['illegal', 'occupied']
opp = 'W' if color == 'B' else 'B'
g[r][c] = color
def group(i, j):
col = g[i][j]
stones = {(i, j)}
libs = set()
stack = [(i, j)]
while stack:
a, b = stack.pop()
for p, q in ((a, b + 1), (a + 1, b), (a, b - 1), (a - 1, b)):
if 0 <= p < n and 0 <= q < m:
if g[p][q] == '.':
libs.add((p, q))
elif g[p][q] == col and (p, q) not in stones:
stones.add((p, q))
stack.append((p, q))
return stones, libs
captured = 0
for p, q in ((r + 1, c), (r - 1, c), (r, c + 1), (r, c - 1)):
if 0 <= p < n and 0 <= q < m and g[p][q] == opp:
stones, libs = group(p, q)
if not libs:
for s, t in stones:
g[s][t] = '.'
captured += len(stones)
break
stones, libs = group(r, c)
if not libs:
return ['illegal', 'suicide']
return [[''.join(row) for row in g], captured]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['...', '...', '...'], 'W', 2, 0], [['...', '...', 'W..'], 0]], [[['.B.', 'B.B', '.B.'], 'W', 2, 2], ['illegal', 'suicide']], [[['.B.', 'B.B', '.B.'], 'W', 2, 0], ['illegal', 'suicide']], [[['.B.', 'B.B', '.B.'], 'B', 0, 0], [['BB.', 'B.B', '.B.'], 0]], [[['.B.', 'B.B', '.B.'], 'B', 0, 2], [['.BB', 'B.B', '.B.'], 0]], [[['.B.', 'B.B', '.B.'], 'B', 0, 1], ['illegal', 'occupied']], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]]], [[[['B..W', 'B..W', 'B..W', 'B..W'], 'B', 1, 1], [['B..W', 'BB.W', 'B..W', 'B..W'], 0]], [[['B..W', 'B..W', 'B..W', 'B..W'], 'W', 0, 2], [['B.WW', 'B..W', 'B..W', 'B..W'], 0]], [[['B..W', 'B..W', 'B..W', 'B..W'], 'B', 0, 1], [['BB.W', 'B..W', 'B..W', 'B..W'], 0]], [[['B..W', 'B..W', 'B..W', 'B..W'], 'B', 2, 0], ['illegal', 'occupied']], [[['.BW.', '.BW.', '.BW.', '.BW.'], 'W', 2, 3], [['.BW.', '.BW.', '.BWW', '.BW.'], 0]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 'W', 0, 0], [['WBW.', '.BW.', '.BW.', '.BW.'], 0]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]], [[['BWB', 'W.W', 'BWB'], 'B', 1, 1], [['B.B', '.B.', 'B.B'], 4]]], [[[['.BW.', '.BW.', '.BW.', '.BW.'], 'B', 2, 0], [['.BW.', '.BW.', 'BBW.', '.BW.'], 0]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 'B', 0, 2], ['illegal', 'occupied']], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 'B', 0, 0], [['B.B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 'B', 1, 1], [['..B..', '.BB..', 'BBBBB', 'WWWWW', '..W..'], 0]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 'B', 4, 0], [['..B..', '..B..', 'BBBBB', 'WWWWW', 'B.W..'], 0]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 'B', 0, 1], [['.BB..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]], [[['.WB.', 'B.WB', 'W.BW'], 'W', 0, 3], [['.W.W', 'B.W.', 'W.BW'], 2]]], [[[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 'W', 2, 1], ['illegal', 'suicide']], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 'W', 0, 1], ['illegal', 'suicide']], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 'B', 4, 3], [['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..WB.'], 0]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 'B', 2, 4], [['B.B.W', '.B.W.', 'B.BWB', 'BBW.W', '..W..'], 0]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 'B', 3, 2], ['illegal', 'occupied']], [[['W....', '.....', '.....', '.....', '....B'], 'W', 4, 1], [['W....', '.....', '.....', '.....', '.W..B'], 0]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]]], [[[['W....', '.....', '.....', '.....', '....B'], 'W', 3, 0], [['W....', '.....', '.....', 'W....', '....B'], 0]], [[['W....', '.....', '.....', '.....', '....B'], 'W', 4, 0], [['W....', '.....', '.....', '.....', 'W...B'], 0]], [[['W....', '.....', '.....', '.....', '....B'], 'B', 4, 4], ['illegal', 'occupied']], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 'W', 0, 2], [['.WWB.', 'W.WB.', '.WB..', 'WB...', 'B....'], 0]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 'W', 0, 0], [['WW.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 0]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 'B', 2, 4], [['.W.B.', 'W.WB.', '.WB.B', 'WB...', 'B....'], 0]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]], [[['BWB', 'W.W', 'BWB'], 'B', 1, 1], [['B.B', '.B.', 'B.B'], 4]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("move result case %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| move result case 0 | [['...', '...', 'W..'], 0] | [['...', '...', 'W..'], 0] | Passed |
| move result case 1 | ['illegal', 'suicide'] | ['illegal', 'suicide'] | Passed |
| move result case 2 | ['illegal', 'suicide'] | ['illegal', 'suicide'] | Passed |
| move result case 3 | [['BB.', 'B.B', '.B.'], 0] | [['BB.', 'B.B', '.B.'], 0] | Passed |
| move result case 4 | [['.BB', 'B.B', '.B.'], 0] | [['.BB', 'B.B', '.B.'], 0] | Passed |
| move result case 5 | ['illegal', 'occupied'] | ['illegal', 'occupied'] | Passed |
| move result case 6 | [['WB.BB', 'B.B.W', 'BBWBB', 'B.BW.'], 1] | [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2] | Failed |
| move result case 7 | [['WB.BB', 'B.B.W', 'BBWBB', 'B.BW.'], 1] | [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2] | Failed |
SHA-256 / 67643e254b8c3b488f8e48f282f2d3e5fc4e30b2793991355452790cde6c4ca8
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
board, color, r, c = x
g = [list(row) for row in board]
n = len(g)
m = len(g[0])
if g[r][c] != '.':
return ['illegal', 'occupied']
opp = 'W' if color == 'B' else 'B'
g[r][c] = color
def group(i, j):
col = g[i][j]
stones = {(i, j)}
libs = set()
stack = [(i, j)]
while stack:
a, b = stack.pop()
for p, q in ((a, b + 1), (a + 1, b), (a, b - 1), (a - 1, b)):
if 0 <= p < n and 0 <= q < m:
if g[p][q] == '.':
libs.add((p, q))
elif g[p][q] == col and (p, q) not in stones:
stones.add((p, q))
stack.append((p, q))
return stones, libs
captured = 0
for p, q in ((r + 1, c), (r - 1, c), (r, c + 1), (r, c - 1)):
if 0 <= p < n and 0 <= q < m and g[p][q] == opp:
stones, libs = group(p, q)
if not libs:
for s, t in stones:
g[s][t] = '.'
captured = len(stones)
stones, libs = group(r, c)
if not libs:
return ['illegal', 'suicide']
return [[''.join(row) for row in g], captured]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['...', '...', '...'], 'W', 2, 0], [['...', '...', 'W..'], 0]], [[['.B.', 'B.B', '.B.'], 'W', 2, 2], ['illegal', 'suicide']], [[['.B.', 'B.B', '.B.'], 'W', 2, 0], ['illegal', 'suicide']], [[['.B.', 'B.B', '.B.'], 'B', 0, 0], [['BB.', 'B.B', '.B.'], 0]], [[['.B.', 'B.B', '.B.'], 'B', 0, 2], [['.BB', 'B.B', '.B.'], 0]], [[['.B.', 'B.B', '.B.'], 'B', 0, 1], ['illegal', 'occupied']], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]]], [[[['B..W', 'B..W', 'B..W', 'B..W'], 'B', 1, 1], [['B..W', 'BB.W', 'B..W', 'B..W'], 0]], [[['B..W', 'B..W', 'B..W', 'B..W'], 'W', 0, 2], [['B.WW', 'B..W', 'B..W', 'B..W'], 0]], [[['B..W', 'B..W', 'B..W', 'B..W'], 'B', 0, 1], [['BB.W', 'B..W', 'B..W', 'B..W'], 0]], [[['B..W', 'B..W', 'B..W', 'B..W'], 'B', 2, 0], ['illegal', 'occupied']], [[['.BW.', '.BW.', '.BW.', '.BW.'], 'W', 2, 3], [['.BW.', '.BW.', '.BWW', '.BW.'], 0]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 'W', 0, 0], [['WBW.', '.BW.', '.BW.', '.BW.'], 0]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]], [[['BWB', 'W.W', 'BWB'], 'B', 1, 1], [['B.B', '.B.', 'B.B'], 4]]], [[[['.BW.', '.BW.', '.BW.', '.BW.'], 'B', 2, 0], [['.BW.', '.BW.', 'BBW.', '.BW.'], 0]], [[['.BW.', '.BW.', '.BW.', '.BW.'], 'B', 0, 2], ['illegal', 'occupied']], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 'B', 0, 0], [['B.B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 'B', 1, 1], [['..B..', '.BB..', 'BBBBB', 'WWWWW', '..W..'], 0]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 'B', 4, 0], [['..B..', '..B..', 'BBBBB', 'WWWWW', 'B.W..'], 0]], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 'B', 0, 1], [['.BB..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]], [[['.WB.', 'B.WB', 'W.BW'], 'W', 0, 3], [['.W.W', 'B.W.', 'W.BW'], 2]]], [[[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 'W', 2, 1], ['illegal', 'suicide']], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 'W', 0, 1], ['illegal', 'suicide']], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 'B', 4, 3], [['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..WB.'], 0]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 'B', 2, 4], [['B.B.W', '.B.W.', 'B.BWB', 'BBW.W', '..W..'], 0]], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 'B', 3, 2], ['illegal', 'occupied']], [[['W....', '.....', '.....', '.....', '....B'], 'W', 4, 1], [['W....', '.....', '.....', '.....', '.W..B'], 0]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]]], [[[['W....', '.....', '.....', '.....', '....B'], 'W', 3, 0], [['W....', '.....', '.....', 'W....', '....B'], 0]], [[['W....', '.....', '.....', '.....', '....B'], 'W', 4, 0], [['W....', '.....', '.....', '.....', 'W...B'], 0]], [[['W....', '.....', '.....', '.....', '....B'], 'B', 4, 4], ['illegal', 'occupied']], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 'W', 0, 2], [['.WWB.', 'W.WB.', '.WB..', 'WB...', 'B....'], 0]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 'W', 0, 0], [['WW.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 0]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 'B', 2, 4], [['.W.B.', 'W.WB.', '.WB.B', 'WB...', 'B....'], 0]], [[['WB.BB', 'B.B.W', 'B.WBB', 'BWBW.'], 'B', 2, 1], [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2]], [[['BWB', 'W.W', 'BWB'], 'B', 1, 1], [['B.B', '.B.', 'B.B'], 4]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("move result case %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| move result case 0 | [['...', '...', 'W..'], 0] | [['...', '...', 'W..'], 0] | Passed |
| move result case 1 | ['illegal', 'suicide'] | ['illegal', 'suicide'] | Passed |
| move result case 2 | ['illegal', 'suicide'] | ['illegal', 'suicide'] | Passed |
| move result case 3 | [['BB.', 'B.B', '.B.'], 0] | [['BB.', 'B.B', '.B.'], 0] | Passed |
| move result case 4 | [['.BB', 'B.B', '.B.'], 0] | [['.BB', 'B.B', '.B.'], 0] | Passed |
| move result case 5 | ['illegal', 'occupied'] | ['illegal', 'occupied'] | Passed |
| move result case 6 | [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 1] | [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2] | Failed |
| move result case 7 | [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 1] | [['WB.BB', 'B.B.W', 'BB.BB', 'B.BW.'], 2] | Failed |
SHA-256 / a186506b9d4bc8b959b6d3cdf0ce7cefea9a0cbf346e89ff756252d74343faef
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:50:16.445998+00:00.
Case digest / 4a75762e5312b995aa0d6c29e95770929b2bd1e648f993880fd4272660d7a6bc