FA-84161 / Sports scoring and tiebreakers / Open access
Points floor applied before adding handicap strokes · case 01
A double-bogey on a stroke hole scores too many or too few points.
ROOT CAUSE
The gross score is floored at zero points before the received strokes are added.
VERIFIED REPAIR
Compute net strokes first, then floor the points at zero.
Unsuccessful approach: Removing the floor gives negative points for blow-up holes.
Case contract
Stableford points with stroke allocation. holes rows are [par, stroke_index, strokes] with stroke index 1-18 and strokes None for a hole with no score. A handicap H >= 0 receives H // 18 strokes on every hole plus one more on holes with stroke index <= H % 18. A plus handicap (H < 0) gives back one stroke on holes with stroke index > 18 + H. Points = max(0, 2 + par - (strokes - received)); a hole with no score earns 0. Return [total, per-hole points].
Why this case matters
Club competition software computes Stableford totals from gross cards and course handicaps.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(holes, handicap):
per = []
for par, si, strokes in holes:
if handicap >= 0:
received = handicap // 18 + (1 if si <= handicap % 18 else 0)
else:
received = -1 if si > 18 + handicap else 0
if strokes is None:
per.append(0)
continue
per.append(max(0, 2 + par - strokes) + received)
return [sum(per), per]
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 scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage', ([[5, 9, 9], [4, 8, 2], [4, 1, 4]], 18), [8, [0, 5, 3]]),
('variant scenario 1',
([[4, 5, 8], [5, 6, 8], [4, 8, 6], [4, 4, 7], [4, 1, 6], [4, 17, 2], [5, 10, 8], [4, 11, 7]],
-2),
[3, [0, 0, 0, 0, 0, 3, 0, 0]]),
('variant scenario 2',
([[4, 15, 4], [3, 4, 4], [5, 17, 9], [3, 14, 4], [3, 7, 4]], 34),
[13, [4, 3, 0, 3, 3]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[5, 13, 7], [4, 10, None], [3, 8, 6], [3, 4, 6], [4, 17, 4], [5, 12, 8], [3, 14, None]], -2),
[1, [0, 0, 0, 0, 1, 0, 0]]),
('regression: zero floor stage',
([[4, 6, 5],
[4, 4, 7],
[5, 17, 5],
[5, 16, None],
[5, 14, 6],
[3, 18, 3],
[3, 11, 7],
[4, 9, 5]],
20),
[12, [2, 0, 3, 0, 2, 3, 0, 2]]),
('variant scenario 1', ([[4, 2, None], [3, 4, 7], [3, 10, 3]], 18), [3, [0, 0, 3]]),
('variant scenario 2',
([[3, 14, 7], [5, 5, 5], [3, 4, 4], [4, 17, 4], [4, 8, 4], [4, 10, 4]], 0),
[9, [0, 2, 1, 2, 2, 2]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[4, 3, 7], [5, 17, 9], [4, 11, 5], [4, 5, 5], [4, 8, 5], [5, 2, 5]], 6),
[7, [0, 0, 1, 2, 1, 3]]),
('variant scenario 1',
([[3, 8, 1],
[3, 7, 7],
[5, 9, 8],
[4, 14, None],
[4, 4, 8],
[4, 13, 2],
[4, 10, 7],
[4, 5, 5],
[4, 17, 8]],
-2),
[9, [4, 0, 0, 0, 0, 4, 0, 1, 0]]),
('variant scenario 2',
([[4, 2, 6], [3, 9, 6], [4, 12, 2], [4, 13, 8], [4, 16, None]], 3),
[5, [1, 0, 4, 0, 0]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[5, 7, 6],
[3, 9, 4],
[5, 12, 6],
[3, 15, 2],
[4, 16, 5],
[3, 17, 4],
[3, 6, 2],
[3, 2, 7],
[4, 3, 6]],
15),
[17, [2, 2, 2, 4, 1, 1, 4, 0, 1]]),
('variant scenario 1',
([[3, 8, 2],
[4, 7, None],
[4, 14, 4],
[4, 9, 7],
[5, 11, 5],
[4, 1, 8],
[3, 5, 3],
[5, 18, 5],
[4, 16, 3]],
18),
[20, [4, 0, 3, 0, 3, 0, 3, 3, 4]]),
('variant scenario 2',
([[4, 4, None],
[4, 6, 6],
[4, 11, 7],
[4, 18, 8],
[3, 3, 3],
[3, 12, 7],
[4, 14, 4],
[3, 17, 4]],
10),
[7, [0, 1, 0, 0, 3, 0, 2, 1]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[4, 2, 4],
[3, 8, 1],
[3, 12, 1],
[5, 15, 8],
[4, 7, 6],
[4, 4, 3],
[5, 3, 9],
[5, 6, 6],
[4, 14, 6],
[4, 11, 2],
[3, 5, 2]],
7),
[26, [3, 4, 4, 0, 1, 4, 0, 2, 0, 4, 4]]),
('variant scenario 1',
([[5, 9, 4],
[3, 12, 3],
[4, 15, 5],
[5, 2, 7],
[3, 17, 7],
[4, 18, 3],
[4, 11, 8],
[5, 16, 6],
[4, 14, 4],
[4, 7, 7],
[5, 5, 9],
[3, 4, 7]],
9),
[14, [4, 2, 1, 1, 0, 3, 0, 1, 2, 0, 0, 0]]),
('variant scenario 2',
([[4, 2, 8], [5, 1, 7], [3, 3, 1], [4, 10, 8], [5, 6, 8], [3, 4, 6], [4, 11, 5], [3, 14, None]],
20),
[9, [0, 2, 5, 0, 0, 0, 2, 0]])]]
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 scratch par | [4, [2, 2]] | [4, [2, 2]] | Passed |
| boundary stroke index equals remainder | [3, [2, 1]] | [3, [2, 1]] | Passed |
| boundary second shot above 18 | [3, [2, 1]] | [3, [2, 1]] | Passed |
| boundary plus handicap | [3, [1, 2]] | [3, [1, 2]] | Passed |
| control blob hole | [1, [1, 0]] | [0, [0, 0]] | Failed |
| control net albatross | [4, [4]] | [4, [4]] | Passed |
| regression: zero floor stage | [9, [1, 5, 3]] | [8, [0, 5, 3]] | Failed |
| variant scenario 1 | [3, [0, 0, 0, 0, 0, 3, 0, 0]] | [3, [0, 0, 0, 0, 0, 3, 0, 0]] | Passed |
| variant scenario 2 | [14, [4, 3, 1, 3, 3]] | [13, [4, 3, 0, 3, 3]] | Failed |
SHA-256 / 705ee42c8c12433284c05b7bdff20360fd8fa5530ab2f6d7193733d88848d55f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(holes, handicap):
per = []
for par, si, strokes in holes:
if handicap >= 0:
received = handicap // 18 + (1 if si <= handicap % 18 else 0)
else:
received = -1 if si > 18 + handicap else 0
if strokes is None:
per.append(0)
continue
per.append(2 + par - (strokes - received))
return [sum(per), per]
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 scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage', ([[5, 9, 9], [4, 8, 2], [4, 1, 4]], 18), [8, [0, 5, 3]]),
('variant scenario 1',
([[4, 5, 8], [5, 6, 8], [4, 8, 6], [4, 4, 7], [4, 1, 6], [4, 17, 2], [5, 10, 8], [4, 11, 7]],
-2),
[3, [0, 0, 0, 0, 0, 3, 0, 0]]),
('variant scenario 2',
([[4, 15, 4], [3, 4, 4], [5, 17, 9], [3, 14, 4], [3, 7, 4]], 34),
[13, [4, 3, 0, 3, 3]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[5, 13, 7], [4, 10, None], [3, 8, 6], [3, 4, 6], [4, 17, 4], [5, 12, 8], [3, 14, None]], -2),
[1, [0, 0, 0, 0, 1, 0, 0]]),
('regression: zero floor stage',
([[4, 6, 5],
[4, 4, 7],
[5, 17, 5],
[5, 16, None],
[5, 14, 6],
[3, 18, 3],
[3, 11, 7],
[4, 9, 5]],
20),
[12, [2, 0, 3, 0, 2, 3, 0, 2]]),
('variant scenario 1', ([[4, 2, None], [3, 4, 7], [3, 10, 3]], 18), [3, [0, 0, 3]]),
('variant scenario 2',
([[3, 14, 7], [5, 5, 5], [3, 4, 4], [4, 17, 4], [4, 8, 4], [4, 10, 4]], 0),
[9, [0, 2, 1, 2, 2, 2]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[4, 3, 7], [5, 17, 9], [4, 11, 5], [4, 5, 5], [4, 8, 5], [5, 2, 5]], 6),
[7, [0, 0, 1, 2, 1, 3]]),
('variant scenario 1',
([[3, 8, 1],
[3, 7, 7],
[5, 9, 8],
[4, 14, None],
[4, 4, 8],
[4, 13, 2],
[4, 10, 7],
[4, 5, 5],
[4, 17, 8]],
-2),
[9, [4, 0, 0, 0, 0, 4, 0, 1, 0]]),
('variant scenario 2',
([[4, 2, 6], [3, 9, 6], [4, 12, 2], [4, 13, 8], [4, 16, None]], 3),
[5, [1, 0, 4, 0, 0]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[5, 7, 6],
[3, 9, 4],
[5, 12, 6],
[3, 15, 2],
[4, 16, 5],
[3, 17, 4],
[3, 6, 2],
[3, 2, 7],
[4, 3, 6]],
15),
[17, [2, 2, 2, 4, 1, 1, 4, 0, 1]]),
('variant scenario 1',
([[3, 8, 2],
[4, 7, None],
[4, 14, 4],
[4, 9, 7],
[5, 11, 5],
[4, 1, 8],
[3, 5, 3],
[5, 18, 5],
[4, 16, 3]],
18),
[20, [4, 0, 3, 0, 3, 0, 3, 3, 4]]),
('variant scenario 2',
([[4, 4, None],
[4, 6, 6],
[4, 11, 7],
[4, 18, 8],
[3, 3, 3],
[3, 12, 7],
[4, 14, 4],
[3, 17, 4]],
10),
[7, [0, 1, 0, 0, 3, 0, 2, 1]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[4, 2, 4],
[3, 8, 1],
[3, 12, 1],
[5, 15, 8],
[4, 7, 6],
[4, 4, 3],
[5, 3, 9],
[5, 6, 6],
[4, 14, 6],
[4, 11, 2],
[3, 5, 2]],
7),
[26, [3, 4, 4, 0, 1, 4, 0, 2, 0, 4, 4]]),
('variant scenario 1',
([[5, 9, 4],
[3, 12, 3],
[4, 15, 5],
[5, 2, 7],
[3, 17, 7],
[4, 18, 3],
[4, 11, 8],
[5, 16, 6],
[4, 14, 4],
[4, 7, 7],
[5, 5, 9],
[3, 4, 7]],
9),
[14, [4, 2, 1, 1, 0, 3, 0, 1, 2, 0, 0, 0]]),
('variant scenario 2',
([[4, 2, 8], [5, 1, 7], [3, 3, 1], [4, 10, 8], [5, 6, 8], [3, 4, 6], [4, 11, 5], [3, 14, None]],
20),
[9, [0, 2, 5, 0, 0, 0, 2, 0]])]]
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 scratch par | [4, [2, 2]] | [4, [2, 2]] | Passed |
| boundary stroke index equals remainder | [3, [2, 1]] | [3, [2, 1]] | Passed |
| boundary second shot above 18 | [3, [2, 1]] | [3, [2, 1]] | Passed |
| boundary plus handicap | [3, [1, 2]] | [3, [1, 2]] | Passed |
| control blob hole | [-1, [-1, 0]] | [0, [0, 0]] | Failed |
| control net albatross | [4, [4]] | [4, [4]] | Passed |
| regression: zero floor stage | [7, [-1, 5, 3]] | [8, [0, 5, 3]] | Failed |
| variant scenario 1 | [-3, [-2, -1, 0, -1, 0, 3, -1, -1]] | [3, [0, 0, 0, 0, 0, 3, 0, 0]] | Failed |
| variant scenario 2 | [12, [4, 3, -1, 3, 3]] | [13, [4, 3, 0, 3, 3]] | Failed |
SHA-256 / e681170a589c9fa0a6be4c1f06e2f0e2a0ff4656b9d5d465b83cd50a630c0107
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(holes, handicap):
per = []
for par, si, strokes in holes:
if handicap >= 0:
received = handicap // 18 + (1 if si <= handicap % 18 else 0)
else:
received = -1 if si > 18 + handicap else 0
if strokes is None:
per.append(0)
continue
per.append(max(0, 2 + par - (strokes - received)))
return [sum(per), per]
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 scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage', ([[5, 9, 9], [4, 8, 2], [4, 1, 4]], 18), [8, [0, 5, 3]]),
('variant scenario 1',
([[4, 5, 8], [5, 6, 8], [4, 8, 6], [4, 4, 7], [4, 1, 6], [4, 17, 2], [5, 10, 8], [4, 11, 7]],
-2),
[3, [0, 0, 0, 0, 0, 3, 0, 0]]),
('variant scenario 2',
([[4, 15, 4], [3, 4, 4], [5, 17, 9], [3, 14, 4], [3, 7, 4]], 34),
[13, [4, 3, 0, 3, 3]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[5, 13, 7], [4, 10, None], [3, 8, 6], [3, 4, 6], [4, 17, 4], [5, 12, 8], [3, 14, None]], -2),
[1, [0, 0, 0, 0, 1, 0, 0]]),
('regression: zero floor stage',
([[4, 6, 5],
[4, 4, 7],
[5, 17, 5],
[5, 16, None],
[5, 14, 6],
[3, 18, 3],
[3, 11, 7],
[4, 9, 5]],
20),
[12, [2, 0, 3, 0, 2, 3, 0, 2]]),
('variant scenario 1', ([[4, 2, None], [3, 4, 7], [3, 10, 3]], 18), [3, [0, 0, 3]]),
('variant scenario 2',
([[3, 14, 7], [5, 5, 5], [3, 4, 4], [4, 17, 4], [4, 8, 4], [4, 10, 4]], 0),
[9, [0, 2, 1, 2, 2, 2]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[4, 3, 7], [5, 17, 9], [4, 11, 5], [4, 5, 5], [4, 8, 5], [5, 2, 5]], 6),
[7, [0, 0, 1, 2, 1, 3]]),
('variant scenario 1',
([[3, 8, 1],
[3, 7, 7],
[5, 9, 8],
[4, 14, None],
[4, 4, 8],
[4, 13, 2],
[4, 10, 7],
[4, 5, 5],
[4, 17, 8]],
-2),
[9, [4, 0, 0, 0, 0, 4, 0, 1, 0]]),
('variant scenario 2',
([[4, 2, 6], [3, 9, 6], [4, 12, 2], [4, 13, 8], [4, 16, None]], 3),
[5, [1, 0, 4, 0, 0]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[5, 7, 6],
[3, 9, 4],
[5, 12, 6],
[3, 15, 2],
[4, 16, 5],
[3, 17, 4],
[3, 6, 2],
[3, 2, 7],
[4, 3, 6]],
15),
[17, [2, 2, 2, 4, 1, 1, 4, 0, 1]]),
('variant scenario 1',
([[3, 8, 2],
[4, 7, None],
[4, 14, 4],
[4, 9, 7],
[5, 11, 5],
[4, 1, 8],
[3, 5, 3],
[5, 18, 5],
[4, 16, 3]],
18),
[20, [4, 0, 3, 0, 3, 0, 3, 3, 4]]),
('variant scenario 2',
([[4, 4, None],
[4, 6, 6],
[4, 11, 7],
[4, 18, 8],
[3, 3, 3],
[3, 12, 7],
[4, 14, 4],
[3, 17, 4]],
10),
[7, [0, 1, 0, 0, 3, 0, 2, 1]])],
[('control scratch par', ([[4, 1, 4], [3, 18, 3]], 0), [4, [2, 2]]),
('boundary stroke index equals remainder', ([[4, 5, 5], [4, 6, 5]], 5), [3, [2, 1]]),
('boundary second shot above 18', ([[4, 2, 6], [4, 3, 6]], 20), [3, [2, 1]]),
('boundary plus handicap', ([[4, 18, 4], [4, 17, 4]], -1), [3, [1, 2]]),
('control blob hole', ([[5, 1, 9], [4, 2, None]], 10), [0, [0, 0]]),
('control net albatross', ([[5, 1, 4]], 18), [4, [4]]),
('regression: zero floor stage',
([[4, 2, 4],
[3, 8, 1],
[3, 12, 1],
[5, 15, 8],
[4, 7, 6],
[4, 4, 3],
[5, 3, 9],
[5, 6, 6],
[4, 14, 6],
[4, 11, 2],
[3, 5, 2]],
7),
[26, [3, 4, 4, 0, 1, 4, 0, 2, 0, 4, 4]]),
('variant scenario 1',
([[5, 9, 4],
[3, 12, 3],
[4, 15, 5],
[5, 2, 7],
[3, 17, 7],
[4, 18, 3],
[4, 11, 8],
[5, 16, 6],
[4, 14, 4],
[4, 7, 7],
[5, 5, 9],
[3, 4, 7]],
9),
[14, [4, 2, 1, 1, 0, 3, 0, 1, 2, 0, 0, 0]]),
('variant scenario 2',
([[4, 2, 8], [5, 1, 7], [3, 3, 1], [4, 10, 8], [5, 6, 8], [3, 4, 6], [4, 11, 5], [3, 14, None]],
20),
[9, [0, 2, 5, 0, 0, 0, 2, 0]])]]
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 scratch par | [4, [2, 2]] | [4, [2, 2]] | Passed |
| boundary stroke index equals remainder | [3, [2, 1]] | [3, [2, 1]] | Passed |
| boundary second shot above 18 | [3, [2, 1]] | [3, [2, 1]] | Passed |
| boundary plus handicap | [3, [1, 2]] | [3, [1, 2]] | Passed |
| control blob hole | [0, [0, 0]] | [0, [0, 0]] | Passed |
| control net albatross | [4, [4]] | [4, [4]] | Passed |
| regression: zero floor stage | [8, [0, 5, 3]] | [8, [0, 5, 3]] | Passed |
| variant scenario 1 | [3, [0, 0, 0, 0, 0, 3, 0, 0]] | [3, [0, 0, 0, 0, 0, 3, 0, 0]] | Passed |
| variant scenario 2 | [13, [4, 3, 0, 3, 3]] | [13, [4, 3, 0, 3, 3]] | Passed |
SHA-256 / e8fbb9f23f671e8ba632d132c8e9594e5caf1d6cc7a589814b7a6246044fca53
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.414735+00:00.
Case digest / 2c463476fd7d0aeed9da6bd2981a3cdf0ba2778d3cd757c97996711076057f51