FAILURE MAP
← Case archive

FA-83886 / Sports scoring and tiebreakers / Open access

Set at six-all continues as an advantage set · case 01

A set that went to a tiebreak is reported as 8-6 or longer instead of 7-6.

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

ROOT CAUSE

The set closure test only checks for a two-game lead and never closes at seven games.

THE FAILURE

The set closure test only checks for a two-game lead and never closes at seven games.

Unsuccessful approach: Closing the set when twelve games have been played ends it at 6-6 and credits the wrong player.

Case contract

games is a string of game winners (A/B); best_of is 3 or 5. A set is won by the first player to 6 games with a lead of two, or at 7 games (7-5, or 7-6 after the tiebreak game played at 6-6). The match ends when a player has won best_of // 2 + 1 sets; later games are ignored. Return [set scores as "a-b" strings in A-B order, match winner or None]; an unfinished set with at least one game is appended as its current score.

Why this case matters

Tournament live-results feeds reconstruct set scores from game-level events.

1 / The failure

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

N = 1
observations = []
def solve(games, best_of):
    sets = []
    a = b = 0
    won = {'A': 0, 'B': 0}
    need = best_of // 2 + 1
    for g in games:
        if g == 'A':
            a += 1
        else:
            b += 1
        if (max(a, b) >= 6 and abs(a - b) >= 2):
            w = 'A' if a > b else 'B'
            won[w] += 1
            sets.append('%d-%d' % (a, b))
            a = b = 0
            if won[w] == need:
                return [sets, w]
    if a or b:
        sets.append('%d-%d' % (a, b))
    return [sets, None]
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 bagel set', ('AAAAAA', 3), [['6-0'], None]),
  ('boundary seven-five', ('AAAAABBBBBAA', 3), [['7-5'], None]),
  ('boundary tiebreak set', ('AAAAABBBBBABB', 3), [['6-7'], None]),
  ('control straight sets', ('AAAAAAAAAAAA', 3), [['6-0', '6-0'], 'A']),
  ('control in-progress set', ('AAAAAAB', 3), [['6-0', '0-1'], None]),
  ('control empty', ('', 5), [[], None]),
  ('regression: tiebreak set closure', ('AAABAABBBAABABABABBABAA', 3), [['6-4', '7-6'], 'A']),
  ('variant scenario 1', ('AAAAAA', 5), [['6-0'], None]),
  ('variant scenario 2', ('AAABBBAAAABBAAAAAAAAABABAA', 3), [['6-3', '6-2'], 'A'])],
 [('control bagel set', ('AAAAAA', 3), [['6-0'], None]),
  ('boundary seven-five', ('AAAAABBBBBAA', 3), [['7-5'], None]),
  ('boundary tiebreak set', ('AAAAABBBBBABB', 3), [['6-7'], None]),
  ('control straight sets', ('AAAAAAAAAAAA', 3), [['6-0', '6-0'], 'A']),
  ('control in-progress set', ('AAAAAAB', 3), [['6-0', '0-1'], None]),
  ('control empty', ('', 5), [[], None]),
  ('regression: tiebreak set closure',
   ('BAAABBBBAABABAAAABABBAB', 5),
   [['6-7', '6-3', '0-1'], None]),
  ('variant scenario 1', ('ABBBAABABBA', 5), [['4-6', '1-0'], None]),
  ('variant scenario 2', ('ABABAA', 3), [['4-2'], None])],
 [('control bagel set', ('AAAAAA', 3), [['6-0'], None]),
  ('boundary seven-five', ('AAAAABBBBBAA', 3), [['7-5'], None]),
  ('boundary tiebreak set', ('AAAAABBBBBABB', 3), [['6-7'], None]),
  ('control straight sets', ('AAAAAAAAAAAA', 3), [['6-0', '6-0'], 'A']),
  ('control in-progress set', ('AAAAAAB', 3), [['6-0', '0-1'], None]),
  ('control empty', ('', 5), [[], None]),
  ('regression: tiebreak set closure',
   ('AABAABBBBAABBABABAABABABABBA', 3),
   [['6-7', '6-4', '2-3'], None]),
  ('variant scenario 1', ('ABBABABBBABBBABAB', 5), [['3-6', '3-5'], None]),
  ('variant scenario 2', ('BBABBAAAAABBAAABBABAABABBBAAAABAAA', 3), [['6-4', '7-6'], 'A'])],
 [('control bagel set', ('AAAAAA', 3), [['6-0'], None]),
  ('boundary seven-five', ('AAAAABBBBBAA', 3), [['7-5'], None]),
  ('boundary tiebreak set', ('AAAAABBBBBABB', 3), [['6-7'], None]),
  ('control straight sets', ('AAAAAAAAAAAA', 3), [['6-0', '6-0'], 'A']),
  ('control in-progress set', ('AAAAAAB', 3), [['6-0', '0-1'], None]),
  ('control empty', ('', 5), [[], None]),
  ('regression: tiebreak set closure', ('BABABABBAAABBBBBB', 3), [['6-7', '0-4'], None]),
  ('variant scenario 1',
   ('AABAABBBAAAAABBBBAAABABBABBBABAAABABBAAABBABABAABB', 5),
   [['6-4', '6-4', '2-6', '6-4'], 'A']),
  ('variant scenario 2', ('BABAABAAAAABAABAAABABBBA', 3), [['6-3', '6-2'], 'A'])],
 [('control bagel set', ('AAAAAA', 3), [['6-0'], None]),
  ('boundary seven-five', ('AAAAABBBBBAA', 3), [['7-5'], None]),
  ('boundary tiebreak set', ('AAAAABBBBBABB', 3), [['6-7'], None]),
  ('control straight sets', ('AAAAAAAAAAAA', 3), [['6-0', '6-0'], 'A']),
  ('control in-progress set', ('AAAAAAB', 3), [['6-0', '0-1'], None]),
  ('control empty', ('', 5), [[], None]),
  ('regression: tiebreak set closure',
   ('BBAABABBBBAAAABABBBBABABABAABBABAAABBAAAABAB', 3),
   [['3-6', '6-7'], 'B']),
  ('variant scenario 1',
   ('AAAAABBAAAABBABBBBABAAAAABBAAAAABBAAAA', 5),
   [['6-2', '4-6', '6-1', '6-4'], 'A']),
  ('variant scenario 2',
   ('BABABBAAAAAABABAAAABAAAABAAABAABBBABAAABBBAABABABAAAB', 5),
   [['6-4', '6-2', '6-2'], 'A'])]]
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 bagel set[['6-0'], None][['6-0'], None]Passed
boundary seven-five[['7-5'], None][['7-5'], None]Passed
boundary tiebreak set[['6-7'], None][['6-7'], None]Passed
control straight sets[['6-0', '6-0'], 'A'][['6-0', '6-0'], 'A']Passed
control in-progress set[['6-0', '0-1'], None][['6-0', '0-1'], None]Passed
control empty[[], None][[], None]Passed
regression: tiebreak set closure[['6-4', '7-6'], None][['6-4', '7-6'], 'A']Failed
variant scenario 1[['6-0'], None][['6-0'], None]Passed
variant scenario 2[['6-3', '6-2'], 'A'][['6-3', '6-2'], 'A']Passed

