FAILURE MAP
← Case archive

FA-12811 / Tournament pairing rules / Open access

Incomplete mini-league produces a head-to-head ranking · case 01

Incomplete mini-league produces a head-to-head ranking.

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

ROOT CAUSE

Head-to-head ordering is used before every pair in the tied group has met.

VERIFIED REPAIR

Games contain distinct endpoints and an endpoint winner. Rank by wins then id only when every unordered pair in players has met; otherwise None. Outside games are ignored.

Unsuccessful approach: Counting game records allows duplicate or outside games to mask missing pairs.

Case contract

Synthetic model: Games contain distinct endpoints and an endpoint winner. Rank by wins then id only when every unordered pair in players has met; otherwise None. Outside games are ignored.

Why this case matters

Makes the stated pairing or standings policy executable without assuming any real federation rulebook.

1 / The failure

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

N = 1
observations = []
def solve(players, games):
    points={p:0 for p in players}
    for a,b,w in games:
        if a in points and b in points: points[w]+=1
    return sorted(players,key=lambda p:(-points[p],p))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing encounter', solve([N,N+1,N+2], [(N,N+1,N)]), None)
check('duplicates hide missing', solve([N,N+1,N+2], [(N,N+1,N)]*3), None)
check('outsider does not fill gap', solve([N,N+1], [(N+2,N+3,N+2)]), None)
check('complete two', solve([N,N+1], [(N,N+1,N+1)]), [N+1,N])
check('singleton', solve([N], []), [N])
check('empty', solve([], []), [])
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
missing encounter[1, 2, 3]NoneFailed
duplicates hide missing[1, 2, 3]NoneFailed
outsider does not fill gap[1, 2]NoneFailed
complete two[2, 1][2, 1]Passed
singleton[1][1]Passed
empty[][]Passed

SHA-256 / 372a42aca324eb608beb7ac8637acaeab9e84fe723ade5f98b3751e44e727526

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(players, games):
    points={p:0 for p in players}
    for a,b,w in games:
        if a in points and b in points: points[w]+=1
    if len(games)<len(players)*(len(players)-1)//2: return None
    return sorted(players,key=lambda p:(-points[p],p))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing encounter', solve([N,N+1,N+2], [(N,N+1,N)]), None)
check('duplicates hide missing', solve([N,N+1,N+2], [(N,N+1,N)]*3), None)
check('outsider does not fill gap', solve([N,N+1], [(N+2,N+3,N+2)]), None)
check('complete two', solve([N,N+1], [(N,N+1,N+1)]), [N+1,N])
check('singleton', solve([N], []), [N])
check('empty', solve([], []), [])
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
missing encounterNoneNonePassed
duplicates hide missing[1, 2, 3]NoneFailed
outsider does not fill gap[1, 2]NoneFailed
complete two[2, 1][2, 1]Passed
singleton[1][1]Passed
empty[][]Passed

SHA-256 / 43190be3ecc03030125706c1235ba0c8975f8ca945adbad29c2fa38b8cdb62f8

3 / The verified repair

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

N = 1
observations = []
def solve(players, games):
    points={p:0 for p in players}; seen=set()
    for a,b,w in games:
        if a in points and b in points:
            seen.add(tuple(sorted([a,b]))); points[w]+=1
    if len(seen)!=len(players)*(len(players)-1)//2: return None
    return sorted(players,key=lambda p:(-points[p],p))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing encounter', solve([N,N+1,N+2], [(N,N+1,N)]), None)
check('duplicates hide missing', solve([N,N+1,N+2], [(N,N+1,N)]*3), None)
check('outsider does not fill gap', solve([N,N+1], [(N+2,N+3,N+2)]), None)
check('complete two', solve([N,N+1], [(N,N+1,N+1)]), [N+1,N])
check('singleton', solve([N], []), [N])
check('empty', solve([], []), [])
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
missing encounterNoneNonePassed
duplicates hide missingNoneNonePassed
outsider does not fill gapNoneNonePassed
complete two[2, 1][2, 1]Passed
singleton[1][1]Passed
empty[][]Passed

SHA-256 / c22e0fe8820f70dd18ba2c645643975259cfb31482a6d1555861cefd1c711a44

Verification & scope

Controlled synthetic policy; does not implement an entire tournament system. 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:39:00.396011+00:00.

Case digest / a99cad63209004bce17dfecb420a1fe72f23c128dfef14d017b272134e0108df