FAILURE MAP
← Case archive

FA-11616 / Compression format semantics / Open access

Padding bits are decoded as extra compressed symbols · case 01

Padding bits are decoded as extra compressed symbols.

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

ROOT CAUSE

A decoder returns every physical bit instead of the declared logical symbol count.

VERIFIED REPAIR

Use the declared symbol count as the decoding bound; neither physical padding nor symbol values determine termination.

Unsuccessful approach: Removing trailing zeros also removes valid final zero symbols.

Case contract

Decode exactly count one-bit symbols from integer bytes in LSB order. Count is valid and padding is ignored.

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(data, count):
    return [(v>>j)&1 for v in data for j in range(8)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('valid zero suffix',solve([1],N+1),[1]+[0]*N)
check('no symbols',solve([],0),[])
check('padding can be set',solve([255],1),[1])
check('whole byte',solve([255],8),[1]*8)
check('all zero symbols',solve([0],3),[0,0,0])
check('cross byte',solve([255,1],9),[1]*9)
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
valid zero suffix[1, 0, 0, 0, 0, 0, 0, 0][1, 0]Failed
no symbols[][]Passed
padding can be set[1, 1, 1, 1, 1, 1, 1, 1][1]Failed
whole byte[1, 1, 1, 1, 1, 1, 1, 1][1, 1, 1, 1, 1, 1, 1, 1]Passed
all zero symbols[0, 0, 0, 0, 0, 0, 0, 0][0, 0, 0]Failed
cross byte[1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0][1, 1, 1, 1, 1, 1, 1, 1, 1]Failed

SHA-256 / 16ba8a322939c1fa867c4b4bc1d4384215fd1959ad006fdc74bae22a5f4274b2

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(data, count):
    bits=[(v>>j)&1 for v in data for j in range(8)]
    while bits and bits[-1]==0: bits.pop()
    return bits
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('valid zero suffix',solve([1],N+1),[1]+[0]*N)
check('no symbols',solve([],0),[])
check('padding can be set',solve([255],1),[1])
check('whole byte',solve([255],8),[1]*8)
check('all zero symbols',solve([0],3),[0,0,0])
check('cross byte',solve([255,1],9),[1]*9)
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
valid zero suffix[1][1, 0]Failed
no symbols[][]Passed
padding can be set[1, 1, 1, 1, 1, 1, 1, 1][1]Failed
whole byte[1, 1, 1, 1, 1, 1, 1, 1][1, 1, 1, 1, 1, 1, 1, 1]Passed
all zero symbols[][0, 0, 0]Failed
cross byte[1, 1, 1, 1, 1, 1, 1, 1, 1][1, 1, 1, 1, 1, 1, 1, 1, 1]Passed

SHA-256 / 4a6f74b12131ccb69666a4251a23af3d1ded0ee90b4c91d4ba21d609ea975d80

3 / The verified repair

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

N = 1
observations = []
def solve(data, count):
    return [(data[i//8]>>(i%8))&1 for i in range(count)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('valid zero suffix',solve([1],N+1),[1]+[0]*N)
check('no symbols',solve([],0),[])
check('padding can be set',solve([255],1),[1])
check('whole byte',solve([255],8),[1]*8)
check('all zero symbols',solve([0],3),[0,0,0])
check('cross byte',solve([255,1],9),[1]*9)
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
valid zero suffix[1, 0][1, 0]Passed
no symbols[][]Passed
padding can be set[1][1]Passed
whole byte[1, 1, 1, 1, 1, 1, 1, 1][1, 1, 1, 1, 1, 1, 1, 1]Passed
all zero symbols[0, 0, 0][0, 0, 0]Passed
cross byte[1, 1, 1, 1, 1, 1, 1, 1, 1][1, 1, 1, 1, 1, 1, 1, 1, 1]Passed

SHA-256 / aa32cdb2b3bc1633dd44cb33759e8a0fcd2c59decffdcae39247557fcfff5139

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

Case digest / 18c076f7d37ce49f7edacc01858862f0d772a34eaf845d7b49d94129f44e4017