FAILURE MAP
← Case archive

FA-83876 / Sports scoring and tiebreakers / Open access

Points recorded after the tiebreak ended are still counted · case 01

A log that contains trailing warm-up points changes the final tiebreak score.

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

ROOT CAUSE

The loop keeps consuming rally characters after the completion condition is met.

VERIFIED REPAIR

Stop consuming points as soon as the tiebreak is finished.

Unsuccessful approach: Stopping only when player A has won still counts trailing points after a B victory.

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) >= 2
    a = b = 0
    for p in points:
        if p == 'A':
            a += 1
        else:
            b += 1
    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: points after completion', ('AAAABBBBAAABB', 'A', 7), [7, 4, 'A', None, False]),
  ('regression: points after completion', ('AABBBABBBBBAB', 'B', 7), [3, 7, 'B', None, False]),
  ('variant scenario 1', ('ABAABABAA', 'A', 7), [6, 3, None, 'B', False]),
  ('variant scenario 2', ('AAAABBBBAABBB', 'A', 10), [6, 7, 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: points after completion', ('AAAAAAABBABA', 'A', 7), [7, 0, 'A', None, False]),
  ('regression: points after completion', ('BBBBABBBBABBBB', 'A', 7), [1, 7, 'B', None, False]),
  ('variant scenario 1', ('ABABAABBAAAABA', 'A', 10), [9, 5, None, 'B', False]),
  ('variant scenario 2', ('ABBBAAABAA', 'B', 7), [6, 4, 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: points after completion', ('ABBAABBBBBAAABAA', 'B', 7), [3, 7, 'B', None, False]),
  ('variant scenario 1', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('variant scenario 2', ('BAA', 'A', 7), [2, 1, 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: points after completion',
   ('AAAABABABAABBBBBAABB', 'A', 7),
   [7, 3, 'A', None, False]),
  ('regression: points after completion',
   ('ABBBBBBAABABBBABBBBBA', 'A', 7),
   [3, 7, 'B', None, False]),
  ('variant scenario 1', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('variant scenario 2', ('BABAA', 'B', 10), [3, 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: points after completion',
   ('BABABAAABBABABAAABABAA', 'A', 10),
   [10, 7, 'A', None, False]),
  ('regression: points after completion',
   ('BABABBBBABABBBAABBBAABBAA', 'B', 10),
   [4, 10, 'B', None, False]),
  ('variant scenario 1', ('AABABAABAABABAABB', 'B', 10), [10, 5, 'A', None, False]),
  ('variant scenario 2', ('BABAABA', 'A', 7), [4, 3, 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: points after completion[7, 6, None, 'B', False][7, 4, 'A', None, False]Failed
regression: points after completion[4, 9, 'B', None, False][3, 7, 'B', None, False]Failed
variant scenario 1[6, 3, None, 'B', False][6, 3, None, 'B', False]Passed
variant scenario 2[6, 7, None, 'B', False][6, 7, None, 'B', False]Passed

SHA-256 / e21608ecd95624a95291f5d0d78122d510a384b344a0467fa6c63c5a392a1642

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) and 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: points after completion', ('AAAABBBBAAABB', 'A', 7), [7, 4, 'A', None, False]),
  ('regression: points after completion', ('AABBBABBBBBAB', 'B', 7), [3, 7, 'B', None, False]),
  ('variant scenario 1', ('ABAABABAA', 'A', 7), [6, 3, None, 'B', False]),
  ('variant scenario 2', ('AAAABBBBAABBB', 'A', 10), [6, 7, 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: points after completion', ('AAAAAAABBABA', 'A', 7), [7, 0, 'A', None, False]),
  ('regression: points after completion', ('BBBBABBBBABBBB', 'A', 7), [1, 7, 'B', None, False]),
  ('variant scenario 1', ('ABABAABBAAAABA', 'A', 10), [9, 5, None, 'B', False]),
  ('variant scenario 2', ('ABBBAAABAA', 'B', 7), [6, 4, 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: points after completion', ('ABBAABBBBBAAABAA', 'B', 7), [3, 7, 'B', None, False]),
  ('variant scenario 1', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('variant scenario 2', ('BAA', 'A', 7), [2, 1, 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: points after completion',
   ('AAAABABABAABBBBBAABB', 'A', 7),
   [7, 3, 'A', None, False]),
  ('regression: points after completion',
   ('ABBBBBBAABABBBABBBBBA', 'A', 7),
   [3, 7, 'B', None, False]),
  ('variant scenario 1', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('variant scenario 2', ('BABAA', 'B', 10), [3, 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: points after completion',
   ('BABABAAABBABABAAABABAA', 'A', 10),
   [10, 7, 'A', None, False]),
  ('regression: points after completion',
   ('BABABBBBABABBBAABBBAABBAA', 'B', 10),
   [4, 10, 'B', None, False]),
  ('variant scenario 1', ('AABABAABAABABAABB', 'B', 10), [10, 5, 'A', None, False]),
  ('variant scenario 2', ('BABAABA', 'A', 7), [4, 3, 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: points after completion[7, 4, 'A', None, False][7, 4, 'A', None, False]Passed
regression: points after completion[4, 9, 'B', None, False][3, 7, 'B', None, False]Failed
variant scenario 1[6, 3, None, 'B', False][6, 3, None, 'B', False]Passed
variant scenario 2[6, 7, None, 'B', False][6, 7, None, 'B', False]Passed

SHA-256 / 4a8bc2eaffecafbff2d24a64eb94b72cc653ddd5fba63d8314ee78774bd6a6ad

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: points after completion', ('AAAABBBBAAABB', 'A', 7), [7, 4, 'A', None, False]),
  ('regression: points after completion', ('AABBBABBBBBAB', 'B', 7), [3, 7, 'B', None, False]),
  ('variant scenario 1', ('ABAABABAA', 'A', 7), [6, 3, None, 'B', False]),
  ('variant scenario 2', ('AAAABBBBAABBB', 'A', 10), [6, 7, 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: points after completion', ('AAAAAAABBABA', 'A', 7), [7, 0, 'A', None, False]),
  ('regression: points after completion', ('BBBBABBBBABBBB', 'A', 7), [1, 7, 'B', None, False]),
  ('variant scenario 1', ('ABABAABBAAAABA', 'A', 10), [9, 5, None, 'B', False]),
  ('variant scenario 2', ('ABBBAAABAA', 'B', 7), [6, 4, 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: points after completion', ('ABBAABBBBBAAABAA', 'B', 7), [3, 7, 'B', None, False]),
  ('variant scenario 1', ('A', 'A', 7), [1, 0, None, 'B', False]),
  ('variant scenario 2', ('BAA', 'A', 7), [2, 1, 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: points after completion',
   ('AAAABABABAABBBBBAABB', 'A', 7),
   [7, 3, 'A', None, False]),
  ('regression: points after completion',
   ('ABBBBBBAABABBBABBBBBA', 'A', 7),
   [3, 7, 'B', None, False]),
  ('variant scenario 1', ('', 'A', 7), [0, 0, None, 'A', False]),
  ('variant scenario 2', ('BABAA', 'B', 10), [3, 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: points after completion',
   ('BABABAAABBABABAAABABAA', 'A', 10),
   [10, 7, 'A', None, False]),
  ('regression: points after completion',
   ('BABABBBBABABBBAABBBAABBAA', 'B', 10),
   [4, 10, 'B', None, False]),
  ('variant scenario 1', ('AABABAABAABABAABB', 'B', 10), [10, 5, 'A', None, False]),
  ('variant scenario 2', ('BABAABA', 'A', 7), [4, 3, 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: points after completion[7, 4, 'A', None, False][7, 4, 'A', None, False]Passed
regression: points after completion[3, 7, 'B', None, False][3, 7, 'B', None, False]Passed
variant scenario 1[6, 3, None, 'B', False][6, 3, None, 'B', False]Passed
variant scenario 2[6, 7, None, 'B', False][6, 7, None, 'B', False]Passed

SHA-256 / 2959358a18941444193f1a6fdc6c3e28036c56d05ec43843db67b6abd9834693

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

Case digest / 3ec1281de015f1e2fb8e5b1f40b46fa7c125b6d742f5b5b2f7e5ac560f8b7162