FAILURE MAP
← Case archive

FA-48866 / PCM sample encoding / Open access

Subbyte code reader: prefix consumption · case 01

Reader consumes the sync prefix as a sample field.

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

ROOT CAUSE

Reader consumes the sync prefix as a sample field.

VERIFIED REPAIR

Use the stated conversion contract at prefix consumption.

Unsuccessful approach: Treating a bit offset as an octet count starts inside sync.

Case contract

Read up to declared unsigned packed fields after a bit prefix; incomplete fields are ignored, and report cursor in bits from packet start.

Why this case matters

Offline PCM interchange uses these exact bounded packet and sample representation decisions.

1 / The failure

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

N = 1
observations = []
def solve(octets, width, count, prefix_bits):
    bits = [(byte >> (7-j)) & 1 for byte in octets for j in range(8)]
    bits = bits[:]
    available = len(bits)//width
    count = min(count,available)
    values=[]
    for i in range(count):
        values.append(sum(bits[i*width+j] << (width-1-j) for j in range(width)))
    consumed = prefix_bits+count*width
    return [values,consumed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([179, 144], 3, 3, 2)), [[6, 3, 4], 11])
check('oracle 2', solve(*([255], 2, 2, 0)), [[3, 3], 4])
check('oracle 3', solve(*([0], 1, 8, 0)), [[0, 0, 0, 0, 0, 0, 0, 0], 8])
check('oracle 4', solve(*([], 3, 0, 0)), [[], 0])
check('oracle 5', solve(*([160], 3, 1, 1)), [[2], 4])
check('oracle 6', solve(*([18, 52], 4, 2, 4)), [[2, 3], 12])
check('oracle 7', solve(*([255], 3, 5, 1)), [[7, 7], 7])
if N == 1: check('variant packet 1', solve(*[[179, 144, 179, 144], 3, 6, 2]), [[6, 3, 4, 4, 1, 3], 20])
if N == 2: check('variant packet 2', solve(*[[179, 144, 179, 144, 179, 144], 3, 9, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2], 29])
if N == 3: check('variant packet 3', solve(*[[179, 144, 179, 144, 179, 144, 179, 144], 3, 12, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2, 0, 5, 4], 38])
if N == 4: check('variant packet 4', solve(*[[179, 144, 179, 144, 179, 144, 179, 144, 179, 144], 3, 15, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2, 0, 5, 4, 7, 1, 0], 47])
if N == 5: check('variant packet 5', solve(*[[179, 144, 179, 144, 179, 144, 179, 144, 179, 144, 179, 144], 3, 18, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2, 0, 5, 4, 7, 1, 0, 2, 6, 3], 56])
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
oracle 1[[5, 4, 7], 11][[6, 3, 4], 11]Failed
oracle 2[[3, 3], 4][[3, 3], 4]Passed
oracle 3[[0, 0, 0, 0, 0, 0, 0, 0], 8][[0, 0, 0, 0, 0, 0, 0, 0], 8]Passed
oracle 4[[], 0][[], 0]Passed
oracle 5[[5], 4][[2], 4]Failed
oracle 6[[1, 2], 12][[2, 3], 12]Failed
oracle 7[[7, 7], 7][[7, 7], 7]Passed
variant packet 1[[5, 4, 7, 1, 0, 2], 20][[6, 3, 4, 4, 1, 3], 20]Failed

SHA-256 / b32c8982d8a0bcb07a2890cdf10f10d0c5032d071891529f48efac5dd317b742

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(octets, width, count, prefix_bits):
    bits = [(byte >> (7-j)) & 1 for byte in octets for j in range(8)]
    bits = bits[prefix_bits//8:]
    available = len(bits)//width
    count = min(count,available)
    values=[]
    for i in range(count):
        values.append(sum(bits[i*width+j] << (width-1-j) for j in range(width)))
    consumed = prefix_bits+count*width
    return [values,consumed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([179, 144], 3, 3, 2)), [[6, 3, 4], 11])
