FA-83996 / Sports scoring and tiebreakers / Open access
Wide penalty run omitted · case 01
A plain wide adds nothing to the total.
ROOT CAUSE
The wide branch only adds the completed run wides, not the one-run penalty.
VERIFIED REPAIR
Add the one-run penalty plus completed wides to total and extras.
Unsuccessful approach: Adding the penalty to the total but not to extras leaves the extras column short.
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 += k
extras += 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: wide penalty',
(['nb', 'W', '0', '0', '1', '0', 'nb1', 'wd4', 'nb', '2', '0'],),
[12, 1, '1.1', 8, 2]),
('variant scenario 1', (['W', 'lb2', '6'],), [8, 1, '0.3', 2, 3]),
('variant scenario 2',
(['lb2', '0', 'nb4', '0', 'wd4', 'nb4', 'nb4', 'nb4', '0', '4', '4', 'wd'],),
[36, 0, '1.0', 12, 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: wide penalty', (['0', '1', 'wd4', '3', '0', '0', '6'],), [15, 0, '1.0', 5, 2]),
('variant scenario 1', (['1', '4', '0', '4', '4', 'b1'],), [14, 0, '1.0', 1, 2]),
('variant scenario 2', (['4', '1', 'b1', '4', 'nb1', 'b4', '0', 'b1'],), [17, 0, '1.1', 7, 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: wide penalty',
(['wd',
'0',
'nb4',
'wd1',
'b4',
'1',
'0',
'b4',
'nb4',
'4',
'nb1',
'4',
'1',
'0',
'0',
'b1',
'4',
'0',
'lb1'],),
[39, 0, '2.2', 16, 1]),
('variant scenario 1',
(['4',
'lb2',
'4',
'1',
'4',
'0',
'6',
'lb2',
'nb4',
'1',
'lb2',
'b4',
'0',
'0',
'2',
'0',
'0',
'0'],),
[37, 0, '2.5', 11, 1]),
('variant scenario 2',
(['1',
'0',
'2',
'nb4',
'1',
'nb',
'nb4',
'0',
'1',
'nb4',
'2',
'lb1',
'nb',
'lb1',
'b4',
'0',
'0',
'2',
'b1',
'lb1'],),
[34, 0, '2.3', 13, 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: wide penalty',
(['4',
'nb4',
'0',
'lb2',
'W',
'0',
'0',
'W',
'1',
'0',
'W',
'0',
'wd1',
'2',
'4',
'1',
'0',
'0',
'wd',
'W',
'1',
'0',
'4',
'lb1'],),
[28, 4, '3.3', 7, 5]),
('variant scenario 1', (['wd', '4', '4', '4', '0', 'nb', '6'],), [20, 0, '0.5', 2, 1]),
('variant scenario 2', (['0', '0', 'nb4', '2', '0', 'nb'],), [8, 0, '0.4', 2, 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: wide penalty',
(['lb2',
'0',
'W',
'2',
'1',
'nb4',
'2',
'0',
'0',
'1',
'6',
'b4',
'wd',
'nb',
'0',
'W',
'nb1',
'b4'],),
[31, 2, '2.2', 14, 2]),
('variant scenario 1', (['1', 'wd4', '0', '4', '1', '0'],), [11, 0, '0.5', 5, 1]),
('variant scenario 2',
(['1',
'0',
'1',
'1',
'6',
'2',
'2',
'wd',
'nb4',
'lb1',
'nb4',
'nb1',
'0',
'lb1',
'1',
'0',
'1',
'0',
'1',
'1',
'nb1',
'1',
'0',
'1',
'b1',
'4',
'1',
'4'],),
[46, 0, '3.5', 8, 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 | [4, 0, '0.1', 0, 1] | [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: wide penalty | [11, 1, '1.1', 7, 2] | [12, 1, '1.1', 8, 2] | Failed |
| variant scenario 1 | [8, 1, '0.3', 2, 3] | [8, 1, '0.3', 2, 3] | Passed |
| variant scenario 2 | [34, 0, '1.0', 10, 2] | [36, 0, '1.0', 12, 2] | Failed |
SHA-256 / cfbfdff8ebe3e73c750860f92c1bda74a7f63c0577a16edef4dc30c7e0f5de36
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 += 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: wide penalty',
(['nb', 'W', '0', '0', '1', '0', 'nb1', 'wd4', 'nb', '2', '0'],),
[12, 1, '1.1', 8, 2]),
('variant scenario 1', (['W', 'lb2', '6'],), [8, 1, '0.3', 2, 3]),
('variant scenario 2',
(['lb2', '0', 'nb4', '0', 'wd4', 'nb4', 'nb4', 'nb4', '0', '4', '4', 'wd'],),
[36, 0, '1.0', 12, 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: wide penalty', (['0', '1', 'wd4', '3', '0', '0', '6'],), [15, 0, '1.0', 5, 2]),
('variant scenario 1', (['1', '4', '0', '4', '4', 'b1'],), [14, 0, '1.0', 1, 2]),
('variant scenario 2', (['4', '1', 'b1', '4', 'nb1', 'b4', '0', 'b1'],), [17, 0, '1.1', 7, 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: wide penalty',
(['wd',
'0',
'nb4',
'wd1',
'b4',
'1',
'0',
'b4',
'nb4',
'4',
'nb1',
'4',
'1',
'0',
'0',
'b1',
'4',
'0',
'lb1'],),
[39, 0, '2.2', 16, 1]),
('variant scenario 1',
(['4',
'lb2',
'4',
'1',
'4',
'0',
'6',
'lb2',
'nb4',
'1',
'lb2',
'b4',
'0',
'0',
'2',
'0',
'0',
'0'],),
[37, 0, '2.5', 11, 1]),
('variant scenario 2',
(['1',
'0',
'2',
'nb4',
'1',
'nb',
'nb4',
'0',
'1',
'nb4',
'2',
'lb1',
'nb',
'lb1',
'b4',
'0',
'0',
'2',
'b1',
'lb1'],),
[34, 0, '2.3', 13, 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: wide penalty',
(['4',
'nb4',
'0',
'lb2',
'W',
'0',
'0',
'W',
'1',
'0',
'W',
'0',
'wd1',
'2',
'4',
'1',
'0',
'0',
'wd',
'W',
'1',
'0',
'4',
'lb1'],),
[28, 4, '3.3', 7, 5]),
('variant scenario 1', (['wd', '4', '4', '4', '0', 'nb', '6'],), [20, 0, '0.5', 2, 1]),
('variant scenario 2', (['0', '0', 'nb4', '2', '0', 'nb'],), [8, 0, '0.4', 2, 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: wide penalty',
(['lb2',
'0',
'W',
'2',
'1',
'nb4',
'2',
'0',
'0',
'1',
'6',
'b4',
'wd',
'nb',
'0',
'W',
'nb1',
'b4'],),
[31, 2, '2.2', 14, 2]),
('variant scenario 1', (['1', 'wd4', '0', '4', '1', '0'],), [11, 0, '0.5', 5, 1]),
('variant scenario 2',
(['1',
'0',
'1',
'1',
'6',
'2',
'2',
'wd',
'nb4',
'lb1',
'nb4',
'nb1',
'0',
'lb1',
'1',
'0',
'1',
'0',
'1',
'1',
'nb1',
'1',
'0',
'1',
'b1',
'4',
'1',
'4'],),
[46, 0, '3.5', 8, 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', 0, 1] | [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: wide penalty | [12, 1, '1.1', 7, 2] | [12, 1, '1.1', 8, 2] | Failed |
| variant scenario 1 | [8, 1, '0.3', 2, 3] | [8, 1, '0.3', 2, 3] | Passed |
| variant scenario 2 | [36, 0, '1.0', 10, 2] | [36, 0, '1.0', 12, 2] | Failed |
SHA-256 / fa89908e429a9f5b0043fa01887b1acfccac4742a763691bc66e5cb37e28342f
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: wide penalty',
(['nb', 'W', '0', '0', '1', '0', 'nb1', 'wd4', 'nb', '2', '0'],),
[12, 1, '1.1', 8, 2]),
('variant scenario 1', (['W', 'lb2', '6'],), [8, 1, '0.3', 2, 3]),
('variant scenario 2',
(['lb2', '0', 'nb4', '0', 'wd4', 'nb4', 'nb4', 'nb4', '0', '4', '4', 'wd'],),
[36, 0, '1.0', 12, 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: wide penalty', (['0', '1', 'wd4', '3', '0', '0', '6'],), [15, 0, '1.0', 5, 2]),
('variant scenario 1', (['1', '4', '0', '4', '4', 'b1'],), [14, 0, '1.0', 1, 2]),
('variant scenario 2', (['4', '1', 'b1', '4', 'nb1', 'b4', '0', 'b1'],), [17, 0, '1.1', 7, 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: wide penalty',
(['wd',
'0',
'nb4',
'wd1',
'b4',
'1',
'0',
'b4',
'nb4',
'4',
'nb1',
'4',
'1',
'0',
'0',
'b1',
'4',
'0',
'lb1'],),
[39, 0, '2.2', 16, 1]),
('variant scenario 1',
(['4',
'lb2',
'4',
'1',
'4',
'0',
'6',
'lb2',
'nb4',
'1',
'lb2',
'b4',
'0',
'0',
'2',
'0',
'0',
'0'],),
[37, 0, '2.5', 11, 1]),
('variant scenario 2',
(['1',
'0',
'2',
'nb4',
'1',
'nb',
'nb4',
'0',
'1',
'nb4',
'2',
'lb1',
'nb',
'lb1',
'b4',
'0',
'0',
'2',
'b1',
'lb1'],),
[34, 0, '2.3', 13, 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: wide penalty',
(['4',
'nb4',
'0',
'lb2',
'W',
'0',
'0',
'W',
'1',
'0',
'W',
'0',
'wd1',
'2',
'4',
'1',
'0',
'0',
'wd',
'W',
'1',
'0',
'4',
'lb1'],),
[28, 4, '3.3', 7, 5]),
('variant scenario 1', (['wd', '4', '4', '4', '0', 'nb', '6'],), [20, 0, '0.5', 2, 1]),
('variant scenario 2', (['0', '0', 'nb4', '2', '0', 'nb'],), [8, 0, '0.4', 2, 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: wide penalty',
(['lb2',
'0',
'W',
'2',
'1',
'nb4',
'2',
'0',
'0',
'1',
'6',
'b4',
'wd',
'nb',
'0',
'W',
'nb1',
'b4'],),
[31, 2, '2.2', 14, 2]),
('variant scenario 1', (['1', 'wd4', '0', '4', '1', '0'],), [11, 0, '0.5', 5, 1]),
('variant scenario 2',
(['1',
'0',
'1',
'1',
'6',
'2',
'2',
'wd',
'nb4',
'lb1',
'nb4',
'nb1',
'0',
'lb1',
'1',
'0',
'1',
'0',
'1',
'1',
'nb1',
'1',
'0',
'1',
'b1',
'4',
'1',
'4'],),
[46, 0, '3.5', 8, 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: wide penalty | [12, 1, '1.1', 8, 2] | [12, 1, '1.1', 8, 2] | Passed |
| variant scenario 1 | [8, 1, '0.3', 2, 3] | [8, 1, '0.3', 2, 3] | Passed |
| variant scenario 2 | [36, 0, '1.0', 12, 2] | [36, 0, '1.0', 12, 2] | Passed |
SHA-256 / 696dad37433e34e222f046940be28ee867cc56efbf072e80a23d64c15f9d271e
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.672467+00:00.
Case digest / c6f622ac6dcc7ecaa28484ad3d899e65cc960966bb2b9e6eab7a879125ba6755