FA-84221 / Sports scoring and tiebreakers / Open access
Stones biting the house edge ignored · case 01
A stone whose edge overlaps the twelve-foot ring does not count.
ROOT CAUSE
The house test compares the stone centre with the house radius only.
VERIFIED REPAIR
Add the stone radius to the house radius.
Unsuccessful approach: Adding the full stone diameter counts stones that are clear of the house.
Case contract
Curling end result. stones rows are [team, distance_mm] from the button to the stone centre; a stone counts only if it touches the house: distance <= 1830 + 145 (house radius plus stone radius). The team with the closest counting stone scores one point for each of its counting stones strictly closer than the opponent's closest counting stone (all its counting stones if the opponent has none). If no stone counts, or the two closest counting stones of different teams are at the same distance, the end is blank and the hammer stays. After a score the hammer goes to the team that did not score. Return [scoring team or None, points, hammer for next end].
Why this case matters
Curling scoreboards compute end scores and hammer possession from measured stone positions.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(stones, hammer):
inside = sorted((d, t) for t, d in stones if d <= 1830)
tie = bool(inside) and any(d == inside[0][0] and t != inside[0][1] for d, t in inside)
if not inside or tie:
return [None, 0, hammer]
best_d, team = inside[0]
opp = [d for d, t in inside if t != team]
limit = min(opp) if opp else None
points = sum(1 for d, t in inside if t == team and (limit is None or d < limit))
nxt = 'B' if team == 'A' else 'A'
return [team, points, nxt]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
try:
return solve(*args)
except Exception as exc:
return 'raised ' + type(exc).__name__
cases = [[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge',
([['A', 1577], ['A', 237], ['A', 1562], ['A', 1383], ['A', 1874]], 'A'),
['A', 5, 'B']),
('regression: house edge', ([['B', 1991]], 'B'), [None, 0, 'B']),
('variant scenario 1', ([], 'B'), [None, 0, 'B']),
('variant scenario 2',
([['B', 505], ['B', 120], ['A', 1845], ['A', 444], ['B', 357], ['A', 1976]], 'A'),
['B', 2, 'A'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['B', 1985]], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 1837], ['A', 251]], 'A'), ['A', 2, 'B']),
('variant scenario 1',
([['B', 97],
['B', 1854],
['A', 384],
['A', 139],
['A', 363],
['B', 479],
['A', 71],
['A', 1720]],
'B'),
['A', 1, 'B']),
('variant scenario 2', ([['B', 155]], 'A'), ['B', 1, 'A'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 2065]], 'A'), [None, 0, 'A']),
('regression: house edge', ([['B', 1921], ['B', 241], ['A', 2086]], 'B'), ['B', 2, 'A']),
('variant scenario 1', ([['A', 1555], ['A', 2016], ['B', 251]], 'B'), ['B', 1, 'A']),
('variant scenario 2',
([['A', 2048], ['B', 547], ['B', 1960], ['A', 1783]], 'B'),
['B', 1, 'A'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 2074], ['A', 375], ['A', 2060]], 'B'), ['A', 1, 'B']),
('regression: house edge',
([['B', 70], ['B', 1549], ['A', 1913], ['B', 1896], ['A', 2038]], 'B'),
['B', 3, 'A']),
('variant scenario 1',
([['A', 2096], ['A', 1446], ['A', 119], ['B', 948], ['A', 63], ['A', 792]], 'A'),
['A', 3, 'B']),
('variant scenario 2', ([['A', 1724]], 'B'), ['A', 1, 'B'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 237], ['A', 1878], ['B', 1945]], 'B'), ['A', 2, 'B']),
('regression: house edge',
([['A', 2098], ['A', 1789], ['A', 1751], ['A', 1825], ['A', 1965], ['A', 389]], 'A'),
['A', 5, 'B']),
('variant scenario 1', ([['B', 50]], 'A'), ['B', 1, 'A']),
('variant scenario 2',
([['B', 2106],
['A', 1855],
['A', 1782],
['A', 86],
['B', 185],
['A', 212],
['A', 1713],
['A', 366]],
'B'),
['A', 1, 'B'])]]
for label, args, expected in cases[N - 1]:
check(label, run(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 |
|---|---|---|---|
| control single shot | ['A', 1, 'B'] | ['A', 1, 'B'] | Passed |
| boundary stone biting house edge | [None, 0, 'A'] | ['B', 1, 'A'] | Failed |
| boundary stone just outside | [None, 0, 'A'] | [None, 0, 'A'] | Passed |
| control steal of two | ['B', 2, 'A'] | ['B', 2, 'A'] | Passed |
| boundary measured tie | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
| control empty house | [None, 0, 'A'] | [None, 0, 'A'] | Passed |
| regression: house edge | ['A', 4, 'B'] | ['A', 5, 'B'] | Failed |
| regression: house edge | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
| variant scenario 1 | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
| variant scenario 2 | ['B', 2, 'A'] | ['B', 2, 'A'] | Passed |
SHA-256 / 7b28763f40395b1089c40fb0894ecd66b6b37d6341be174c65d4600d39b4de1c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(stones, hammer):
inside = sorted((d, t) for t, d in stones if d <= 1830 + 290)
tie = bool(inside) and any(d == inside[0][0] and t != inside[0][1] for d, t in inside)
if not inside or tie:
return [None, 0, hammer]
best_d, team = inside[0]
opp = [d for d, t in inside if t != team]
limit = min(opp) if opp else None
points = sum(1 for d, t in inside if t == team and (limit is None or d < limit))
nxt = 'B' if team == 'A' else 'A'
return [team, points, nxt]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
try:
return solve(*args)
except Exception as exc:
return 'raised ' + type(exc).__name__
cases = [[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge',
([['A', 1577], ['A', 237], ['A', 1562], ['A', 1383], ['A', 1874]], 'A'),
['A', 5, 'B']),
('regression: house edge', ([['B', 1991]], 'B'), [None, 0, 'B']),
('variant scenario 1', ([], 'B'), [None, 0, 'B']),
('variant scenario 2',
([['B', 505], ['B', 120], ['A', 1845], ['A', 444], ['B', 357], ['A', 1976]], 'A'),
['B', 2, 'A'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['B', 1985]], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 1837], ['A', 251]], 'A'), ['A', 2, 'B']),
('variant scenario 1',
([['B', 97],
['B', 1854],
['A', 384],
['A', 139],
['A', 363],
['B', 479],
['A', 71],
['A', 1720]],
'B'),
['A', 1, 'B']),
('variant scenario 2', ([['B', 155]], 'A'), ['B', 1, 'A'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 2065]], 'A'), [None, 0, 'A']),
('regression: house edge', ([['B', 1921], ['B', 241], ['A', 2086]], 'B'), ['B', 2, 'A']),
('variant scenario 1', ([['A', 1555], ['A', 2016], ['B', 251]], 'B'), ['B', 1, 'A']),
('variant scenario 2',
([['A', 2048], ['B', 547], ['B', 1960], ['A', 1783]], 'B'),
['B', 1, 'A'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 2074], ['A', 375], ['A', 2060]], 'B'), ['A', 1, 'B']),
('regression: house edge',
([['B', 70], ['B', 1549], ['A', 1913], ['B', 1896], ['A', 2038]], 'B'),
['B', 3, 'A']),
('variant scenario 1',
([['A', 2096], ['A', 1446], ['A', 119], ['B', 948], ['A', 63], ['A', 792]], 'A'),
['A', 3, 'B']),
('variant scenario 2', ([['A', 1724]], 'B'), ['A', 1, 'B'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 237], ['A', 1878], ['B', 1945]], 'B'), ['A', 2, 'B']),
('regression: house edge',
([['A', 2098], ['A', 1789], ['A', 1751], ['A', 1825], ['A', 1965], ['A', 389]], 'A'),
['A', 5, 'B']),
('variant scenario 1', ([['B', 50]], 'A'), ['B', 1, 'A']),
('variant scenario 2',
([['B', 2106],
['A', 1855],
['A', 1782],
['A', 86],
['B', 185],
['A', 212],
['A', 1713],
['A', 366]],
'B'),
['A', 1, 'B'])]]
for label, args, expected in cases[N - 1]:
check(label, run(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 |
|---|---|---|---|
| control single shot | ['A', 1, 'B'] | ['A', 1, 'B'] | Passed |
| boundary stone biting house edge | ['B', 1, 'A'] | ['B', 1, 'A'] | Passed |
| boundary stone just outside | ['B', 1, 'A'] | [None, 0, 'A'] | Failed |
| control steal of two | ['B', 2, 'A'] | ['B', 2, 'A'] | Passed |
| boundary measured tie | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
| control empty house | [None, 0, 'A'] | [None, 0, 'A'] | Passed |
| regression: house edge | ['A', 5, 'B'] | ['A', 5, 'B'] | Passed |
| regression: house edge | ['B', 1, 'A'] | [None, 0, 'B'] | Failed |
| variant scenario 1 | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
| variant scenario 2 | ['B', 2, 'A'] | ['B', 2, 'A'] | Passed |
SHA-256 / b5082f853e2c661e1418bd4dd5a0d78633a16625a5ed756ca6f2da4c72bff05c
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(stones, hammer):
inside = sorted((d, t) for t, d in stones if d <= 1830 + 145)
tie = bool(inside) and any(d == inside[0][0] and t != inside[0][1] for d, t in inside)
if not inside or tie:
return [None, 0, hammer]
best_d, team = inside[0]
opp = [d for d, t in inside if t != team]
limit = min(opp) if opp else None
points = sum(1 for d, t in inside if t == team and (limit is None or d < limit))
nxt = 'B' if team == 'A' else 'A'
return [team, points, nxt]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
try:
return solve(*args)
except Exception as exc:
return 'raised ' + type(exc).__name__
cases = [[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge',
([['A', 1577], ['A', 237], ['A', 1562], ['A', 1383], ['A', 1874]], 'A'),
['A', 5, 'B']),
('regression: house edge', ([['B', 1991]], 'B'), [None, 0, 'B']),
('variant scenario 1', ([], 'B'), [None, 0, 'B']),
('variant scenario 2',
([['B', 505], ['B', 120], ['A', 1845], ['A', 444], ['B', 357], ['A', 1976]], 'A'),
['B', 2, 'A'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['B', 1985]], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 1837], ['A', 251]], 'A'), ['A', 2, 'B']),
('variant scenario 1',
([['B', 97],
['B', 1854],
['A', 384],
['A', 139],
['A', 363],
['B', 479],
['A', 71],
['A', 1720]],
'B'),
['A', 1, 'B']),
('variant scenario 2', ([['B', 155]], 'A'), ['B', 1, 'A'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 2065]], 'A'), [None, 0, 'A']),
('regression: house edge', ([['B', 1921], ['B', 241], ['A', 2086]], 'B'), ['B', 2, 'A']),
('variant scenario 1', ([['A', 1555], ['A', 2016], ['B', 251]], 'B'), ['B', 1, 'A']),
('variant scenario 2',
([['A', 2048], ['B', 547], ['B', 1960], ['A', 1783]], 'B'),
['B', 1, 'A'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 2074], ['A', 375], ['A', 2060]], 'B'), ['A', 1, 'B']),
('regression: house edge',
([['B', 70], ['B', 1549], ['A', 1913], ['B', 1896], ['A', 2038]], 'B'),
['B', 3, 'A']),
('variant scenario 1',
([['A', 2096], ['A', 1446], ['A', 119], ['B', 948], ['A', 63], ['A', 792]], 'A'),
['A', 3, 'B']),
('variant scenario 2', ([['A', 1724]], 'B'), ['A', 1, 'B'])],
[('control single shot', ([['A', 100], ['B', 400]], 'A'), ['A', 1, 'B']),
('boundary stone biting house edge', ([['B', 1975]], 'A'), ['B', 1, 'A']),
('boundary stone just outside', ([['B', 1976]], 'A'), [None, 0, 'A']),
('control steal of two', ([['B', 50], ['B', 300], ['A', 500]], 'A'), ['B', 2, 'A']),
('boundary measured tie', ([['A', 200], ['B', 200]], 'B'), [None, 0, 'B']),
('control empty house', ([], 'A'), [None, 0, 'A']),
('regression: house edge', ([['A', 237], ['A', 1878], ['B', 1945]], 'B'), ['A', 2, 'B']),
('regression: house edge',
([['A', 2098], ['A', 1789], ['A', 1751], ['A', 1825], ['A', 1965], ['A', 389]], 'A'),
['A', 5, 'B']),
('variant scenario 1', ([['B', 50]], 'A'), ['B', 1, 'A']),
('variant scenario 2',
([['B', 2106],
['A', 1855],
['A', 1782],
['A', 86],
['B', 185],
['A', 212],
['A', 1713],
['A', 366]],
'B'),
['A', 1, 'B'])]]
for label, args, expected in cases[N - 1]:
check(label, run(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 |
|---|---|---|---|
| control single shot | ['A', 1, 'B'] | ['A', 1, 'B'] | Passed |
| boundary stone biting house edge | ['B', 1, 'A'] | ['B', 1, 'A'] | Passed |
| boundary stone just outside | [None, 0, 'A'] | [None, 0, 'A'] | Passed |
| control steal of two | ['B', 2, 'A'] | ['B', 2, 'A'] | Passed |
| boundary measured tie | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
| control empty house | [None, 0, 'A'] | [None, 0, 'A'] | Passed |
| regression: house edge | ['A', 5, 'B'] | ['A', 5, 'B'] | Passed |
| regression: house edge | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
| variant scenario 1 | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
| variant scenario 2 | ['B', 2, 'A'] | ['B', 2, 'A'] | Passed |
SHA-256 / 3c6899e35030c708035ce6a31c97b3dce8b52d857c145ae79866aeb0b82a3844
Verification & scope
Stipulated, bounded toy contract stated in the contract field; not a claim of conformance with any governing body rulebook or operator house rules. 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:28.923319+00:00.
Case digest / 8120fb4163aa4d0856e9c38289390e2d6e8e9163e24e1a666d506836ea814190