FAILURE MAP
← Case archive

FA-48871 / PCM sample encoding / Open access

Subbyte code reader: available fields · case 01

Available packed samples are counted as octets.

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

ROOT CAUSE

Available packed samples are counted as octets.

VERIFIED REPAIR

Use the stated conversion contract at available fields.

Unsuccessful approach: Dropping one field avoids overread but loses a complete final sample.

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[prefix_bits:]
    available = len(bits)//8
    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], 5][[6, 3, 4], 11]Failed
oracle 2[[3], 2][[3, 3], 4]Failed
oracle 3[[0], 1][[0, 0, 0, 0, 0, 0, 0, 0], 8]Failed
oracle 4[[], 0][[], 0]Passed
oracle 5[[], 1][[2], 4]Failed
oracle 6[[2], 8][[2, 3], 12]Failed
oracle 7[[], 1][[7, 7], 7]Failed
variant packet 1[[6, 3, 4], 11][[6, 3, 4, 4, 1, 3], 20]Failed

SHA-256 / 746eb9bc43045890c8b2adf796e2007e35dbe3843e9587394f63067e9ddedbd0

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:]
    available = max(0,len(bits)//width-1)
    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], 7][[0, 0, 0, 0, 0, 0, 0, 0], 8]Failed
oracle 4[[], 0][[], 0]Passed
oracle 5[[2], 4][[2], 4]Passed
oracle 6[[2, 3], 12][[2, 3], 12]Passed
oracle 7[[7], 4][[7, 7], 7]Failed
variant packet 1[[6, 3, 4, 4, 1, 3], 20][[6, 3, 4, 4, 1, 3], 20]Passed

SHA-256 / c67724919fda5d7b2d8786cb2fb60c5cee56aecb14669f1f91477c41b3ef081d

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

Case digest / c71822e06febb1582ee825d97806b4730151af5821c1f136ecedb887fdfce0b1