FAILURE MAP
← Case archive

FA-12746 / Voting rule computation / Open access

Two omitted candidates acquire a fictitious pairwise preference · case 01

Two omitted candidates acquire a fictitious pairwise preference.

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

ROOT CAUSE

A missing candidate receives an ordinary rank index.

VERIFIED REPAIR

Treat omitted candidates as tied below every ranked candidate.

Unsuccessful approach: Counting a tie as a preference awards both-omitted ballots to the first candidate.

Case contract

Return number of partial unique rankings preferring a over b; both omitted are tied, one ranked beats one omitted.

Why this case matters

A deterministic toy ballot model makes the stated counting convention executable.

1 / The failure

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

N = 1
observations = []
def solve(ballots, a, b):
    return sum((r.index(a) if a in r else -1) < (r.index(b) if b in r else -1) for r in ballots)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ranked beats missing', solve([[0]]*N,0,1), N)
check('both missing tie', solve([[]]*N,0,1), 0)
check('missing loses', solve([[1]]*N,0,1), 0)
check('rank order', solve([[1,0],[0,1]],0,1), 1)
check('unrelated rank', solve([[2],[2,0]],0,1), 1)
check('no ballots', solve([],0,1), 0)
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
ranked beats missing01Failed
both missing tie00Passed
missing loses10Failed
rank order11Passed
unrelated rank01Failed
no ballots00Passed

SHA-256 / 9364b025e32e149a33fe7ee9c647f55188ab115087402595e14c7406284b02ea

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(ballots, a, b):
    return sum((r.index(a) if a in r else len(r)) <= (r.index(b) if b in r else len(r)) for r in ballots)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ranked beats missing', solve([[0]]*N,0,1), N)
check('both missing tie', solve([[]]*N,0,1), 0)
check('missing loses', solve([[1]]*N,0,1), 0)
check('rank order', solve([[1,0],[0,1]],0,1), 1)
check('unrelated rank', solve([[2],[2,0]],0,1), 1)
check('no ballots', solve([],0,1), 0)
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
ranked beats missing11Passed
both missing tie10Failed
missing loses00Passed
rank order11Passed
unrelated rank21Failed
no ballots00Passed

SHA-256 / d4c99e15ffc133b82e2033c7243977efd9c83b6a760083dc74eecacb375ff6ae

3 / The verified repair

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

N = 1
observations = []
def solve(ballots, a, b):
    return sum((r.index(a) if a in r else len(r)) < (r.index(b) if b in r else len(r)) for r in ballots)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ranked beats missing', solve([[0]]*N,0,1), N)
check('both missing tie', solve([[]]*N,0,1), 0)
check('missing loses', solve([[1]]*N,0,1), 0)
check('rank order', solve([[1,0],[0,1]],0,1), 1)
check('unrelated rank', solve([[2],[2,0]],0,1), 1)
check('no ballots', solve([],0,1), 0)
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
ranked beats missing11Passed
both missing tie00Passed
missing loses00Passed
rank order11Passed
unrelated rank11Passed
no ballots00Passed

SHA-256 / 90935265adedb4cd7045739e95fcc75d4f59d70e44ab8d15c4b3691f23217097

Verification & scope

Abstract counting rules only; excludes jurisdictional law, ballot authentication and election operations. 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:38:59.790775+00:00.

Case digest / 47da9eaa14ac80be453393847de0c76279a0a0422fcd3d31789e1a957def06a8