FA-84171 / Sports scoring and tiebreakers / Open access
Handicaps above 18 capped at one stroke per hole · case 01
A 20-handicap player receives only one stroke on the hardest holes.
ROOT CAUSE
The base H // 18 strokes per hole are omitted.
VERIFIED REPAIR
Add H // 18 to every hole before the remainder allocation.
Unsuccessful approach: Allocating when si <= H caps the receipt at one stroke per hole.
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 = (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: multi stroke allocation',
([[3, 5, 4], [3, 11, 3], [3, 17, 3], [5, 10, 8], [5, 13, 9], [4, 6, 3], [3, 7, 2]], 18),
[16, [2, 3, 3, 0, 0, 4, 4]]),
('regression: multi stroke allocation',
([[3, 15, 6], [4, 17, 3], [3, 7, 1], [5, 5, 9], [5, 4, 8]], 35),
[13, [1, 5, 6, 0, 1]]),
('variant scenario 1', ([[5, 16, 9], [5, 14, 3], [4, 12, 6], [4, 8, 8]], 20), [6, [0, 5, 1, 0]]),
('variant scenario 2',
([[3, 13, 3],
[4, 6, 5],
[3, 7, 2],
[4, 11, 5],
[5, 12, 6],
[4, 9, 3],
[3, 1, 5],
[3, 17, 4],
[4, 15, 5],
[3, 3, 1]],
-2),
[16, [2, 1, 3, 1, 1, 3, 0, 0, 1, 4]])],
[('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: multi stroke allocation',
([[3, 13, 3], [5, 11, 7], [5, 16, 7]], 20),
[5, [3, 1, 1]]),
('regression: multi stroke allocation',
([[4, 13, 4], [4, 1, 4], [4, 5, 4], [5, 16, 6]], 20),
[12, [3, 4, 3, 2]]),
('variant scenario 1',
([[3, 17, 3], [4, 7, 3], [4, 4, 7], [4, 18, 2], [4, 6, 8]], -2),
[7, [1, 3, 0, 3, 0]]),
('variant scenario 2',
([[3, 2, 6], [4, 9, 4], [3, 4, 7], [4, 7, 5], [3, 14, 4], [4, 17, 5], [3, 13, 3]], 19),
[12, [0, 3, 0, 2, 2, 2, 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: multi stroke allocation',
([[5, 11, 9], [5, 18, 5], [4, 4, 6], [3, 3, 4], [4, 16, 5], [4, 6, 2], [5, 14, 4], [3, 2, 3]],
18),
[20, [0, 3, 1, 2, 2, 5, 4, 3]]),
('regression: multi stroke allocation',
([[3, 2, 1],
[5, 18, 8],
[4, 10, 5],
[5, 5, 6],
[4, 6, 2],
[4, 1, 8],
[4, 17, 4],
[5, 9, 5],
[4, 7, 8],
[3, 3, 5],
[3, 4, 7],
[4, 14, 7]],
20),
[22, [6, 0, 2, 2, 5, 0, 3, 3, 0, 1, 0, 0]]),
('variant scenario 1', ([[4, 1, None], [3, 7, 4], [5, 6, 5], [5, 2, 4]], 10), [9, [0, 2, 3, 4]]),
('variant scenario 2',
([[5, 2, 5],
[4, 9, 7],
[3, 14, 1],
[3, 4, 2],
[5, 8, 6],
[4, 18, 3],
[3, 15, 7],
[4, 6, 7],
[3, 5, 7],
[4, 12, 4],
[4, 16, 8],
[3, 11, 1]],
12),
[24, [3, 0, 4, 4, 2, 3, 0, 0, 0, 3, 0, 5]])],
[('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: multi stroke allocation',
([[5, 9, 5], [4, 2, 4], [3, 18, 6], [4, 10, 5], [5, 14, 5], [5, 3, 8], [5, 8, 5], [4, 1, 4]],
18),
[17, [3, 3, 0, 2, 3, 0, 3, 3]]),
('regression: multi stroke allocation',
([[5, 11, 9], [5, 2, 5], [3, 13, 5], [4, 15, 5], [3, 4, 3]], 20),
[10, [0, 4, 1, 2, 3]]),
('variant scenario 1', ([[4, 9, 5], [5, 18, 8], [4, 12, 4], [4, 7, 8]], 12), [5, [2, 0, 3, 0]]),
('variant scenario 2',
([[3, 2, 7], [3, 4, 5], [4, 9, 4], [5, 11, 6], [5, 7, 9], [4, 18, 5], [5, 12, 4]], -2),
[6, [0, 0, 2, 1, 0, 0, 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: multi stroke allocation',
([[3, 13, 5],
[5, 5, 3],
[4, 16, 2],
[3, 1, 2],
[5, 17, 6],
[4, 10, 5],
[5, 8, 5],
[3, 3, 3],
[4, 7, 5],
[4, 12, 8],
[4, 15, 5],
[5, 9, 8]],
18),
[29, [1, 5, 5, 4, 2, 2, 3, 3, 2, 0, 2, 0]]),
('regression: multi stroke allocation',
([[5, 16, 8],
[3, 11, 3],
[5, 4, 3],
[4, 14, 4],
[4, 7, 2],
[3, 1, 1],
[3, 5, 4],
[4, 17, 4],
[3, 10, 3],
[4, 3, 2],
[4, 8, 6]],
20),
[36, [0, 3, 5, 3, 5, 6, 2, 3, 3, 5, 1]]),
('variant scenario 1',
([[3, 11, 3],
[3, 4, 4],
[4, 18, 5],
[4, 1, None],
[4, 15, 8],
[5, 3, None],
[4, 9, 5],
[4, 5, 5],
[5, 12, 7],
[4, 8, 4],
[4, 6, 5]],
18),
[17, [3, 2, 2, 0, 0, 0, 2, 2, 1, 3, 2]]),
('variant scenario 2',
([[4, 5, None], [4, 13, 4], [5, 12, 9], [4, 10, 7]], 20),
[3, [0, 3, 0, 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 | [1, [1, 0]] | [3, [2, 1]] | Failed |
| boundary plus handicap | [3, [1, 2]] | [3, [1, 2]] | Passed |
| control blob hole | [0, [0, 0]] | [0, [0, 0]] | Passed |
| control net albatross | [3, [3]] | [4, [4]] | Failed |
| regression: multi stroke allocation | [11, [1, 2, 2, 0, 0, 3, 3]] | [16, [2, 3, 3, 0, 0, 4, 4]] | Failed |
| regression: multi stroke allocation | [9, [0, 4, 5, 0, 0]] | [13, [1, 5, 6, 0, 1]] | Failed |
| variant scenario 1 | [4, [0, 4, 0, 0]] | [6, [0, 5, 1, 0]] | Failed |
| variant scenario 2 | [16, [2, 1, 3, 1, 1, 3, 0, 0, 1, 4]] | [16, [2, 1, 3, 1, 1, 3, 0, 0, 1, 4]] | Passed |
SHA-256 / 55b566b6f58523554159847cc03c6826139b64d659543e80c34810e370cb24fb
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 = (1 if si <= handicap 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: multi stroke allocation',
([[3, 5, 4], [3, 11, 3], [3, 17, 3], [5, 10, 8], [5, 13, 9], [4, 6, 3], [3, 7, 2]], 18),
[16, [2, 3, 3, 0, 0, 4, 4]]),
('regression: multi stroke allocation',
([[3, 15, 6], [4, 17, 3], [3, 7, 1], [5, 5, 9], [5, 4, 8]], 35),
[13, [1, 5, 6, 0, 1]]),
('variant scenario 1', ([[5, 16, 9], [5, 14, 3], [4, 12, 6], [4, 8, 8]], 20), [6, [0, 5, 1, 0]]),
('variant scenario 2',
([[3, 13, 3],
[4, 6, 5],
[3, 7, 2],
[4, 11, 5],
[5, 12, 6],
[4, 9, 3],
[3, 1, 5],
[3, 17, 4],
[4, 15, 5],
[3, 3, 1]],
-2),
[16, [2, 1, 3, 1, 1, 3, 0, 0, 1, 4]])],
[('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: multi stroke allocation',
([[3, 13, 3], [5, 11, 7], [5, 16, 7]], 20),
[5, [3, 1, 1]]),
('regression: multi stroke allocation',
([[4, 13, 4], [4, 1, 4], [4, 5, 4], [5, 16, 6]], 20),
[12, [3, 4, 3, 2]]),
('variant scenario 1',
([[3, 17, 3], [4, 7, 3], [4, 4, 7], [4, 18, 2], [4, 6, 8]], -2),
[7, [1, 3, 0, 3, 0]]),
('variant scenario 2',
([[3, 2, 6], [4, 9, 4], [3, 4, 7], [4, 7, 5], [3, 14, 4], [4, 17, 5], [3, 13, 3]], 19),
[12, [0, 3, 0, 2, 2, 2, 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: multi stroke allocation',
([[5, 11, 9], [5, 18, 5], [4, 4, 6], [3, 3, 4], [4, 16, 5], [4, 6, 2], [5, 14, 4], [3, 2, 3]],
18),
[20, [0, 3, 1, 2, 2, 5, 4, 3]]),
('regression: multi stroke allocation',
([[3, 2, 1],
[5, 18, 8],
[4, 10, 5],
[5, 5, 6],
[4, 6, 2],
[4, 1, 8],
[4, 17, 4],
[5, 9, 5],
[4, 7, 8],
[3, 3, 5],
[3, 4, 7],
[4, 14, 7]],
20),
[22, [6, 0, 2, 2, 5, 0, 3, 3, 0, 1, 0, 0]]),
('variant scenario 1', ([[4, 1, None], [3, 7, 4], [5, 6, 5], [5, 2, 4]], 10), [9, [0, 2, 3, 4]]),
('variant scenario 2',
([[5, 2, 5],
[4, 9, 7],
[3, 14, 1],
[3, 4, 2],
[5, 8, 6],
[4, 18, 3],
[3, 15, 7],
[4, 6, 7],
[3, 5, 7],
[4, 12, 4],
[4, 16, 8],
[3, 11, 1]],
12),
[24, [3, 0, 4, 4, 2, 3, 0, 0, 0, 3, 0, 5]])],
[('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: multi stroke allocation',
([[5, 9, 5], [4, 2, 4], [3, 18, 6], [4, 10, 5], [5, 14, 5], [5, 3, 8], [5, 8, 5], [4, 1, 4]],
18),
[17, [3, 3, 0, 2, 3, 0, 3, 3]]),
('regression: multi stroke allocation',
([[5, 11, 9], [5, 2, 5], [3, 13, 5], [4, 15, 5], [3, 4, 3]], 20),
[10, [0, 4, 1, 2, 3]]),
('variant scenario 1', ([[4, 9, 5], [5, 18, 8], [4, 12, 4], [4, 7, 8]], 12), [5, [2, 0, 3, 0]]),
('variant scenario 2',
([[3, 2, 7], [3, 4, 5], [4, 9, 4], [5, 11, 6], [5, 7, 9], [4, 18, 5], [5, 12, 4]], -2),
[6, [0, 0, 2, 1, 0, 0, 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: multi stroke allocation',
([[3, 13, 5],
[5, 5, 3],
[4, 16, 2],
[3, 1, 2],
[5, 17, 6],
[4, 10, 5],
[5, 8, 5],
[3, 3, 3],
[4, 7, 5],
[4, 12, 8],
[4, 15, 5],
[5, 9, 8]],
18),
[29, [1, 5, 5, 4, 2, 2, 3, 3, 2, 0, 2, 0]]),
('regression: multi stroke allocation',
([[5, 16, 8],
[3, 11, 3],
[5, 4, 3],
[4, 14, 4],
[4, 7, 2],
[3, 1, 1],
[3, 5, 4],
[4, 17, 4],
[3, 10, 3],
[4, 3, 2],
[4, 8, 6]],
20),
[36, [0, 3, 5, 3, 5, 6, 2, 3, 3, 5, 1]]),
('variant scenario 1',
([[3, 11, 3],
[3, 4, 4],
[4, 18, 5],
[4, 1, None],
[4, 15, 8],
[5, 3, None],
[4, 9, 5],
[4, 5, 5],
[5, 12, 7],
[4, 8, 4],
[4, 6, 5]],
18),
[17, [3, 2, 2, 0, 0, 0, 2, 2, 1, 3, 2]]),
('variant scenario 2',
([[4, 5, None], [4, 13, 4], [5, 12, 9], [4, 10, 7]], 20),
[3, [0, 3, 0, 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 | [2, [1, 1]] | [3, [2, 1]] | Failed |
| 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: multi stroke allocation | [16, [2, 3, 3, 0, 0, 4, 4]] | [16, [2, 3, 3, 0, 0, 4, 4]] | Passed |
| regression: multi stroke allocation | [9, [0, 4, 5, 0, 0]] | [13, [1, 5, 6, 0, 1]] | Failed |
| variant scenario 1 | [6, [0, 5, 1, 0]] | [6, [0, 5, 1, 0]] | Passed |
| variant scenario 2 | [16, [2, 1, 3, 1, 1, 3, 0, 0, 1, 4]] | [16, [2, 1, 3, 1, 1, 3, 0, 0, 1, 4]] | Passed |
SHA-256 / 03238797f153c1bdc1ab3de32ce0612dcf635e048ee81dfb6945d90cf0bd9902
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: multi stroke allocation',
([[3, 5, 4], [3, 11, 3], [3, 17, 3], [5, 10, 8], [5, 13, 9], [4, 6, 3], [3, 7, 2]], 18),
[16, [2, 3, 3, 0, 0, 4, 4]]),
('regression: multi stroke allocation',
([[3, 15, 6], [4, 17, 3], [3, 7, 1], [5, 5, 9], [5, 4, 8]], 35),
[13, [1, 5, 6, 0, 1]]),
('variant scenario 1', ([[5, 16, 9], [5, 14, 3], [4, 12, 6], [4, 8, 8]], 20), [6, [0, 5, 1, 0]]),
('variant scenario 2',
([[3, 13, 3],
[4, 6, 5],
[3, 7, 2],
[4, 11, 5],
[5, 12, 6],
[4, 9, 3],
[3, 1, 5],
[3, 17, 4],
[4, 15, 5],
[3, 3, 1]],
-2),
[16, [2, 1, 3, 1, 1, 3, 0, 0, 1, 4]])],
[('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: multi stroke allocation',
([[3, 13, 3], [5, 11, 7], [5, 16, 7]], 20),
[5, [3, 1, 1]]),
('regression: multi stroke allocation',
([[4, 13, 4], [4, 1, 4], [4, 5, 4], [5, 16, 6]], 20),
[12, [3, 4, 3, 2]]),
('variant scenario 1',
([[3, 17, 3], [4, 7, 3], [4, 4, 7], [4, 18, 2], [4, 6, 8]], -2),
[7, [1, 3, 0, 3, 0]]),
('variant scenario 2',
([[3, 2, 6], [4, 9, 4], [3, 4, 7], [4, 7, 5], [3, 14, 4], [4, 17, 5], [3, 13, 3]], 19),
[12, [0, 3, 0, 2, 2, 2, 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: multi stroke allocation',
([[5, 11, 9], [5, 18, 5], [4, 4, 6], [3, 3, 4], [4, 16, 5], [4, 6, 2], [5, 14, 4], [3, 2, 3]],
18),
[20, [0, 3, 1, 2, 2, 5, 4, 3]]),
('regression: multi stroke allocation',
([[3, 2, 1],
[5, 18, 8],
[4, 10, 5],
[5, 5, 6],
[4, 6, 2],
[4, 1, 8],
[4, 17, 4],
[5, 9, 5],
[4, 7, 8],
[3, 3, 5],
[3, 4, 7],
[4, 14, 7]],
20),
[22, [6, 0, 2, 2, 5, 0, 3, 3, 0, 1, 0, 0]]),
('variant scenario 1', ([[4, 1, None], [3, 7, 4], [5, 6, 5], [5, 2, 4]], 10), [9, [0, 2, 3, 4]]),
('variant scenario 2',
([[5, 2, 5],
[4, 9, 7],
[3, 14, 1],
[3, 4, 2],
[5, 8, 6],
[4, 18, 3],
[3, 15, 7],
[4, 6, 7],
[3, 5, 7],
[4, 12, 4],
[4, 16, 8],
[3, 11, 1]],
12),
[24, [3, 0, 4, 4, 2, 3, 0, 0, 0, 3, 0, 5]])],
[('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: multi stroke allocation',
([[5, 9, 5], [4, 2, 4], [3, 18, 6], [4, 10, 5], [5, 14, 5], [5, 3, 8], [5, 8, 5], [4, 1, 4]],
18),
[17, [3, 3, 0, 2, 3, 0, 3, 3]]),
('regression: multi stroke allocation',
([[5, 11, 9], [5, 2, 5], [3, 13, 5], [4, 15, 5], [3, 4, 3]], 20),
[10, [0, 4, 1, 2, 3]]),
('variant scenario 1', ([[4, 9, 5], [5, 18, 8], [4, 12, 4], [4, 7, 8]], 12), [5, [2, 0, 3, 0]]),
('variant scenario 2',
([[3, 2, 7], [3, 4, 5], [4, 9, 4], [5, 11, 6], [5, 7, 9], [4, 18, 5], [5, 12, 4]], -2),
[6, [0, 0, 2, 1, 0, 0, 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: multi stroke allocation',
([[3, 13, 5],
[5, 5, 3],
[4, 16, 2],
[3, 1, 2],
[5, 17, 6],
[4, 10, 5],
[5, 8, 5],
[3, 3, 3],
[4, 7, 5],
[4, 12, 8],
[4, 15, 5],
[5, 9, 8]],
18),
[29, [1, 5, 5, 4, 2, 2, 3, 3, 2, 0, 2, 0]]),
('regression: multi stroke allocation',
([[5, 16, 8],
[3, 11, 3],
[5, 4, 3],
[4, 14, 4],
[4, 7, 2],
[3, 1, 1],
[3, 5, 4],
[4, 17, 4],
[3, 10, 3],
[4, 3, 2],
[4, 8, 6]],
20),
[36, [0, 3, 5, 3, 5, 6, 2, 3, 3, 5, 1]]),
('variant scenario 1',
([[3, 11, 3],
[3, 4, 4],
[4, 18, 5],
[4, 1, None],
[4, 15, 8],
[5, 3, None],
[4, 9, 5],
[4, 5, 5],
[5, 12, 7],
[4, 8, 4],
[4, 6, 5]],
18),
[17, [3, 2, 2, 0, 0, 0, 2, 2, 1, 3, 2]]),
('variant scenario 2',
([[4, 5, None], [4, 13, 4], [5, 12, 9], [4, 10, 7]], 20),
[3, [0, 3, 0, 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: multi stroke allocation | [16, [2, 3, 3, 0, 0, 4, 4]] | [16, [2, 3, 3, 0, 0, 4, 4]] | Passed |
| regression: multi stroke allocation | [13, [1, 5, 6, 0, 1]] | [13, [1, 5, 6, 0, 1]] | Passed |
| variant scenario 1 | [6, [0, 5, 1, 0]] | [6, [0, 5, 1, 0]] | Passed |
| variant scenario 2 | [16, [2, 1, 3, 1, 1, 3, 0, 0, 1, 4]] | [16, [2, 1, 3, 1, 1, 3, 0, 0, 1, 4]] | Passed |
SHA-256 / ea5e0aa21fb0a2d7d9c67e8f86fb86ebac6b9b50723ffc99d17cf551f044b3e7
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.495506+00:00.
Case digest / 713df34b7b33bf18f69d568d6231cc18cdd727de4e513cca3e22d24c872da39c