FA-84206 / Sports scoring and tiebreakers / Open access
Thrower keeps throwing after a bust · case 01
Darts after a bust in the same turn are scored against the reverted total.
ROOT CAUSE
The bust branch does not end the turn.
VERIFIED REPAIR
End the turn immediately after a bust.
Unsuccessful approach: Skipping the remaining dart slots of the turn discards darts that belong to the next turn.
Case contract
Double-out darts leg from a remaining score. darts lists thrown darts: S/D/T followed by 1-20, SB (25), DB (50, a double) or M (miss). Turns are three darts. After each dart: reaching exactly 0 with a double (D* or DB) checks out and later darts are ignored; a remaining score below 2 otherwise is a bust, the score reverts to its value at the start of the turn and the turn ends immediately (the next dart in the list starts a new turn). Return [remaining, turns used, checked_out].
Why this case matters
Darts scoring apps must implement bust reversion and double-out exactly.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(start, darts):
def value(d):
if d == 'M':
return 0, False
if d == 'SB':
return 25, False
if d == 'DB':
return 50, True
mult = {'S': 1, 'D': 2, 'T': 3}[d[0]]
return mult * int(d[1:]), d[0] == 'D'
score = start
turns = 0
i = 0
while i < len(darts):
turns += 1
turn_start = score
for k in range(3):
if i >= len(darts):
break
v, dbl = value(darts[i])
i += 1
score -= v
if score == 0 and dbl:
return [0, turns, True]
if score < 2:
score = turn_start
return [score, turns, False]
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 checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (3, ['S14', 'D16', 'D3']), [3, 3, False]),
('variant scenario 1', (15, ['T4', 'D13', 'DB', 'D5', 'S19', 'D12', 'D4']), [7, 5, False]),
('variant scenario 2', (59, ['D10', 'S18', 'S11', 'D1', 'SB']), [10, 2, False])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn',
(23, ['D8', 'D8', 'S16', 'D2', 'D8', 'S1', 'M', 'DB', 'T19']),
[23, 4, False]),
('variant scenario 1', (101, ['D15', 'D20', 'SB', 'D3', 'S4', 'D13', 'T5', 'S16']), [0, 2, True]),
('variant scenario 2', (32, ['D9', 'S4', 'S6', 'D16', 'D18', 'S13']), [4, 4, False])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (7, ['D1', 'S3', 'D17', 'S19', 'D1', 'D20', 'S7']), [7, 4, False]),
('variant scenario 1', (101, ['D10', 'T4']), [69, 1, False]),
('variant scenario 2',
(10, ['D20', 'D6', 'D5', 'M', 'D18', 'SB', 'D16', 'S18', 'T12']),
[0, 3, True])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (50, ['D13', 'D5', 'S14', 'T19', 'D5', 'SB']), [15, 3, False]),
('variant scenario 1', (40, ['T15']), [40, 1, False]),
('variant scenario 2', (40, ['D5', 'D1', 'T18']), [40, 1, False])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (3, ['D13', 'S6', 'D18', 'D14']), [3, 4, False]),
('variant scenario 1', (101, ['M', 'D13', 'T6']), [57, 1, False]),
('variant scenario 2', (50, ['S1']), [49, 1, False])]]
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 checkout on double | [0, 1, True] | [0, 1, True] | Passed |
| boundary finish on single busts | [0, 1, True] | [0, 2, True] | Failed |
| boundary leave one busts | [20, 1, False] | [20, 2, False] | Failed |
| control bull finish | [0, 1, True] | [0, 1, True] | Passed |
| boundary bust mid-turn reverts | [0, 1, True] | [0, 2, True] | Failed |
| control scoring turn | [20, 1, False] | [20, 1, False] | Passed |
| regression: bust ends turn | [3, 1, False] | [3, 3, False] | Failed |
| variant scenario 1 | [7, 3, False] | [7, 5, False] | Failed |
| variant scenario 2 | [10, 2, False] | [10, 2, False] | Passed |
SHA-256 / 5028e6937784046131eb522aa940f01ad02c938c8d42d409d093feb4a727eb62
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(start, darts):
def value(d):
if d == 'M':
return 0, False
if d == 'SB':
return 25, False
if d == 'DB':
return 50, True
mult = {'S': 1, 'D': 2, 'T': 3}[d[0]]
return mult * int(d[1:]), d[0] == 'D'
score = start
turns = 0
i = 0
while i < len(darts):
turns += 1
turn_start = score
for k in range(3):
if i >= len(darts):
break
v, dbl = value(darts[i])
i += 1
score -= v
if score == 0 and dbl:
return [0, turns, True]
if score < 2:
score = turn_start
i += 2 - k
break
return [score, turns, False]
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 checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (3, ['S14', 'D16', 'D3']), [3, 3, False]),
('variant scenario 1', (15, ['T4', 'D13', 'DB', 'D5', 'S19', 'D12', 'D4']), [7, 5, False]),
('variant scenario 2', (59, ['D10', 'S18', 'S11', 'D1', 'SB']), [10, 2, False])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn',
(23, ['D8', 'D8', 'S16', 'D2', 'D8', 'S1', 'M', 'DB', 'T19']),
[23, 4, False]),
('variant scenario 1', (101, ['D15', 'D20', 'SB', 'D3', 'S4', 'D13', 'T5', 'S16']), [0, 2, True]),
('variant scenario 2', (32, ['D9', 'S4', 'S6', 'D16', 'D18', 'S13']), [4, 4, False])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (7, ['D1', 'S3', 'D17', 'S19', 'D1', 'D20', 'S7']), [7, 4, False]),
('variant scenario 1', (101, ['D10', 'T4']), [69, 1, False]),
('variant scenario 2',
(10, ['D20', 'D6', 'D5', 'M', 'D18', 'SB', 'D16', 'S18', 'T12']),
[0, 3, True])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (50, ['D13', 'D5', 'S14', 'T19', 'D5', 'SB']), [15, 3, False]),
('variant scenario 1', (40, ['T15']), [40, 1, False]),
('variant scenario 2', (40, ['D5', 'D1', 'T18']), [40, 1, False])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (3, ['D13', 'S6', 'D18', 'D14']), [3, 4, False]),
('variant scenario 1', (101, ['M', 'D13', 'T6']), [57, 1, False]),
('variant scenario 2', (50, ['S1']), [49, 1, False])]]
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 checkout on double | [0, 1, True] | [0, 1, True] | Passed |
| boundary finish on single busts | [20, 1, False] | [0, 2, True] | Failed |
| boundary leave one busts | [21, 1, False] | [20, 2, False] | Failed |
| control bull finish | [0, 1, True] | [0, 1, True] | Passed |
| boundary bust mid-turn reverts | [32, 1, False] | [0, 2, True] | Failed |
| control scoring turn | [20, 1, False] | [20, 1, False] | Passed |
| regression: bust ends turn | [3, 1, False] | [3, 3, False] | Failed |
| variant scenario 1 | [7, 3, False] | [7, 5, False] | Failed |
| variant scenario 2 | [10, 2, False] | [10, 2, False] | Passed |
SHA-256 / b36802cac354219be62e54a927de0b7cac2808e9c059887568e75c572276104b
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(start, darts):
def value(d):
if d == 'M':
return 0, False
if d == 'SB':
return 25, False
if d == 'DB':
return 50, True
mult = {'S': 1, 'D': 2, 'T': 3}[d[0]]
return mult * int(d[1:]), d[0] == 'D'
score = start
turns = 0
i = 0
while i < len(darts):
turns += 1
turn_start = score
for k in range(3):
if i >= len(darts):
break
v, dbl = value(darts[i])
i += 1
score -= v
if score == 0 and dbl:
return [0, turns, True]
if score < 2:
score = turn_start
break
return [score, turns, False]
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 checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (3, ['S14', 'D16', 'D3']), [3, 3, False]),
('variant scenario 1', (15, ['T4', 'D13', 'DB', 'D5', 'S19', 'D12', 'D4']), [7, 5, False]),
('variant scenario 2', (59, ['D10', 'S18', 'S11', 'D1', 'SB']), [10, 2, False])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn',
(23, ['D8', 'D8', 'S16', 'D2', 'D8', 'S1', 'M', 'DB', 'T19']),
[23, 4, False]),
('variant scenario 1', (101, ['D15', 'D20', 'SB', 'D3', 'S4', 'D13', 'T5', 'S16']), [0, 2, True]),
('variant scenario 2', (32, ['D9', 'S4', 'S6', 'D16', 'D18', 'S13']), [4, 4, False])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (7, ['D1', 'S3', 'D17', 'S19', 'D1', 'D20', 'S7']), [7, 4, False]),
('variant scenario 1', (101, ['D10', 'T4']), [69, 1, False]),
('variant scenario 2',
(10, ['D20', 'D6', 'D5', 'M', 'D18', 'SB', 'D16', 'S18', 'T12']),
[0, 3, True])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (50, ['D13', 'D5', 'S14', 'T19', 'D5', 'SB']), [15, 3, False]),
('variant scenario 1', (40, ['T15']), [40, 1, False]),
('variant scenario 2', (40, ['D5', 'D1', 'T18']), [40, 1, False])],
[('control checkout on double', (40, ['D20']), [0, 1, True]),
('boundary finish on single busts', (20, ['S20', 'D10']), [0, 2, True]),
('boundary leave one busts', (21, ['S20', 'S1']), [20, 2, False]),
('control bull finish', (50, ['DB']), [0, 1, True]),
('boundary bust mid-turn reverts', (32, ['S10', 'T20', 'D16']), [0, 2, True]),
('control scoring turn', (101, ['T20', 'S1', 'S20']), [20, 1, False]),
('regression: bust ends turn', (3, ['D13', 'S6', 'D18', 'D14']), [3, 4, False]),
('variant scenario 1', (101, ['M', 'D13', 'T6']), [57, 1, False]),
('variant scenario 2', (50, ['S1']), [49, 1, False])]]
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 checkout on double | [0, 1, True] | [0, 1, True] | Passed |
| boundary finish on single busts | [0, 2, True] | [0, 2, True] | Passed |
| boundary leave one busts | [20, 2, False] | [20, 2, False] | Passed |
| control bull finish | [0, 1, True] | [0, 1, True] | Passed |
| boundary bust mid-turn reverts | [0, 2, True] | [0, 2, True] | Passed |
| control scoring turn | [20, 1, False] | [20, 1, False] | Passed |
| regression: bust ends turn | [3, 3, False] | [3, 3, False] | Passed |
| variant scenario 1 | [7, 5, False] | [7, 5, False] | Passed |
| variant scenario 2 | [10, 2, False] | [10, 2, False] | Passed |
SHA-256 / 0e01fd3992210f34fad29fc360df1a967e531364f83e71af360faec82a237a19
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.591590+00:00.
Case digest / c353843f21cb38225d030f6e484ac8f63be130ab3ed8d3153d8f8e7b0f574d99