FA-84001 / Sports scoring and tiebreakers / Open access
Strike not rotated at the end of an over · case 01
The same batter is shown on strike for the first ball of the new over.
ROOT CAUSE
The end-of-over swap is missing.
VERIFIED REPAIR
Swap strike after each sixth legal ball.
Unsuccessful approach: Swapping whenever the legal count is a multiple of six also swaps on wides and no-balls bowled then.
Case contract
Ball-by-ball innings tally. Events: "0".."6" runs off the bat (legal ball); "W" wicket (legal ball, no runs, the new batter takes strike); "wdK" wide: 1 penalty + K run wides, all extras, not a legal ball, K runs completed; "nbK" no-ball: 1 penalty extra + K runs off the bat, not a legal ball; "bK"/"lbK" byes/leg byes: K extras on a legal ball. Batters change ends when an odd number of runs is completed, and again after the 6th legal ball of an over. Batters are numbered 1, 2 and then 3, 4, ... as they come in; batter 1 starts on strike. Return [total, wickets, overs "O.B", extras, batter on strike].
Why this case matters
Scoring apps derive totals, overs and strike from ball events; extras and strike rotation are error-prone.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(events):
total = wickets = legal = extras = 0
striker, non = 1, 2
next_bat = 3
for e in events:
if e == 'W':
wickets += 1
legal += 1
striker = next_bat
next_bat += 1
ran = 0
elif e.startswith('wd'):
k = int(e[2:] or 0)
total += 1 + k
extras += 1 + k
ran = k
elif e.startswith('nb'):
k = int(e[2:] or 0)
total += 1 + k
extras += 1
ran = k
elif e[0] in 'bl':
k = int(e.lstrip('lb'))
total += k
extras += k
legal += 1
ran = k
else:
k = int(e)
total += k
legal += 1
ran = k
if ran % 2 == 1:
striker, non = non, striker
return [total, wickets, '%d.%d' % (legal // 6, legal % 6), extras, striker]
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 maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation', (['nb', '2', '0', '4'],), [7, 0, '0.3', 1, 1]),
('regression: over end rotation', (['wd', '0', '1', '4', '0', '1', '0'],), [7, 0, '1.0', 1, 2]),
('variant scenario 1', (['b1', '4', '1'],), [6, 0, '0.3', 1, 1]),
('variant scenario 2',
(['1', '4', '4', '0', '0', '2', '4', 'b1', '0', 'wd1'],),
[18, 0, '1.3', 3, 1])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['nb4', '1', '0', 'nb1', '1', 'W', '0', '0', 'wd4', '1', 'b4', '1'],),
[20, 1, '1.3', 11, 1]),
('variant scenario 1',
(['1', '3', '4', 'nb1', 'wd', '4', '0', '4', '1', '1', 'wd1', '1', 'nb', 'lb2'],),
[27, 0, '1.4', 7, 1]),
('variant scenario 2', (['6', 'lb2', '1'],), [9, 0, '0.3', 2, 2])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['0', 'b1', 'b1', '0', '1', '1', 'b4', '0', 'nb4', '0'],),
[13, 0, '1.3', 7, 2]),
('regression: over end rotation',
(['wd1',
'2',
'b1',
'wd1',
'nb',
'4',
'1',
'wd',
'1',
'0',
'wd1',
'wd',
'2',
'0',
'nb4',
'1',
'1',
'wd',
'wd1',
'6'],),
[36, 0, '1.5', 14, 1]),
('variant scenario 1',
(['1', '2', 'nb1', '3', '1', 'nb', '0', 'W', '4', '0', '1', '0', 'b1', 'nb', '1', '3', 'lb1'],),
[22, 1, '2.2', 5, 2]),
('variant scenario 2',
(['1', '0', '1', '1', '2', 'b1', '4', '1', 'nb', '2', '4', '4', '6', 'lb2', 'wd4', 'W'],),
[35, 1, '2.2', 9, 3])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['4',
'nb',
'4',
'3',
'b4',
'1',
'1',
'W',
'nb4',
'6',
'1',
'0',
'b4',
'nb4',
'2',
'1',
'0',
'W',
'2',
'0',
'lb1',
'1'],),
[46, 2, '3.1', 12, 3]),
('regression: over end rotation',
(['wd',
'1',
'nb4',
'wd1',
'1',
'wd',
'2',
'1',
'nb4',
'1',
'1',
'4',
'wd4',
'4',
'6',
'0',
'wd1',
'6'],),
[48, 0, '1.5', 13, 1]),
('variant scenario 1',
(['W', 'wd1', '3', 'wd4', '4', 'b1', '3', 'wd', 'b1'],),
[20, 1, '1.0', 10, 3]),
('variant scenario 2',
(['0',
'6',
'b1',
'wd1',
'lb2',
'lb1',
'lb1',
'nb1',
'0',
'W',
'4',
'lb1',
'0',
'1',
'nb4',
'1',
'0'],),
[27, 1, '2.2', 10, 3])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['lb2',
'4',
'2',
'4',
'2',
'b4',
'wd',
'1',
'wd4',
'4',
'nb1',
'6',
'6',
'nb',
'1',
'nb4',
'0',
'1',
'4',
'1',
'nb1',
'2',
'nb'],),
[61, 0, '2.4', 17, 1]),
('regression: over end rotation',
(['4', '4', 'W', '2', 'nb4', '0', 'nb4', '6'],),
[26, 1, '1.0', 2, 2]),
('variant scenario 1',
(['lb1',
'wd4',
'0',
'6',
'W',
'1',
'2',
'b1',
'0',
'1',
'wd4',
'0',
'1',
'0',
'1',
'wd',
'1',
'3',
'6',
'2',
'0',
'W',
'wd',
'b4'],),
[42, 2, '3.2', 18, 4]),
('variant scenario 2', (['0', '1', '4', 'wd', '1', 'b1'],), [8, 0, '0.5', 2, 2])]]
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 maiden over | [0, 0, '1.0', 0, 1] | [0, 0, '1.0', 0, 2] | Failed |
| boundary single rotates strike | [1, 0, '0.1', 0, 2] | [1, 0, '0.1', 0, 2] | Passed |
| boundary wide is not a legal ball | [5, 0, '0.1', 1, 1] | [5, 0, '0.1', 1, 1] | Passed |
| control no-ball boundary | [5, 0, '0.0', 1, 1] | [5, 0, '0.0', 1, 1] | Passed |
| boundary wicket brings new striker | [0, 1, '0.2', 0, 3] | [0, 1, '0.2', 0, 3] | Passed |
| control leg byes | [3, 0, '0.2', 1, 2] | [3, 0, '0.2', 1, 2] | Passed |
| regression: over end rotation | [7, 0, '0.3', 1, 1] | [7, 0, '0.3', 1, 1] | Passed |
| regression: over end rotation | [7, 0, '1.0', 1, 1] | [7, 0, '1.0', 1, 2] | Failed |
| variant scenario 1 | [6, 0, '0.3', 1, 1] | [6, 0, '0.3', 1, 1] | Passed |
| variant scenario 2 | [18, 0, '1.3', 3, 2] | [18, 0, '1.3', 3, 1] | Failed |
SHA-256 / 9afedf64a8f917190c573594274609e8a6489bdb29a03d908b3caf92e272b169
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(events):
total = wickets = legal = extras = 0
striker, non = 1, 2
next_bat = 3
for e in events:
if e == 'W':
wickets += 1
legal += 1
striker = next_bat
next_bat += 1
ran = 0
elif e.startswith('wd'):
k = int(e[2:] or 0)
total += 1 + k
extras += 1 + k
ran = k
elif e.startswith('nb'):
k = int(e[2:] or 0)
total += 1 + k
extras += 1
ran = k
elif e[0] in 'bl':
k = int(e.lstrip('lb'))
total += k
extras += k
legal += 1
ran = k
else:
k = int(e)
total += k
legal += 1
ran = k
if ran % 2 == 1:
striker, non = non, striker
if legal % 6 == 0:
striker, non = non, striker
return [total, wickets, '%d.%d' % (legal // 6, legal % 6), extras, striker]
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 maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation', (['nb', '2', '0', '4'],), [7, 0, '0.3', 1, 1]),
('regression: over end rotation', (['wd', '0', '1', '4', '0', '1', '0'],), [7, 0, '1.0', 1, 2]),
('variant scenario 1', (['b1', '4', '1'],), [6, 0, '0.3', 1, 1]),
('variant scenario 2',
(['1', '4', '4', '0', '0', '2', '4', 'b1', '0', 'wd1'],),
[18, 0, '1.3', 3, 1])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['nb4', '1', '0', 'nb1', '1', 'W', '0', '0', 'wd4', '1', 'b4', '1'],),
[20, 1, '1.3', 11, 1]),
('variant scenario 1',
(['1', '3', '4', 'nb1', 'wd', '4', '0', '4', '1', '1', 'wd1', '1', 'nb', 'lb2'],),
[27, 0, '1.4', 7, 1]),
('variant scenario 2', (['6', 'lb2', '1'],), [9, 0, '0.3', 2, 2])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['0', 'b1', 'b1', '0', '1', '1', 'b4', '0', 'nb4', '0'],),
[13, 0, '1.3', 7, 2]),
('regression: over end rotation',
(['wd1',
'2',
'b1',
'wd1',
'nb',
'4',
'1',
'wd',
'1',
'0',
'wd1',
'wd',
'2',
'0',
'nb4',
'1',
'1',
'wd',
'wd1',
'6'],),
[36, 0, '1.5', 14, 1]),
('variant scenario 1',
(['1', '2', 'nb1', '3', '1', 'nb', '0', 'W', '4', '0', '1', '0', 'b1', 'nb', '1', '3', 'lb1'],),
[22, 1, '2.2', 5, 2]),
('variant scenario 2',
(['1', '0', '1', '1', '2', 'b1', '4', '1', 'nb', '2', '4', '4', '6', 'lb2', 'wd4', 'W'],),
[35, 1, '2.2', 9, 3])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['4',
'nb',
'4',
'3',
'b4',
'1',
'1',
'W',
'nb4',
'6',
'1',
'0',
'b4',
'nb4',
'2',
'1',
'0',
'W',
'2',
'0',
'lb1',
'1'],),
[46, 2, '3.1', 12, 3]),
('regression: over end rotation',
(['wd',
'1',
'nb4',
'wd1',
'1',
'wd',
'2',
'1',
'nb4',
'1',
'1',
'4',
'wd4',
'4',
'6',
'0',
'wd1',
'6'],),
[48, 0, '1.5', 13, 1]),
('variant scenario 1',
(['W', 'wd1', '3', 'wd4', '4', 'b1', '3', 'wd', 'b1'],),
[20, 1, '1.0', 10, 3]),
('variant scenario 2',
(['0',
'6',
'b1',
'wd1',
'lb2',
'lb1',
'lb1',
'nb1',
'0',
'W',
'4',
'lb1',
'0',
'1',
'nb4',
'1',
'0'],),
[27, 1, '2.2', 10, 3])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['lb2',
'4',
'2',
'4',
'2',
'b4',
'wd',
'1',
'wd4',
'4',
'nb1',
'6',
'6',
'nb',
'1',
'nb4',
'0',
'1',
'4',
'1',
'nb1',
'2',
'nb'],),
[61, 0, '2.4', 17, 1]),
('regression: over end rotation',
(['4', '4', 'W', '2', 'nb4', '0', 'nb4', '6'],),
[26, 1, '1.0', 2, 2]),
('variant scenario 1',
(['lb1',
'wd4',
'0',
'6',
'W',
'1',
'2',
'b1',
'0',
'1',
'wd4',
'0',
'1',
'0',
'1',
'wd',
'1',
'3',
'6',
'2',
'0',
'W',
'wd',
'b4'],),
[42, 2, '3.2', 18, 4]),
('variant scenario 2', (['0', '1', '4', 'wd', '1', 'b1'],), [8, 0, '0.5', 2, 2])]]
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 maiden over | [0, 0, '1.0', 0, 2] | [0, 0, '1.0', 0, 2] | Passed |
| boundary single rotates strike | [1, 0, '0.1', 0, 2] | [1, 0, '0.1', 0, 2] | Passed |
| boundary wide is not a legal ball | [5, 0, '0.1', 1, 2] | [5, 0, '0.1', 1, 1] | Failed |
| control no-ball boundary | [5, 0, '0.0', 1, 2] | [5, 0, '0.0', 1, 1] | Failed |
| boundary wicket brings new striker | [0, 1, '0.2', 0, 3] | [0, 1, '0.2', 0, 3] | Passed |
| control leg byes | [3, 0, '0.2', 1, 2] | [3, 0, '0.2', 1, 2] | Passed |
| regression: over end rotation | [7, 0, '0.3', 1, 2] | [7, 0, '0.3', 1, 1] | Failed |
| regression: over end rotation | [7, 0, '1.0', 1, 1] | [7, 0, '1.0', 1, 2] | Failed |
| variant scenario 1 | [6, 0, '0.3', 1, 1] | [6, 0, '0.3', 1, 1] | Passed |
| variant scenario 2 | [18, 0, '1.3', 3, 1] | [18, 0, '1.3', 3, 1] | Passed |
SHA-256 / b833cd3b2a228ab6177c6899b2b82cfed41a31b6805e5754b985c4bef4995558
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(events):
total = wickets = legal = extras = 0
striker, non = 1, 2
next_bat = 3
for e in events:
if e == 'W':
wickets += 1
legal += 1
striker = next_bat
next_bat += 1
ran = 0
elif e.startswith('wd'):
k = int(e[2:] or 0)
total += 1 + k
extras += 1 + k
ran = k
elif e.startswith('nb'):
k = int(e[2:] or 0)
total += 1 + k
extras += 1
ran = k
elif e[0] in 'bl':
k = int(e.lstrip('lb'))
total += k
extras += k
legal += 1
ran = k
else:
k = int(e)
total += k
legal += 1
ran = k
if ran % 2 == 1:
striker, non = non, striker
if e[:2] not in ('wd', 'nb') and legal % 6 == 0:
striker, non = non, striker
return [total, wickets, '%d.%d' % (legal // 6, legal % 6), extras, striker]
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 maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation', (['nb', '2', '0', '4'],), [7, 0, '0.3', 1, 1]),
('regression: over end rotation', (['wd', '0', '1', '4', '0', '1', '0'],), [7, 0, '1.0', 1, 2]),
('variant scenario 1', (['b1', '4', '1'],), [6, 0, '0.3', 1, 1]),
('variant scenario 2',
(['1', '4', '4', '0', '0', '2', '4', 'b1', '0', 'wd1'],),
[18, 0, '1.3', 3, 1])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['nb4', '1', '0', 'nb1', '1', 'W', '0', '0', 'wd4', '1', 'b4', '1'],),
[20, 1, '1.3', 11, 1]),
('variant scenario 1',
(['1', '3', '4', 'nb1', 'wd', '4', '0', '4', '1', '1', 'wd1', '1', 'nb', 'lb2'],),
[27, 0, '1.4', 7, 1]),
('variant scenario 2', (['6', 'lb2', '1'],), [9, 0, '0.3', 2, 2])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['0', 'b1', 'b1', '0', '1', '1', 'b4', '0', 'nb4', '0'],),
[13, 0, '1.3', 7, 2]),
('regression: over end rotation',
(['wd1',
'2',
'b1',
'wd1',
'nb',
'4',
'1',
'wd',
'1',
'0',
'wd1',
'wd',
'2',
'0',
'nb4',
'1',
'1',
'wd',
'wd1',
'6'],),
[36, 0, '1.5', 14, 1]),
('variant scenario 1',
(['1', '2', 'nb1', '3', '1', 'nb', '0', 'W', '4', '0', '1', '0', 'b1', 'nb', '1', '3', 'lb1'],),
[22, 1, '2.2', 5, 2]),
('variant scenario 2',
(['1', '0', '1', '1', '2', 'b1', '4', '1', 'nb', '2', '4', '4', '6', 'lb2', 'wd4', 'W'],),
[35, 1, '2.2', 9, 3])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['4',
'nb',
'4',
'3',
'b4',
'1',
'1',
'W',
'nb4',
'6',
'1',
'0',
'b4',
'nb4',
'2',
'1',
'0',
'W',
'2',
'0',
'lb1',
'1'],),
[46, 2, '3.1', 12, 3]),
('regression: over end rotation',
(['wd',
'1',
'nb4',
'wd1',
'1',
'wd',
'2',
'1',
'nb4',
'1',
'1',
'4',
'wd4',
'4',
'6',
'0',
'wd1',
'6'],),
[48, 0, '1.5', 13, 1]),
('variant scenario 1',
(['W', 'wd1', '3', 'wd4', '4', 'b1', '3', 'wd', 'b1'],),
[20, 1, '1.0', 10, 3]),
('variant scenario 2',
(['0',
'6',
'b1',
'wd1',
'lb2',
'lb1',
'lb1',
'nb1',
'0',
'W',
'4',
'lb1',
'0',
'1',
'nb4',
'1',
'0'],),
[27, 1, '2.2', 10, 3])],
[('control maiden over', (['0', '0', '0', '0', '0', '0'],), [0, 0, '1.0', 0, 2]),
('boundary single rotates strike', (['1'],), [1, 0, '0.1', 0, 2]),
('boundary wide is not a legal ball', (['wd', '4'],), [5, 0, '0.1', 1, 1]),
('control no-ball boundary', (['nb4'],), [5, 0, '0.0', 1, 1]),
('boundary wicket brings new striker', (['W', '0'],), [0, 1, '0.2', 0, 3]),
('control leg byes', (['lb1', '2'],), [3, 0, '0.2', 1, 2]),
('regression: over end rotation',
(['lb2',
'4',
'2',
'4',
'2',
'b4',
'wd',
'1',
'wd4',
'4',
'nb1',
'6',
'6',
'nb',
'1',
'nb4',
'0',
'1',
'4',
'1',
'nb1',
'2',
'nb'],),
[61, 0, '2.4', 17, 1]),
('regression: over end rotation',
(['4', '4', 'W', '2', 'nb4', '0', 'nb4', '6'],),
[26, 1, '1.0', 2, 2]),
('variant scenario 1',
(['lb1',
'wd4',
'0',
'6',
'W',
'1',
'2',
'b1',
'0',
'1',
'wd4',
'0',
'1',
'0',
'1',
'wd',
'1',
'3',
'6',
'2',
'0',
'W',
'wd',
'b4'],),
[42, 2, '3.2', 18, 4]),
('variant scenario 2', (['0', '1', '4', 'wd', '1', 'b1'],), [8, 0, '0.5', 2, 2])]]
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 maiden over | [0, 0, '1.0', 0, 2] | [0, 0, '1.0', 0, 2] | Passed |
| boundary single rotates strike | [1, 0, '0.1', 0, 2] | [1, 0, '0.1', 0, 2] | Passed |
| boundary wide is not a legal ball | [5, 0, '0.1', 1, 1] | [5, 0, '0.1', 1, 1] | Passed |
| control no-ball boundary | [5, 0, '0.0', 1, 1] | [5, 0, '0.0', 1, 1] | Passed |
| boundary wicket brings new striker | [0, 1, '0.2', 0, 3] | [0, 1, '0.2', 0, 3] | Passed |
| control leg byes | [3, 0, '0.2', 1, 2] | [3, 0, '0.2', 1, 2] | Passed |
| regression: over end rotation | [7, 0, '0.3', 1, 1] | [7, 0, '0.3', 1, 1] | Passed |
| regression: over end rotation | [7, 0, '1.0', 1, 2] | [7, 0, '1.0', 1, 2] | Passed |
| variant scenario 1 | [6, 0, '0.3', 1, 1] | [6, 0, '0.3', 1, 1] | Passed |
| variant scenario 2 | [18, 0, '1.3', 3, 1] | [18, 0, '1.3', 3, 1] | Passed |
SHA-256 / 4286b015339345fb7e09ce29b0a5e3eb9b6704648ef54094f2c3f5b5e0513209
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:26.754212+00:00.
Case digest / 736ad96914b6158fe62fac0909feefff090feb14f09315bf612cce03e1cc6076