FA-84006 / Sports scoring and tiebreakers / Open access
Run wides do not change the strike · case 01
After the batters run one on a wide the wrong batter is on strike.
ROOT CAUSE
The wide branch records zero completed runs for strike rotation.
VERIFIED REPAIR
Use the completed run wides (K) to decide rotation.
Unsuccessful approach: Counting the penalty as a completed run swaps strike on every plain wide.
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 = 0
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: run wide strike',
(['0', 'lb1', '1', '1', '4', '1', '0', 'wd', '0', '0', '4'],),
[13, 0, '1.4', 2, 2]),
('regression: run wide strike',
(['wd', '1', 'nb', '2', '2', '6', '0', 'wd1', '0', '1', '6'],),
[22, 0, '1.2', 4, 1]),
('variant scenario 1', (['b4', '4', '2', 'b4'],), [14, 0, '0.4', 8, 1]),
('variant scenario 2', (['nb1', '1', '0', '4', '1', '4'],), [12, 0, '0.5', 1, 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: run wide strike',
(['4', 'wd1', '1', '4', '0', '2', 'nb1', '1', 'lb2', '1'],),
[19, 0, '1.2', 5, 1]),
('variant scenario 1',
(['4', '1', 'nb', 'wd1', '2', '1', 'wd1', '0', 'nb4', '0', 'lb1', 'b4'],),
[23, 0, '1.2', 11, 1]),
('variant scenario 2', (['1', '1', 'wd', '1', 'W', '2'],), [6, 1, '0.5', 1, 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: run wide strike', (['0', 'wd1', '1', '2'],), [5, 0, '0.3', 2, 1]),
('variant scenario 1',
(['4', 'wd4', '6', 'nb', '1', '6', 'wd', '0', '1', '0', 'nb', 'wd4'],),
[31, 0, '1.1', 13, 2]),
('variant scenario 2',
(['3', '0', '1', 'wd', '0', 'wd', '1', '3', 'b1', '2', '3', '1', '0', '4'],),
[21, 0, '2.0', 3, 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: run wide strike',
(['6',
'1',
'0',
'4',
'0',
'wd4',
'6',
'1',
'nb1',
'1',
'1',
'wd1',
'wd',
'0',
'wd',
'6',
'nb1',
'1',
'0'],),
[40, 0, '2.1', 11, 1]),
('regression: run wide strike',
(['1',
'b1',
'2',
'2',
'1',
'1',
'0',
'4',
'nb',
'wd1',
'6',
'6',
'nb4',
'nb4',
'wd4',
'lb1',
'0',
'nb',
'wd1',
'6'],),
[52, 0, '2.1', 15, 2]),
('variant scenario 1',
(['0', '0', 'wd4', 'wd', 'b1', '2', '1', '0', '6', '1', 'nb', '1', '1', '4', '1'],),
[25, 0, '2.0', 8, 1]),
('variant scenario 2', (['2', '1', '6', '1'],), [10, 0, '0.4', 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: run wide strike',
(['0', 'wd', '4', '0', 'lb2', '1', '2', 'nb4', '1', 'nb', 'nb4', '1', 'wd1'],),
[25, 0, '1.2', 8, 2]),
('regression: run wide strike',
(['lb1',
'b4',
'wd1',
'W',
'wd1',
'2',
'wd',
'lb1',
'0',
'0',
'nb1',
'nb4',
'wd1',
'2',
'6',
'nb1'],),
[32, 1, '1.3', 16, 3]),
('variant scenario 1',
(['4', '1', 'lb2', 'lb2', 'nb4', '1', '6', '6', '1', 'lb1', 'wd1'],),
[31, 0, '1.3', 8, 1]),
('variant scenario 2', (['0', '0', 'wd1', '0', 'nb', 'b1'],), [4, 0, '0.4', 4, 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: run wide strike | [13, 0, '1.4', 2, 2] | [13, 0, '1.4', 2, 2] | Passed |
| regression: run wide strike | [22, 0, '1.2', 4, 2] | [22, 0, '1.2', 4, 1] | Failed |
| variant scenario 1 | [14, 0, '0.4', 8, 1] | [14, 0, '0.4', 8, 1] | Passed |
| variant scenario 2 | [12, 0, '0.5', 1, 2] | [12, 0, '0.5', 1, 2] | Passed |
SHA-256 / b3ccf0a539c04476bb599599e8cb8ccaca3d3851a183801e6c03833389c66f08
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 = 1 + 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: run wide strike',
(['0', 'lb1', '1', '1', '4', '1', '0', 'wd', '0', '0', '4'],),
[13, 0, '1.4', 2, 2]),
('regression: run wide strike',
(['wd', '1', 'nb', '2', '2', '6', '0', 'wd1', '0', '1', '6'],),
[22, 0, '1.2', 4, 1]),
('variant scenario 1', (['b4', '4', '2', 'b4'],), [14, 0, '0.4', 8, 1]),
('variant scenario 2', (['nb1', '1', '0', '4', '1', '4'],), [12, 0, '0.5', 1, 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: run wide strike',
(['4', 'wd1', '1', '4', '0', '2', 'nb1', '1', 'lb2', '1'],),
[19, 0, '1.2', 5, 1]),
('variant scenario 1',
(['4', '1', 'nb', 'wd1', '2', '1', 'wd1', '0', 'nb4', '0', 'lb1', 'b4'],),
[23, 0, '1.2', 11, 1]),
('variant scenario 2', (['1', '1', 'wd', '1', 'W', '2'],), [6, 1, '0.5', 1, 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: run wide strike', (['0', 'wd1', '1', '2'],), [5, 0, '0.3', 2, 1]),
('variant scenario 1',
(['4', 'wd4', '6', 'nb', '1', '6', 'wd', '0', '1', '0', 'nb', 'wd4'],),
[31, 0, '1.1', 13, 2]),
('variant scenario 2',
(['3', '0', '1', 'wd', '0', 'wd', '1', '3', 'b1', '2', '3', '1', '0', '4'],),
[21, 0, '2.0', 3, 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: run wide strike',
(['6',
'1',
'0',
'4',
'0',
'wd4',
'6',
'1',
'nb1',
'1',
'1',
'wd1',
'wd',
'0',
'wd',
'6',
'nb1',
'1',
'0'],),
[40, 0, '2.1', 11, 1]),
('regression: run wide strike',
(['1',
'b1',
'2',
'2',
'1',
'1',
'0',
'4',
'nb',
'wd1',
'6',
'6',
'nb4',
'nb4',
'wd4',
'lb1',
'0',
'nb',
'wd1',
'6'],),
[52, 0, '2.1', 15, 2]),
('variant scenario 1',
(['0', '0', 'wd4', 'wd', 'b1', '2', '1', '0', '6', '1', 'nb', '1', '1', '4', '1'],),
[25, 0, '2.0', 8, 1]),
('variant scenario 2', (['2', '1', '6', '1'],), [10, 0, '0.4', 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: run wide strike',
(['0', 'wd', '4', '0', 'lb2', '1', '2', 'nb4', '1', 'nb', 'nb4', '1', 'wd1'],),
[25, 0, '1.2', 8, 2]),
('regression: run wide strike',
(['lb1',
'b4',
'wd1',
'W',
'wd1',
'2',
'wd',
'lb1',
'0',
'0',
'nb1',
'nb4',
'wd1',
'2',
'6',
'nb1'],),
[32, 1, '1.3', 16, 3]),
('variant scenario 1',
(['4', '1', 'lb2', 'lb2', 'nb4', '1', '6', '6', '1', 'lb1', 'wd1'],),
[31, 0, '1.3', 8, 1]),
('variant scenario 2', (['0', '0', 'wd1', '0', 'nb', 'b1'],), [4, 0, '0.4', 4, 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, 2] | [5, 0, '0.1', 1, 1] | Failed |
| 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: run wide strike | [13, 0, '1.4', 2, 1] | [13, 0, '1.4', 2, 2] | Failed |
| regression: run wide strike | [22, 0, '1.2', 4, 1] | [22, 0, '1.2', 4, 1] | Passed |
| variant scenario 1 | [14, 0, '0.4', 8, 1] | [14, 0, '0.4', 8, 1] | Passed |
| variant scenario 2 | [12, 0, '0.5', 1, 2] | [12, 0, '0.5', 1, 2] | Passed |
SHA-256 / 7ecaa4bcd30d2458c73f5d234f8c3ec883c1f725443f9664790e4137b3e7c675
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: run wide strike',
(['0', 'lb1', '1', '1', '4', '1', '0', 'wd', '0', '0', '4'],),
[13, 0, '1.4', 2, 2]),
('regression: run wide strike',
(['wd', '1', 'nb', '2', '2', '6', '0', 'wd1', '0', '1', '6'],),
[22, 0, '1.2', 4, 1]),
('variant scenario 1', (['b4', '4', '2', 'b4'],), [14, 0, '0.4', 8, 1]),
('variant scenario 2', (['nb1', '1', '0', '4', '1', '4'],), [12, 0, '0.5', 1, 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: run wide strike',
(['4', 'wd1', '1', '4', '0', '2', 'nb1', '1', 'lb2', '1'],),
[19, 0, '1.2', 5, 1]),
('variant scenario 1',
(['4', '1', 'nb', 'wd1', '2', '1', 'wd1', '0', 'nb4', '0', 'lb1', 'b4'],),
[23, 0, '1.2', 11, 1]),
('variant scenario 2', (['1', '1', 'wd', '1', 'W', '2'],), [6, 1, '0.5', 1, 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: run wide strike', (['0', 'wd1', '1', '2'],), [5, 0, '0.3', 2, 1]),
('variant scenario 1',
(['4', 'wd4', '6', 'nb', '1', '6', 'wd', '0', '1', '0', 'nb', 'wd4'],),
[31, 0, '1.1', 13, 2]),
('variant scenario 2',
(['3', '0', '1', 'wd', '0', 'wd', '1', '3', 'b1', '2', '3', '1', '0', '4'],),
[21, 0, '2.0', 3, 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: run wide strike',
(['6',
'1',
'0',
'4',
'0',
'wd4',
'6',
'1',
'nb1',
'1',
'1',
'wd1',
'wd',
'0',
'wd',
'6',
'nb1',
'1',
'0'],),
[40, 0, '2.1', 11, 1]),
('regression: run wide strike',
(['1',
'b1',
'2',
'2',
'1',
'1',
'0',
'4',
'nb',
'wd1',
'6',
'6',
'nb4',
'nb4',
'wd4',
'lb1',
'0',
'nb',
'wd1',
'6'],),
[52, 0, '2.1', 15, 2]),
('variant scenario 1',
(['0', '0', 'wd4', 'wd', 'b1', '2', '1', '0', '6', '1', 'nb', '1', '1', '4', '1'],),
[25, 0, '2.0', 8, 1]),
('variant scenario 2', (['2', '1', '6', '1'],), [10, 0, '0.4', 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: run wide strike',
(['0', 'wd', '4', '0', 'lb2', '1', '2', 'nb4', '1', 'nb', 'nb4', '1', 'wd1'],),
[25, 0, '1.2', 8, 2]),
('regression: run wide strike',
(['lb1',
'b4',
'wd1',
'W',
'wd1',
'2',
'wd',
'lb1',
'0',
'0',
'nb1',
'nb4',
'wd1',
'2',
'6',
'nb1'],),
[32, 1, '1.3', 16, 3]),
('variant scenario 1',
(['4', '1', 'lb2', 'lb2', 'nb4', '1', '6', '6', '1', 'lb1', 'wd1'],),
[31, 0, '1.3', 8, 1]),
('variant scenario 2', (['0', '0', 'wd1', '0', 'nb', 'b1'],), [4, 0, '0.4', 4, 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: run wide strike | [13, 0, '1.4', 2, 2] | [13, 0, '1.4', 2, 2] | Passed |
| regression: run wide strike | [22, 0, '1.2', 4, 1] | [22, 0, '1.2', 4, 1] | Passed |
| variant scenario 1 | [14, 0, '0.4', 8, 1] | [14, 0, '0.4', 8, 1] | Passed |
| variant scenario 2 | [12, 0, '0.5', 1, 2] | [12, 0, '0.5', 1, 2] | Passed |
SHA-256 / 53d977c047e3c9bca47f283b05a04aca6b3a3a79a8e5be9d38ce8d8db352e932
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.837818+00:00.
Case digest / 0b2c2f42c79046b8c5e95a8c5cfb77e94f2fd9c09c34fa8803843e424966cb32