FAILURE MAP
← Case archive

FA-12756 / Voting rule computation / Open access

A transferred ranking stops at another eliminated candidate · case 01

A transferred ranking stops at another eliminated candidate.

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

ROOT CAUSE

Only the first rank is inspected.

VERIFIED REPAIR

Find the first candidate still active, otherwise exhaust the ballot.

Unsuccessful approach: Skipping exactly one rank still stops before the next active preference.

Case contract

For a unique ranking and active candidate set, return first active candidate or None.

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(ranking, active):
    return ranking[0] if ranking and ranking[0] in active else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('skip multiple eliminated candidates', solve(list(range(N+3)),[N+2]), N+2)
check('first active remains', solve([0,1,2],[0,2]), 0)
check('one eliminated', solve([0,1],[1]), 1)
check('all eliminated', solve([0,1],[]), None)
check('empty ranking', solve([],[0]), None)
check('active order irrelevant', solve([2,1,0],[0,1]), 1)
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
skip multiple eliminated candidatesNone3Failed
first active remains00Passed
one eliminatedNone1Failed
all eliminatedNoneNonePassed
empty rankingNoneNonePassed
active order irrelevantNone1Failed

SHA-256 / ab8197381c4c57359dbe7c1e76ca97b29f5f77c3bde2b2c8b1161750fb751a2e

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(ranking, active):
    r = ranking if ranking and ranking[0] in active else ranking[1:]
    return r[0] if r and r[0] in active else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('skip multiple eliminated candidates', solve(list(range(N+3)),[N+2]), N+2)
check('first active remains', solve([0,1,2],[0,2]), 0)
check('one eliminated', solve([0,1],[1]), 1)
check('all eliminated', solve([0,1],[]), None)
check('empty ranking', solve([],[0]), None)
check('active order irrelevant', solve([2,1,0],[0,1]), 1)
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
skip multiple eliminated candidatesNone3Failed
first active remains00Passed
one eliminated11Passed
all eliminatedNoneNonePassed
empty rankingNoneNonePassed
active order irrelevant11Passed

SHA-256 / 0a27ba936466dcb802783b465eaa6a74a57a658dec3d91e0a20ce291d633de86

3 / The verified repair

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

N = 1
observations = []
def solve(ranking, active):
    return next((c for c in ranking if c in active), None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('skip multiple eliminated candidates', solve(list(range(N+3)),[N+2]), N+2)
check('first active remains', solve([0,1,2],[0,2]), 0)
check('one eliminated', solve([0,1],[1]), 1)
check('all eliminated', solve([0,1],[]), None)
check('empty ranking', solve([],[0]), None)
check('active order irrelevant', solve([2,1,0],[0,1]), 1)
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
skip multiple eliminated candidates33Passed
first active remains00Passed
one eliminated11Passed
all eliminatedNoneNonePassed
empty rankingNoneNonePassed
active order irrelevant11Passed

SHA-256 / e0b9fef46c259f31c4e7cae54fcc66ff9707eb456dea8099bffa2c44bb3a0c9c

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

Case digest / e5cfa04132b505dda8936b813c4ea6747aba82b452030867b22e055a357bb226