FAILURE MAP
← Case archive

FA-83126 / Go territory scoring / Open access

Occupied points are classified as eyes · case 01

A stone surrounded by its own colour is reported as an eye.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The emptiness test is missing.

VERIFIED REPAIR

Return none for occupied points.

Unsuccessful approach: Checking only for black stones still classifies white stones as eyes.

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])
    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'], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 0, 0], 'none'], [[['WBB', 'B.B', 'BBW'], 0, 0], 'none']], [[[['.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'], [[['WWB.', 'W.WW', 'B.WW', 'WBBW', 'WWB.'], 0, 0], 'none'], [[['WW.WW', 'WB.B.', 'WBW.W', 'W.WBB', 'BBB.B'], 0, 0], 'none']], [[[['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'], [[['WWW', 'W.W', 'WWW'], 0, 0], 'none'], [[['BW.', 'W..', '..B', 'W.W'], 0, 0], 'none']], [[[['.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'], [[['WWW..', 'WB..W', '.WW..', '.B.WW', 'B..W.'], 0, 0], 'none'], [[['BBB', 'B.B', 'BBB'], 0, 0], 'none']], [[[['..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'], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 0, 0], 'none'], [[['WWB.', 'W.WW', 'B.WW', 'WBBW', 'WWB.'], 0, 0], 'none']]]
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 fixtureActualExpectedOutcome
eye case 0nonenonePassed
eye case 1nonenonePassed
eye case 2nonenonePassed
eye case 3nonenonePassed
eye case 4nonenonePassed
eye case 5eye-Beye-BPassed
eye case 6eye-BnoneFailed
eye case 7eye-BnoneFailed

SHA-256 / 1eea7c73643aeff6f8a2b718074fe659fddcf2d7eda9e228af2c4314b2219abd

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] == 'B':
        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'], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 0, 0], 'none'], [[['WBB', 'B.B', 'BBW'], 0, 0], 'none']], [[[['.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'], [[['WWB.', 'W.WW', 'B.WW', 'WBBW', 'WWB.'], 0, 0], 'none'], [[['WW.WW', 'WB.B.', 'WBW.W', 'W.WBB', 'BBB.B'], 0, 0], 'none']], [[[['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'], [[['WWW', 'W.W', 'WWW'], 0, 0], 'none'], [[['BW.', 'W..', '..B', 'W.W'], 0, 0], 'none']], [[[['.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'], [[['WWW..', 'WB..W', '.WW..', '.B.WW', 'B..W.'], 0, 0], 'none'], [[['BBB', 'B.B', 'BBB'], 0, 0], 'none']], [[[['..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'], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 0, 0], 'none'], [[['WWB.', 'W.WW', 'B.WW', 'WBBW', 'WWB.'], 0, 0], 'none']]]
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 fixtureActualExpectedOutcome
eye case 0nonenonePassed
eye case 1nonenonePassed
eye case 2nonenonePassed
eye case 3nonenonePassed
eye case 4nonenonePassed
eye case 5eye-Beye-BPassed
eye case 6nonenonePassed
eye case 7eye-BnoneFailed

SHA-256 / 68a71b196250305d3074eeeaa49c2ce855c5a49e5ff05bfe0855e5a3c8932127

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'], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 0, 0], 'none'], [[['WBB', 'B.B', 'BBW'], 0, 0], 'none']], [[[['.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'], [[['WWB.', 'W.WW', 'B.WW', 'WBBW', 'WWB.'], 0, 0], 'none'], [[['WW.WW', 'WB.B.', 'WBW.W', 'W.WBB', 'BBB.B'], 0, 0], 'none']], [[[['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'], [[['WWW', 'W.W', 'WWW'], 0, 0], 'none'], [[['BW.', 'W..', '..B', 'W.W'], 0, 0], 'none']], [[[['.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'], [[['WWW..', 'WB..W', '.WW..', '.B.WW', 'B..W.'], 0, 0], 'none'], [[['BBB', 'B.B', 'BBB'], 0, 0], 'none']], [[[['..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'], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 0, 0], 'none'], [[['WWB.', 'W.WW', 'B.WW', 'WBBW', 'WWB.'], 0, 0], 'none']]]
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 fixtureActualExpectedOutcome
eye case 0nonenonePassed
eye case 1nonenonePassed
eye case 2nonenonePassed
eye case 3nonenonePassed
eye case 4nonenonePassed
eye case 5eye-Beye-BPassed
eye case 6nonenonePassed
eye case 7nonenonePassed

SHA-256 / e6296790c30c57c9353ca29d0b87f70456b27392e95fe21b2ccee762a19311f2

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.730828+00:00.

Case digest / 0ca19900facf19cfe29cafddfd0be351beb68739313fdd0086c649feef9da1e1