FAILURE MAP
← Case archive

FA-84166 / Sports scoring and tiebreakers / Open access

Plus handicap receives strokes instead of giving them back · case 01

A +2 golfer is given strokes on the two hardest holes.

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

ROOT CAUSE

The plus-handicap branch drops the sign and allocates strokes like a normal handicap.

VERIFIED REPAIR

Give back one stroke on holes whose stroke index exceeds 18 + H.

Unsuccessful approach: Restoring the sign but keeping the hardest holes (lowest stroke index) still gives back on the wrong 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 <= -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: plus handicap',
   ([[3, 11, 1],
     [5, 5, 6],
     [5, 7, 6],
     [3, 1, 3],
     [4, 17, None],
     [5, 6, 7],
     [3, 4, 2],
     [5, 13, 5],
     [4, 15, 3],
     [3, 12, 3]],
    -2),
   [18, [4, 1, 1, 2, 0, 0, 3, 2, 3, 2]]),
  ('variant scenario 1', ([[4, 17, 7], [3, 18, 3], [4, 12, 8]], 29), [3, [0, 3, 0]]),
  ('variant scenario 2',
   ([[4, 4, 5], [5, 11, 3], [4, 9, 5], [5, 15, 7], [3, 6, 7], [4, 2, 5]], 20),
   [13, [2, 5, 2, 1, 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: plus handicap',
   ([[5, 8, 7], [4, 4, 4], [4, 5, 4], [4, 2, 4], [5, 17, None], [5, 11, 9], [5, 18, 6], [3, 14, 7]],
    -2),
   [6, [0, 2, 2, 2, 0, 0, 0, 0]]),
  ('variant scenario 1',
   ([[4, 13, 3],
     [5, 2, 4],
     [4, 7, 6],
     [4, 16, 4],
     [5, 11, 4],
     [4, 9, 7],
     [3, 5, 1],
     [4, 6, 5],
     [5, 4, 5],
     [4, 18, 7],
     [3, 3, 4]],
    20),
   [29, [4, 5, 1, 3, 4, 0, 5, 2, 3, 0, 2]]),
  ('variant scenario 2',
   ([[4, 17, 5], [4, 15, 6], [3, 8, 1], [4, 2, 8], [5, 11, 8], [4, 10, 8]], 18),
   [8, [2, 1, 5, 0, 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: plus handicap',
   ([[4, 12, 5],
     [4, 7, 7],
     [4, 11, 2],
     [5, 18, None],
     [3, 2, 3],
     [4, 14, 4],
     [5, 16, 6],
     [5, 10, 5],
     [3, 15, 1],
     [3, 5, 4]],
    -2),
   [17, [1, 0, 4, 0, 2, 2, 1, 2, 4, 1]]),
  ('variant scenario 1',
   ([[4, 14, 2], [5, 13, 9], [4, 3, 4], [3, 2, 7], [4, 17, 5], [3, 9, 4], [4, 7, 7]], 16),
   [11, [5, 0, 3, 0, 1, 2, 0]]),
  ('variant scenario 2',
   ([[4, 1, 5], [3, 7, 6], [4, 5, 2], [5, 3, 5], [4, 10, 5], [4, 11, None], [4, 13, 5], [4, 8, 5]],
    15),
   [16, [2, 0, 5, 3, 2, 0, 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: plus handicap',
   ([[4, 10, 2],
     [4, 12, 8],
     [3, 9, 6],
     [5, 17, 5],
     [3, 18, 7],
     [4, 15, 4],
     [4, 13, 4],
     [4, 6, 4],
     [4, 3, 3],
     [4, 8, 5],
     [4, 4, 5]],
    -2),
   [16, [4, 0, 0, 1, 0, 2, 2, 2, 3, 1, 1]]),
  ('variant scenario 1',
   ([[5, 16, 6],
     [3, 13, 3],
     [4, 10, 4],
     [5, 4, 9],
     [4, 12, 5],
     [4, 15, 6],
     [4, 11, 4],
     [4, 5, 2],
     [5, 2, 6],
     [3, 14, 3],
     [4, 7, None],
     [5, 18, 6]],
    -2),
   [15, [1, 2, 2, 0, 1, 0, 2, 4, 1, 2, 0, 0]]),
  ('variant scenario 2',
   ([[5, 10, 5], [4, 18, 4], [4, 5, 3], [4, 15, 5], [4, 9, 6], [5, 12, 3], [4, 6, 4]], 16),
   [20, [3, 2, 4, 2, 1, 5, 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: plus handicap',
   ([[5, 2, 4], [5, 1, 3], [4, 6, 5], [5, 15, 6], [5, 5, 5], [5, 10, 9], [4, 3, 5]], -2),
   [12, [3, 4, 1, 1, 2, 0, 1]]),
  ('variant scenario 1', ([[4, 4, 5], [3, 1, 4], [4, 13, 4], [4, 9, 8]], 18), [7, [2, 2, 3, 0]]),
  ('variant scenario 2', ([[5, 14, 5], [5, 18, 6], [4, 9, 3]], 18), [9, [3, 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[4, [2, 2]][3, [1, 2]]Failed
control blob hole[0, [0, 0]][0, [0, 0]]Passed
control net albatross[4, [4]][4, [4]]Passed
regression: plus handicap[19, [4, 1, 1, 3, 0, 0, 3, 2, 3, 2]][18, [4, 1, 1, 2, 0, 0, 3, 2, 3, 2]]Failed
variant scenario 1[3, [0, 3, 0]][3, [0, 3, 0]]Passed
variant scenario 2[13, [2, 5, 2, 1, 0, 3]][13, [2, 5, 2, 1, 0, 3]]Passed

SHA-256 / d204ff477ef1e4f8795b6a9be662f7e8f9d9d4e3fe1d6f48867136784a3e44ce

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 <= -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: plus handicap',
   ([[3, 11, 1],
     [5, 5, 6],
     [5, 7, 6],
     [3, 1, 3],
     [4, 17, None],
     [5, 6, 7],
     [3, 4, 2],
     [5, 13, 5],
     [4, 15, 3],
     [3, 12, 3]],
    -2),
   [18, [4, 1, 1, 2, 0, 0, 3, 2, 3, 2]]),
  ('variant scenario 1', ([[4, 17, 7], [3, 18, 3], [4, 12, 8]], 29), [3, [0, 3, 0]]),
  ('variant scenario 2',
   ([[4, 4, 5], [5, 11, 3], [4, 9, 5], [5, 15, 7], [3, 6, 7], [4, 2, 5]], 20),
   [13, [2, 5, 2, 1, 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: plus handicap',
   ([[5, 8, 7], [4, 4, 4], [4, 5, 4], [4, 2, 4], [5, 17, None], [5, 11, 9], [5, 18, 6], [3, 14, 7]],
    -2),
   [6, [0, 2, 2, 2, 0, 0, 0, 0]]),
  ('variant scenario 1',
   ([[4, 13, 3],
     [5, 2, 4],
     [4, 7, 6],
     [4, 16, 4],
     [5, 11, 4],
     [4, 9, 7],
     [3, 5, 1],
     [4, 6, 5],
     [5, 4, 5],
     [4, 18, 7],
     [3, 3, 4]],
    20),
   [29, [4, 5, 1, 3, 4, 0, 5, 2, 3, 0, 2]]),
  ('variant scenario 2',
   ([[4, 17, 5], [4, 15, 6], [3, 8, 1], [4, 2, 8], [5, 11, 8], [4, 10, 8]], 18),
   [8, [2, 1, 5, 0, 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: plus handicap',
   ([[4, 12, 5],
     [4, 7, 7],
     [4, 11, 2],
     [5, 18, None],
     [3, 2, 3],
     [4, 14, 4],
     [5, 16, 6],
     [5, 10, 5],
     [3, 15, 1],
     [3, 5, 4]],
    -2),
   [17, [1, 0, 4, 0, 2, 2, 1, 2, 4, 1]]),
  ('variant scenario 1',
   ([[4, 14, 2], [5, 13, 9], [4, 3, 4], [3, 2, 7], [4, 17, 5], [3, 9, 4], [4, 7, 7]], 16),
   [11, [5, 0, 3, 0, 1, 2, 0]]),
  ('variant scenario 2',
   ([[4, 1, 5], [3, 7, 6], [4, 5, 2], [5, 3, 5], [4, 10, 5], [4, 11, None], [4, 13, 5], [4, 8, 5]],
    15),
   [16, [2, 0, 5, 3, 2, 0, 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: plus handicap',
   ([[4, 10, 2],
     [4, 12, 8],
     [3, 9, 6],
     [5, 17, 5],
     [3, 18, 7],
     [4, 15, 4],
     [4, 13, 4],
     [4, 6, 4],
     [4, 3, 3],
     [4, 8, 5],
     [4, 4, 5]],
    -2),
   [16, [4, 0, 0, 1, 0, 2, 2, 2, 3, 1, 1]]),
  ('variant scenario 1',
   ([[5, 16, 6],
     [3, 13, 3],
     [4, 10, 4],
     [5, 4, 9],
     [4, 12, 5],
     [4, 15, 6],
     [4, 11, 4],
     [4, 5, 2],
     [5, 2, 6],
     [3, 14, 3],
     [4, 7, None],
     [5, 18, 6]],
    -2),
   [15, [1, 2, 2, 0, 1, 0, 2, 4, 1, 2, 0, 0]]),
  ('variant scenario 2',
   ([[5, 10, 5], [4, 18, 4], [4, 5, 3], [4, 15, 5], [4, 9, 6], [5, 12, 3], [4, 6, 4]], 16),
   [20, [3, 2, 4, 2, 1, 5, 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: plus handicap',
   ([[5, 2, 4], [5, 1, 3], [4, 6, 5], [5, 15, 6], [5, 5, 5], [5, 10, 9], [4, 3, 5]], -2),
   [12, [3, 4, 1, 1, 2, 0, 1]]),
  ('variant scenario 1', ([[4, 4, 5], [3, 1, 4], [4, 13, 4], [4, 9, 8]], 18), [7, [2, 2, 3, 0]]),
  ('variant scenario 2', ([[5, 14, 5], [5, 18, 6], [4, 9, 3]], 18), [9, [3, 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[4, [2, 2]][3, [1, 2]]Failed
control blob hole[0, [0, 0]][0, [0, 0]]Passed
control net albatross[4, [4]][4, [4]]Passed
regression: plus handicap[17, [4, 1, 1, 1, 0, 0, 3, 2, 3, 2]][18, [4, 1, 1, 2, 0, 0, 3, 2, 3, 2]]Failed
variant scenario 1[3, [0, 3, 0]][3, [0, 3, 0]]Passed
variant scenario 2[13, [2, 5, 2, 1, 0, 3]][13, [2, 5, 2, 1, 0, 3]]Passed

SHA-256 / cdf64887c3654520871fac8ac6d3e079a8fcff7e030a861e0156dadfe47df264

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: plus handicap',
   ([[3, 11, 1],
     [5, 5, 6],
     [5, 7, 6],
     [3, 1, 3],
     [4, 17, None],
     [5, 6, 7],
     [3, 4, 2],
     [5, 13, 5],
     [4, 15, 3],
     [3, 12, 3]],
    -2),
   [18, [4, 1, 1, 2, 0, 0, 3, 2, 3, 2]]),
  ('variant scenario 1', ([[4, 17, 7], [3, 18, 3], [4, 12, 8]], 29), [3, [0, 3, 0]]),
  ('variant scenario 2',
   ([[4, 4, 5], [5, 11, 3], [4, 9, 5], [5, 15, 7], [3, 6, 7], [4, 2, 5]], 20),
   [13, [2, 5, 2, 1, 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: plus handicap',
   ([[5, 8, 7], [4, 4, 4], [4, 5, 4], [4, 2, 4], [5, 17, None], [5, 11, 9], [5, 18, 6], [3, 14, 7]],
    -2),
   [6, [0, 2, 2, 2, 0, 0, 0, 0]]),
  ('variant scenario 1',
   ([[4, 13, 3],
     [5, 2, 4],
     [4, 7, 6],
     [4, 16, 4],
     [5, 11, 4],
     [4, 9, 7],
     [3, 5, 1],
     [4, 6, 5],
     [5, 4, 5],
     [4, 18, 7],
     [3, 3, 4]],
    20),
   [29, [4, 5, 1, 3, 4, 0, 5, 2, 3, 0, 2]]),
  ('variant scenario 2',
   ([[4, 17, 5], [4, 15, 6], [3, 8, 1], [4, 2, 8], [5, 11, 8], [4, 10, 8]], 18),
   [8, [2, 1, 5, 0, 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: plus handicap',
   ([[4, 12, 5],
     [4, 7, 7],
     [4, 11, 2],
     [5, 18, None],
     [3, 2, 3],
     [4, 14, 4],
     [5, 16, 6],
     [5, 10, 5],
     [3, 15, 1],
     [3, 5, 4]],
    -2),
   [17, [1, 0, 4, 0, 2, 2, 1, 2, 4, 1]]),
  ('variant scenario 1',
   ([[4, 14, 2], [5, 13, 9], [4, 3, 4], [3, 2, 7], [4, 17, 5], [3, 9, 4], [4, 7, 7]], 16),
   [11, [5, 0, 3, 0, 1, 2, 0]]),
  ('variant scenario 2',
   ([[4, 1, 5], [3, 7, 6], [4, 5, 2], [5, 3, 5], [4, 10, 5], [4, 11, None], [4, 13, 5], [4, 8, 5]],
    15),
   [16, [2, 0, 5, 3, 2, 0, 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: plus handicap',
   ([[4, 10, 2],
     [4, 12, 8],
     [3, 9, 6],
     [5, 17, 5],
     [3, 18, 7],
     [4, 15, 4],
     [4, 13, 4],
     [4, 6, 4],
     [4, 3, 3],
     [4, 8, 5],
     [4, 4, 5]],
    -2),
   [16, [4, 0, 0, 1, 0, 2, 2, 2, 3, 1, 1]]),
  ('variant scenario 1',
   ([[5, 16, 6],
     [3, 13, 3],
     [4, 10, 4],
     [5, 4, 9],
     [4, 12, 5],
     [4, 15, 6],
     [4, 11, 4],
     [4, 5, 2],
     [5, 2, 6],
     [3, 14, 3],
     [4, 7, None],
     [5, 18, 6]],
    -2),
   [15, [1, 2, 2, 0, 1, 0, 2, 4, 1, 2, 0, 0]]),
  ('variant scenario 2',
   ([[5, 10, 5], [4, 18, 4], [4, 5, 3], [4, 15, 5], [4, 9, 6], [5, 12, 3], [4, 6, 4]], 16),
   [20, [3, 2, 4, 2, 1, 5, 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: plus handicap',
   ([[5, 2, 4], [5, 1, 3], [4, 6, 5], [5, 15, 6], [5, 5, 5], [5, 10, 9], [4, 3, 5]], -2),
   [12, [3, 4, 1, 1, 2, 0, 1]]),
  ('variant scenario 1', ([[4, 4, 5], [3, 1, 4], [4, 13, 4], [4, 9, 8]], 18), [7, [2, 2, 3, 0]]),
  ('variant scenario 2', ([[5, 14, 5], [5, 18, 6], [4, 9, 3]], 18), [9, [3, 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: plus handicap[18, [4, 1, 1, 2, 0, 0, 3, 2, 3, 2]][18, [4, 1, 1, 2, 0, 0, 3, 2, 3, 2]]Passed
variant scenario 1[3, [0, 3, 0]][3, [0, 3, 0]]Passed
variant scenario 2[13, [2, 5, 2, 1, 0, 3]][13, [2, 5, 2, 1, 0, 3]]Passed

SHA-256 / 9c7daf914159407343e96a1c607d33fcee20b6801f55607ffe6f492efab74ad9

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

Case digest / 3d729e951380fabf2260b919758527d1582a2f6eee333c13fd67c6e58af121d0