FA-83306 / Go territory scoring / Open access
The half glyph is not recognised · case 01
Komi written as 6½ is rejected.
ROOT CAUSE
The suffix test looks for "1/2" rather than the glyph.
VERIFIED REPAIR
Detect the "½" suffix and strip it.
Unsuccessful approach: Detecting the glyph without stripping it leaves a non-digit in the whole part.
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('1/2'):
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 = [[['6½', 65], ['-6½', -65], ['7.0', 70], ['6.3', 'invalid'], ['.5', 5], ['', 'invalid'], ['-', 'invalid'], ['abc', 'invalid']], [['abc', 'invalid'], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['-7.5', -75], ['0.0', 0], ['+½', 5], ['+½', 5]], [['6.5', 65], ['7', 70], ['-0.5', -5], ['6½', 65], ['-6½', -65], ['6.50', 'invalid'], ['+', 'invalid'], ['+½', 5]], [['0.5', 5], ['6½', 65], ['½', 5], ['½', 5], ['-6½', -65], ['0', 0], ['+5.5', 55], ['7.0', 70]], [['6½', 65], ['-6½', -65], ['-', 'invalid'], ['abc', 'invalid'], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['-7.5', -75]]]
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 | 65 | Failed |
| komi case 1 | invalid | -65 | Failed |
| 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 / 9a96ad3df959947a98e8055a9717d97ba71c5ceb7c9b39213fb385471c50364e
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
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 = [[['6½', 65], ['-6½', -65], ['7.0', 70], ['6.3', 'invalid'], ['.5', 5], ['', 'invalid'], ['-', 'invalid'], ['abc', 'invalid']], [['abc', 'invalid'], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['-7.5', -75], ['0.0', 0], ['+½', 5], ['+½', 5]], [['6.5', 65], ['7', 70], ['-0.5', -5], ['6½', 65], ['-6½', -65], ['6.50', 'invalid'], ['+', 'invalid'], ['+½', 5]], [['0.5', 5], ['6½', 65], ['½', 5], ['½', 5], ['-6½', -65], ['0', 0], ['+5.5', 55], ['7.0', 70]], [['6½', 65], ['-6½', -65], ['-', 'invalid'], ['abc', 'invalid'], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['-7.5', -75]]]
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 | 65 | Failed |
| komi case 1 | invalid | -65 | Failed |
| 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 / 1a90873b57f7da4821ff9e37425c678022876fa09d2cf3272d9d83fec2a90217
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 = [[['6½', 65], ['-6½', -65], ['7.0', 70], ['6.3', 'invalid'], ['.5', 5], ['', 'invalid'], ['-', 'invalid'], ['abc', 'invalid']], [['abc', 'invalid'], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['-7.5', -75], ['0.0', 0], ['+½', 5], ['+½', 5]], [['6.5', 65], ['7', 70], ['-0.5', -5], ['6½', 65], ['-6½', -65], ['6.50', 'invalid'], ['+', 'invalid'], ['+½', 5]], [['0.5', 5], ['6½', 65], ['½', 5], ['½', 5], ['-6½', -65], ['0', 0], ['+5.5', 55], ['7.0', 70]], [['6½', 65], ['-6½', -65], ['-', 'invalid'], ['abc', 'invalid'], ['5.', 'invalid'], [' 6.5 ', 65], ['-3', -30], ['-7.5', -75]]]
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 | 65 | 65 | Passed |
| komi case 1 | -65 | -65 | 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 / c3531af67ec3f893486e700e64decdbfa106bb8221a98b7f059f90be62e5fc8b
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.349834+00:00.
Case digest / 1ffbe6f1024d31d8eced97e3b3284663fb2bdf73ba06498c27cc6f4d97933bf5