FAILURE MAP
← Case archive

FA-11631 / Compression format semantics / Open access

Move-to-front decoder updates the wrong position · case 01

Move-to-front decoder updates the wrong position.

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

ROOT CAUSE

The alphabet remains static after emitted symbols.

VERIFIED REPAIR

Remove the symbol at the requested current rank and insert that same symbol at the front before decoding the next rank.

Unsuccessful approach: Moving a decoded symbol to the back applies the opposite update rule.

Case contract

Decode valid ranks against a unique-symbol alphabet; emit selected symbol and move it to the front after each selection.

Why this case matters

A small offline codec model isolates a compression-specific failure without external files or libraries.

1 / The failure

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

N = 1
observations = []
def solve(alphabet, ranks):
    return ''.join(alphabet[i] for i in ranks)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat front',solve('abc',[2]+[0]*N),'c'*(N+1))
check('empty',solve('abc',[]),'')
check('first',solve('abc',[0]),'a')
check('middle twice',solve('abc',[1,1]),'ba')
check('last twice',solve('abc',[2,2]),'cb')
check('single alphabet',solve('x',[0,0]),'xx')
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
repeat frontcaccFailed
emptyPassed
firstaaPassed
middle twicebbbaFailed
last twicecccbFailed
single alphabetxxxxPassed

SHA-256 / c307a1580c00fbb6cee945fce0a59e93d6c58980bd2b53ac421e376c7a7d0d73

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(alphabet, ranks):
    a=list(alphabet); out=''
    for i in ranks:
        s=a.pop(i); out+=s; a.append(s)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat front',solve('abc',[2]+[0]*N),'c'*(N+1))
check('empty',solve('abc',[]),'')
check('first',solve('abc',[0]),'a')
check('middle twice',solve('abc',[1,1]),'ba')
check('last twice',solve('abc',[2,2]),'cb')
check('single alphabet',solve('x',[0,0]),'xx')
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
repeat frontcaccFailed
emptyPassed
firstaaPassed
middle twicebcbaFailed
last twicecccbFailed
single alphabetxxxxPassed

SHA-256 / a8b97745f030a21947297d20fc99b2753faf42845bc92482e3ad75a7d0a867c1

3 / The verified repair

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

N = 1
observations = []
def solve(alphabet, ranks):
    a=list(alphabet); out=''
    for i in ranks:
        s=a.pop(i); out+=s; a.insert(0,s)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat front',solve('abc',[2]+[0]*N),'c'*(N+1))
check('empty',solve('abc',[]),'')
check('first',solve('abc',[0]),'a')
check('middle twice',solve('abc',[1,1]),'ba')
check('last twice',solve('abc',[2,2]),'cb')
check('single alphabet',solve('x',[0,0]),'xx')
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
repeat frontccccPassed
emptyPassed
firstaaPassed
middle twicebabaPassed
last twicecbcbPassed
single alphabetxxxxPassed

SHA-256 / ccf333118a98efa13ef7dca6882d678af6f98c4fcc3d30e25ee45f6671024064

Verification & scope

Controlled educational model, not a complete implementation of a production compression format. 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:49.658574+00:00.

Case digest / 6d4ab19b615e6772ab3355f67e997091b3263490cd0670655714069aab479ee1