check('oracle 2', solve(*([255], 2, 2, 0)), [[3, 3], 4])
check('oracle 3', solve(*([0], 1, 8, 0)), [[0, 0, 0, 0, 0, 0, 0, 0], 8])
check('oracle 4', solve(*([], 3, 0, 0)), [[], 0])
check('oracle 5', solve(*([160], 3, 1, 1)), [[2], 4])
check('oracle 6', solve(*([18, 52], 4, 2, 4)), [[2, 3], 12])
check('oracle 7', solve(*([255], 3, 5, 1)), [[7, 7], 7])
if N == 1: check('variant packet 1', solve(*[[179, 144, 179, 144], 3, 6, 2]), [[6, 3, 4, 4, 1, 3], 20])
if N == 2: check('variant packet 2', solve(*[[179, 144, 179, 144, 179, 144], 3, 9, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2], 29])
if N == 3: check('variant packet 3', solve(*[[179, 144, 179, 144, 179, 144, 179, 144], 3, 12, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2, 0, 5, 4], 38])
if N == 4: check('variant packet 4', solve(*[[179, 144, 179, 144, 179, 144, 179, 144, 179, 144], 3, 15, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2, 0, 5, 4, 7, 1, 0], 47])
if N == 5: check('variant packet 5', solve(*[[179, 144, 179, 144, 179, 144, 179, 144, 179, 144, 179, 144], 3, 18, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2, 0, 5, 4, 7, 1, 0, 2, 6, 3], 56])
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
oracle 1[[5, 4, 7], 11][[6, 3, 4], 11]Failed
oracle 2[[3, 3], 4][[3, 3], 4]Passed
oracle 3[[0, 0, 0, 0, 0, 0, 0, 0], 8][[0, 0, 0, 0, 0, 0, 0, 0], 8]Passed
oracle 4[[], 0][[], 0]Passed
oracle 5[[5], 4][[2], 4]Failed
oracle 6[[1, 2], 12][[2, 3], 12]Failed
oracle 7[[7, 7], 7][[7, 7], 7]Passed
variant packet 1[[5, 4, 7, 1, 0, 2], 20][[6, 3, 4, 4, 1, 3], 20]Failed

SHA-256 / 9f4fa0f55b8768dc502a190b34357b0d27f61de51c2a0b65f4e1de5bf2dbfdda

3 / The verified repair

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

N = 1
observations = []
def solve(octets, width, count, prefix_bits):
    bits = [(byte >> (7-j)) & 1 for byte in octets for j in range(8)]
    bits = bits[prefix_bits:]
    available = len(bits)//width
    count = min(count,available)
    values=[]
    for i in range(count):
        values.append(sum(bits[i*width+j] << (width-1-j) for j in range(width)))
    consumed = prefix_bits+count*width
    return [values,consumed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([179, 144], 3, 3, 2)), [[6, 3, 4], 11])
check('oracle 2', solve(*([255], 2, 2, 0)), [[3, 3], 4])
check('oracle 3', solve(*([0], 1, 8, 0)), [[0, 0, 0, 0, 0, 0, 0, 0], 8])
check('oracle 4', solve(*([], 3, 0, 0)), [[], 0])
check('oracle 5', solve(*([160], 3, 1, 1)), [[2], 4])
check('oracle 6', solve(*([18, 52], 4, 2, 4)), [[2, 3], 12])
check('oracle 7', solve(*([255], 3, 5, 1)), [[7, 7], 7])
if N == 1: check('variant packet 1', solve(*[[179, 144, 179, 144], 3, 6, 2]), [[6, 3, 4, 4, 1, 3], 20])
if N == 2: check('variant packet 2', solve(*[[179, 144, 179, 144, 179, 144], 3, 9, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2], 29])
if N == 3: check('variant packet 3', solve(*[[179, 144, 179, 144, 179, 144, 179, 144], 3, 12, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2, 0, 5, 4], 38])
if N == 4: check('variant packet 4', solve(*[[179, 144, 179, 144, 179, 144, 179, 144, 179, 144], 3, 15, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2, 0, 5, 4, 7, 1, 0], 47])
if N == 5: check('variant packet 5', solve(*[[179, 144, 179, 144, 179, 144, 179, 144, 179, 144, 179, 144], 3, 18, 2]), [[6, 3, 4, 4, 1, 3, 1, 6, 2, 0, 5, 4, 7, 1, 0, 2, 6, 3], 56])
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
oracle 1[[6, 3, 4], 11][[6, 3, 4], 11]Passed
oracle 2[[3, 3], 4][[3, 3], 4]Passed
oracle 3[[0, 0, 0, 0, 0, 0, 0, 0], 8][[0, 0, 0, 0, 0, 0, 0, 0], 8]Passed
oracle 4[[], 0][[], 0]Passed
oracle 5[[2], 4][[2], 4]Passed
oracle 6[[2, 3], 12][[2, 3], 12]Passed
oracle 7[[7, 7], 7][[7, 7], 7]Passed
variant packet 1[[6, 3, 4, 4, 1, 3], 20][[6, 3, 4, 4, 1, 3], 20]Passed

SHA-256 / cd726691cc1aff69384aab8691bb0919dabb00a31cadcbed47a90409541c3525

Verification & scope

Stipulated finite model; no claim of hardware timing or full file-format conformance. 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:44:54.652210+00:00.

Case digest / 51e70f3ecd05f522e7e218aa24cd6c60d0698746c11b6b3619bf6783ec29d1c1