FAILURE MAP
← Case archive

FA-48891 / PCM sample encoding / Open access

Validbit left container: left padding shift · case 01

Left justified sample bits are interpreted as right justified.

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

ROOT CAUSE

Left justified sample bits are interpreted as right justified.

VERIFIED REPAIR

Use the stated conversion contract at left padding shift.

Unsuccessful approach: Shifting by the valid width removes the wrong number of pad bits.

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=0
    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[[0, 0, 0], [0, 0, 0]][[-1, 7, 1], [0, 0, 0]]Failed
oracle 2[[0, 0, 0], [0, 0, 0]][[-8, 7, 0], [0, 0, 0]]Failed
oracle 3[[0, 0], [0, 0]][[-8, -1], [0, 0]]Failed
oracle 4[[1, 2], [0, 0]][[-8, 7], [1, 2]]Failed
oracle 5[[], []][[], []]Passed
oracle 6[[0, 0], [0, 0]][[-1, 1], [0, 0]]Failed
oracle 7[[-4, 4], [0, 0]][[-1, 1], [0, 0]]Failed
variant packet 1[[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]][[-1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0]]Failed

SHA-256 / 2a2aae687ebe1b346e736ef440406dd474690cd370af429bedee498a4542aeb6

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=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[[0, 0, 0], [0, 0, 0]][[-1, 7, 1], [0, 0, 0]]Failed
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[[-4, -4], [0, 0]][[-1, 1], [0, 0]]Failed
oracle 7[[3, 0], [1020, 4]][[-1, 1], [0, 0]]Failed
variant packet 1[[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]][[-1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0]]Failed

SHA-256 / c6fbf10edc1cc00baddbb730177710b5a627f7e591442b4db39cc096c7ee4ff1

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

Case digest / 65cf4e7967c4954d07826da01293d4a901018a28371eb7775983c30d31f64022