FA-84181 / Sports scoring and tiebreakers / Open access
Dormie treated as a closed match · case 01
A player 3 up with 3 to play is declared the winner.
ROOT CAUSE
The closure test uses lead >= remaining.
VERIFIED REPAIR
Close only when the lead strictly exceeds the holes remaining.
Unsuccessful approach: Closing only when A leads leaves matches B has already won open.
Case contract
Eighteen-hole match play. holes is a string of hole results: A, B or H (halved). The match closes as soon as the lead exceeds the holes remaining: "X wins L&R" (L lead, R remaining), or "X wins L up" if it closes on the 18th. Later characters are ignored. After 18 holes level: "halved". Unfinished: "all square", "X dormie R" when the lead equals the holes remaining, otherwise "X L up".
Why this case matters
Ryder-Cup style boards and match-play brackets display closure notation like 3&2 and dormie.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(holes):
lead = 0
played = 0
for h in holes:
played += 1
if h == 'A':
lead += 1
elif h == 'B':
lead -= 1
remaining = 18 - played
if abs(lead) >= remaining:
side = 'A' if lead > 0 else 'B'
if remaining == 0:
return '%s wins %d up' % (side, abs(lead))
return '%s wins %d&%d' % (side, abs(lead), remaining)
if played == 18:
return 'halved'
remaining = 18 - played
if lead == 0:
return 'all square'
side = 'A' if lead > 0 else 'B'
if abs(lead) == remaining:
return '%s dormie %d' % (side, remaining)
return '%s %d up' % (side, abs(lead))
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 early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBHAABABABBHBBABA',), 'B wins 4&2'),
('variant scenario 1', ('HBAABBABBBAAABAHBBAABB',), 'B wins 2 up'),
('variant scenario 2', ('HABBAHHAAH',), 'A 2 up')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBHAAHHBBABBBABBABH',), 'B wins 4&3'),
('regression: closure condition', ('AAHAHABAAHABH',), 'A dormie 5'),
('variant scenario 1', ('HBHBAHBHAHBBAAA',), 'all square'),
('variant scenario 2', ('BABHBBBAAHA',), 'B 1 up')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('AABHAHABBBAAABAB',), 'A dormie 2'),
('regression: closure condition', ('AAHBABAHABBHBBBHABHA',), 'B wins 2 up'),
('variant scenario 1', ('ABAHAAAHAAAAAAHHBBABA',), 'A wins 8&6'),
('variant scenario 2', ('AHAHHABAABAAAABAH',), 'A wins 6&5')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBBAAHHBAABBBHHBAB',), 'B wins 4&2'),
('variant scenario 1', ('BHABBABABHAH',), 'B 1 up'),
('variant scenario 2', ('ABHBABBBHHBBBAB',), 'B wins 6&5')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBHABABABBABHHBBHB',), 'B wins 4&3'),
('regression: closure condition', ('BAAHHAAHAHBBABAAAAA',), 'A wins 4&2'),
('variant scenario 1', ('ABBBABHAAAH',), 'A 1 up'),
('variant scenario 2', ('AABBHAAHBAAHAABABA',), 'A wins 5&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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control early lead | A 2 up | A 2 up | Passed |
| boundary dormie | A wins 3&3 | A dormie 3 | Failed |
| boundary closure three and two | B wins 3&3 | B wins 3&2 | Failed |
| boundary one up at eighteen | A wins 1&1 | A wins 1 up | Failed |
| control halved match | A wins 1&1 | halved | Failed |
| control all square | all square | all square | Passed |
| regression: closure condition | B wins 4&4 | B wins 4&2 | Failed |
| variant scenario 1 | B wins 1&1 | B wins 2 up | Failed |
| variant scenario 2 | A 2 up | A 2 up | Passed |
SHA-256 / 779a48ae4d056431ed267ef4c44baf6e555ee39757205232bb3c0b151bcf3c15
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(holes):
lead = 0
played = 0
for h in holes:
played += 1
if h == 'A':
lead += 1
elif h == 'B':
lead -= 1
remaining = 18 - played
if lead > remaining:
side = 'A' if lead > 0 else 'B'
if remaining == 0:
return '%s wins %d up' % (side, abs(lead))
return '%s wins %d&%d' % (side, abs(lead), remaining)
if played == 18:
return 'halved'
remaining = 18 - played
if lead == 0:
return 'all square'
side = 'A' if lead > 0 else 'B'
if abs(lead) == remaining:
return '%s dormie %d' % (side, remaining)
return '%s %d up' % (side, abs(lead))
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 early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBHAABABABBHBBABA',), 'B wins 4&2'),
('variant scenario 1', ('HBAABBABBBAAABAHBBAABB',), 'B wins 2 up'),
('variant scenario 2', ('HABBAHHAAH',), 'A 2 up')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBHAAHHBBABBBABBABH',), 'B wins 4&3'),
('regression: closure condition', ('AAHAHABAAHABH',), 'A dormie 5'),
('variant scenario 1', ('HBHBAHBHAHBBAAA',), 'all square'),
('variant scenario 2', ('BABHBBBAAHA',), 'B 1 up')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('AABHAHABBBAAABAB',), 'A dormie 2'),
('regression: closure condition', ('AAHBABAHABBHBBBHABHA',), 'B wins 2 up'),
('variant scenario 1', ('ABAHAAAHAAAAAAHHBBABA',), 'A wins 8&6'),
('variant scenario 2', ('AHAHHABAABAAAABAH',), 'A wins 6&5')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBBAAHHBAABBBHHBAB',), 'B wins 4&2'),
('variant scenario 1', ('BHABBABABHAH',), 'B 1 up'),
('variant scenario 2', ('ABHBABBBHHBBBAB',), 'B wins 6&5')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBHABABABBABHHBBHB',), 'B wins 4&3'),
('regression: closure condition', ('BAAHHAAHAHBBABAAAAA',), 'A wins 4&2'),
('variant scenario 1', ('ABBBABHAAAH',), 'A 1 up'),
('variant scenario 2', ('AABBHAAHBAAHAABABA',), 'A wins 5&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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control early lead | A 2 up | A 2 up | Passed |
| boundary dormie | A dormie 3 | A dormie 3 | Passed |
| boundary closure three and two | B 3 up | B wins 3&2 | Failed |
| boundary one up at eighteen | A wins 1 up | A wins 1 up | Passed |
| control halved match | halved | halved | Passed |
| control all square | all square | all square | Passed |
| regression: closure condition | B 3 up | B wins 4&2 | Failed |
| variant scenario 1 | B wins 0&-2 | B wins 2 up | Failed |
| variant scenario 2 | A 2 up | A 2 up | Passed |
SHA-256 / 3fc05eefa3722a167dc713b501b8ea6f171061d0fa3161a014ffe33e0b640be9
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(holes):
lead = 0
played = 0
for h in holes:
played += 1
if h == 'A':
lead += 1
elif h == 'B':
lead -= 1
remaining = 18 - played
if abs(lead) > remaining:
side = 'A' if lead > 0 else 'B'
if remaining == 0:
return '%s wins %d up' % (side, abs(lead))
return '%s wins %d&%d' % (side, abs(lead), remaining)
if played == 18:
return 'halved'
remaining = 18 - played
if lead == 0:
return 'all square'
side = 'A' if lead > 0 else 'B'
if abs(lead) == remaining:
return '%s dormie %d' % (side, remaining)
return '%s %d up' % (side, abs(lead))
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 early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBHAABABABBHBBABA',), 'B wins 4&2'),
('variant scenario 1', ('HBAABBABBBAAABAHBBAABB',), 'B wins 2 up'),
('variant scenario 2', ('HABBAHHAAH',), 'A 2 up')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBHAAHHBBABBBABBABH',), 'B wins 4&3'),
('regression: closure condition', ('AAHAHABAAHABH',), 'A dormie 5'),
('variant scenario 1', ('HBHBAHBHAHBBAAA',), 'all square'),
('variant scenario 2', ('BABHBBBAAHA',), 'B 1 up')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('AABHAHABBBAAABAB',), 'A dormie 2'),
('regression: closure condition', ('AAHBABAHABBHBBBHABHA',), 'B wins 2 up'),
('variant scenario 1', ('ABAHAAAHAAAAAAHHBBABA',), 'A wins 8&6'),
('variant scenario 2', ('AHAHHABAABAAAABAH',), 'A wins 6&5')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBBAAHHBAABBBHHBAB',), 'B wins 4&2'),
('variant scenario 1', ('BHABBABABHAH',), 'B 1 up'),
('variant scenario 2', ('ABHBABBBHHBBBAB',), 'B wins 6&5')],
[('control early lead', ('AAH',), 'A 2 up'),
('boundary dormie', ('AAAHHHHHHHHHHHH',), 'A dormie 3'),
('boundary closure three and two', ('BBBHHHHHHHHHHHHH',), 'B wins 3&2'),
('boundary one up at eighteen', ('AHHHHHHHHHHHHHHHHH',), 'A wins 1 up'),
('control halved match', ('ABABABABABABABABAB',), 'halved'),
('control all square', ('HAB',), 'all square'),
('regression: closure condition', ('BBHABABABBABHHBBHB',), 'B wins 4&3'),
('regression: closure condition', ('BAAHHAAHAHBBABAAAAA',), 'A wins 4&2'),
('variant scenario 1', ('ABBBABHAAAH',), 'A 1 up'),
('variant scenario 2', ('AABBHAAHBAAHAABABA',), 'A wins 5&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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control early lead | A 2 up | A 2 up | Passed |
| boundary dormie | A dormie 3 | A dormie 3 | Passed |
| boundary closure three and two | B wins 3&2 | B wins 3&2 | Passed |
| boundary one up at eighteen | A wins 1 up | A wins 1 up | Passed |
| control halved match | halved | halved | Passed |
| control all square | all square | all square | Passed |
| regression: closure condition | B wins 4&2 | B wins 4&2 | Passed |
| variant scenario 1 | B wins 2 up | B wins 2 up | Passed |
| variant scenario 2 | A 2 up | A 2 up | Passed |
SHA-256 / 9dd784bb4fb335e05c630a038cd669b8c0d7c557741ca41ad70e4714399aaae5
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.506238+00:00.
Case digest / f88cfc37b67930cfc2df8bf87f06f27bcc608452c38b7954c9717a04cc1b2647