FAILURE MAP
← Case archive

FA-12741 / Voting rule computation / Open access

Truncated rankings change the Borda point scale · case 01

Truncated rankings change the Borda point scale.

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

ROOT CAUSE

The number ranked replaces the fixed candidate count.

VERIFIED REPAIR

Award m-1-position to ranked candidates, and zero to unranked candidates.

Unsuccessful approach: Padding unranked candidates assigns them arbitrary positive points.

Case contract

For unique candidate names and a unique partial ranking, return scores in candidate order; ranked position i earns m-1-i and omitted candidates earn zero.

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(candidates, ranking):
    return [len(ranking)-1-ranking.index(c) if c in ranking else 0 for c in candidates]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cs = list(range(N+3))
check('single ranked candidate', solve(cs,[0]), [N+2]+[0]*(N+2))
check('empty ranking', solve(cs,[]), [0]*len(cs))
check('two ranked candidates', solve(cs,[1,0]), [N+1,N+2]+[0]*(N+1))
check('complete ranking', solve([0,1,2],[2,0,1]), [1,0,2])
check('single candidate', solve([0],[0]), [0])
check('omitted candidate retains zero', solve([0,1,2,3],[3,2]), [0,0,2,3])
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
single ranked candidate[0, 0, 0, 0][3, 0, 0, 0]Failed
empty ranking[0, 0, 0, 0][0, 0, 0, 0]Passed
two ranked candidates[0, 1, 0, 0][2, 3, 0, 0]Failed
complete ranking[1, 0, 2][1, 0, 2]Passed
single candidate[0][0]Passed
omitted candidate retains zero[0, 0, 0, 1][0, 0, 2, 3]Failed

SHA-256 / ef8c745d811d166b021d4f0ec75ca0127b8f716043453d1f26e2da18dd69c5e3

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(candidates, ranking):
    full = ranking + [c for c in candidates if c not in ranking]
    return [len(candidates)-1-full.index(c) for c in candidates]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cs = list(range(N+3))
check('single ranked candidate', solve(cs,[0]), [N+2]+[0]*(N+2))
check('empty ranking', solve(cs,[]), [0]*len(cs))
check('two ranked candidates', solve(cs,[1,0]), [N+1,N+2]+[0]*(N+1))
check('complete ranking', solve([0,1,2],[2,0,1]), [1,0,2])
check('single candidate', solve([0],[0]), [0])
check('omitted candidate retains zero', solve([0,1,2,3],[3,2]), [0,0,2,3])
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
single ranked candidate[3, 2, 1, 0][3, 0, 0, 0]Failed
empty ranking[3, 2, 1, 0][0, 0, 0, 0]Failed
two ranked candidates[2, 3, 1, 0][2, 3, 0, 0]Failed
complete ranking[1, 0, 2][1, 0, 2]Passed
single candidate[0][0]Passed
omitted candidate retains zero[1, 0, 2, 3][0, 0, 2, 3]Failed

SHA-256 / 80c592578a8513a3d3613d3a21f0bdadd04160974eaa52672de202149ed63203

3 / The verified repair

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

N = 1
observations = []
def solve(candidates, ranking):
    return [len(candidates)-1-ranking.index(c) if c in ranking else 0 for c in candidates]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cs = list(range(N+3))
check('single ranked candidate', solve(cs,[0]), [N+2]+[0]*(N+2))
check('empty ranking', solve(cs,[]), [0]*len(cs))
check('two ranked candidates', solve(cs,[1,0]), [N+1,N+2]+[0]*(N+1))
check('complete ranking', solve([0,1,2],[2,0,1]), [1,0,2])
check('single candidate', solve([0],[0]), [0])
check('omitted candidate retains zero', solve([0,1,2,3],[3,2]), [0,0,2,3])
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
single ranked candidate[3, 0, 0, 0][3, 0, 0, 0]Passed
empty ranking[0, 0, 0, 0][0, 0, 0, 0]Passed
two ranked candidates[2, 3, 0, 0][2, 3, 0, 0]Passed
complete ranking[1, 0, 2][1, 0, 2]Passed
single candidate[0][0]Passed
omitted candidate retains zero[0, 0, 2, 3][0, 0, 2, 3]Passed

SHA-256 / 7efc2fb0a4b1f8d34bba042e853686bbada3c8b09823af8951330e090c6f4c4d

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.697261+00:00.

Case digest / c406bba74456505f5811b542d2c7841d5616f78151a7e091210920d2375a5b1c