FAILURE MAP
← Case archive

FA-48901 / PCM sample encoding / Open access

Validbit left container: sign position · case 01

The container sign position is tested after valid-bit extraction.

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

ROOT CAUSE

The container sign position is tested after valid-bit extraction.

VERIFIED REPAIR

Use the stated conversion contract at sign position.

Unsuccessful approach: Testing one bit beyond the extracted field still misses negativity.

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<<(container-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[[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]]Failed
oracle 3[[8, 15], [0, 0]][[-8, -1], [0, 0]]Failed
oracle 4[[8, 7], [1, 2]][[-8, 7], [1, 2]]Failed
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 / 33ca6280aaaa18ac501f90483c347ca1e52d40d959d8c569cbb5f6d54e721a6c

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
        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[[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]]Failed
oracle 3[[8, 15], [0, 0]][[-8, -1], [0, 0]]Failed
oracle 4[[8, 7], [1, 2]][[-8, 7], [1, 2]]Failed
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 / 11d5cc9da5a7d86eca06680482432decd0c89a381867f799fc51aeef569228ed

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

Case digest / 367dab4bd4f3e45d9da599e0a920939d57a2118c4789704a7261e6b6391c2de1