FA-83881 / Sports scoring and tiebreakers / Open access
Change of ends prompted at the start or after the tiebreak ended · case 01
The umpire is told to change ends before any point is played or after a 7-5 finish.
ROOT CAUSE
The change-of-ends flag only checks played % 6, ignoring zero points and finished tiebreaks.
VERIFIED REPAIR
Require a positive multiple of six points and an unfinished tiebreak.
Unsuccessful approach: Adding the positive-count guard alone still prompts a change after a tiebreak finished on point 12.
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
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 % 6 == 0
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: ends change conditions', ('', 'A', 10), [0, 0, None, 'A', False]),
('regression: ends change conditions', ('AABBABBBABABB', 'A', 7), [5, 7, 'B', None, False]),
('variant scenario 1', ('BBBAABABB', 'A', 7), [3, 6, None, 'B', 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: ends change conditions', ('', 'A', 7), [0, 0, None, 'A', False]),
('regression: ends change conditions', ('BBAAAAAABBBAAAA', 'A', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('BAAAAABAABAABB', 'A', 7), [7, 2, 'A', None, False]),
('variant scenario 2', ('ABABAABAABABAB', 'A', 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: ends change conditions', ('BBAABBAAAABAAA', 'A', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('BBBAAA', 'B', 7), [3, 3, None, 'A', True]),
('variant scenario 2', ('', 'A', 7), [0, 0, 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: ends change conditions', ('AABABBAAABBAABABA', 'B', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('AAAABAABABBABAAB', 'B', 10), [10, 5, 'A', None, False]),
('variant scenario 2', ('ABB', 'B', 7), [1, 2, 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: ends change conditions', ('BBBABAAAABAABABBBAA', 'B', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('AABBB', 'B', 7), [2, 3, None, 'A', False]),
('variant scenario 2', ('ABBBAABBBBAB', 'B', 10), [4, 8, None, 'B', True])]]
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 opening point | [0, 0, None, 'A', True] | [0, 0, None, 'A', False] | Failed |
| 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, 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: ends change conditions | [0, 0, None, 'A', True] | [0, 0, None, 'A', False] | Failed |
| regression: ends change conditions | [5, 7, 'B', None, True] | [5, 7, 'B', None, False] | Failed |
| variant scenario 1 | [3, 6, None, 'B', False] | [3, 6, None, 'B', False] | Passed |
| variant scenario 2 | [1, 0, None, 'B', False] | [1, 0, None, 'B', False] | Passed |
SHA-256 / 144a7c2b07cd1beff48a6cc505d7fdca86811efa8d784e4c01ccf04dc9138fde
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
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: ends change conditions', ('', 'A', 10), [0, 0, None, 'A', False]),
('regression: ends change conditions', ('AABBABBBABABB', 'A', 7), [5, 7, 'B', None, False]),
('variant scenario 1', ('BBBAABABB', 'A', 7), [3, 6, None, 'B', 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: ends change conditions', ('', 'A', 7), [0, 0, None, 'A', False]),
('regression: ends change conditions', ('BBAAAAAABBBAAAA', 'A', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('BAAAAABAABAABB', 'A', 7), [7, 2, 'A', None, False]),
('variant scenario 2', ('ABABAABAABABAB', 'A', 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: ends change conditions', ('BBAABBAAAABAAA', 'A', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('BBBAAA', 'B', 7), [3, 3, None, 'A', True]),
('variant scenario 2', ('', 'A', 7), [0, 0, 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: ends change conditions', ('AABABBAAABBAABABA', 'B', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('AAAABAABABBABAAB', 'B', 10), [10, 5, 'A', None, False]),
('variant scenario 2', ('ABB', 'B', 7), [1, 2, 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: ends change conditions', ('BBBABAAAABAABABBBAA', 'B', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('AABBB', 'B', 7), [2, 3, None, 'A', False]),
('variant scenario 2', ('ABBBAABBBBAB', 'B', 10), [4, 8, None, 'B', True])]]
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 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, 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: ends change conditions | [0, 0, None, 'A', False] | [0, 0, None, 'A', False] | Passed |
| regression: ends change conditions | [5, 7, 'B', None, True] | [5, 7, 'B', None, False] | Failed |
| variant scenario 1 | [3, 6, None, 'B', False] | [3, 6, None, 'B', False] | Passed |
| variant scenario 2 | [1, 0, None, 'B', False] | [1, 0, None, 'B', False] | Passed |
SHA-256 / c5d07b39b76aed17d174532456e0b28713eee1b61635017689368a1d43ce1958
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: ends change conditions', ('', 'A', 10), [0, 0, None, 'A', False]),
('regression: ends change conditions', ('AABBABBBABABB', 'A', 7), [5, 7, 'B', None, False]),
('variant scenario 1', ('BBBAABABB', 'A', 7), [3, 6, None, 'B', 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: ends change conditions', ('', 'A', 7), [0, 0, None, 'A', False]),
('regression: ends change conditions', ('BBAAAAAABBBAAAA', 'A', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('BAAAAABAABAABB', 'A', 7), [7, 2, 'A', None, False]),
('variant scenario 2', ('ABABAABAABABAB', 'A', 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: ends change conditions', ('BBAABBAAAABAAA', 'A', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('BBBAAA', 'B', 7), [3, 3, None, 'A', True]),
('variant scenario 2', ('', 'A', 7), [0, 0, 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: ends change conditions', ('AABABBAAABBAABABA', 'B', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('AAAABAABABBABAAB', 'B', 10), [10, 5, 'A', None, False]),
('variant scenario 2', ('ABB', 'B', 7), [1, 2, 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: ends change conditions', ('BBBABAAAABAABABBBAA', 'B', 7), [7, 5, 'A', None, False]),
('variant scenario 1', ('AABBB', 'B', 7), [2, 3, None, 'A', False]),
('variant scenario 2', ('ABBBAABBBBAB', 'B', 10), [4, 8, None, 'B', True])]]
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 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: ends change conditions | [0, 0, None, 'A', False] | [0, 0, None, 'A', False] | Passed |
| regression: ends change conditions | [5, 7, 'B', None, False] | [5, 7, 'B', None, False] | Passed |
| variant scenario 1 | [3, 6, None, 'B', False] | [3, 6, None, 'B', False] | Passed |
| variant scenario 2 | [1, 0, None, 'B', False] | [1, 0, None, 'B', False] | Passed |
SHA-256 / 2abf8cd61adbd131d3730c36f5ecf30df5565ce1d8fae4f7942b2af36b1785bf
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.821069+00:00.
Case digest / 2a73831e4df4f932259e2155977bbbb78495ae0c203978f4c8da283a9db9ddee