FAILURE MAP
← Case archive

FA-84196 / Sports scoring and tiebreakers / Open access

Dormie shown only for one side or only on the 18th tee · case 01

B dormie situations display as "B 3 up".

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

ROOT CAUSE

The dormie check compares the signed lead with the holes remaining.

THE FAILURE

The dormie check compares the signed lead with the holes remaining.

Unsuccessful approach: Only flagging dormie with one hole to play misses dormie 2 and 3 situations.

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 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: dormie detection', ('BAHBHBAABAAAHHBA',), 'A dormie 2'),
  ('regression: dormie detection', ('ABBBBBAHABBHBA',), 'B dormie 4'),
  ('variant scenario 1', ('HBHAABAHBBBBHABBAABH',), 'B wins 4&2'),
  ('variant scenario 2', ('AHABABAA',), 'A 3 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: dormie detection', ('HABBHABHBABBHBA',), 'B dormie 3'),
  ('variant scenario 1', ('AHAAABBHBAABA',), 'A 3 up'),
  ('variant scenario 2', ('BBAAAABAB',), 'A 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: dormie detection', ('AABBBAHBAAAAABH',), 'A dormie 3'),
  ('regression: dormie detection', ('ABABBHBBHAABBAB',), 'B dormie 3'),
  ('variant scenario 1', ('AABAAAAAAAHBHBH',), 'A wins 8&7'),
  ('variant scenario 2', ('HBAHBABABAA',), 'A 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: dormie detection', ('BBHABABABAHBBAB',), 'B dormie 3'),
  ('variant scenario 1', ('BAAHBABA',), 'A 1 up'),
  ('variant scenario 2', ('AABBABHAAAHAAAHBH',), 'A wins 6&4')],
 [('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: dormie detection', ('AHAAAABABAABBBH',), 'A dormie 3'),
  ('regression: dormie detection', ('BHABAAABHABBBBB',), 'B dormie 3'),
  ('variant scenario 1', ('HHABAAABHA',), 'A 3 up'),
  ('variant scenario 2', ('AHBBAAAHBHBAAHBABAH',), 'A wins 2 up')]]
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 early leadA 2 upA 2 upPassed
boundary dormieA dormie 3A dormie 3Passed
boundary closure three and twoB wins 3&2B wins 3&2Passed
boundary one up at eighteenA wins 1 upA wins 1 upPassed
control halved matchhalvedhalvedPassed
control all squareall squareall squarePassed
regression: dormie detectionA dormie 2A dormie 2Passed
regression: dormie detectionB 4 upB dormie 4Failed
variant scenario 1B wins 4&2B wins 4&2Passed
variant scenario 2A 3 upA 3 upPassed

SHA-256 / 3b87a410c83140bcaf67af8516212cdd694408d11574d7dc6e1fbe0b2d56ac3d

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 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 == 1:
        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: dormie detection', ('BAHBHBAABAAAHHBA',), 'A dormie 2'),
  ('regression: dormie detection', ('ABBBBBAHABBHBA',), 'B dormie 4'),
  ('variant scenario 1', ('HBHAABAHBBBBHABBAABH',), 'B wins 4&2'),
  ('variant scenario 2', ('AHABABAA',), 'A 3 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: dormie detection', ('HABBHABHBABBHBA',), 'B dormie 3'),
  ('variant scenario 1', ('AHAAABBHBAABA',), 'A 3 up'),
  ('variant scenario 2', ('BBAAAABAB',), 'A 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: dormie detection', ('AABBBAHBAAAAABH',), 'A dormie 3'),
  ('regression: dormie detection', ('ABABBHBBHAABBAB',), 'B dormie 3'),
  ('variant scenario 1', ('AABAAAAAAAHBHBH',), 'A wins 8&7'),
  ('variant scenario 2', ('HBAHBABABAA',), 'A 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: dormie detection', ('BBHABABABAHBBAB',), 'B dormie 3'),
  ('variant scenario 1', ('BAAHBABA',), 'A 1 up'),
  ('variant scenario 2', ('AABBABHAAAHAAAHBH',), 'A wins 6&4')],
 [('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: dormie detection', ('AHAAAABABAABBBH',), 'A dormie 3'),
  ('regression: dormie detection', ('BHABAAABHABBBBB',), 'B dormie 3'),
  ('variant scenario 1', ('HHABAAABHA',), 'A 3 up'),
  ('variant scenario 2', ('AHBBAAAHBHBAAHBABAH',), 'A wins 2 up')]]
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 early leadA 2 upA 2 upPassed
boundary dormieA 3 upA dormie 3Failed
boundary closure three and twoB wins 3&2B wins 3&2Passed
boundary one up at eighteenA wins 1 upA wins 1 upPassed
control halved matchhalvedhalvedPassed
control all squareall squareall squarePassed
regression: dormie detectionA 2 upA dormie 2Failed
regression: dormie detectionB 4 upB dormie 4Failed
variant scenario 1B wins 4&2B wins 4&2Passed
variant scenario 2A 3 upA 3 upPassed

SHA-256 / 39e8650e4e062a2044214337163495e77300cc08659f1fcfb3172717c04acc47

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 10 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 2d5518478e6dad92ed0253969ababb61ba9cfb0daaada6b3922108fea08e4660