FA-83121 / Go territory scoring / Open access
False eyes need one opponent diagonal too many · case 01
Centre points with exactly two opponent diagonals are called real eyes.
ROOT CAUSE
The comparison uses > limit.
VERIFIED REPAIR
A point is false when bad >= limit.
Unsuccessful approach: Restricting false eyes to centre points ignores the edge rule.
Case contract
Input [board, row, col]. A point is an eye candidate of colour X if it is empty and every on-board orthogonal neighbour is X. It is false if opponent stones occupy >= 2 diagonals in the centre, or >= 1 diagonal on the edge/corner. Return "eye-X", "false-X" or "none".
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, r, c = x
n = len(board)
m = len(board[0])
if board[r][c] != '.':
return 'none'
orth = []
for p, q in ((r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)):
if 0 <= p < n and 0 <= q < m:
orth.append(board[p][q])
if not orth or orth.count(orth[0]) != len(orth) or orth[0] == '.':
return 'none'
col = orth[0]
opp = 'W' if col == 'B' else 'B'
bad = 0
ondiag = 0
for p, q in ((r - 1, c - 1), (r - 1, c + 1), (r + 1, c - 1), (r + 1, c + 1)):
if 0 <= p < n and 0 <= q < m:
ondiag += 1
if board[p][q] == opp:
bad += 1
limit = 2 if ondiag == 4 else 1
if bad > limit:
return 'false-' + col
return 'eye-' + col
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['...', '...', '...'], 0, 1], 'none'], [[['...', '...', '...'], 0, 2], 'none'], [[['...', '...', '...'], 1, 0], 'none'], [[['...', '...', '...'], 1, 1], 'none'], [[['...', '...', '...'], 1, 2], 'none'], [[['.B.', 'B.B', '.B.'], 0, 0], 'eye-B'], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 0], 'false-W'], [[['B.B..', '.BWBB', '..WB.'], 0, 1], 'false-B']], [[[['.B.', 'B.B', '.B.'], 1, 1], 'eye-B'], [[['.B.', 'B.B', '.B.'], 2, 0], 'eye-B'], [[['.B.', 'B.B', '.B.'], 2, 2], 'eye-B'], [[['.B.', 'B.B', '.B.'], 0, 1], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 0, 1], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 0, 2], 'none'], [[['WB.BB', '..BWB', '...BB'], 0, 2], 'false-B'], [[['WW.WW', 'WB.B.', 'WBW.W', 'W.WBB', 'BBB.B'], 4, 3], 'false-B']], [[[['B..W', 'B..W', 'B..W', 'B..W'], 1, 2], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 2, 1], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 2, 2], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 0, 0], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 0, 0], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 0, 3], 'none'], [[['WBW', '.BW', 'BW.'], 2, 2], 'false-W'], [[['B.B..', '.BWBB', '..WB.'], 0, 1], 'false-B']], [[[['.BW.', '.BW.', '.BW.', '.BW.'], 1, 3], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 2, 0], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 2, 3], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 0, 1], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 0], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 1], 'none'], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 0], 'false-W'], [[['.BW', 'B.B', 'WB.'], 1, 1], 'false-B']], [[[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 4], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 0], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 1], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 2], 'none'], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 0, 1], 'eye-B'], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 0, 3], 'none'], [[['WBW', '.BW', 'BW.'], 2, 2], 'false-W'], [[['..B.', '.BWB', '.BWW', '.BBW'], 0, 3], 'false-B']]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("eye 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 |
|---|---|---|---|
| eye case 0 | none | none | Passed |
| eye case 1 | none | none | Passed |
| eye case 2 | none | none | Passed |
| eye case 3 | none | none | Passed |
| eye case 4 | none | none | Passed |
| eye case 5 | eye-B | eye-B | Passed |
| eye case 6 | eye-W | false-W | Failed |
| eye case 7 | eye-B | false-B | Failed |
SHA-256 / 8d86103ab395a4788edf11f27ad8b81936faf12a86105349ed9605a4b3a5d29b
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
board, r, c = x
n = len(board)
m = len(board[0])
if board[r][c] != '.':
return 'none'
orth = []
for p, q in ((r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)):
if 0 <= p < n and 0 <= q < m:
orth.append(board[p][q])
if not orth or orth.count(orth[0]) != len(orth) or orth[0] == '.':
return 'none'
col = orth[0]
opp = 'W' if col == 'B' else 'B'
bad = 0
ondiag = 0
for p, q in ((r - 1, c - 1), (r - 1, c + 1), (r + 1, c - 1), (r + 1, c + 1)):
if 0 <= p < n and 0 <= q < m:
ondiag += 1
if board[p][q] == opp:
bad += 1
limit = 2 if ondiag == 4 else 1
if bad >= limit and ondiag == 4:
return 'false-' + col
return 'eye-' + col
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['...', '...', '...'], 0, 1], 'none'], [[['...', '...', '...'], 0, 2], 'none'], [[['...', '...', '...'], 1, 0], 'none'], [[['...', '...', '...'], 1, 1], 'none'], [[['...', '...', '...'], 1, 2], 'none'], [[['.B.', 'B.B', '.B.'], 0, 0], 'eye-B'], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 0], 'false-W'], [[['B.B..', '.BWBB', '..WB.'], 0, 1], 'false-B']], [[[['.B.', 'B.B', '.B.'], 1, 1], 'eye-B'], [[['.B.', 'B.B', '.B.'], 2, 0], 'eye-B'], [[['.B.', 'B.B', '.B.'], 2, 2], 'eye-B'], [[['.B.', 'B.B', '.B.'], 0, 1], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 0, 1], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 0, 2], 'none'], [[['WB.BB', '..BWB', '...BB'], 0, 2], 'false-B'], [[['WW.WW', 'WB.B.', 'WBW.W', 'W.WBB', 'BBB.B'], 4, 3], 'false-B']], [[[['B..W', 'B..W', 'B..W', 'B..W'], 1, 2], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 2, 1], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 2, 2], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 0, 0], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 0, 0], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 0, 3], 'none'], [[['WBW', '.BW', 'BW.'], 2, 2], 'false-W'], [[['B.B..', '.BWBB', '..WB.'], 0, 1], 'false-B']], [[[['.BW.', '.BW.', '.BW.', '.BW.'], 1, 3], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 2, 0], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 2, 3], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 0, 1], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 0], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 1], 'none'], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 0], 'false-W'], [[['.BW', 'B.B', 'WB.'], 1, 1], 'false-B']], [[[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 4], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 0], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 1], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 2], 'none'], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 0, 1], 'eye-B'], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 0, 3], 'none'], [[['WBW', '.BW', 'BW.'], 2, 2], 'false-W'], [[['..B.', '.BWB', '.BWW', '.BBW'], 0, 3], 'false-B']]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("eye 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 |
|---|---|---|---|
| eye case 0 | none | none | Passed |
| eye case 1 | none | none | Passed |
| eye case 2 | none | none | Passed |
| eye case 3 | none | none | Passed |
| eye case 4 | none | none | Passed |
| eye case 5 | eye-B | eye-B | Passed |
| eye case 6 | eye-W | false-W | Failed |
| eye case 7 | eye-B | false-B | Failed |
SHA-256 / 0499d8d124c8237eaed21f821525e711eed270db46256696871f31534e58eff0
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
board, r, c = x
n = len(board)
m = len(board[0])
if board[r][c] != '.':
return 'none'
orth = []
for p, q in ((r - 1, c), (r + 1, c), (r, c - 1), (r, c + 1)):
if 0 <= p < n and 0 <= q < m:
orth.append(board[p][q])
if not orth or orth.count(orth[0]) != len(orth) or orth[0] == '.':
return 'none'
col = orth[0]
opp = 'W' if col == 'B' else 'B'
bad = 0
ondiag = 0
for p, q in ((r - 1, c - 1), (r - 1, c + 1), (r + 1, c - 1), (r + 1, c + 1)):
if 0 <= p < n and 0 <= q < m:
ondiag += 1
if board[p][q] == opp:
bad += 1
limit = 2 if ondiag == 4 else 1
if bad >= limit:
return 'false-' + col
return 'eye-' + col
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['...', '...', '...'], 0, 1], 'none'], [[['...', '...', '...'], 0, 2], 'none'], [[['...', '...', '...'], 1, 0], 'none'], [[['...', '...', '...'], 1, 1], 'none'], [[['...', '...', '...'], 1, 2], 'none'], [[['.B.', 'B.B', '.B.'], 0, 0], 'eye-B'], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 0], 'false-W'], [[['B.B..', '.BWBB', '..WB.'], 0, 1], 'false-B']], [[[['.B.', 'B.B', '.B.'], 1, 1], 'eye-B'], [[['.B.', 'B.B', '.B.'], 2, 0], 'eye-B'], [[['.B.', 'B.B', '.B.'], 2, 2], 'eye-B'], [[['.B.', 'B.B', '.B.'], 0, 1], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 0, 1], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 0, 2], 'none'], [[['WB.BB', '..BWB', '...BB'], 0, 2], 'false-B'], [[['WW.WW', 'WB.B.', 'WBW.W', 'W.WBB', 'BBB.B'], 4, 3], 'false-B']], [[[['B..W', 'B..W', 'B..W', 'B..W'], 1, 2], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 2, 1], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 2, 2], 'none'], [[['B..W', 'B..W', 'B..W', 'B..W'], 0, 0], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 0, 0], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 0, 3], 'none'], [[['WBW', '.BW', 'BW.'], 2, 2], 'false-W'], [[['B.B..', '.BWBB', '..WB.'], 0, 1], 'false-B']], [[[['.BW.', '.BW.', '.BW.', '.BW.'], 1, 3], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 2, 0], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 2, 3], 'none'], [[['.BW.', '.BW.', '.BW.', '.BW.'], 0, 1], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 0], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 1], 'none'], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 2, 0], 'false-W'], [[['.BW', 'B.B', 'WB.'], 1, 1], 'false-B']], [[[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 4], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 0], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 1, 1], 'none'], [[['..B..', '..B..', 'BBBBB', 'WWWWW', '..W..'], 0, 2], 'none'], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 0, 1], 'eye-B'], [[['B.B.W', '.B.W.', 'B.BW.', 'BBW.W', '..W..'], 0, 3], 'none'], [[['WBW', '.BW', 'BW.'], 2, 2], 'false-W'], [[['..B.', '.BWB', '.BWW', '.BBW'], 0, 3], 'false-B']]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("eye 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 |
|---|---|---|---|
| eye case 0 | none | none | Passed |
| eye case 1 | none | none | Passed |
| eye case 2 | none | none | Passed |
| eye case 3 | none | none | Passed |
| eye case 4 | none | none | Passed |
| eye case 5 | eye-B | eye-B | Passed |
| eye case 6 | false-W | false-W | Passed |
| eye case 7 | false-B | false-B | Passed |
SHA-256 / 75d02ab07d55294180b6e07639ac58462d23ce5956f82b68490c592cba1f040d
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:18.727791+00:00.
Case digest / 48b101d7527eda290151c27af4acb705e88e9675dae2b68abf309c09fb9ef565