FAILURE MAP
← Case archive

FA-49906 / PCM sample encoding / Open access

Pcm nonlinear reconstruction table: invalid marker · case 01

Invalid PCM codes become plausible silence amplitudes.

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

ROOT CAUSE

Invalid PCM codes become plausible silence amplitudes.

VERIFIED REPAIR

Use the stated conversion contract at invalid marker.

Unsuccessful approach: Returning the calibration zero level hides invalidity too.

Case contract

Decode an explicitly calibrated nonlinear PCM code table relative to its designated zero entry; invalid indices return null rather than a plausible sample.

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(codes, table, zero_index):
    out=[]
    for code in codes:
        if code<0 or code>=len(table):
            out.append(0)
            continue
        amplitude=table[code]-table[zero_index]
        out.append(amplitude)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 1, 2, 3], [-9, -2, 4, 15], 1)), [-7, 0, 6, 17])
check('oracle 2', solve(*([-1, 0, 3], [1, 3, 9], 0)), [None, 0, None])
check('oracle 3', solve(*([0], [-5], 0)), [0])
check('oracle 4', solve(*([], [-3, 2], 1)), [])
check('oracle 5', solve(*([1, 2], [0, 10, 11], 1)), [0, 1])
check('oracle 6', solve(*([0, 2, 4], [-8, -3, 0, 3, 8], 2)), [-8, 0, 8])
check('oracle 7', solve(*([0, -2, 2], [4, 8, 12], 1)), [-4, None, 4])
if N == 1: check('variant packet 1', solve(*[[0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17])
if N == 2: check('variant packet 2', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
if N == 3: check('variant packet 3', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
if N == 4: check('variant packet 4', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
if N == 5: check('variant packet 5', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
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[-7, 0, 6, 17][-7, 0, 6, 17]Passed
oracle 2[0, 0, 0][None, 0, None]Failed
oracle 3[0][0]Passed
oracle 4[][]Passed
oracle 5[0, 1][0, 1]Passed
oracle 6[-8, 0, 8][-8, 0, 8]Passed
oracle 7[-4, 0, 4][-4, None, 4]Failed
variant packet 1[-7, 0, 6, 17, -7, 0, 6, 17][-7, 0, 6, 17, -7, 0, 6, 17]Passed

SHA-256 / 0476b061c2ee9aa4221390e6e45e4061445ab101b0112433cf046ddf8fd76363

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(codes, table, zero_index):
    out=[]
    for code in codes:
        if code<0 or code>=len(table):
            out.append(table[zero_index])
            continue
        amplitude=table[code]-table[zero_index]
        out.append(amplitude)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 1, 2, 3], [-9, -2, 4, 15], 1)), [-7, 0, 6, 17])
check('oracle 2', solve(*([-1, 0, 3], [1, 3, 9], 0)), [None, 0, None])
check('oracle 3', solve(*([0], [-5], 0)), [0])
check('oracle 4', solve(*([], [-3, 2], 1)), [])
check('oracle 5', solve(*([1, 2], [0, 10, 11], 1)), [0, 1])
check('oracle 6', solve(*([0, 2, 4], [-8, -3, 0, 3, 8], 2)), [-8, 0, 8])
check('oracle 7', solve(*([0, -2, 2], [4, 8, 12], 1)), [-4, None, 4])
if N == 1: check('variant packet 1', solve(*[[0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17])
if N == 2: check('variant packet 2', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
if N == 3: check('variant packet 3', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
if N == 4: check('variant packet 4', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
if N == 5: check('variant packet 5', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
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[-7, 0, 6, 17][-7, 0, 6, 17]Passed
oracle 2[1, 0, 1][None, 0, None]Failed
oracle 3[0][0]Passed
oracle 4[][]Passed
oracle 5[0, 1][0, 1]Passed
oracle 6[-8, 0, 8][-8, 0, 8]Passed
oracle 7[-4, 8, 4][-4, None, 4]Failed
variant packet 1[-7, 0, 6, 17, -7, 0, 6, 17][-7, 0, 6, 17, -7, 0, 6, 17]Passed

SHA-256 / e35fedfbee001ac56d6a1a46052200161f67d4f2f4557d39382c32d332a5a028

3 / The verified repair

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

N = 1
observations = []
def solve(codes, table, zero_index):
    out=[]
    for code in codes:
        if code<0 or code>=len(table):
            out.append(None)
            continue
        amplitude=table[code]-table[zero_index]
        out.append(amplitude)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 1, 2, 3], [-9, -2, 4, 15], 1)), [-7, 0, 6, 17])
check('oracle 2', solve(*([-1, 0, 3], [1, 3, 9], 0)), [None, 0, None])
check('oracle 3', solve(*([0], [-5], 0)), [0])
check('oracle 4', solve(*([], [-3, 2], 1)), [])
check('oracle 5', solve(*([1, 2], [0, 10, 11], 1)), [0, 1])
check('oracle 6', solve(*([0, 2, 4], [-8, -3, 0, 3, 8], 2)), [-8, 0, 8])
check('oracle 7', solve(*([0, -2, 2], [4, 8, 12], 1)), [-4, None, 4])
if N == 1: check('variant packet 1', solve(*[[0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17])
if N == 2: check('variant packet 2', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
if N == 3: check('variant packet 3', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
if N == 4: check('variant packet 4', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
if N == 5: check('variant packet 5', solve(*[[0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], [-9, -2, 4, 15], 1]), [-7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17, -7, 0, 6, 17])
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[-7, 0, 6, 17][-7, 0, 6, 17]Passed
oracle 2[None, 0, None][None, 0, None]Passed
oracle 3[0][0]Passed
oracle 4[][]Passed
oracle 5[0, 1][0, 1]Passed
oracle 6[-8, 0, 8][-8, 0, 8]Passed
oracle 7[-4, None, 4][-4, None, 4]Passed
variant packet 1[-7, 0, 6, 17, -7, 0, 6, 17][-7, 0, 6, 17, -7, 0, 6, 17]Passed

SHA-256 / d754a48d1633122d3f5923c7b9156a14acad856ca6c136430413b61518b4994b

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

Case digest / e59c91a3c5424956d96a7a6fb070d1219c458912e85f5ce37e75383c4eb674f8