FAILURE MAP
← Case archive

FA-83261 / Go territory scoring / Open access

Points exactly at the reach distance are left neutral · case 01

The estimate shrinks every moyo by one ring.

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

ROOT CAUSE

The cutoff excludes d == reach.

VERIFIED REPAIR

Include distances up to and including reach.

Unsuccessful approach: Applying the cutoff with Chebyshev distance while ranking by Manhattan distance admits diagonal points beyond reach.

Case contract

Input [board, reach]. Each empty point belongs to the colour of the strictly nearest stones by Manhattan distance, provided that distance <= reach; ties between colours or no stone in reach leave it neutral. Return [black_points, white_points].

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, reach = x
    n = len(board)
    m = len(board[0])
    stones = [(i, j, board[i][j]) for i in range(n) for j in range(m) if board[i][j] != '.']
    own = {'B': 0, 'W': 0}
    for r in range(n):
        for c in range(m):
            if board[r][c] != '.':
                continue
            best = None
            near = set()
            for i, j, col in stones:
                d = abs(i - r) + abs(j - c)
                if d >= reach:
                    continue
                if best is None or d < best:
                    best = d
                    near = {col}
                elif d == best:
                    near.add(col)
            if len(near) == 1:
                own[near.pop()] += 1
    return [own['B'], own['W']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['.BW.', '.BW.', '.BW.', '.BW.'], 1], [4, 4]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 1], [5, 3]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 2], [4, 0]], [[['WWW', 'W.W', 'WWW'], 3], [0, 1]], [[['B.W', '...', 'W.B'], 4], [0, 0]], [[['.B...', 'B....', '.....', '....W', '...W.'], 1], [4, 4]], [[['BW.', 'BW.', 'BW.'], 2], [0, 3]], [[['WW.B.', '.W.B.', '....B', '...W.', '.W..W', 'BWBWW'], 1], [2, 5]]], [[[['.B...', 'B....', '.....', '....W', '...W.'], 1], [4, 4]], [[['WB.B', 'B.B.', '.B..', 'B...'], 4], [9, 0]], [[['..W', '.W.', 'W..'], 1], [0, 4]], [[['B....B', '......', '..WW..', '..WW..', '......', 'B....B'], 2], [8, 8]], [[['......', '..WW..', '.....B', '.....B'], 3], [4, 14]], [[['W.W...', 'W...B.', 'BB....', 'W.....', 'W.....', 'WWWW..'], 4], [10, 11]], [[['..W.', 'B.WW', 'WBWB', 'WWW.', 'WBBW', '.WWB'], 1], [1, 3]], [[['.BB...', 'BBB.B.', '.B...B', 'B.BB..', '..BW..'], 1], [14, 1]]], [[[['.B...', 'B....', '.....', '....W', '...W.'], 1], [4, 4]], [[['..W.', 'B.WW', 'WBWB', 'WWW.', 'WBBW', '.WWB'], 1], [1, 3]], [[['W.W.', 'WW.W', '..WB', 'WWBW'], 4], [0, 5]], [[['BW..', 'BBBW', 'W...', '.W..', '..W.', '..BW'], 1], [2, 6]], [[['....B.', '.....B', 'B.W.B.', '.B.BBW'], 2], [6, 1]], [[['B.....', '...B.W', '....B.', 'BB.BWB'], 3], [11, 1]], [[['W..WW.', '.W....', 'WW.B..', '....W.', '..W..B'], 4], [0, 13]], [[['..WWW', '...BB', '.W...', '.BW..'], 1], [3, 5]]], [[[['..WWW', '...BB', '.W...', '.BW..'], 1], [3, 5]], [[['BWWBBW', 'BBWWBB', '.WW.BW', 'WW.WWB'], 2], [0, 1]], [[['BBWW', 'WBBW', 'WBBW', '..BB'], 3], [1, 1]], [[['....BB', 'B.....', 'B.....', 'B.BB..', '...B.B'], 4], [21, 0]], [[['.WBBB', 'B.BBB', 'WB...', 'BBBWW'], 1], [1, 0]], [[['WWWWWW', '.WB.B.', '.WBBB.', '.B.W.B', 'WBBW..'], 2], [2, 3]], [[['.W.B', '...W', '....', '..BB', 'B..B'], 3], [6, 4]], [[['WW.B.', '.W.B.', '....B', '...W.', '.W..W', 'BWBWW'], 1], [2, 5]]], [[[['WW..B', '..W..', '....W', 'WWW.B', 'B...W', 'WB.WB'], 4], [1, 10]], [[['WWWW.B', '.WW.B.', 'W.WWBW', 'W...BW', 'B.WBBW', '..BW..'], 1], [2, 5]], [[['.B.B', 'WBW.', 'B.BB', '....', '.W.B'], 2], [4, 2]], [[['....B', '....B', 'B...W', '..B..', '...WW'], 3], [13, 2]], [[['WBB..', 'WWW.W', 'BW..W', 'W.B.B', 'W.WW.'], 4], [1, 4]], [[['WW.B.', '.W.B.', '....B', '...W.', '.W..W', 'BWBWW'], 1], [2, 5]], [[['.W.B.', '...W.', 'WW...', 'BB...'], 2], [2, 8]], [[['.BB...', 'BBB.B.', '.B...B', 'B.BB..', '..BW..'], 1], [14, 1]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("estimate 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
estimate case 0[0, 0][4, 4]Failed
estimate case 1[0, 0][5, 3]Failed
estimate case 2[4, 0][4, 0]Passed
estimate case 3[0, 1][0, 1]Passed
estimate case 4[0, 0][0, 0]Passed
estimate case 5[0, 0][4, 4]Failed
estimate case 6[0, 3][0, 3]Passed
estimate case 7[0, 0][2, 5]Failed

SHA-256 / 2c7ef359d927c072cc79ad6a90b501d4ef828044ec1f8e0645a4e365cf9b1bae

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    board, reach = x
    n = len(board)
    m = len(board[0])
    stones = [(i, j, board[i][j]) for i in range(n) for j in range(m) if board[i][j] != '.']
    own = {'B': 0, 'W': 0}
    for r in range(n):
        for c in range(m):
            if board[r][c] != '.':
                continue
            best = None
            near = set()
            for i, j, col in stones:
                d = abs(i - r) + abs(j - c)
                if max(abs(i - r), abs(j - c)) > reach:
                    continue
                if best is None or d < best:
                    best = d
                    near = {col}
                elif d == best:
                    near.add(col)
            if len(near) == 1:
                own[near.pop()] += 1
    return [own['B'], own['W']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['.BW.', '.BW.', '.BW.', '.BW.'], 1], [4, 4]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 1], [5, 3]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 2], [4, 0]], [[['WWW', 'W.W', 'WWW'], 3], [0, 1]], [[['B.W', '...', 'W.B'], 4], [0, 0]], [[['.B...', 'B....', '.....', '....W', '...W.'], 1], [4, 4]], [[['BW.', 'BW.', 'BW.'], 2], [0, 3]], [[['WW.B.', '.W.B.', '....B', '...W.', '.W..W', 'BWBWW'], 1], [2, 5]]], [[[['.B...', 'B....', '.....', '....W', '...W.'], 1], [4, 4]], [[['WB.B', 'B.B.', '.B..', 'B...'], 4], [9, 0]], [[['..W', '.W.', 'W..'], 1], [0, 4]], [[['B....B', '......', '..WW..', '..WW..', '......', 'B....B'], 2], [8, 8]], [[['......', '..WW..', '.....B', '.....B'], 3], [4, 14]], [[['W.W...', 'W...B.', 'BB....', 'W.....', 'W.....', 'WWWW..'], 4], [10, 11]], [[['..W.', 'B.WW', 'WBWB', 'WWW.', 'WBBW', '.WWB'], 1], [1, 3]], [[['.BB...', 'BBB.B.', '.B...B', 'B.BB..', '..BW..'], 1], [14, 1]]], [[[['.B...', 'B....', '.....', '....W', '...W.'], 1], [4, 4]], [[['..W.', 'B.WW', 'WBWB', 'WWW.', 'WBBW', '.WWB'], 1], [1, 3]], [[['W.W.', 'WW.W', '..WB', 'WWBW'], 4], [0, 5]], [[['BW..', 'BBBW', 'W...', '.W..', '..W.', '..BW'], 1], [2, 6]], [[['....B.', '.....B', 'B.W.B.', '.B.BBW'], 2], [6, 1]], [[['B.....', '...B.W', '....B.', 'BB.BWB'], 3], [11, 1]], [[['W..WW.', '.W....', 'WW.B..', '....W.', '..W..B'], 4], [0, 13]], [[['..WWW', '...BB', '.W...', '.BW..'], 1], [3, 5]]], [[[['..WWW', '...BB', '.W...', '.BW..'], 1], [3, 5]], [[['BWWBBW', 'BBWWBB', '.WW.BW', 'WW.WWB'], 2], [0, 1]], [[['BBWW', 'WBBW', 'WBBW', '..BB'], 3], [1, 1]], [[['....BB', 'B.....', 'B.....', 'B.BB..', '...B.B'], 4], [21, 0]], [[['.WBBB', 'B.BBB', 'WB...', 'BBBWW'], 1], [1, 0]], [[['WWWWWW', '.WB.B.', '.WBBB.', '.B.W.B', 'WBBW..'], 2], [2, 3]], [[['.W.B', '...W', '....', '..BB', 'B..B'], 3], [6, 4]], [[['WW.B.', '.W.B.', '....B', '...W.', '.W..W', 'BWBWW'], 1], [2, 5]]], [[[['WW..B', '..W..', '....W', 'WWW.B', 'B...W', 'WB.WB'], 4], [1, 10]], [[['WWWW.B', '.WW.B.', 'W.WWBW', 'W...BW', 'B.WBBW', '..BW..'], 1], [2, 5]], [[['.B.B', 'WBW.', 'B.BB', '....', '.W.B'], 2], [4, 2]], [[['....B', '....B', 'B...W', '..B..', '...WW'], 3], [13, 2]], [[['WBB..', 'WWW.W', 'BW..W', 'W.B.B', 'W.WW.'], 4], [1, 4]], [[['WW.B.', '.W.B.', '....B', '...W.', '.W..W', 'BWBWW'], 1], [2, 5]], [[['.W.B.', '...W.', 'WW...', 'BB...'], 2], [2, 8]], [[['.BB...', 'BBB.B.', '.B...B', 'B.BB..', '..BW..'], 1], [14, 1]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("estimate 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
estimate case 0[4, 4][4, 4]Passed
estimate case 1[8, 3][5, 3]Failed
estimate case 2[4, 0][4, 0]Passed
estimate case 3[0, 1][0, 1]Passed
estimate case 4[0, 0][0, 0]Passed
estimate case 5[6, 6][4, 4]Failed
estimate case 6[0, 3][0, 3]Passed
estimate case 7[2, 7][2, 5]Failed

SHA-256 / 9180d3c859894c2c573fd528cc98e92e456e9e7b20f5b82a17585517807dd3cf

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    board, reach = x
    n = len(board)
    m = len(board[0])
    stones = [(i, j, board[i][j]) for i in range(n) for j in range(m) if board[i][j] != '.']
    own = {'B': 0, 'W': 0}
    for r in range(n):
        for c in range(m):
            if board[r][c] != '.':
                continue
            best = None
            near = set()
            for i, j, col in stones:
                d = abs(i - r) + abs(j - c)
                if d > reach:
                    continue
                if best is None or d < best:
                    best = d
                    near = {col}
                elif d == best:
                    near.add(col)
            if len(near) == 1:
                own[near.pop()] += 1
    return [own['B'], own['W']]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['.BW.', '.BW.', '.BW.', '.BW.'], 1], [4, 4]], [[['.W.B.', 'W.WB.', '.WB..', 'WB...', 'B....'], 1], [5, 3]], [[['BBBB', 'B..B', 'B..B', 'BBBB'], 2], [4, 0]], [[['WWW', 'W.W', 'WWW'], 3], [0, 1]], [[['B.W', '...', 'W.B'], 4], [0, 0]], [[['.B...', 'B....', '.....', '....W', '...W.'], 1], [4, 4]], [[['BW.', 'BW.', 'BW.'], 2], [0, 3]], [[['WW.B.', '.W.B.', '....B', '...W.', '.W..W', 'BWBWW'], 1], [2, 5]]], [[[['.B...', 'B....', '.....', '....W', '...W.'], 1], [4, 4]], [[['WB.B', 'B.B.', '.B..', 'B...'], 4], [9, 0]], [[['..W', '.W.', 'W..'], 1], [0, 4]], [[['B....B', '......', '..WW..', '..WW..', '......', 'B....B'], 2], [8, 8]], [[['......', '..WW..', '.....B', '.....B'], 3], [4, 14]], [[['W.W...', 'W...B.', 'BB....', 'W.....', 'W.....', 'WWWW..'], 4], [10, 11]], [[['..W.', 'B.WW', 'WBWB', 'WWW.', 'WBBW', '.WWB'], 1], [1, 3]], [[['.BB...', 'BBB.B.', '.B...B', 'B.BB..', '..BW..'], 1], [14, 1]]], [[[['.B...', 'B....', '.....', '....W', '...W.'], 1], [4, 4]], [[['..W.', 'B.WW', 'WBWB', 'WWW.', 'WBBW', '.WWB'], 1], [1, 3]], [[['W.W.', 'WW.W', '..WB', 'WWBW'], 4], [0, 5]], [[['BW..', 'BBBW', 'W...', '.W..', '..W.', '..BW'], 1], [2, 6]], [[['....B.', '.....B', 'B.W.B.', '.B.BBW'], 2], [6, 1]], [[['B.....', '...B.W', '....B.', 'BB.BWB'], 3], [11, 1]], [[['W..WW.', '.W....', 'WW.B..', '....W.', '..W..B'], 4], [0, 13]], [[['..WWW', '...BB', '.W...', '.BW..'], 1], [3, 5]]], [[[['..WWW', '...BB', '.W...', '.BW..'], 1], [3, 5]], [[['BWWBBW', 'BBWWBB', '.WW.BW', 'WW.WWB'], 2], [0, 1]], [[['BBWW', 'WBBW', 'WBBW', '..BB'], 3], [1, 1]], [[['....BB', 'B.....', 'B.....', 'B.BB..', '...B.B'], 4], [21, 0]], [[['.WBBB', 'B.BBB', 'WB...', 'BBBWW'], 1], [1, 0]], [[['WWWWWW', '.WB.B.', '.WBBB.', '.B.W.B', 'WBBW..'], 2], [2, 3]], [[['.W.B', '...W', '....', '..BB', 'B..B'], 3], [6, 4]], [[['WW.B.', '.W.B.', '....B', '...W.', '.W..W', 'BWBWW'], 1], [2, 5]]], [[[['WW..B', '..W..', '....W', 'WWW.B', 'B...W', 'WB.WB'], 4], [1, 10]], [[['WWWW.B', '.WW.B.', 'W.WWBW', 'W...BW', 'B.WBBW', '..BW..'], 1], [2, 5]], [[['.B.B', 'WBW.', 'B.BB', '....', '.W.B'], 2], [4, 2]], [[['....B', '....B', 'B...W', '..B..', '...WW'], 3], [13, 2]], [[['WBB..', 'WWW.W', 'BW..W', 'W.B.B', 'W.WW.'], 4], [1, 4]], [[['WW.B.', '.W.B.', '....B', '...W.', '.W..W', 'BWBWW'], 1], [2, 5]], [[['.W.B.', '...W.', 'WW...', 'BB...'], 2], [2, 8]], [[['.BB...', 'BBB.B.', '.B...B', 'B.BB..', '..BW..'], 1], [14, 1]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("estimate 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
estimate case 0[4, 4][4, 4]Passed
estimate case 1[5, 3][5, 3]Passed
estimate case 2[4, 0][4, 0]Passed
estimate case 3[0, 1][0, 1]Passed
estimate case 4[0, 0][0, 0]Passed
estimate case 5[4, 4][4, 4]Passed
estimate case 6[0, 3][0, 3]Passed
estimate case 7[2, 5][2, 5]Passed

SHA-256 / bc5eaf3e7532d42361ab544cce70841905d3153fd8599c083cee51aee84f22a0

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

Case digest / 04d37666473c9b9f89ee15e0e5b388ea8e8d6e23ad726179bc824251bfa1b3d9