FAILURE MAP
← Case archive

FA-83016 / Go territory scoring / Open access

Capitalised resign and time reasons are not recognised · case 01

B+R and W+Resign are reported as unknown results.

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

ROOT CAUSE

The reason word is compared without lower-casing.

THE FAILURE

The reason word is compared without lower-casing.

Unsuccessful approach: Matching only the first letter accepts arbitrary words such as B+Rough as resignations.

Case contract

Input an SGF RE string. "0", "Draw", "Jigo" -> ["draw", 0, "score"]; "Void" -> ["void", None, "none"]; C+R/Resign, C+T/Time, C+F/Forfeit (case-insensitive) -> [C, None, reason]; "C+" -> [C, None, "unknown"]; C+digits with optional one-digit fraction -> [C, tenths, "score"]; else unknown.

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):
    s = x.strip()
    if s in ('0', 'Draw', 'Jigo'):
        return ['draw', 0, 'score']
    if s == 'Void':
        return ['void', None, 'none']
    if len(s) < 2 or s[0] not in 'BW' or s[1] != '+':
        return ['unknown', None, 'none']
    who = s[0]
    rest = s[2:]
    if rest == '':
        return [who, None, 'unknown']
    word = rest
    for key, reason in (('r', 'resign'), ('t', 'time'), ('f', 'forfeit')):
        if word in (key, reason):
            return [who, None, reason]
    if '.' in rest:
        whole, _, frac = rest.partition('.')
    else:
        whole, frac = rest, '0'
    if not whole.isdigit() or not frac.isdigit() or len(frac) != 1:
        return ['unknown', None, 'none']
    return [who, int(whole) * 10 + int(frac), 'score']
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['B+R', ['B', None, 'resign']], ['W+0.5', ['W', 5, 'score']], ['W+12', ['W', 120, 'score']], ['B+2.3', ['B', 23, 'score']], ['W+8.2', ['W', 82, 'score']], ['B+1.1', ['B', 11, 'score']], ['B+', ['B', None, 'unknown']], ['B+Rough', ['unknown', None, 'none']]], [['B+Time', ['B', None, 'time']], ['0', ['draw', 0, 'score']], ['Draw', ['draw', 0, 'score']], ['Jigo', ['draw', 0, 'score']], ['Void', ['void', None, 'none']], ['?', ['unknown', None, 'none']], [' B+R ', ['B', None, 'resign']], ['W+Timeout', ['unknown', None, 'none']]], [[' B+R ', ['B', None, 'resign']], [' W+7', ['W', 70, 'score']], ['X+3', ['unknown', None, 'none']], ['B-3', ['unknown', None, 'none']], ['B+3.25', ['unknown', None, 'none']], ['W+3.0', ['W', 30, 'score']], ['B+6.0', ['B', 60, 'score']], ['B+Rough', ['unknown', None, 'none']]], [['W+T', ['W', None, 'time']], ['B+Rough', ['unknown', None, 'none']], ['W+Timeout', ['unknown', None, 'none']], ['B+r', ['B', None, 'resign']], ['W+t', ['W', None, 'time']], ['B+100.5', ['B', 1005, 'score']], ['W+4.1', ['W', 41, 'score']], ['W+.5', ['unknown', None, 'none']]], [['B+R', ['B', None, 'resign']], ['W+Resign', ['W', None, 'resign']], ['B+resign', ['B', None, 'resign']], ['W+T', ['W', None, 'time']], ['B+Time', ['B', None, 'time']], ['W+F', ['W', None, 'forfeit']], ['B+Forfeit', ['B', None, 'forfeit']], ['B+Rough', ['unknown', None, 'none']]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("result 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
result case 0['unknown', None, 'none']['B', None, 'resign']Failed
result case 1['W', 5, 'score']['W', 5, 'score']Passed
result case 2['W', 120, 'score']['W', 120, 'score']Passed
result case 3['B', 23, 'score']['B', 23, 'score']Passed
result case 4['W', 82, 'score']['W', 82, 'score']Passed
result case 5['B', 11, 'score']['B', 11, 'score']Passed
result case 6['B', None, 'unknown']['B', None, 'unknown']Passed
result case 7['unknown', None, 'none']['unknown', None, 'none']Passed

SHA-256 / 4a7d527635ea747fee1d120ad7db2c042d6f29f7b47a6b3e84a32e3a2e5303fc

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    s = x.strip()
    if s in ('0', 'Draw', 'Jigo'):
        return ['draw', 0, 'score']
    if s == 'Void':
        return ['void', None, 'none']
    if len(s) < 2 or s[0] not in 'BW' or s[1] != '+':
        return ['unknown', None, 'none']
    who = s[0]
    rest = s[2:]
    if rest == '':
        return [who, None, 'unknown']
    word = rest.lower()[:1]
    for key, reason in (('r', 'resign'), ('t', 'time'), ('f', 'forfeit')):
        if word in (key, reason):
            return [who, None, reason]
    if '.' in rest:
        whole, _, frac = rest.partition('.')
    else:
        whole, frac = rest, '0'
    if not whole.isdigit() or not frac.isdigit() or len(frac) != 1:
        return ['unknown', None, 'none']
    return [who, int(whole) * 10 + int(frac), 'score']
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['B+R', ['B', None, 'resign']], ['W+0.5', ['W', 5, 'score']], ['W+12', ['W', 120, 'score']], ['B+2.3', ['B', 23, 'score']], ['W+8.2', ['W', 82, 'score']], ['B+1.1', ['B', 11, 'score']], ['B+', ['B', None, 'unknown']], ['B+Rough', ['unknown', None, 'none']]], [['B+Time', ['B', None, 'time']], ['0', ['draw', 0, 'score']], ['Draw', ['draw', 0, 'score']], ['Jigo', ['draw', 0, 'score']], ['Void', ['void', None, 'none']], ['?', ['unknown', None, 'none']], [' B+R ', ['B', None, 'resign']], ['W+Timeout', ['unknown', None, 'none']]], [[' B+R ', ['B', None, 'resign']], [' W+7', ['W', 70, 'score']], ['X+3', ['unknown', None, 'none']], ['B-3', ['unknown', None, 'none']], ['B+3.25', ['unknown', None, 'none']], ['W+3.0', ['W', 30, 'score']], ['B+6.0', ['B', 60, 'score']], ['B+Rough', ['unknown', None, 'none']]], [['W+T', ['W', None, 'time']], ['B+Rough', ['unknown', None, 'none']], ['W+Timeout', ['unknown', None, 'none']], ['B+r', ['B', None, 'resign']], ['W+t', ['W', None, 'time']], ['B+100.5', ['B', 1005, 'score']], ['W+4.1', ['W', 41, 'score']], ['W+.5', ['unknown', None, 'none']]], [['B+R', ['B', None, 'resign']], ['W+Resign', ['W', None, 'resign']], ['B+resign', ['B', None, 'resign']], ['W+T', ['W', None, 'time']], ['B+Time', ['B', None, 'time']], ['W+F', ['W', None, 'forfeit']], ['B+Forfeit', ['B', None, 'forfeit']], ['B+Rough', ['unknown', None, 'none']]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("result 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
result case 0['B', None, 'resign']['B', None, 'resign']Passed
result case 1['W', 5, 'score']['W', 5, 'score']Passed
result case 2['W', 120, 'score']['W', 120, 'score']Passed
result case 3['B', 23, 'score']['B', 23, 'score']Passed
result case 4['W', 82, 'score']['W', 82, 'score']Passed
result case 5['B', 11, 'score']['B', 11, 'score']Passed
result case 6['B', None, 'unknown']['B', None, 'unknown']Passed
result case 7['B', None, 'resign']['unknown', None, 'none']Failed

SHA-256 / 8bafdfb46cabdd90d2330cf5b69c2b7b2cd9a6202cfd16ba7bdebe863cce8a57

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 0ca188b1f1273e9f3223479ad3f5c6215a96871a3ab7e75152c7dea18c11457e