FAILURE MAP
← Case archive

FA-48911 / PCM sample encoding / Open access

Validbit left container: padding observation · case 01

Padding inspection includes signal bits.

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

ROOT CAUSE

Padding inspection includes signal bits.

VERIFIED REPAIR

Use the stated conversion contract at padding observation.

Unsuccessful approach: Inspecting the shifted payload reports the sample instead of pad contamination.

Case contract

Extract a signed valid-bit field left justified in an unsigned container; ignore bits above the container and separately return low unused pad bits. valid<container.

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(words, valid, container):
    shift=container-valid
    mask=(1<<valid)-1
    values=[]
    for word in words:
        code=(word>>shift)&mask
        sign=1<<(valid-1)
        values.append(code-(1<<valid) if code&sign else code)
    unused=[word&((1<<valid)-1) for word in words]
    return [values,unused]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([3840, 1792, 256], 4, 12)), [[-1, 7, 1], [0, 0, 0]])
check('oracle 2', solve(*([128, 112, 0], 4, 8)), [[-8, 7, 0], [0, 0, 0]])
check('oracle 3', solve(*([384, 496], 4, 8)), [[-8, -1], [0, 0]])
check('oracle 4', solve(*([129, 114], 4, 8)), [[-8, 7], [1, 2]])
check('oracle 5', solve(*([], 3, 8)), [[], []])
check('oracle 6', solve(*([224, 32], 3, 8)), [[-1, 1], [0, 0]])
check('oracle 7', solve(*([4092, 4], 10, 12)), [[-1, 1], [0, 0]])
if N == 1: check('variant packet 1', solve(*[[3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0]])
if N == 2: check('variant packet 2', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0]])
if N == 3: check('variant packet 3', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
if N == 4: check('variant packet 4', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
if N == 5: check('variant packet 5', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
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[[-1, 7, 1], [0, 0, 0]][[-1, 7, 1], [0, 0, 0]]Passed
oracle 2[[-8, 7, 0], [0, 0, 0]][[-8, 7, 0], [0, 0, 0]]Passed
oracle 3[[-8, -1], [0, 0]][[-8, -1], [0, 0]]Passed
oracle 4[[-8, 7], [1, 2]][[-8, 7], [1, 2]]Passed
oracle 5[[], []][[], []]Passed
oracle 6[[-1, 1], [0, 0]][[-1, 1], [0, 0]]Passed
oracle 7[[-1, 1], [1020, 4]][[-1, 1], [0, 0]]Failed
variant packet 1[[-1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0]][[-1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0]]Passed

SHA-256 / 661af87e898c84292a4273c72ffd292cc26747fcae5fefb72afc8833afd5ab3f

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(words, valid, container):
    shift=container-valid
    mask=(1<<valid)-1
    values=[]
    for word in words:
        code=(word>>shift)&mask
        sign=1<<(valid-1)
        values.append(code-(1<<valid) if code&sign else code)
    unused=[word>>shift for word in words]
    return [values,unused]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([3840, 1792, 256], 4, 12)), [[-1, 7, 1], [0, 0, 0]])
check('oracle 2', solve(*([128, 112, 0], 4, 8)), [[-8, 7, 0], [0, 0, 0]])
check('oracle 3', solve(*([384, 496], 4, 8)), [[-8, -1], [0, 0]])
check('oracle 4', solve(*([129, 114], 4, 8)), [[-8, 7], [1, 2]])
check('oracle 5', solve(*([], 3, 8)), [[], []])
check('oracle 6', solve(*([224, 32], 3, 8)), [[-1, 1], [0, 0]])
check('oracle 7', solve(*([4092, 4], 10, 12)), [[-1, 1], [0, 0]])
if N == 1: check('variant packet 1', solve(*[[3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0]])
if N == 2: check('variant packet 2', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0]])
if N == 3: check('variant packet 3', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
if N == 4: check('variant packet 4', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
if N == 5: check('variant packet 5', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
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[[-1, 7, 1], [15, 7, 1]][[-1, 7, 1], [0, 0, 0]]Failed
oracle 2[[-8, 7, 0], [8, 7, 0]][[-8, 7, 0], [0, 0, 0]]Failed
oracle 3[[-8, -1], [24, 31]][[-8, -1], [0, 0]]Failed
oracle 4[[-8, 7], [8, 7]][[-8, 7], [1, 2]]Failed
oracle 5[[], []][[], []]Passed
oracle 6[[-1, 1], [7, 1]][[-1, 1], [0, 0]]Failed
oracle 7[[-1, 1], [1023, 1]][[-1, 1], [0, 0]]Failed
variant packet 1[[-1, 7, 1, -1, 7, 1], [15, 7, 1, 15, 7, 1]][[-1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0]]Failed

SHA-256 / 39b3721a1b90b5b315e8399ec393220a2b42fe76e3a8d774c06240e4de25eae4

3 / The verified repair

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

N = 1
observations = []
def solve(words, valid, container):
    shift=container-valid
    mask=(1<<valid)-1
    values=[]
    for word in words:
        code=(word>>shift)&mask
        sign=1<<(valid-1)
        values.append(code-(1<<valid) if code&sign else code)
    unused=[word&((1<<shift)-1) for word in words]
    return [values,unused]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([3840, 1792, 256], 4, 12)), [[-1, 7, 1], [0, 0, 0]])
check('oracle 2', solve(*([128, 112, 0], 4, 8)), [[-8, 7, 0], [0, 0, 0]])
check('oracle 3', solve(*([384, 496], 4, 8)), [[-8, -1], [0, 0]])
check('oracle 4', solve(*([129, 114], 4, 8)), [[-8, 7], [1, 2]])
check('oracle 5', solve(*([], 3, 8)), [[], []])
check('oracle 6', solve(*([224, 32], 3, 8)), [[-1, 1], [0, 0]])
check('oracle 7', solve(*([4092, 4], 10, 12)), [[-1, 1], [0, 0]])
if N == 1: check('variant packet 1', solve(*[[3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0]])
if N == 2: check('variant packet 2', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0]])
if N == 3: check('variant packet 3', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
if N == 4: check('variant packet 4', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
if N == 5: check('variant packet 5', solve(*[[3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256, 3840, 1792, 256], 4, 12]), [[-1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
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[[-1, 7, 1], [0, 0, 0]][[-1, 7, 1], [0, 0, 0]]Passed
oracle 2[[-8, 7, 0], [0, 0, 0]][[-8, 7, 0], [0, 0, 0]]Passed
oracle 3[[-8, -1], [0, 0]][[-8, -1], [0, 0]]Passed
oracle 4[[-8, 7], [1, 2]][[-8, 7], [1, 2]]Passed
oracle 5[[], []][[], []]Passed
oracle 6[[-1, 1], [0, 0]][[-1, 1], [0, 0]]Passed
oracle 7[[-1, 1], [0, 0]][[-1, 1], [0, 0]]Passed
variant packet 1[[-1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0]][[-1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0]]Passed

SHA-256 / ca7293e7026af013c2db0a94ce1e628036256a4a01402c3fc8b3e0204e17275f

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

Case digest / 3ff8d470bff293d04df7cfbec77efc0e6120b7a0452e3d1afc4b18af682d6d03