FAILURE MAP
← Case archive

FA-50131 / PCM sample encoding / Open access

Pcm escaped residuals: residual update · case 01

Ordinary residual replaces PCM amplitude rather than updating it.

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

ROOT CAUSE

Ordinary residual replaces PCM amplitude rather than updating it.

VERIFIED REPAIR

Use the stated conversion contract at residual update.

Unsuccessful approach: Adding each residual to seed loses cumulative reconstruction.

Case contract

Decode a stipulated PCM residual stream with an escape token followed by an absolute sample anchor; report a dangling escape without losing valid prefix state.

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(tokens, initial, escape):
    out=[]
    previous=initial
    cursor=0
    while cursor<len(tokens):
        token=tokens[cursor]
        cursor+=1
        if token==escape:
            if cursor==len(tokens):
                return [out,previous,'truncated']
            previous=tokens[cursor]
            cursor+=1
        else:
            previous=token
        out.append(previous)
    return [out,previous,'ok']
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 99, 20, -2], 10, 99)), [[11, 20, 18], 18, 'ok'])
check('oracle 2', solve(*([99, -5, 2], 1, 99)), [[-5, -3], -3, 'ok'])
check('oracle 3', solve(*([1, 99], 3, 99)), [[4], 4, 'truncated'])
check('oracle 4', solve(*([], 4, 99)), [[], 4, 'ok'])
check('oracle 5', solve(*([0, 1, 0], 2, 99)), [[2, 3, 3], 3, 'ok'])
check('oracle 6', solve(*([8, 9, 0], 1, 7)), [[9, 18, 18], 18, 'ok'])
check('oracle 7', solve(*([7, 3, 7, 8], 0, 7)), [[3, 8], 8, 'ok'])
if N == 1: check('variant packet 1', solve(*[[1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 2: check('variant packet 2', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 3: check('variant packet 3', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 4: check('variant packet 4', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 5: check('variant packet 5', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
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, 20, -2], -2, 'ok'][[11, 20, 18], 18, 'ok']Failed
oracle 2[[-5, 2], 2, 'ok'][[-5, -3], -3, 'ok']Failed
oracle 3[[1], 1, 'truncated'][[4], 4, 'truncated']Failed
oracle 4[[], 4, 'ok'][[], 4, 'ok']Passed
oracle 5[[0, 1, 0], 0, 'ok'][[2, 3, 3], 3, 'ok']Failed
oracle 6[[8, 9, 0], 0, 'ok'][[9, 18, 18], 18, 'ok']Failed
oracle 7[[3, 8], 8, 'ok'][[3, 8], 8, 'ok']Passed
variant packet 1[[1, 20, -2, 1, 20, -2], -2, 'ok'][[11, 20, 18, 19, 20, 18], 18, 'ok']Failed

SHA-256 / 610d94f906c6f1a65c064078f72f43aa2d3a6d134e843f8129171cea98a23432

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(tokens, initial, escape):
    out=[]
    previous=initial
    cursor=0
    while cursor<len(tokens):
        token=tokens[cursor]
        cursor+=1
        if token==escape:
            if cursor==len(tokens):
                return [out,previous,'truncated']
            previous=tokens[cursor]
            cursor+=1
        else:
            previous=initial+token
        out.append(previous)
    return [out,previous,'ok']
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 99, 20, -2], 10, 99)), [[11, 20, 18], 18, 'ok'])
check('oracle 2', solve(*([99, -5, 2], 1, 99)), [[-5, -3], -3, 'ok'])
check('oracle 3', solve(*([1, 99], 3, 99)), [[4], 4, 'truncated'])
check('oracle 4', solve(*([], 4, 99)), [[], 4, 'ok'])
check('oracle 5', solve(*([0, 1, 0], 2, 99)), [[2, 3, 3], 3, 'ok'])
check('oracle 6', solve(*([8, 9, 0], 1, 7)), [[9, 18, 18], 18, 'ok'])
check('oracle 7', solve(*([7, 3, 7, 8], 0, 7)), [[3, 8], 8, 'ok'])
if N == 1: check('variant packet 1', solve(*[[1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 2: check('variant packet 2', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 3: check('variant packet 3', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 4: check('variant packet 4', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 5: check('variant packet 5', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
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[[11, 20, 8], 8, 'ok'][[11, 20, 18], 18, 'ok']Failed
oracle 2[[-5, 3], 3, 'ok'][[-5, -3], -3, 'ok']Failed
oracle 3[[4], 4, 'truncated'][[4], 4, 'truncated']Passed
oracle 4[[], 4, 'ok'][[], 4, 'ok']Passed
oracle 5[[2, 3, 2], 2, 'ok'][[2, 3, 3], 3, 'ok']Failed
oracle 6[[9, 10, 1], 1, 'ok'][[9, 18, 18], 18, 'ok']Failed
oracle 7[[3, 8], 8, 'ok'][[3, 8], 8, 'ok']Passed
variant packet 1[[11, 20, 8, 11, 20, 8], 8, 'ok'][[11, 20, 18, 19, 20, 18], 18, 'ok']Failed

SHA-256 / 9f69dcd3c01e1232e5be0cb99d0afb6f74f758fc471943699b9c4f0431418eff

3 / The verified repair

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

N = 1
observations = []
def solve(tokens, initial, escape):
    out=[]
    previous=initial
    cursor=0
    while cursor<len(tokens):
        token=tokens[cursor]
        cursor+=1
        if token==escape:
            if cursor==len(tokens):
                return [out,previous,'truncated']
            previous=tokens[cursor]
            cursor+=1
        else:
            previous+=token
        out.append(previous)
    return [out,previous,'ok']
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 99, 20, -2], 10, 99)), [[11, 20, 18], 18, 'ok'])
check('oracle 2', solve(*([99, -5, 2], 1, 99)), [[-5, -3], -3, 'ok'])
check('oracle 3', solve(*([1, 99], 3, 99)), [[4], 4, 'truncated'])
check('oracle 4', solve(*([], 4, 99)), [[], 4, 'ok'])
check('oracle 5', solve(*([0, 1, 0], 2, 99)), [[2, 3, 3], 3, 'ok'])
check('oracle 6', solve(*([8, 9, 0], 1, 7)), [[9, 18, 18], 18, 'ok'])
check('oracle 7', solve(*([7, 3, 7, 8], 0, 7)), [[3, 8], 8, 'ok'])
if N == 1: check('variant packet 1', solve(*[[1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 2: check('variant packet 2', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 3: check('variant packet 3', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 4: check('variant packet 4', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
if N == 5: check('variant packet 5', solve(*[[1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2, 1, 99, 20, -2], 10, 99]), [[11, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18, 19, 20, 18], 18, 'ok'])
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[[11, 20, 18], 18, 'ok'][[11, 20, 18], 18, 'ok']Passed
oracle 2[[-5, -3], -3, 'ok'][[-5, -3], -3, 'ok']Passed
oracle 3[[4], 4, 'truncated'][[4], 4, 'truncated']Passed
oracle 4[[], 4, 'ok'][[], 4, 'ok']Passed
oracle 5[[2, 3, 3], 3, 'ok'][[2, 3, 3], 3, 'ok']Passed
oracle 6[[9, 18, 18], 18, 'ok'][[9, 18, 18], 18, 'ok']Passed
oracle 7[[3, 8], 8, 'ok'][[3, 8], 8, 'ok']Passed
variant packet 1[[11, 20, 18, 19, 20, 18], 18, 'ok'][[11, 20, 18, 19, 20, 18], 18, 'ok']Passed

SHA-256 / 8fb1ef408938fe1aaa436580f6ed38ab4209efae2a48f494c76437794a8db3ec

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

Case digest / ef5e70aefa452f36945055b8d741b4c7da7bf9103f395a26ff76bb15b0676eae