FA-84226 / Sports scoring and tiebreakers / Open access
Hammer kept by the scoring team · case 01
After scoring, the scoring team is shown with the hammer.
ROOT CAUSE
The next-end hammer is assigned to the scoring team.
THE FAILURE
The next-end hammer is assigned to the scoring team.
Unsuccessful approach: Toggling the previous hammer mishandles steals, where the hammer should stay put.
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 + 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 = team
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: hammer after score',
([['B', 1771], ['B', 1727], ['B', 2067], ['A', 1934], ['B', 262], ['B', 499], ['B', 1851]], 'B'),
['B', 5, 'A']),
('regression: hammer after score',
([['B', 433], ['A', 41], ['A', 57], ['A', 254], ['B', 1877], ['A', 792]], 'B'),
['A', 3, 'B']),
('variant scenario 1', ([['A', 290], ['A', 1718], ['B', 1957], ['B', 210]], 'B'), ['B', 1, 'A']),
('variant scenario 2', ([['B', 1797], ['A', 1797]], 'B'), [None, 0, '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: hammer after score',
([['A', 42], ['A', 474], ['A', 1879], ['B', 526]], 'A'),
['A', 2, 'B']),
('regression: hammer after score',
([['B', 1889],
['A', 1272],
['A', 450],
['A', 459],
['A', 59],
['A', 1811],
['A', 293],
['B', 263]],
'B'),
['A', 1, 'B']),
('variant scenario 1',
([['B', 261], ['A', 1016], ['A', 439], ['A', 515], ['B', 2090]], 'B'),
['B', 1, 'A']),
('variant scenario 2', ([['B', 1059], ['A', 279], ['A', 171], ['A', 2071]], 'B'), ['A', 2, '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: hammer after score', ([['B', 1811], ['A', 429], ['A', 669]], 'A'), ['A', 2, 'B']),
('regression: hammer after score',
([['A', 518], ['B', 2006], ['B', 410], ['B', 2313], ['A', 518]], 'A'),
['B', 1, 'A']),
('variant scenario 1', ([['A', 1776], ['A', 2036], ['A', 293], ['A', 1902]], 'A'), ['A', 3, 'B']),
('variant scenario 2', ([], 'B'), [None, 0, '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: hammer after score',
([['B', 2174], ['B', 199], ['A', 2055], ['A', 2174]], 'A'),
['B', 1, 'A']),
('variant scenario 1',
([['B', 166],
['B', 1724],
['B', 2226],
['A', 1998],
['A', 509],
['A', 576],
['B', 2004],
['B', 1904]],
'B'),
['B', 1, 'A']),
('variant scenario 2', ([['B', 2323], ['A', 397]], '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: hammer after score', ([['A', 1923], ['B', 1922], ['B', 1923]], 'A'), ['B', 1, 'A']),
('variant scenario 1', ([], 'A'), [None, 0, 'A']),
('variant scenario 2',
([['A', 1859], ['A', 861], ['A', 73], ['A', 1750], ['A', 1858], ['B', 1938], ['B', 353]], 'A'),
['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, 'A'] | ['A', 1, 'B'] | Failed |
| boundary stone biting house edge | ['B', 1, 'B'] | ['B', 1, 'A'] | Failed |
| boundary stone just outside | [None, 0, 'A'] | [None, 0, 'A'] | Passed |
| control steal of two | ['B', 2, 'B'] | ['B', 2, 'A'] | Failed |
| boundary measured tie | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
| control empty house | [None, 0, 'A'] | [None, 0, 'A'] | Passed |
| regression: hammer after score | ['B', 5, 'B'] | ['B', 5, 'A'] | Failed |
| regression: hammer after score | ['A', 3, 'A'] | ['A', 3, 'B'] | Failed |
| variant scenario 1 | ['B', 1, 'B'] | ['B', 1, 'A'] | Failed |
| variant scenario 2 | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
SHA-256 / e44d3b6f1664a57b101c7b8eb0a8ca38f5a43641afa64fc551f8625c0b5ebabe
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 + 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 hammer == '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: hammer after score',
([['B', 1771], ['B', 1727], ['B', 2067], ['A', 1934], ['B', 262], ['B', 499], ['B', 1851]], 'B'),
['B', 5, 'A']),
('regression: hammer after score',
([['B', 433], ['A', 41], ['A', 57], ['A', 254], ['B', 1877], ['A', 792]], 'B'),
['A', 3, 'B']),
('variant scenario 1', ([['A', 290], ['A', 1718], ['B', 1957], ['B', 210]], 'B'), ['B', 1, 'A']),
('variant scenario 2', ([['B', 1797], ['A', 1797]], 'B'), [None, 0, '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: hammer after score',
([['A', 42], ['A', 474], ['A', 1879], ['B', 526]], 'A'),
['A', 2, 'B']),
('regression: hammer after score',
([['B', 1889],
['A', 1272],
['A', 450],
['A', 459],
['A', 59],
['A', 1811],
['A', 293],
['B', 263]],
'B'),
['A', 1, 'B']),
('variant scenario 1',
([['B', 261], ['A', 1016], ['A', 439], ['A', 515], ['B', 2090]], 'B'),
['B', 1, 'A']),
('variant scenario 2', ([['B', 1059], ['A', 279], ['A', 171], ['A', 2071]], 'B'), ['A', 2, '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: hammer after score', ([['B', 1811], ['A', 429], ['A', 669]], 'A'), ['A', 2, 'B']),
('regression: hammer after score',
([['A', 518], ['B', 2006], ['B', 410], ['B', 2313], ['A', 518]], 'A'),
['B', 1, 'A']),
('variant scenario 1', ([['A', 1776], ['A', 2036], ['A', 293], ['A', 1902]], 'A'), ['A', 3, 'B']),
('variant scenario 2', ([], 'B'), [None, 0, '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: hammer after score',
([['B', 2174], ['B', 199], ['A', 2055], ['A', 2174]], 'A'),
['B', 1, 'A']),
('variant scenario 1',
([['B', 166],
['B', 1724],
['B', 2226],
['A', 1998],
['A', 509],
['A', 576],
['B', 2004],
['B', 1904]],
'B'),
['B', 1, 'A']),
('variant scenario 2', ([['B', 2323], ['A', 397]], '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: hammer after score', ([['A', 1923], ['B', 1922], ['B', 1923]], 'A'), ['B', 1, 'A']),
('variant scenario 1', ([], 'A'), [None, 0, 'A']),
('variant scenario 2',
([['A', 1859], ['A', 861], ['A', 73], ['A', 1750], ['A', 1858], ['B', 1938], ['B', 353]], 'A'),
['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, 'B'] | ['B', 1, 'A'] | Failed |
| boundary stone just outside | [None, 0, 'A'] | [None, 0, 'A'] | Passed |
| control steal of two | ['B', 2, 'B'] | ['B', 2, 'A'] | Failed |
| boundary measured tie | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
| control empty house | [None, 0, 'A'] | [None, 0, 'A'] | Passed |
| regression: hammer after score | ['B', 5, 'A'] | ['B', 5, 'A'] | Passed |
| regression: hammer after score | ['A', 3, 'A'] | ['A', 3, 'B'] | Failed |
| variant scenario 1 | ['B', 1, 'A'] | ['B', 1, 'A'] | Passed |
| variant scenario 2 | [None, 0, 'B'] | [None, 0, 'B'] | Passed |
SHA-256 / c9219c37bd9c9441af35e13ac098e2ea07311755774d2e5271714fd5f5f4fde6
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 10 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
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.964011+00:00.
Case digest / e7d397c122e1bedc13545fc687ddc3f243a70f1c838660c28115ffe132830ec6