FA-83176 / Go territory scoring / Open access
Exact draws are assigned to one player · case 01
A zero margin is reported as a win.
ROOT CAUSE
The winner comparison includes equality.
VERIFIED REPAIR
Report draw when the margin is zero.
Unsuccessful approach: Moving the equality to the white test still awards the draw.
Case contract
Input [size, black_area, komi_tenths] for a board with no dame. White area is size^2 - black_area. Return [margin_tenths, winner] where margin = 10*(black - white) - komi and winner is B, W or draw.
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):
size, black, komi = x
total = size * size
margin = 20 * black - 10 * total - komi
if margin >= 0:
return [margin, 'B']
if margin < 0:
return [margin, 'W']
return [0, 'draw']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[9, 3, 5], [-755, 'W']], [[9, 26, 65], [-355, 'W']], [[9, 53, 75], [175, 'B']], [[9, 74, 0], [670, 'B']], [[9, 64, 0], [470, 'B']], [[9, 12, 65], [-635, 'W']], [[19, 184, 70], [0, 'draw']], [[9, 43, 50], [0, 'draw']]], [[[9, 6, 0], [-690, 'W']], [[9, 3, 5], [-755, 'W']], [[9, 4, 0], [-730, 'W']], [[9, 69, 65], [505, 'B']], [[9, 35, 70], [-180, 'W']], [[9, 21, 75], [-465, 'W']], [[9, 43, 50], [0, 'draw']], [[19, 185, 90], [0, 'draw']]], [[[13, 163, 5], [1565, 'B']], [[13, 105, 5], [405, 'B']], [[13, 111, 5], [525, 'B']], [[13, 13, 5], [-1435, 'W']], [[13, 7, 70], [-1620, 'W']], [[13, 46, 75], [-845, 'W']], [[9, 43, 50], [0, 'draw']], [[9, 43, 50], [0, 'draw']]], [[[13, 167, 0], [1650, 'B']], [[13, 59, 5], [-515, 'W']], [[13, 130, 5], [905, 'B']], [[13, 39, 65], [-975, 'W']], [[13, 76, 65], [-235, 'W']], [[13, 132, 65], [885, 'B']], [[9, 43, 50], [0, 'draw']], [[9, 42, 30], [0, 'draw']]], [[[13, 107, 65], [385, 'B']], [[13, 136, 5], [1025, 'B']], [[13, 137, 0], [1050, 'B']], [[13, 9, 65], [-1575, 'W']], [[13, 114, 65], [525, 'B']], [[19, 309, 0], [2570, 'B']], [[9, 43, 50], [0, 'draw']], [[13, 87, 50], [0, 'draw']]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("black count 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 |
|---|---|---|---|
| black count case 0 | [-755, 'W'] | [-755, 'W'] | Passed |
| black count case 1 | [-355, 'W'] | [-355, 'W'] | Passed |
| black count case 2 | [175, 'B'] | [175, 'B'] | Passed |
| black count case 3 | [670, 'B'] | [670, 'B'] | Passed |
| black count case 4 | [470, 'B'] | [470, 'B'] | Passed |
| black count case 5 | [-635, 'W'] | [-635, 'W'] | Passed |
| black count case 6 | [0, 'B'] | [0, 'draw'] | Failed |
| black count case 7 | [0, 'B'] | [0, 'draw'] | Failed |
SHA-256 / 5f91e3d376e9ac725ea00e681523f3d615358a4924b231f31c5e468069aaf3cf
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
size, black, komi = x
total = size * size
margin = 20 * black - 10 * total - komi
if margin > 0:
return [margin, 'B']
if margin <= 0:
return [margin, 'W']
return [0, 'draw']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[9, 3, 5], [-755, 'W']], [[9, 26, 65], [-355, 'W']], [[9, 53, 75], [175, 'B']], [[9, 74, 0], [670, 'B']], [[9, 64, 0], [470, 'B']], [[9, 12, 65], [-635, 'W']], [[19, 184, 70], [0, 'draw']], [[9, 43, 50], [0, 'draw']]], [[[9, 6, 0], [-690, 'W']], [[9, 3, 5], [-755, 'W']], [[9, 4, 0], [-730, 'W']], [[9, 69, 65], [505, 'B']], [[9, 35, 70], [-180, 'W']], [[9, 21, 75], [-465, 'W']], [[9, 43, 50], [0, 'draw']], [[19, 185, 90], [0, 'draw']]], [[[13, 163, 5], [1565, 'B']], [[13, 105, 5], [405, 'B']], [[13, 111, 5], [525, 'B']], [[13, 13, 5], [-1435, 'W']], [[13, 7, 70], [-1620, 'W']], [[13, 46, 75], [-845, 'W']], [[9, 43, 50], [0, 'draw']], [[9, 43, 50], [0, 'draw']]], [[[13, 167, 0], [1650, 'B']], [[13, 59, 5], [-515, 'W']], [[13, 130, 5], [905, 'B']], [[13, 39, 65], [-975, 'W']], [[13, 76, 65], [-235, 'W']], [[13, 132, 65], [885, 'B']], [[9, 43, 50], [0, 'draw']], [[9, 42, 30], [0, 'draw']]], [[[13, 107, 65], [385, 'B']], [[13, 136, 5], [1025, 'B']], [[13, 137, 0], [1050, 'B']], [[13, 9, 65], [-1575, 'W']], [[13, 114, 65], [525, 'B']], [[19, 309, 0], [2570, 'B']], [[9, 43, 50], [0, 'draw']], [[13, 87, 50], [0, 'draw']]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("black count 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 |
|---|---|---|---|
| black count case 0 | [-755, 'W'] | [-755, 'W'] | Passed |
| black count case 1 | [-355, 'W'] | [-355, 'W'] | Passed |
| black count case 2 | [175, 'B'] | [175, 'B'] | Passed |
| black count case 3 | [670, 'B'] | [670, 'B'] | Passed |
| black count case 4 | [470, 'B'] | [470, 'B'] | Passed |
| black count case 5 | [-635, 'W'] | [-635, 'W'] | Passed |
| black count case 6 | [0, 'W'] | [0, 'draw'] | Failed |
| black count case 7 | [0, 'W'] | [0, 'draw'] | Failed |
SHA-256 / eb7bc9a2ff6187e3c759495246755c396328e0a38e3f6fe6254568b3e72e42b0
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
size, black, komi = x
total = size * size
margin = 20 * black - 10 * total - komi
if margin > 0:
return [margin, 'B']
if margin < 0:
return [margin, 'W']
return [0, 'draw']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[9, 3, 5], [-755, 'W']], [[9, 26, 65], [-355, 'W']], [[9, 53, 75], [175, 'B']], [[9, 74, 0], [670, 'B']], [[9, 64, 0], [470, 'B']], [[9, 12, 65], [-635, 'W']], [[19, 184, 70], [0, 'draw']], [[9, 43, 50], [0, 'draw']]], [[[9, 6, 0], [-690, 'W']], [[9, 3, 5], [-755, 'W']], [[9, 4, 0], [-730, 'W']], [[9, 69, 65], [505, 'B']], [[9, 35, 70], [-180, 'W']], [[9, 21, 75], [-465, 'W']], [[9, 43, 50], [0, 'draw']], [[19, 185, 90], [0, 'draw']]], [[[13, 163, 5], [1565, 'B']], [[13, 105, 5], [405, 'B']], [[13, 111, 5], [525, 'B']], [[13, 13, 5], [-1435, 'W']], [[13, 7, 70], [-1620, 'W']], [[13, 46, 75], [-845, 'W']], [[9, 43, 50], [0, 'draw']], [[9, 43, 50], [0, 'draw']]], [[[13, 167, 0], [1650, 'B']], [[13, 59, 5], [-515, 'W']], [[13, 130, 5], [905, 'B']], [[13, 39, 65], [-975, 'W']], [[13, 76, 65], [-235, 'W']], [[13, 132, 65], [885, 'B']], [[9, 43, 50], [0, 'draw']], [[9, 42, 30], [0, 'draw']]], [[[13, 107, 65], [385, 'B']], [[13, 136, 5], [1025, 'B']], [[13, 137, 0], [1050, 'B']], [[13, 9, 65], [-1575, 'W']], [[13, 114, 65], [525, 'B']], [[19, 309, 0], [2570, 'B']], [[9, 43, 50], [0, 'draw']], [[13, 87, 50], [0, 'draw']]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("black count 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 |
|---|---|---|---|
| black count case 0 | [-755, 'W'] | [-755, 'W'] | Passed |
| black count case 1 | [-355, 'W'] | [-355, 'W'] | Passed |
| black count case 2 | [175, 'B'] | [175, 'B'] | Passed |
| black count case 3 | [670, 'B'] | [670, 'B'] | Passed |
| black count case 4 | [470, 'B'] | [470, 'B'] | Passed |
| black count case 5 | [-635, 'W'] | [-635, 'W'] | Passed |
| black count case 6 | [0, 'draw'] | [0, 'draw'] | Passed |
| black count case 7 | [0, 'draw'] | [0, 'draw'] | Passed |
SHA-256 / 5bd94aebd3e1538e82ad760deaf5140966df6ef6bbeea679b86865d0167270cd
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:19.237086+00:00.
Case digest / 519c9b328c494a1479fc14c42c0de99438b62b45fb32744d55b0f1a4127a9cbb