FA-83071 / Go territory scoring / Open access
AGA compensation uses the full handicap count · case 01
AGA games are scored like Chinese games.
ROOT CAUSE
The AGA branch omits the minus-one adjustment.
VERIFIED REPAIR
AGA gives handicap-1 points.
Unsuccessful approach: Halving the handicap under-compensates larger handicaps.
Case contract
Input [rules, handicap, area_b, area_w, komi_tenths]. With handicap >= 2, white receives handicap points under chinese and handicap-1 under aga; other rules none. Return black margin in tenths.
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):
rules, h, ab, aw, komi = x
comp = 0
if h >= 2:
if rules == 'chinese':
comp = h
elif rules == 'aga':
comp = h
return ab * 10 - (aw + comp) * 10 - komi
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[['aga', 5, 177, 168, 5], 45], [['aga', 4, 151, 193, 65], -515], [['japanese', 2, 192, 168, 5], 235], [['japanese', 6, 150, 163, 0], -130], [['korean', 4, 186, 189, 0], -30], [['japanese', 0, 194, 172, 5], 215], [['aga', 5, 208, 202, 65], -45], [['aga', 9, 154, 181, 75], -425]], [[['aga', 5, 208, 202, 65], -45], [['aga', 8, 157, 153, 0], -30], [['japanese', 9, 154, 170, 65], -225], [['japanese', 5, 174, 162, 5], 115], [['korean', 6, 207, 201, 5], 55], [['korean', 0, 160, 185, 65], -315], [['japanese', 1, 209, 204, 5], 45], [['aga', 4, 197, 187, 75], -5]], [[['korean', 2, 163, 163, 65], -65], [['aga', 0, 154, 183, 75], -365], [['chinese', 0, 190, 164, 75], 185], [['korean', 2, 151, 171, 75], -275], [['chinese', 5, 192, 202, 5], -155], [['korean', 2, 172, 205, 75], -405], [['aga', 2, 184, 170, 65], 65], [['aga', 7, 169, 174, 65], -175]], [[['aga', 8, 157, 153, 0], -30], [['aga', 2, 184, 170, 65], 65], [['korean', 2, 160, 206, 65], -525], [['korean', 7, 159, 177, 0], -180], [['aga', 9, 154, 181, 75], -425], [['japanese', 7, 205, 198, 0], 70], [['aga', 7, 191, 209, 75], -315], [['aga', 7, 202, 195, 65], -55]], [[['korean', 8, 159, 195, 0], -360], [['korean', 4, 163, 154, 0], 90], [['aga', 7, 202, 195, 65], -55], [['korean', 1, 174, 169, 75], -25], [['korean', 7, 195, 188, 65], 5], [['korean', 8, 166, 205, 5], -395], [['aga', 9, 167, 184, 65], -315], [['aga', 6, 185, 208, 0], -280]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("compensation 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 |
|---|---|---|---|
| compensation case 0 | 35 | 45 | Failed |
| compensation case 1 | -525 | -515 | Failed |
| compensation case 2 | 235 | 235 | Passed |
| compensation case 3 | -130 | -130 | Passed |
| compensation case 4 | -30 | -30 | Passed |
| compensation case 5 | 215 | 215 | Passed |
| compensation case 6 | -55 | -45 | Failed |
| compensation case 7 | -435 | -425 | Failed |
SHA-256 / 2a400715e534b432b6cb4f5050d4b95f2159511033a5e017d93585f1b0ab84cc
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
rules, h, ab, aw, komi = x
comp = 0
if h >= 2:
if rules == 'chinese':
comp = h
elif rules == 'aga':
comp = h // 2
return ab * 10 - (aw + comp) * 10 - komi
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[['aga', 5, 177, 168, 5], 45], [['aga', 4, 151, 193, 65], -515], [['japanese', 2, 192, 168, 5], 235], [['japanese', 6, 150, 163, 0], -130], [['korean', 4, 186, 189, 0], -30], [['japanese', 0, 194, 172, 5], 215], [['aga', 5, 208, 202, 65], -45], [['aga', 9, 154, 181, 75], -425]], [[['aga', 5, 208, 202, 65], -45], [['aga', 8, 157, 153, 0], -30], [['japanese', 9, 154, 170, 65], -225], [['japanese', 5, 174, 162, 5], 115], [['korean', 6, 207, 201, 5], 55], [['korean', 0, 160, 185, 65], -315], [['japanese', 1, 209, 204, 5], 45], [['aga', 4, 197, 187, 75], -5]], [[['korean', 2, 163, 163, 65], -65], [['aga', 0, 154, 183, 75], -365], [['chinese', 0, 190, 164, 75], 185], [['korean', 2, 151, 171, 75], -275], [['chinese', 5, 192, 202, 5], -155], [['korean', 2, 172, 205, 75], -405], [['aga', 2, 184, 170, 65], 65], [['aga', 7, 169, 174, 65], -175]], [[['aga', 8, 157, 153, 0], -30], [['aga', 2, 184, 170, 65], 65], [['korean', 2, 160, 206, 65], -525], [['korean', 7, 159, 177, 0], -180], [['aga', 9, 154, 181, 75], -425], [['japanese', 7, 205, 198, 0], 70], [['aga', 7, 191, 209, 75], -315], [['aga', 7, 202, 195, 65], -55]], [[['korean', 8, 159, 195, 0], -360], [['korean', 4, 163, 154, 0], 90], [['aga', 7, 202, 195, 65], -55], [['korean', 1, 174, 169, 75], -25], [['korean', 7, 195, 188, 65], 5], [['korean', 8, 166, 205, 5], -395], [['aga', 9, 167, 184, 65], -315], [['aga', 6, 185, 208, 0], -280]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("compensation 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 |
|---|---|---|---|
| compensation case 0 | 65 | 45 | Failed |
| compensation case 1 | -505 | -515 | Failed |
| compensation case 2 | 235 | 235 | Passed |
| compensation case 3 | -130 | -130 | Passed |
| compensation case 4 | -30 | -30 | Passed |
| compensation case 5 | 215 | 215 | Passed |
| compensation case 6 | -25 | -45 | Failed |
| compensation case 7 | -385 | -425 | Failed |
SHA-256 / 1418412edda57d2e0079593c712bbc0dd2b16b96a2448e739b76ebc13390bd31
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
rules, h, ab, aw, komi = x
comp = 0
if h >= 2:
if rules == 'chinese':
comp = h
elif rules == 'aga':
comp = h - 1
return ab * 10 - (aw + comp) * 10 - komi
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[['aga', 5, 177, 168, 5], 45], [['aga', 4, 151, 193, 65], -515], [['japanese', 2, 192, 168, 5], 235], [['japanese', 6, 150, 163, 0], -130], [['korean', 4, 186, 189, 0], -30], [['japanese', 0, 194, 172, 5], 215], [['aga', 5, 208, 202, 65], -45], [['aga', 9, 154, 181, 75], -425]], [[['aga', 5, 208, 202, 65], -45], [['aga', 8, 157, 153, 0], -30], [['japanese', 9, 154, 170, 65], -225], [['japanese', 5, 174, 162, 5], 115], [['korean', 6, 207, 201, 5], 55], [['korean', 0, 160, 185, 65], -315], [['japanese', 1, 209, 204, 5], 45], [['aga', 4, 197, 187, 75], -5]], [[['korean', 2, 163, 163, 65], -65], [['aga', 0, 154, 183, 75], -365], [['chinese', 0, 190, 164, 75], 185], [['korean', 2, 151, 171, 75], -275], [['chinese', 5, 192, 202, 5], -155], [['korean', 2, 172, 205, 75], -405], [['aga', 2, 184, 170, 65], 65], [['aga', 7, 169, 174, 65], -175]], [[['aga', 8, 157, 153, 0], -30], [['aga', 2, 184, 170, 65], 65], [['korean', 2, 160, 206, 65], -525], [['korean', 7, 159, 177, 0], -180], [['aga', 9, 154, 181, 75], -425], [['japanese', 7, 205, 198, 0], 70], [['aga', 7, 191, 209, 75], -315], [['aga', 7, 202, 195, 65], -55]], [[['korean', 8, 159, 195, 0], -360], [['korean', 4, 163, 154, 0], 90], [['aga', 7, 202, 195, 65], -55], [['korean', 1, 174, 169, 75], -25], [['korean', 7, 195, 188, 65], 5], [['korean', 8, 166, 205, 5], -395], [['aga', 9, 167, 184, 65], -315], [['aga', 6, 185, 208, 0], -280]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("compensation 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 |
|---|---|---|---|
| compensation case 0 | 45 | 45 | Passed |
| compensation case 1 | -515 | -515 | Passed |
| compensation case 2 | 235 | 235 | Passed |
| compensation case 3 | -130 | -130 | Passed |
| compensation case 4 | -30 | -30 | Passed |
| compensation case 5 | 215 | 215 | Passed |
| compensation case 6 | -45 | -45 | Passed |
| compensation case 7 | -425 | -425 | Passed |
SHA-256 / b70a960f9632d7df9dbfcad3cb702fca54eb0e1d92ebd21b1404a91ff1a693e8
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.107316+00:00.
Case digest / 9ebbad44db0ec37a3cbd348e5b0b7b07a62a7624d9afcfe2e19db8d777972d43