FA-84011 / Sports scoring and tiebreakers / Open access
New batter placed at the wrong end after a wicket · case 01
After a dismissal the dismissed batter number stays on strike.
ROOT CAUSE
The wicket branch never assigns the incoming batter to the striker slot.
VERIFIED REPAIR
Put the incoming batter on strike.
Unsuccessful approach: Sending the new batter to the non-striker end strands the old non-striker on strike.
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
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: incoming batter end', (['W', 'wd', 'wd', 'b1', '1', 'nb'],), [5, 1, '0.3', 4, 3]),
('variant scenario 1', (['1', '4', 'wd1', '0', 'wd', '0', '4', '1'],), [13, 0, '1.0', 3, 1]),
('variant scenario 2', (['3', 'b4', '1', 'wd1', '1'],), [11, 0, '0.4', 6, 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: incoming batter end',
(['0', '6', '0', '1', '2', 'wd1', '2', '1', '6', 'nb1', 'wd', 'wd1', 'W', 'W'],),
[25, 2, '1.4', 6, 4]),
('variant scenario 1', (['0', 'wd4', 'wd4', '1', '1', 'lb2', '2'],), [16, 0, '0.5', 12, 1]),
('variant scenario 2', (['0', '0', '4', '0', '0', '1'],), [5, 0, '1.0', 0, 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: incoming batter end',
(['wd4', '2', '1', '0', '6', 'W', '1', '0'],),
[15, 1, '1.1', 5, 3]),
('variant scenario 1', (['4', '1', '1'],), [6, 0, '0.3', 0, 1]),
('variant scenario 2',
(['1',
'nb',
'3',
'4',
'lb2',
'2',
'b1',
'0',
'4',
'6',
'1',
'b1',
'4',
'3',
'lb1',
'nb1',
'lb2'],),
[38, 0, '2.3', 9, 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: incoming batter end',
(['0',
'4',
'nb1',
'1',
'nb4',
'wd1',
'nb1',
'6',
'W',
'1',
'nb',
'3',
'wd1',
'b4',
'0',
'b4',
'1'],),
[38, 1, '1.5', 16, 2]),
('regression: incoming batter end',
(['nb4', '0', 'lb2', '6', '3', '4', 'W', 'lb1'],),
[21, 1, '1.1', 4, 3]),
('variant scenario 1',
(['nb', 'nb', 'wd4', '1', '1', '0', 'nb1', '4', 'b4', 'nb4'],),
[24, 0, '0.5', 13, 2]),
('variant scenario 2',
(['4', '1', 'lb1', '2', '1', 'b1', '0', '0', 'wd', 'nb1', '1', '0', '2', '4', 'nb4'],),
[25, 0, '2.0', 5, 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: incoming batter end', (['wd1', '2', '0', 'W', 'b4', 'b1'],), [9, 1, '0.5', 7, 1]),
('regression: incoming batter end',
(['b4', 'W', '0', '1', '2', 'W', '1', '2', 'wd', '1', '0', '2', '2', '6', 'wd', '0'],),
[23, 2, '2.2', 6, 4]),
('variant scenario 1', (['4', '2', '4', '6', '2', '1'],), [19, 0, '1.0', 0, 1]),
('variant scenario 2',
(['wd4', '1', 'wd1', '0', '6', '1', 'nb', '0', 'b4', '4', '0', 'wd', '4', 'nb'],),
[30, 0, '1.3', 14, 1])]]
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, 1] | [0, 1, '0.2', 0, 3] | Failed |
| control leg byes | [3, 0, '0.2', 1, 2] | [3, 0, '0.2', 1, 2] | Passed |
| regression: incoming batter end | [5, 1, '0.3', 4, 1] | [5, 1, '0.3', 4, 3] | Failed |
| variant scenario 1 | [13, 0, '1.0', 3, 1] | [13, 0, '1.0', 3, 1] | Passed |
| variant scenario 2 | [11, 0, '0.4', 6, 1] | [11, 0, '0.4', 6, 1] | Passed |
SHA-256 / 50520d5ce63273f30e644a49066631c88b1b549f9a15411e46cd342fcca2173b
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
non = 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: incoming batter end', (['W', 'wd', 'wd', 'b1', '1', 'nb'],), [5, 1, '0.3', 4, 3]),
('variant scenario 1', (['1', '4', 'wd1', '0', 'wd', '0', '4', '1'],), [13, 0, '1.0', 3, 1]),
('variant scenario 2', (['3', 'b4', '1', 'wd1', '1'],), [11, 0, '0.4', 6, 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: incoming batter end',
(['0', '6', '0', '1', '2', 'wd1', '2', '1', '6', 'nb1', 'wd', 'wd1', 'W', 'W'],),
[25, 2, '1.4', 6, 4]),
('variant scenario 1', (['0', 'wd4', 'wd4', '1', '1', 'lb2', '2'],), [16, 0, '0.5', 12, 1]),
('variant scenario 2', (['0', '0', '4', '0', '0', '1'],), [5, 0, '1.0', 0, 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: incoming batter end',
(['wd4', '2', '1', '0', '6', 'W', '1', '0'],),
[15, 1, '1.1', 5, 3]),
('variant scenario 1', (['4', '1', '1'],), [6, 0, '0.3', 0, 1]),
('variant scenario 2',
(['1',
'nb',
'3',
'4',
'lb2',
'2',
'b1',
'0',
'4',
'6',
'1',
'b1',
'4',
'3',
'lb1',
'nb1',
'lb2'],),
[38, 0, '2.3', 9, 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: incoming batter end',
(['0',
'4',
'nb1',
'1',
'nb4',
'wd1',
'nb1',
'6',
'W',
'1',
'nb',
'3',
'wd1',
'b4',
'0',
'b4',
'1'],),
[38, 1, '1.5', 16, 2]),
('regression: incoming batter end',
(['nb4', '0', 'lb2', '6', '3', '4', 'W', 'lb1'],),
[21, 1, '1.1', 4, 3]),
('variant scenario 1',
(['nb', 'nb', 'wd4', '1', '1', '0', 'nb1', '4', 'b4', 'nb4'],),
[24, 0, '0.5', 13, 2]),
('variant scenario 2',
(['4', '1', 'lb1', '2', '1', 'b1', '0', '0', 'wd', 'nb1', '1', '0', '2', '4', 'nb4'],),
[25, 0, '2.0', 5, 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: incoming batter end', (['wd1', '2', '0', 'W', 'b4', 'b1'],), [9, 1, '0.5', 7, 1]),
('regression: incoming batter end',
(['b4', 'W', '0', '1', '2', 'W', '1', '2', 'wd', '1', '0', '2', '2', '6', 'wd', '0'],),
[23, 2, '2.2', 6, 4]),
('variant scenario 1', (['4', '2', '4', '6', '2', '1'],), [19, 0, '1.0', 0, 1]),
('variant scenario 2',
(['wd4', '1', 'wd1', '0', '6', '1', 'nb', '0', 'b4', '4', '0', 'wd', '4', 'nb'],),
[30, 0, '1.3', 14, 1])]]
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, 1] | [0, 1, '0.2', 0, 3] | Failed |
| control leg byes | [3, 0, '0.2', 1, 2] | [3, 0, '0.2', 1, 2] | Passed |
| regression: incoming batter end | [5, 1, '0.3', 4, 1] | [5, 1, '0.3', 4, 3] | Failed |
| variant scenario 1 | [13, 0, '1.0', 3, 1] | [13, 0, '1.0', 3, 1] | Passed |
| variant scenario 2 | [11, 0, '0.4', 6, 1] | [11, 0, '0.4', 6, 1] | Passed |
SHA-256 / 7e2a7c0023561c707ca1b96c58275276b88956a025d8f0b946cb2cf34c0d61a1
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: incoming batter end', (['W', 'wd', 'wd', 'b1', '1', 'nb'],), [5, 1, '0.3', 4, 3]),
('variant scenario 1', (['1', '4', 'wd1', '0', 'wd', '0', '4', '1'],), [13, 0, '1.0', 3, 1]),
('variant scenario 2', (['3', 'b4', '1', 'wd1', '1'],), [11, 0, '0.4', 6, 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: incoming batter end',
(['0', '6', '0', '1', '2', 'wd1', '2', '1', '6', 'nb1', 'wd', 'wd1', 'W', 'W'],),
[25, 2, '1.4', 6, 4]),
('variant scenario 1', (['0', 'wd4', 'wd4', '1', '1', 'lb2', '2'],), [16, 0, '0.5', 12, 1]),
('variant scenario 2', (['0', '0', '4', '0', '0', '1'],), [5, 0, '1.0', 0, 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: incoming batter end',
(['wd4', '2', '1', '0', '6', 'W', '1', '0'],),
[15, 1, '1.1', 5, 3]),
('variant scenario 1', (['4', '1', '1'],), [6, 0, '0.3', 0, 1]),
('variant scenario 2',
(['1',
'nb',
'3',
'4',
'lb2',
'2',
'b1',
'0',
'4',
'6',
'1',
'b1',
'4',
'3',
'lb1',
'nb1',
'lb2'],),
[38, 0, '2.3', 9, 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: incoming batter end',
(['0',
'4',
'nb1',
'1',
'nb4',
'wd1',
'nb1',
'6',
'W',
'1',
'nb',
'3',
'wd1',
'b4',
'0',
'b4',
'1'],),
[38, 1, '1.5', 16, 2]),
('regression: incoming batter end',
(['nb4', '0', 'lb2', '6', '3', '4', 'W', 'lb1'],),
[21, 1, '1.1', 4, 3]),
('variant scenario 1',
(['nb', 'nb', 'wd4', '1', '1', '0', 'nb1', '4', 'b4', 'nb4'],),
[24, 0, '0.5', 13, 2]),
('variant scenario 2',
(['4', '1', 'lb1', '2', '1', 'b1', '0', '0', 'wd', 'nb1', '1', '0', '2', '4', 'nb4'],),
[25, 0, '2.0', 5, 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: incoming batter end', (['wd1', '2', '0', 'W', 'b4', 'b1'],), [9, 1, '0.5', 7, 1]),
('regression: incoming batter end',
(['b4', 'W', '0', '1', '2', 'W', '1', '2', 'wd', '1', '0', '2', '2', '6', 'wd', '0'],),
[23, 2, '2.2', 6, 4]),
('variant scenario 1', (['4', '2', '4', '6', '2', '1'],), [19, 0, '1.0', 0, 1]),
('variant scenario 2',
(['wd4', '1', 'wd1', '0', '6', '1', 'nb', '0', 'b4', '4', '0', 'wd', '4', 'nb'],),
[30, 0, '1.3', 14, 1])]]
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: incoming batter end | [5, 1, '0.3', 4, 3] | [5, 1, '0.3', 4, 3] | Passed |
| variant scenario 1 | [13, 0, '1.0', 3, 1] | [13, 0, '1.0', 3, 1] | Passed |
| variant scenario 2 | [11, 0, '0.4', 6, 1] | [11, 0, '0.4', 6, 1] | Passed |
SHA-256 / 9de1ba683ddfc76acccda652fec380688bed2b3069c918511ca3f24aa942f8e4
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.963311+00:00.
Case digest / 4e69e9f98ab4ceb410c9d9a9c7bd129d56e3c90bf813e33f95462befda85878b