SHA-256 / 9d20d22879c2bb517fbfa460d07d8b99a8a6fe50a1a34f97c2256c0a5f848c25

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(games, best_of):
    sets = []
    a = b = 0
    won = {'A': 0, 'B': 0}
    need = best_of // 2 + 1
    for g in games:
        if g == 'A':
            a += 1
        else:
            b += 1
        if (max(a, b) >= 6 and abs(a - b) >= 2) or a + b == 12:
            w = 'A' if a > b else 'B'
            won[w] += 1
            sets.append('%d-%d' % (a, b))
            a = b = 0
            if won[w] == need:
                return [sets, w]
    if a or b:
        sets.append('%d-%d' % (a, b))
    return [sets, None]
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 bagel set', ('AAAAAA', 3), [['6-0'], None]),
  ('boundary seven-five', ('AAAAABBBBBAA', 3), [['7-5'], None]),
  ('boundary tiebreak set', ('AAAAABBBBBABB', 3), [['6-7'], None]),
  ('control straight sets', ('AAAAAAAAAAAA', 3), [['6-0', '6-0'], 'A']),
  ('control in-progress set', ('AAAAAAB', 3), [['6-0', '0-1'], None]),
  ('control empty', ('', 5), [[], None]),
  ('regression: tiebreak set closure', ('AAABAABBBAABABABABBABAA', 3), [['6-4', '7-6'], 'A']),
  ('variant scenario 1', ('AAAAAA', 5), [['6-0'], None]),
  ('variant scenario 2', ('AAABBBAAAABBAAAAAAAAABABAA', 3), [['6-3', '6-2'], 'A'])],
 [('control bagel set', ('AAAAAA', 3), [['6-0'], None]),
  ('boundary seven-five', ('AAAAABBBBBAA', 3), [['7-5'], None]),
  ('boundary tiebreak set', ('AAAAABBBBBABB', 3), [['6-7'], None]),
  ('control straight sets', ('AAAAAAAAAAAA', 3), [['6-0', '6-0'], 'A']),
  ('control in-progress set', ('AAAAAAB', 3), [['6-0', '0-1'], None]),
  ('control empty', ('', 5), [[], None]),
  ('regression: tiebreak set closure',
   ('BAAABBBBAABABAAAABABBAB', 5),
   [['6-7', '6-3', '0-1'], None]),
  ('variant scenario 1', ('ABBBAABABBA', 5), [['4-6', '1-0'], None]),
  ('variant scenario 2', ('ABABAA', 3), [['4-2'], None])],
 [('control bagel set', ('AAAAAA', 3), [['6-0'], None]),
  ('boundary seven-five', ('AAAAABBBBBAA', 3), [['7-5'], None]),
  ('boundary tiebreak set', ('AAAAABBBBBABB', 3), [['6-7'], None]),
  ('control straight sets', ('AAAAAAAAAAAA', 3), [['6-0', '6-0'], 'A']),
  ('control in-progress set', ('AAAAAAB', 3), [['6-0', '0-1'], None]),
  ('control empty', ('', 5), [[], None]),
  ('regression: tiebreak set closure',
   ('AABAABBBBAABBABABAABABABABBA', 3),
   [['6-7', '6-4', '2-3'], None]),
  ('variant scenario 1', ('ABBABABBBABBBABAB', 5), [['3-6', '3-5'], None]),
  ('variant scenario 2', ('BBABBAAAAABBAAABBABAABABBBAAAABAAA', 3), [['6-4', '7-6'], 'A'])],
 [('control bagel set', ('AAAAAA', 3), [['6-0'], None]),
  ('boundary seven-five', ('AAAAABBBBBAA', 3), [['7-5'], None]),
  ('boundary tiebreak set', ('AAAAABBBBBABB', 3), [['6-7'], None]),
  ('control straight sets', ('AAAAAAAAAAAA', 3), [['6-0', '6-0'], 'A']),
  ('control in-progress set', ('AAAAAAB', 3), [['6-0', '0-1'], None]),
  ('control empty', ('', 5), [[], None]),
  ('regression: tiebreak set closure', ('BABABABBAAABBBBBB', 3), [['6-7', '0-4'], None]),
  ('variant scenario 1',
   ('AABAABBBAAAAABBBBAAABABBABBBABAAABABBAAABBABABAABB', 5),
   [['6-4', '6-4', '2-6', '6-4'], 'A']),
  ('variant scenario 2', ('BABAABAAAAABAABAAABABBBA', 3), [['6-3', '6-2'], 'A'])],
 [('control bagel set', ('AAAAAA', 3), [['6-0'], None]),
  ('boundary seven-five', ('AAAAABBBBBAA', 3), [['7-5'], None]),
  ('boundary tiebreak set', ('AAAAABBBBBABB', 3), [['6-7'], None]),
  ('control straight sets', ('AAAAAAAAAAAA', 3), [['6-0', '6-0'], 'A']),
  ('control in-progress set', ('AAAAAAB', 3), [['6-0', '0-1'], None]),
  ('control empty', ('', 5), [[], None]),
  ('regression: tiebreak set closure',
   ('BBAABABBBBAAAABABBBBABABABAABBABAAABBAAAABAB', 3),
   [['3-6', '6-7'], 'B']),
  ('variant scenario 1',
   ('AAAAABBAAAABBABBBBABAAAAABBAAAAABBAAAA', 5),
   [['6-2', '4-6', '6-1', '6-4'], 'A']),
  ('variant scenario 2',
   ('BABABBAAAAAABABAAAABAAAABAAABAABBBABAAABBBAABABABAAAB', 5),
   [['6-4', '6-2', '6-2'], 'A'])]]
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 bagel set[['6-0'], None][['6-0'], None]Passed
boundary seven-five[['7-5'], None][['7-5'], None]Passed
boundary tiebreak set[['6-6', '0-1'], None][['6-7'], None]Failed
control straight sets[['6-0', '6-0'], 'A'][['6-0', '6-0'], 'A']Passed
control in-progress set[['6-0', '0-1'], None][['6-0', '0-1'], None]Passed
control empty[[], None][[], None]Passed
regression: tiebreak set closure[['6-4', '6-6', '1-0'], None][['6-4', '7-6'], 'A']Failed
variant scenario 1[['6-0'], None][['6-0'], None]Passed
variant scenario 2[['6-3', '6-2'], 'A'][['6-3', '6-2'], 'A']Passed

SHA-256 / 54df5e172488cad5e3bae0961810bf003db73b32520bebb871ddcf62ab6cf748

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 9 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:25.857343+00:00.

Case digest / e944837e23468943af07361c2dc1beb7554496d0ddfcf7799ed2ae16883e7747