FA-83316 / Go territory scoring / Open access
A bare half-point komi is rejected · case 01
½ and .5 are rejected as invalid.
ROOT CAUSE
An empty whole part always fails.
VERIFIED REPAIR
Treat an empty whole part as zero when a half is present.
Unsuccessful approach: Accepting any empty whole part makes "" and "-" parse as zero komi.
Case contract
Input a komi string: optional sign, whole points, and an optional half written ".5"/".0" or "½". A bare half ("½", ".5") is allowed. Return komi in tenths or "invalid".
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()
neg = s.startswith('-')
if s[:1] in '+-' and s:
s = s[1:]
half = 0
if s.endswith('½'):
half = 5
s = s[:-1]
elif '.' in s:
s, _, frac = s.partition('.')
if frac not in ('0', '5'):
return 'invalid'
half = int(frac)
if not s.isdigit():
return 'invalid'
v = int(s) * 10 + half
return -v if neg else v
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['½', 5], ['+5.5', 55], ['7.0', 70], ['6.3', 'invalid'], ['.5', 5], ['', 'invalid'], ['-', 'invalid'], ['abc', 'invalid']], [['½', 5], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['-7.5', -75], ['0.0', 0], ['1 1/2', 'invalid'], ['+', 'invalid']], [['6.5', 65], ['7', 70], ['-0.5', -5], ['½', 5], ['-', 'invalid'], ['6.50', 'invalid'], ['+', 'invalid'], ['+½', 5]], [['6½', 65], ['½', 5], ['-6½', -65], ['0', 0], ['+5.5', 55], ['7.0', 70], ['6.3', 'invalid'], ['', 'invalid']], [['½', 5], ['', 'invalid'], ['-', 'invalid'], ['abc', 'invalid'], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['+', 'invalid']]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("komi 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 |
|---|---|---|---|
| komi case 0 | invalid | 5 | Failed |
| komi case 1 | 55 | 55 | Passed |
| komi case 2 | 70 | 70 | Passed |
| komi case 3 | invalid | invalid | Passed |
| komi case 4 | invalid | 5 | Failed |
| komi case 5 | invalid | invalid | Passed |
| komi case 6 | invalid | invalid | Passed |
| komi case 7 | invalid | invalid | Passed |
SHA-256 / b54e5e3ee868ee648887db77a477adf3dfd282f22ec8ef84f9f2d131de4c19bd
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()
neg = s.startswith('-')
if s[:1] in '+-' and s:
s = s[1:]
half = 0
if s.endswith('½'):
half = 5
s = s[:-1]
elif '.' in s:
s, _, frac = s.partition('.')
if frac not in ('0', '5'):
return 'invalid'
half = int(frac)
if not s.isdigit():
if s == '':
s = '0'
else:
return 'invalid'
v = int(s) * 10 + half
return -v if neg else v
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['½', 5], ['+5.5', 55], ['7.0', 70], ['6.3', 'invalid'], ['.5', 5], ['', 'invalid'], ['-', 'invalid'], ['abc', 'invalid']], [['½', 5], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['-7.5', -75], ['0.0', 0], ['1 1/2', 'invalid'], ['+', 'invalid']], [['6.5', 65], ['7', 70], ['-0.5', -5], ['½', 5], ['-', 'invalid'], ['6.50', 'invalid'], ['+', 'invalid'], ['+½', 5]], [['6½', 65], ['½', 5], ['-6½', -65], ['0', 0], ['+5.5', 55], ['7.0', 70], ['6.3', 'invalid'], ['', 'invalid']], [['½', 5], ['', 'invalid'], ['-', 'invalid'], ['abc', 'invalid'], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['+', 'invalid']]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("komi 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 |
|---|---|---|---|
| komi case 0 | 5 | 5 | Passed |
| komi case 1 | 55 | 55 | Passed |
| komi case 2 | 70 | 70 | Passed |
| komi case 3 | invalid | invalid | Passed |
| komi case 4 | 5 | 5 | Passed |
| komi case 5 | 0 | invalid | Failed |
| komi case 6 | 0 | invalid | Failed |
| komi case 7 | invalid | invalid | Passed |
SHA-256 / 90574ab22fa1390f6885f14cb3d81925dac41926008285c96d969b8b9b0e27bd
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
s = x.strip()
neg = s.startswith('-')
if s[:1] in '+-' and s:
s = s[1:]
half = 0
if s.endswith('½'):
half = 5
s = s[:-1]
elif '.' in s:
s, _, frac = s.partition('.')
if frac not in ('0', '5'):
return 'invalid'
half = int(frac)
if not s.isdigit():
if s == '' and half:
s = '0'
else:
return 'invalid'
v = int(s) * 10 + half
return -v if neg else v
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['½', 5], ['+5.5', 55], ['7.0', 70], ['6.3', 'invalid'], ['.5', 5], ['', 'invalid'], ['-', 'invalid'], ['abc', 'invalid']], [['½', 5], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['-7.5', -75], ['0.0', 0], ['1 1/2', 'invalid'], ['+', 'invalid']], [['6.5', 65], ['7', 70], ['-0.5', -5], ['½', 5], ['-', 'invalid'], ['6.50', 'invalid'], ['+', 'invalid'], ['+½', 5]], [['6½', 65], ['½', 5], ['-6½', -65], ['0', 0], ['+5.5', 55], ['7.0', 70], ['6.3', 'invalid'], ['', 'invalid']], [['½', 5], ['', 'invalid'], ['-', 'invalid'], ['abc', 'invalid'], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['+', 'invalid']]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("komi 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 |
|---|---|---|---|
| komi case 0 | 5 | 5 | Passed |
| komi case 1 | 55 | 55 | Passed |
| komi case 2 | 70 | 70 | Passed |
| komi case 3 | invalid | invalid | Passed |
| komi case 4 | 5 | 5 | Passed |
| komi case 5 | invalid | invalid | Passed |
| komi case 6 | invalid | invalid | Passed |
| komi case 7 | invalid | invalid | Passed |
SHA-256 / 62e68d5556508179cf0e17668a0ce4c204de5ce292239389d0db6befc3476720
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.530575+00:00.
Case digest / e110d13a91c53dd60df89234f949e64d7869fdd2428071e5aff4698d8253b3d1