FAILURE MAP
← Case archive

FA-84156 / Sports scoring and tiebreakers / Open access

Handicap stroke missing on the last allocated index · case 01

A 5-handicap player gets no stroke on stroke index 5.

Verified by executionVariant 1 · 10 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The allocation uses si < H % 18.

VERIFIED REPAIR

Allocate on stroke index <= H % 18.

Unsuccessful approach: Allocating to the easiest holes (highest stroke indexes) inverts the stroke table.

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: allocation boundary',
   ([[3, 18, 6], [5, 7, 8], [4, 1, None], [3, 4, 4], [3, 5, 4]], 20),
   [4, [0, 0, 0, 2, 2]]),
  ('regression: allocation boundary',
   ([[3, 7, 6], [3, 5, 3], [4, 14, 7], [3, 3, 6], [4, 11, 8], [4, 9, None], [5, 16, 7], [5, 2, 6]],
    25),
   [10, [1, 4, 0, 1, 0, 0, 1, 3]]),
  ('variant scenario 1', ([[4, 4, 7], [4, 10, 5], [3, 12, 1]], 18), [7, [0, 2, 5]]),
  ('variant scenario 2',
   ([[3, 7, 3], [4, 8, 6], [3, 18, 3], [5, 17, 7], [5, 9, 4]], 5),
   [7, [2, 0, 2, 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: allocation boundary',
   ([[5, 18, 6],
     [3, 9, 5],
     [4, 5, 5],
     [4, 15, 7],
     [4, 7, 2],
     [4, 4, 4],
     [3, 13, 2],
     [5, 10, 5],
     [5, 1, 9],
     [4, 6, 7]],
    11),
   [18, [1, 1, 2, 0, 5, 3, 3, 3, 0, 0]]),
  ('regression: allocation boundary',
   ([[4, 15, 2], [4, 17, 4], [5, 10, 5], [4, 18, 5], [3, 2, 2], [4, 16, 8], [3, 14, 4], [4, 9, 2]],
    20),
   [25, [5, 3, 3, 2, 5, 0, 2, 5]]),
  ('variant scenario 1',
   ([[5, 17, 9], [5, 1, 6], [3, 16, 3], [4, 2, 4], [5, 18, 3], [4, 15, 7], [4, 3, 7]], 0),
   [9, [0, 1, 2, 2, 4, 0, 0]]),
  ('variant scenario 2',
   ([[5, 18, 8],
     [3, 10, 3],
     [3, 17, 7],
     [4, 3, 4],
     [4, 8, 5],
     [4, 4, 4],
     [3, 14, 2],
     [5, 6, 5],
     [4, 1, 2]],
    18),
   [23, [0, 3, 0, 3, 2, 3, 4, 3, 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: allocation boundary',
   ([[4, 18, 8], [3, 16, 5], [3, 5, 1], [5, 17, 4], [3, 12, 7], [3, 9, 5], [4, 7, 5]], 8),
   [10, [0, 0, 5, 3, 0, 0, 2]]),
  ('regression: allocation boundary',
   ([[4, 15, 6], [3, 2, 1], [4, 13, 7], [5, 16, None], [3, 10, 3], [4, 5, 5], [4, 11, 2]], 20),
   [17, [1, 6, 0, 0, 3, 2, 5]]),
  ('variant scenario 1', ([[4, 11, 3], [4, 1, 6], [3, 13, 3], [4, 12, 4]], -2), [7, [3, 0, 2, 2]]),
  ('variant scenario 2', ([[4, 6, 4], [5, 7, 4], [3, 2, 7], [4, 8, 2]], 18), [12, [3, 4, 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: allocation boundary',
   ([[4, 3, 5], [5, 9, 5], [5, 14, 9], [3, 4, 4], [3, 12, 3], [3, 2, 4], [5, 10, 9]], 2),
   [8, [1, 2, 0, 1, 2, 2, 0]]),
  ('variant scenario 1',
   ([[4, 11, 2], [4, 12, 5], [4, 10, None], [5, 4, 4], [5, 18, 4], [5, 13, 5], [5, 1, 5]], 18),
   [21, [5, 2, 0, 4, 4, 3, 3]]),
  ('variant scenario 2',
   ([[5, 14, 4], [4, 12, 3], [5, 8, 5], [5, 10, 6], [5, 16, 6]], 6),
   [10, [3, 3, 2, 1, 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: allocation boundary',
   ([[4, 18, 6],
     [5, 7, 5],
     [3, 14, 5],
     [5, 4, 5],
     [5, 11, 5],
     [5, 3, 5],
     [4, 5, 7],
     [4, 1, 4],
     [4, 2, None],
     [4, 17, 4],
     [3, 16, 2],
     [3, 9, 2],
     [4, 6, 8],
     [4, 10, 5]],
    15),
   [27, [0, 3, 1, 3, 3, 3, 0, 3, 0, 2, 3, 4, 0, 2]]),
  ('regression: allocation boundary',
   ([[4, 11, 5],
     [4, 13, 3],
     [5, 9, 5],
     [5, 3, 6],
     [4, 6, 6],
     [4, 17, 4],
     [3, 5, 3],
     [4, 8, 5],
     [4, 15, 3],
     [4, 14, 2]],
    31),
   [36, [3, 5, 4, 3, 2, 3, 4, 3, 4, 5]]),
  ('variant scenario 1',
   ([[4, 10, 4],
     [4, 12, 6],
     [3, 1, 2],
     [4, 9, 4],
     [3, 17, 2],
     [4, 16, 5],
     [5, 5, 5],
     [4, 6, 4],
     [4, 7, 7],
     [5, 2, 8],
     [5, 4, 9]],
    18),
   [23, [3, 1, 4, 3, 4, 2, 3, 3, 0, 0, 0]]),
  ('variant scenario 2',
   ([[4, 5, 3], [5, 15, 4], [5, 3, None], [4, 12, 5], [3, 6, 4], [3, 13, 2]], 14),
   [15, [4, 3, 0, 2, 2, 4]])]]
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 fixtureActualExpectedOutcome
control scratch par[4, [2, 2]][4, [2, 2]]Passed
boundary stroke index equals remainder[2, [1, 1]][3, [2, 1]]Failed
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: allocation boundary[4, [0, 0, 0, 2, 2]][4, [0, 0, 0, 2, 2]]Passed
regression: allocation boundary[9, [0, 4, 0, 1, 0, 0, 1, 3]][10, [1, 4, 0, 1, 0, 0, 1, 3]]Failed
variant scenario 1[7, [0, 2, 5]][7, [0, 2, 5]]Passed
variant scenario 2[7, [2, 0, 2, 0, 3]][7, [2, 0, 2, 0, 3]]Passed

SHA-256 / ecf41c1fbbebc45209fedfd439f93aa4f76d47a81607ce3903103226f2356bd8

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 > 18 - 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: allocation boundary',
   ([[3, 18, 6], [5, 7, 8], [4, 1, None], [3, 4, 4], [3, 5, 4]], 20),
   [4, [0, 0, 0, 2, 2]]),
  ('regression: allocation boundary',
   ([[3, 7, 6], [3, 5, 3], [4, 14, 7], [3, 3, 6], [4, 11, 8], [4, 9, None], [5, 16, 7], [5, 2, 6]],
    25),
   [10, [1, 4, 0, 1, 0, 0, 1, 3]]),
  ('variant scenario 1', ([[4, 4, 7], [4, 10, 5], [3, 12, 1]], 18), [7, [0, 2, 5]]),
  ('variant scenario 2',
   ([[3, 7, 3], [4, 8, 6], [3, 18, 3], [5, 17, 7], [5, 9, 4]], 5),
   [7, [2, 0, 2, 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: allocation boundary',
   ([[5, 18, 6],
     [3, 9, 5],
     [4, 5, 5],
     [4, 15, 7],
     [4, 7, 2],
     [4, 4, 4],
     [3, 13, 2],
     [5, 10, 5],
     [5, 1, 9],
     [4, 6, 7]],
    11),
   [18, [1, 1, 2, 0, 5, 3, 3, 3, 0, 0]]),
  ('regression: allocation boundary',
   ([[4, 15, 2], [4, 17, 4], [5, 10, 5], [4, 18, 5], [3, 2, 2], [4, 16, 8], [3, 14, 4], [4, 9, 2]],
    20),
   [25, [5, 3, 3, 2, 5, 0, 2, 5]]),
  ('variant scenario 1',
   ([[5, 17, 9], [5, 1, 6], [3, 16, 3], [4, 2, 4], [5, 18, 3], [4, 15, 7], [4, 3, 7]], 0),
   [9, [0, 1, 2, 2, 4, 0, 0]]),
  ('variant scenario 2',
   ([[5, 18, 8],
     [3, 10, 3],
     [3, 17, 7],
     [4, 3, 4],
     [4, 8, 5],
     [4, 4, 4],
     [3, 14, 2],
     [5, 6, 5],
     [4, 1, 2]],
    18),
   [23, [0, 3, 0, 3, 2, 3, 4, 3, 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: allocation boundary',
   ([[4, 18, 8], [3, 16, 5], [3, 5, 1], [5, 17, 4], [3, 12, 7], [3, 9, 5], [4, 7, 5]], 8),
   [10, [0, 0, 5, 3, 0, 0, 2]]),
  ('regression: allocation boundary',
   ([[4, 15, 6], [3, 2, 1], [4, 13, 7], [5, 16, None], [3, 10, 3], [4, 5, 5], [4, 11, 2]], 20),
   [17, [1, 6, 0, 0, 3, 2, 5]]),
  ('variant scenario 1', ([[4, 11, 3], [4, 1, 6], [3, 13, 3], [4, 12, 4]], -2), [7, [3, 0, 2, 2]]),
  ('variant scenario 2', ([[4, 6, 4], [5, 7, 4], [3, 2, 7], [4, 8, 2]], 18), [12, [3, 4, 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: allocation boundary',
   ([[4, 3, 5], [5, 9, 5], [5, 14, 9], [3, 4, 4], [3, 12, 3], [3, 2, 4], [5, 10, 9]], 2),
   [8, [1, 2, 0, 1, 2, 2, 0]]),
  ('variant scenario 1',
   ([[4, 11, 2], [4, 12, 5], [4, 10, None], [5, 4, 4], [5, 18, 4], [5, 13, 5], [5, 1, 5]], 18),
   [21, [5, 2, 0, 4, 4, 3, 3]]),
  ('variant scenario 2',
   ([[5, 14, 4], [4, 12, 3], [5, 8, 5], [5, 10, 6], [5, 16, 6]], 6),
   [10, [3, 3, 2, 1, 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: allocation boundary',
   ([[4, 18, 6],
     [5, 7, 5],
     [3, 14, 5],
     [5, 4, 5],
     [5, 11, 5],
     [5, 3, 5],
     [4, 5, 7],
     [4, 1, 4],
     [4, 2, None],
     [4, 17, 4],
     [3, 16, 2],
     [3, 9, 2],
     [4, 6, 8],
     [4, 10, 5]],
    15),
   [27, [0, 3, 1, 3, 3, 3, 0, 3, 0, 2, 3, 4, 0, 2]]),
  ('regression: allocation boundary',
   ([[4, 11, 5],
     [4, 13, 3],
     [5, 9, 5],
     [5, 3, 6],
     [4, 6, 6],
     [4, 17, 4],
     [3, 5, 3],
     [4, 8, 5],
     [4, 15, 3],
     [4, 14, 2]],
    31),
   [36, [3, 5, 4, 3, 2, 3, 4, 3, 4, 5]]),
  ('variant scenario 1',
   ([[4, 10, 4],
     [4, 12, 6],
     [3, 1, 2],
     [4, 9, 4],
     [3, 17, 2],
     [4, 16, 5],
     [5, 5, 5],
     [4, 6, 4],
     [4, 7, 7],
     [5, 2, 8],
     [5, 4, 9]],
    18),
   [23, [3, 1, 4, 3, 4, 2, 3, 3, 0, 0, 0]]),
  ('variant scenario 2',
   ([[4, 5, 3], [5, 15, 4], [5, 3, None], [4, 12, 5], [3, 6, 4], [3, 13, 2]], 14),
   [15, [4, 3, 0, 2, 2, 4]])]]
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 fixtureActualExpectedOutcome
control scratch par[4, [2, 2]][4, [2, 2]]Passed
boundary stroke index equals remainder[2, [1, 1]][3, [2, 1]]Failed
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: allocation boundary[5, [1, 0, 0, 2, 2]][4, [0, 0, 0, 2, 2]]Failed
regression: allocation boundary[8, [0, 3, 1, 0, 0, 0, 2, 2]][10, [1, 4, 0, 1, 0, 0, 1, 3]]Failed
variant scenario 1[7, [0, 2, 5]][7, [0, 2, 5]]Passed
variant scenario 2[9, [2, 0, 3, 1, 3]][7, [2, 0, 2, 0, 3]]Failed

SHA-256 / 7303aa2b0d2b8c59655ccd0ec38fba5924e281c2ed596c5c4db3d857e1246536

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: allocation boundary',
   ([[3, 18, 6], [5, 7, 8], [4, 1, None], [3, 4, 4], [3, 5, 4]], 20),
   [4, [0, 0, 0, 2, 2]]),
  ('regression: allocation boundary',
   ([[3, 7, 6], [3, 5, 3], [4, 14, 7], [3, 3, 6], [4, 11, 8], [4, 9, None], [5, 16, 7], [5, 2, 6]],
    25),
   [10, [1, 4, 0, 1, 0, 0, 1, 3]]),
  ('variant scenario 1', ([[4, 4, 7], [4, 10, 5], [3, 12, 1]], 18), [7, [0, 2, 5]]),
  ('variant scenario 2',
   ([[3, 7, 3], [4, 8, 6], [3, 18, 3], [5, 17, 7], [5, 9, 4]], 5),
   [7, [2, 0, 2, 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: allocation boundary',
   ([[5, 18, 6],
     [3, 9, 5],
     [4, 5, 5],
     [4, 15, 7],
     [4, 7, 2],
     [4, 4, 4],
     [3, 13, 2],
     [5, 10, 5],
     [5, 1, 9],
     [4, 6, 7]],
    11),
   [18, [1, 1, 2, 0, 5, 3, 3, 3, 0, 0]]),
  ('regression: allocation boundary',
   ([[4, 15, 2], [4, 17, 4], [5, 10, 5], [4, 18, 5], [3, 2, 2], [4, 16, 8], [3, 14, 4], [4, 9, 2]],
    20),
   [25, [5, 3, 3, 2, 5, 0, 2, 5]]),
  ('variant scenario 1',
   ([[5, 17, 9], [5, 1, 6], [3, 16, 3], [4, 2, 4], [5, 18, 3], [4, 15, 7], [4, 3, 7]], 0),
   [9, [0, 1, 2, 2, 4, 0, 0]]),
  ('variant scenario 2',
   ([[5, 18, 8],
     [3, 10, 3],
     [3, 17, 7],
     [4, 3, 4],
     [4, 8, 5],
     [4, 4, 4],
     [3, 14, 2],
     [5, 6, 5],
     [4, 1, 2]],
    18),
   [23, [0, 3, 0, 3, 2, 3, 4, 3, 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: allocation boundary',
   ([[4, 18, 8], [3, 16, 5], [3, 5, 1], [5, 17, 4], [3, 12, 7], [3, 9, 5], [4, 7, 5]], 8),
   [10, [0, 0, 5, 3, 0, 0, 2]]),
  ('regression: allocation boundary',
   ([[4, 15, 6], [3, 2, 1], [4, 13, 7], [5, 16, None], [3, 10, 3], [4, 5, 5], [4, 11, 2]], 20),
   [17, [1, 6, 0, 0, 3, 2, 5]]),
  ('variant scenario 1', ([[4, 11, 3], [4, 1, 6], [3, 13, 3], [4, 12, 4]], -2), [7, [3, 0, 2, 2]]),
  ('variant scenario 2', ([[4, 6, 4], [5, 7, 4], [3, 2, 7], [4, 8, 2]], 18), [12, [3, 4, 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: allocation boundary',
   ([[4, 3, 5], [5, 9, 5], [5, 14, 9], [3, 4, 4], [3, 12, 3], [3, 2, 4], [5, 10, 9]], 2),
   [8, [1, 2, 0, 1, 2, 2, 0]]),
  ('variant scenario 1',
   ([[4, 11, 2], [4, 12, 5], [4, 10, None], [5, 4, 4], [5, 18, 4], [5, 13, 5], [5, 1, 5]], 18),
   [21, [5, 2, 0, 4, 4, 3, 3]]),
  ('variant scenario 2',
   ([[5, 14, 4], [4, 12, 3], [5, 8, 5], [5, 10, 6], [5, 16, 6]], 6),
   [10, [3, 3, 2, 1, 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: allocation boundary',
   ([[4, 18, 6],
     [5, 7, 5],
     [3, 14, 5],
     [5, 4, 5],
     [5, 11, 5],
     [5, 3, 5],
     [4, 5, 7],
     [4, 1, 4],
     [4, 2, None],
     [4, 17, 4],
     [3, 16, 2],
     [3, 9, 2],
     [4, 6, 8],
     [4, 10, 5]],
    15),
   [27, [0, 3, 1, 3, 3, 3, 0, 3, 0, 2, 3, 4, 0, 2]]),
  ('regression: allocation boundary',
   ([[4, 11, 5],
     [4, 13, 3],
     [5, 9, 5],
     [5, 3, 6],
     [4, 6, 6],
     [4, 17, 4],
     [3, 5, 3],
     [4, 8, 5],
     [4, 15, 3],
     [4, 14, 2]],
    31),
   [36, [3, 5, 4, 3, 2, 3, 4, 3, 4, 5]]),
  ('variant scenario 1',
   ([[4, 10, 4],
     [4, 12, 6],
     [3, 1, 2],
     [4, 9, 4],
     [3, 17, 2],
     [4, 16, 5],
     [5, 5, 5],
     [4, 6, 4],
     [4, 7, 7],
     [5, 2, 8],
     [5, 4, 9]],
    18),
   [23, [3, 1, 4, 3, 4, 2, 3, 3, 0, 0, 0]]),
  ('variant scenario 2',
   ([[4, 5, 3], [5, 15, 4], [5, 3, None], [4, 12, 5], [3, 6, 4], [3, 13, 2]], 14),
   [15, [4, 3, 0, 2, 2, 4]])]]
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 fixtureActualExpectedOutcome
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: allocation boundary[4, [0, 0, 0, 2, 2]][4, [0, 0, 0, 2, 2]]Passed
regression: allocation boundary[10, [1, 4, 0, 1, 0, 0, 1, 3]][10, [1, 4, 0, 1, 0, 0, 1, 3]]Passed
variant scenario 1[7, [0, 2, 5]][7, [0, 2, 5]]Passed
variant scenario 2[7, [2, 0, 2, 0, 3]][7, [2, 0, 2, 0, 3]]Passed

SHA-256 / b77a12631fdc521f77cce6e541bee6cd5087c5f32e0d6d7194946b28306aa33a

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.331411+00:00.

Case digest / 55fb6a587c97e7ece6b9913f9e0ae709c9e165fc269257e60a0e16c6930dbc8f