FAILURE MAP
← Case archive

FA-48906 / PCM sample encoding / Open access

Validbit left container: signed modulus · case 01

The extracted field is sign-corrected using container modulus.

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

ROOT CAUSE

The extracted field is sign-corrected using container modulus.

VERIFIED REPAIR

Use the stated conversion contract at signed modulus.

Unsuccessful approach: Negating the unsigned code does not decode its complement representation.

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<<container) 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[[-4081, 7, 1], [0, 0, 0]][[-1, 7, 1], [0, 0, 0]]Failed
oracle 2[[-248, 7, 0], [0, 0, 0]][[-8, 7, 0], [0, 0, 0]]Failed
oracle 3[[-248, -241], [0, 0]][[-8, -1], [0, 0]]Failed
oracle 4[[-248, 7], [1, 2]][[-8, 7], [1, 2]]Failed
oracle 5[[], []][[], []]Passed
oracle 6[[-249, 1], [0, 0]][[-1, 1], [0, 0]]Failed
oracle 7[[-3073, 1], [0, 0]][[-1, 1], [0, 0]]Failed
variant packet 1[[-4081, 7, 1, -4081, 7, 1], [0, 0, 0, 0, 0, 0]][[-1, 7, 1, -1, 7, 1], [0, 0, 0, 0, 0, 0]]Failed

SHA-256 / 0d30444b892907d3b52ad8d057051e7ccf01942681238000bb44bdfe41eae265

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

SHA-256 / 050564a6671b7fa6b1837bf92b57467663747255eae81b6a3722dd74d7c299fd

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

Case digest / a265cb9ecb492f10c23e858674ef418efe68249e1ab0bdc273c2b7dc5d13dbb8