FA-83951 / Sports scoring and tiebreakers / Open access
Service changes every point from the start · case 01
The next server is wrong after the first point of the game.
ROOT CAUSE
The regular block size of two points is not applied.
VERIFIED REPAIR
Divide the point count by two outside deuce.
Unsuccessful approach: Rounding the block up shifts the change to after the first point.
Case contract
One table tennis game to 11 with a two-point lead; later rallies are ignored. Service changes after every two points; once both players have at least 10 points it changes after every point. Return [a, b, winner, None] when finished, else [a, b, None, next server].
Why this case matters
Match software must show who serves next, especially after 10-10.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rallies, first_server):
a = b = 0
for r in rallies:
if r == 'A':
a += 1
else:
b += 1
if max(a, b) >= 11 and abs(a - b) >= 2:
return [a, b, r, None]
k = a + b
other = 'B' if first_server == 'A' else 'A'
if a >= 10 and b >= 10:
block = k - 10
else:
block = k
return [a, b, None, first_server if block % 2 == 0 else other]
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 server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('AAABABA', 'B'), [5, 2, None, 'A']),
('regression: two point service block', ('AABBABBBBB', 'B'), [3, 7, None, 'A']),
('variant scenario 1', ('ABABABABABABABABABAB', 'B'), [10, 10, None, 'B']),
('variant scenario 2', ('ABABABABABABABABABBB', 'A'), [9, 11, 'B', None])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('ABABABABABABABABABB', 'A'), [9, 10, None, 'B']),
('regression: two point service block', ('ABABABABABABABABAB', 'B'), [9, 9, None, 'A']),
('variant scenario 1', ('ABABABABABABABABABABAB', 'B'), [11, 11, None, 'B']),
('variant scenario 2', ('ABABABABABABABABABABABABBB', 'A'), [12, 14, 'B', None])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('ABABABABABABABABABB', 'A'), [9, 10, None, 'B']),
('regression: two point service block', ('ABBBA', 'A'), [2, 3, None, 'A']),
('variant scenario 1', ('ABABABABABABABABABAB', 'B'), [10, 10, None, 'B']),
('variant scenario 2', ('ABABABABABABABABABABAB', 'B'), [11, 11, None, 'B'])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('ABABABABABABABABAB', 'B'), [9, 9, None, 'A']),
('regression: two point service block', ('BBAAABAAAAABBBABB', 'B'), [9, 8, None, 'B']),
('variant scenario 1', ('BABAAAAAAAAABBBAAABBABABAABA', 'A'), [11, 5, 'A', None]),
('variant scenario 2', ('BBBAAAABAABABAAABBBABBAABA', 'A'), [11, 9, 'A', None])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('BABBBAABAB', 'B'), [4, 6, None, 'A']),
('regression: two point service block', ('AABAABABBAAABBABABB', 'A'), [10, 9, None, 'B']),
('variant scenario 1', ('ABABABABABABABABABABABBB', 'B'), [11, 13, 'B', None]),
('variant scenario 2', ('BBBBBBABBBBAABABBBBAABAABBAA', 'A'), [3, 11, 'B', None])]]
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 server | [0, 0, None, 'A'] | [0, 0, None, 'A'] | Passed |
| boundary second point same server | [0, 1, None, 'B'] | [0, 1, None, 'A'] | Failed |
| boundary change after two points | [1, 1, None, 'A'] | [1, 1, None, 'B'] | Failed |
| boundary ten-all | [10, 10, None, 'A'] | [10, 10, None, 'A'] | Passed |
| boundary eleven-ten alternates each point | [11, 10, None, 'B'] | [11, 10, None, 'B'] | Passed |
| control eleven-nine | [11, 9, 'A', None] | [11, 9, 'A', None] | Passed |
| regression: two point service block | [5, 2, None, 'A'] | [5, 2, None, 'A'] | Passed |
| regression: two point service block | [3, 7, None, 'B'] | [3, 7, None, 'A'] | Failed |
| variant scenario 1 | [10, 10, None, 'B'] | [10, 10, None, 'B'] | Passed |
| variant scenario 2 | [9, 11, 'B', None] | [9, 11, 'B', None] | Passed |
SHA-256 / 2f12ee103e8cc551a3e4d9bffc94f7eb649045fd90c9afd9476e21398ca0c84c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rallies, first_server):
a = b = 0
for r in rallies:
if r == 'A':
a += 1
else:
b += 1
if max(a, b) >= 11 and abs(a - b) >= 2:
return [a, b, r, None]
k = a + b
other = 'B' if first_server == 'A' else 'A'
if a >= 10 and b >= 10:
block = k - 10
else:
block = (k + 1) // 2
return [a, b, None, first_server if block % 2 == 0 else other]
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 server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('AAABABA', 'B'), [5, 2, None, 'A']),
('regression: two point service block', ('AABBABBBBB', 'B'), [3, 7, None, 'A']),
('variant scenario 1', ('ABABABABABABABABABAB', 'B'), [10, 10, None, 'B']),
('variant scenario 2', ('ABABABABABABABABABBB', 'A'), [9, 11, 'B', None])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('ABABABABABABABABABB', 'A'), [9, 10, None, 'B']),
('regression: two point service block', ('ABABABABABABABABAB', 'B'), [9, 9, None, 'A']),
('variant scenario 1', ('ABABABABABABABABABABAB', 'B'), [11, 11, None, 'B']),
('variant scenario 2', ('ABABABABABABABABABABABABBB', 'A'), [12, 14, 'B', None])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('ABABABABABABABABABB', 'A'), [9, 10, None, 'B']),
('regression: two point service block', ('ABBBA', 'A'), [2, 3, None, 'A']),
('variant scenario 1', ('ABABABABABABABABABAB', 'B'), [10, 10, None, 'B']),
('variant scenario 2', ('ABABABABABABABABABABAB', 'B'), [11, 11, None, 'B'])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('ABABABABABABABABAB', 'B'), [9, 9, None, 'A']),
('regression: two point service block', ('BBAAABAAAAABBBABB', 'B'), [9, 8, None, 'B']),
('variant scenario 1', ('BABAAAAAAAAABBBAAABBABABAABA', 'A'), [11, 5, 'A', None]),
('variant scenario 2', ('BBBAAAABAABABAAABBBABBAABA', 'A'), [11, 9, 'A', None])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('BABBBAABAB', 'B'), [4, 6, None, 'A']),
('regression: two point service block', ('AABAABABBAAABBABABB', 'A'), [10, 9, None, 'B']),
('variant scenario 1', ('ABABABABABABABABABABABBB', 'B'), [11, 13, 'B', None]),
('variant scenario 2', ('BBBBBBABBBBAABABBBBAABAABBAA', 'A'), [3, 11, 'B', None])]]
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 server | [0, 0, None, 'A'] | [0, 0, None, 'A'] | Passed |
| boundary second point same server | [0, 1, None, 'B'] | [0, 1, None, 'A'] | Failed |
| boundary change after two points | [1, 1, None, 'B'] | [1, 1, None, 'B'] | Passed |
| boundary ten-all | [10, 10, None, 'A'] | [10, 10, None, 'A'] | Passed |
| boundary eleven-ten alternates each point | [11, 10, None, 'B'] | [11, 10, None, 'B'] | Passed |
| control eleven-nine | [11, 9, 'A', None] | [11, 9, 'A', None] | Passed |
| regression: two point service block | [5, 2, None, 'B'] | [5, 2, None, 'A'] | Failed |
| regression: two point service block | [3, 7, None, 'A'] | [3, 7, None, 'A'] | Passed |
| variant scenario 1 | [10, 10, None, 'B'] | [10, 10, None, 'B'] | Passed |
| variant scenario 2 | [9, 11, 'B', None] | [9, 11, 'B', None] | Passed |
SHA-256 / 6dd27f4bc3e95db49dace4f28ba6efcb6a87ed965a088780b5bfac15e7d9bb73
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rallies, first_server):
a = b = 0
for r in rallies:
if r == 'A':
a += 1
else:
b += 1
if max(a, b) >= 11 and abs(a - b) >= 2:
return [a, b, r, None]
k = a + b
other = 'B' if first_server == 'A' else 'A'
if a >= 10 and b >= 10:
block = k - 10
else:
block = k // 2
return [a, b, None, first_server if block % 2 == 0 else other]
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 server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('AAABABA', 'B'), [5, 2, None, 'A']),
('regression: two point service block', ('AABBABBBBB', 'B'), [3, 7, None, 'A']),
('variant scenario 1', ('ABABABABABABABABABAB', 'B'), [10, 10, None, 'B']),
('variant scenario 2', ('ABABABABABABABABABBB', 'A'), [9, 11, 'B', None])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('ABABABABABABABABABB', 'A'), [9, 10, None, 'B']),
('regression: two point service block', ('ABABABABABABABABAB', 'B'), [9, 9, None, 'A']),
('variant scenario 1', ('ABABABABABABABABABABAB', 'B'), [11, 11, None, 'B']),
('variant scenario 2', ('ABABABABABABABABABABABABBB', 'A'), [12, 14, 'B', None])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('ABABABABABABABABABB', 'A'), [9, 10, None, 'B']),
('regression: two point service block', ('ABBBA', 'A'), [2, 3, None, 'A']),
('variant scenario 1', ('ABABABABABABABABABAB', 'B'), [10, 10, None, 'B']),
('variant scenario 2', ('ABABABABABABABABABABAB', 'B'), [11, 11, None, 'B'])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('ABABABABABABABABAB', 'B'), [9, 9, None, 'A']),
('regression: two point service block', ('BBAAABAAAAABBBABB', 'B'), [9, 8, None, 'B']),
('variant scenario 1', ('BABAAAAAAAAABBBAAABBABABAABA', 'A'), [11, 5, 'A', None]),
('variant scenario 2', ('BBBAAAABAABABAAABBBABBAABA', 'A'), [11, 9, 'A', None])],
[('control opening server', ('', 'A'), [0, 0, None, 'A']),
('boundary second point same server', ('B', 'A'), [0, 1, None, 'A']),
('boundary change after two points', ('BA', 'A'), [1, 1, None, 'B']),
('boundary ten-all', ('ABABABABABABABABABAB', 'A'), [10, 10, None, 'A']),
('boundary eleven-ten alternates each point',
('ABABABABABABABABABABA', 'A'),
[11, 10, None, 'B']),
('control eleven-nine', ('AAAAAAAAABBBBBBBBBAA', 'B'), [11, 9, 'A', None]),
('regression: two point service block', ('BABBBAABAB', 'B'), [4, 6, None, 'A']),
('regression: two point service block', ('AABAABABBAAABBABABB', 'A'), [10, 9, None, 'B']),
('variant scenario 1', ('ABABABABABABABABABABABBB', 'B'), [11, 13, 'B', None]),
('variant scenario 2', ('BBBBBBABBBBAABABBBBAABAABBAA', 'A'), [3, 11, 'B', None])]]
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 server | [0, 0, None, 'A'] | [0, 0, None, 'A'] | Passed |
| boundary second point same server | [0, 1, None, 'A'] | [0, 1, None, 'A'] | Passed |
| boundary change after two points | [1, 1, None, 'B'] | [1, 1, None, 'B'] | Passed |
| boundary ten-all | [10, 10, None, 'A'] | [10, 10, None, 'A'] | Passed |
| boundary eleven-ten alternates each point | [11, 10, None, 'B'] | [11, 10, None, 'B'] | Passed |
| control eleven-nine | [11, 9, 'A', None] | [11, 9, 'A', None] | Passed |
| regression: two point service block | [5, 2, None, 'A'] | [5, 2, None, 'A'] | Passed |
| regression: two point service block | [3, 7, None, 'A'] | [3, 7, None, 'A'] | Passed |
| variant scenario 1 | [10, 10, None, 'B'] | [10, 10, None, 'B'] | Passed |
| variant scenario 2 | [9, 11, 'B', None] | [9, 11, 'B', None] | Passed |
SHA-256 / 7e1a7be38ef3e449a0043a3dc7a32fc65e14d9d01c8f55655a82edabf8298a78
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:26.462396+00:00.
Case digest / d00237db9413f049b7f137faa55989b790876d1d1800bd51189f85cbbf88f6c7