FAILURE MAP
← Case archive

FA-83861 / Sports scoring and tiebreakers / Open access

Tiebreak closes on a one-point lead · case 01

A tiebreak at 7-6 is reported as won instead of continuing.

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

ROOT CAUSE

The tiebreak completion test only requires the leader to be ahead by one point.

VERIFIED REPAIR

Require at least target points and a lead of two.

Unsuccessful approach: Demanding a lead greater than two points prolongs tiebreaks won 7-5.

Case contract

Tiebreak game. points is a string of A/B point winners; target is 7 (standard) or 10 (match tiebreak). The tiebreak ends at the first point where a player has at least target points and a two-point lead; later points are ignored. first_server serves point 0, then serve alternates every two points (point k is served by first_server when ((k + 1) // 2) is even). Return [a, b, winner or None, server of the next point or None when finished, ends_change] where ends_change is true when the tiebreak is unfinished and a positive multiple of 6 points has been played.

Why this case matters

Chair-umpire scoring software must drive the server indicator and change-of-ends prompt during tiebreaks.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(points, first_server, target):
    def finished(x, y):
        return max(x, y) >= target and abs(x - y) >= 1
    a = b = 0
    for p in points:
        if p == 'A':
            a += 1
        else:
            b += 1
        if finished(a, b):
            break
    played = a + b
    winner = None
    if finished(a, b):
        winner = 'A' if a > b else 'B'
    other = 'B' if first_server == 'A' else 'A'
    server = first_server if ((played + 1) // 2) % 2 == 0 else other
    ends_change = played > 0 and played % 6 == 0 and winner is None
    return [a, b, winner, None if winner else server, ends_change]
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 opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('AAAABABABBBBB', 'A', 7), [6, 7, None, 'B', False]),
  ('regression: two point margin', ('BABABBBAABABA', 'B', 7), [5, 7, 'B', None, False]),
  ('variant scenario 1', ('BAABA', 'A', 10), [3, 2, None, 'B', False]),
  ('variant scenario 2', ('ABBA', 'A', 7), [2, 2, None, 'A', False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('BABABAAABBBB', 'B', 7), [5, 7, 'B', None, False]),
  ('regression: two point margin', ('ABBAABBBBAAAB', 'A', 7), [6, 7, None, 'B', False]),
  ('variant scenario 1', ('BAABBBBBABBAABBB', 'B', 10), [5, 10, 'B', None, False]),
  ('variant scenario 2', ('A', 'A', 7), [1, 0, None, 'B', False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('AABBBABBAAAABAA', 'A', 7), [7, 5, 'A', None, False]),
  ('regression: two point margin', ('BAAAABBBBABABABBA', 'A', 7), [7, 9, 'B', None, False]),
  ('variant scenario 1', ('BBABABB', 'B', 10), [2, 5, None, 'B', False]),
  ('variant scenario 2', ('ABBBABAAAAABAABBBAB', 'B', 7), [7, 4, 'A', None, False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('ABBAAABBAABBBBABBABA', 'B', 7), [6, 8, 'B', None, False]),
  ('variant scenario 1', ('ABBAA', 'B', 10), [3, 2, None, 'A', False]),
  ('variant scenario 2', ('AAAAAAABAABAABBBBBAABA', 'B', 10), [10, 2, 'A', None, False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin',
   ('BABABBABAABAABBBABABABBB', 'A', 10),
   [8, 10, 'B', None, False]),
  ('regression: two point margin', ('BABBAABBAABABBABBBAAA', 'B', 7), [6, 8, 'B', None, False]),
  ('variant scenario 1', ('ABBBBAAABBBAABBAAA', 'A', 7), [4, 7, 'B', None, False]),
  ('variant scenario 2', ('BABABAB', 'A', 7), [3, 4, None, 'A', False])]]
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 opening point[0, 0, None, 'A', False][0, 0, None, 'A', False]Passed
boundary second server pair[1, 0, None, 'B', False][1, 0, None, 'B', False]Passed
boundary third point back to first[1, 1, None, 'A', False][1, 1, None, 'A', False]Passed
control seven-five tiebreak[7, 5, 'A', None, False][7, 5, 'A', None, False]Passed
boundary change of ends at six[3, 3, None, 'B', True][3, 3, None, 'B', True]Passed
control match tiebreak not over at seven[7, 0, None, 'B', False][7, 0, None, 'B', False]Passed
regression: two point margin[6, 7, 'B', None, False][6, 7, None, 'B', False]Failed
regression: two point margin[5, 7, 'B', None, False][5, 7, 'B', None, False]Passed
variant scenario 1[3, 2, None, 'B', False][3, 2, None, 'B', False]Passed
variant scenario 2[2, 2, None, 'A', False][2, 2, None, 'A', False]Passed

SHA-256 / d938b3323b89d68d53d2de902673b6971cf4d7dfb023c21bcda24e49906c07bd

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(points, first_server, target):
    def finished(x, y):
        return max(x, y) >= target and abs(x - y) > 2
    a = b = 0
    for p in points:
        if p == 'A':
            a += 1
        else:
            b += 1
        if finished(a, b):
            break
    played = a + b
    winner = None
    if finished(a, b):
        winner = 'A' if a > b else 'B'
    other = 'B' if first_server == 'A' else 'A'
    server = first_server if ((played + 1) // 2) % 2 == 0 else other
    ends_change = played > 0 and played % 6 == 0 and winner is None
    return [a, b, winner, None if winner else server, ends_change]
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 opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('AAAABABABBBBB', 'A', 7), [6, 7, None, 'B', False]),
  ('regression: two point margin', ('BABABBBAABABA', 'B', 7), [5, 7, 'B', None, False]),
  ('variant scenario 1', ('BAABA', 'A', 10), [3, 2, None, 'B', False]),
  ('variant scenario 2', ('ABBA', 'A', 7), [2, 2, None, 'A', False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('BABABAAABBBB', 'B', 7), [5, 7, 'B', None, False]),
  ('regression: two point margin', ('ABBAABBBBAAAB', 'A', 7), [6, 7, None, 'B', False]),
  ('variant scenario 1', ('BAABBBBBABBAABBB', 'B', 10), [5, 10, 'B', None, False]),
  ('variant scenario 2', ('A', 'A', 7), [1, 0, None, 'B', False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('AABBBABBAAAABAA', 'A', 7), [7, 5, 'A', None, False]),
  ('regression: two point margin', ('BAAAABBBBABABABBA', 'A', 7), [7, 9, 'B', None, False]),
  ('variant scenario 1', ('BBABABB', 'B', 10), [2, 5, None, 'B', False]),
  ('variant scenario 2', ('ABBBABAAAAABAABBBAB', 'B', 7), [7, 4, 'A', None, False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('ABBAAABBAABBBBABBABA', 'B', 7), [6, 8, 'B', None, False]),
  ('variant scenario 1', ('ABBAA', 'B', 10), [3, 2, None, 'A', False]),
  ('variant scenario 2', ('AAAAAAABAABAABBBBBAABA', 'B', 10), [10, 2, 'A', None, False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin',
   ('BABABBABAABAABBBABABABBB', 'A', 10),
   [8, 10, 'B', None, False]),
  ('regression: two point margin', ('BABBAABBAABABBABBBAAA', 'B', 7), [6, 8, 'B', None, False]),
  ('variant scenario 1', ('ABBBBAAABBBAABBAAA', 'A', 7), [4, 7, 'B', None, False]),
  ('variant scenario 2', ('BABABAB', 'A', 7), [3, 4, None, 'A', False])]]
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 opening point[0, 0, None, 'A', False][0, 0, None, 'A', False]Passed
boundary second server pair[1, 0, None, 'B', False][1, 0, None, 'B', False]Passed
boundary third point back to first[1, 1, None, 'A', False][1, 1, None, 'A', False]Passed
control seven-five tiebreak[7, 5, None, 'A', True][7, 5, 'A', None, False]Failed
boundary change of ends at six[3, 3, None, 'B', True][3, 3, None, 'B', True]Passed
control match tiebreak not over at seven[7, 0, None, 'B', False][7, 0, None, 'B', False]Passed
regression: two point margin[6, 7, None, 'B', False][6, 7, None, 'B', False]Passed
regression: two point margin[6, 7, None, 'A', False][5, 7, 'B', None, False]Failed
variant scenario 1[3, 2, None, 'B', False][3, 2, None, 'B', False]Passed
variant scenario 2[2, 2, None, 'A', False][2, 2, None, 'A', False]Passed

SHA-256 / 62c42c4decd49263aeef3d8bdc88f7bbed44f8355e591f775e09970c67964d14

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(points, first_server, target):
    def finished(x, y):
        return max(x, y) >= target and abs(x - y) >= 2
    a = b = 0
    for p in points:
        if p == 'A':
            a += 1
        else:
            b += 1
        if finished(a, b):
            break
    played = a + b
    winner = None
    if finished(a, b):
        winner = 'A' if a > b else 'B'
    other = 'B' if first_server == 'A' else 'A'
    server = first_server if ((played + 1) // 2) % 2 == 0 else other
    ends_change = played > 0 and played % 6 == 0 and winner is None
    return [a, b, winner, None if winner else server, ends_change]
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 opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('AAAABABABBBBB', 'A', 7), [6, 7, None, 'B', False]),
  ('regression: two point margin', ('BABABBBAABABA', 'B', 7), [5, 7, 'B', None, False]),
  ('variant scenario 1', ('BAABA', 'A', 10), [3, 2, None, 'B', False]),
  ('variant scenario 2', ('ABBA', 'A', 7), [2, 2, None, 'A', False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('BABABAAABBBB', 'B', 7), [5, 7, 'B', None, False]),
  ('regression: two point margin', ('ABBAABBBBAAAB', 'A', 7), [6, 7, None, 'B', False]),
  ('variant scenario 1', ('BAABBBBBABBAABBB', 'B', 10), [5, 10, 'B', None, False]),
  ('variant scenario 2', ('A', 'A', 7), [1, 0, None, 'B', False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('AABBBABBAAAABAA', 'A', 7), [7, 5, 'A', None, False]),
  ('regression: two point margin', ('BAAAABBBBABABABBA', 'A', 7), [7, 9, 'B', None, False]),
  ('variant scenario 1', ('BBABABB', 'B', 10), [2, 5, None, 'B', False]),
  ('variant scenario 2', ('ABBBABAAAAABAABBBAB', 'B', 7), [7, 4, 'A', None, False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin', ('ABBAAABBAABBBBABBABA', 'B', 7), [6, 8, 'B', None, False]),
  ('variant scenario 1', ('ABBAA', 'B', 10), [3, 2, None, 'A', False]),
  ('variant scenario 2', ('AAAAAAABAABAABBBBBAABA', 'B', 10), [10, 2, 'A', None, False])],
 [('control opening point', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('boundary second server pair', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('boundary third point back to first', ('AB', 'B', 7), [1, 1, None, 'A', False]),
  ('control seven-five tiebreak', ('AAAAABBBBBAA', 'A', 7), [7, 5, 'A', None, False]),
  ('boundary change of ends at six', ('ABABAB', 'A', 7), [3, 3, None, 'B', True]),
  ('control match tiebreak not over at seven', ('AAAAAAA', 'B', 10), [7, 0, None, 'B', False]),
  ('regression: two point margin',
   ('BABABBABAABAABBBABABABBB', 'A', 10),
   [8, 10, 'B', None, False]),
  ('regression: two point margin', ('BABBAABBAABABBABBBAAA', 'B', 7), [6, 8, 'B', None, False]),
  ('variant scenario 1', ('ABBBBAAABBBAABBAAA', 'A', 7), [4, 7, 'B', None, False]),
  ('variant scenario 2', ('BABABAB', 'A', 7), [3, 4, None, 'A', False])]]
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 opening point[0, 0, None, 'A', False][0, 0, None, 'A', False]Passed
boundary second server pair[1, 0, None, 'B', False][1, 0, None, 'B', False]Passed
boundary third point back to first[1, 1, None, 'A', False][1, 1, None, 'A', False]Passed
control seven-five tiebreak[7, 5, 'A', None, False][7, 5, 'A', None, False]Passed
boundary change of ends at six[3, 3, None, 'B', True][3, 3, None, 'B', True]Passed
control match tiebreak not over at seven[7, 0, None, 'B', False][7, 0, None, 'B', False]Passed
regression: two point margin[6, 7, None, 'B', False][6, 7, None, 'B', False]Passed
regression: two point margin[5, 7, 'B', None, False][5, 7, 'B', None, False]Passed
variant scenario 1[3, 2, None, 'B', False][3, 2, None, 'B', False]Passed
variant scenario 2[2, 2, None, 'A', False][2, 2, None, 'A', False]Passed

SHA-256 / 922e152c3f5c9bb2f4186c87350e3baae786fc37f3506b7c086dc2b2a2aeb792

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

Case digest / dc37793014d553121e51e88acafbbe2c63d2052e7f61eb5a2f596ee071d2dae8