FAILURE MAP
← Case archive

FA-49406 / PCM sample encoding / Open access

Pcm silence run packets: limit slice · case 01

A bounded decode retains the latest tail instead of earliest samples.

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

ROOT CAUSE

A bounded decode retains the latest tail instead of earliest samples.

VERIFIED REPAIR

Use the stated conversion contract at limit slice.

Unsuccessful approach: Removing one additional sample violates the declared output capacity.

Case contract

Decode tagged PCM literal and silence-run packets up to a sample capacity, honoring the declared digital-silence code and skipping unknown metadata.

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(packets, zero, limit):
    out=[]
    for tag,payload in packets:
        if tag=='audio':
            out.extend(payload)
        elif tag=='silence':
            out.extend([zero]*max(0,payload))
        else:
            continue
        if len(out)>=limit:
            out=out[-limit:] if limit else []
            break
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 8)), [130, 131, 128, 128, 129])
check('oracle 2', solve(*([['silence', 0], ['audio', [5]]], 128, 5)), [5])
check('oracle 3', solve(*([['metadata', []], ['audio', [1, 2]]], 0, 4)), [1, 2])
check('oracle 4', solve(*([['audio', [1, 2, 3]], ['silence', 2]], 0, 2)), [1, 2])
check('oracle 5', solve(*([], 128, 5)), [])
check('oracle 6', solve(*([['silence', -1], ['silence', 2]], 128, 3)), [128, 128])
check('oracle 7', solve(*([['audio', [1]], ['audio', [2]]], 0, 0)), [])
if N == 1: check('variant packet 1', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 16]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 2: check('variant packet 2', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 24]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 3: check('variant packet 3', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 32]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 4: check('variant packet 4', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 40]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 5: check('variant packet 5', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 48]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
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[130, 131, 128, 128, 129][130, 131, 128, 128, 129]Passed
oracle 2[5][5]Passed
oracle 3[1, 2][1, 2]Passed
oracle 4[2, 3][1, 2]Failed
oracle 5[][]Passed
oracle 6[128, 128][128, 128]Passed
oracle 7[][]Passed
variant packet 1[130, 131, 128, 128, 129, 130, 131, 128, 128, 129][130, 131, 128, 128, 129, 130, 131, 128, 128, 129]Passed

SHA-256 / a91f6f0a4032217ca3854f9d1f90f7998b616e1947326a14d68ee291fa3f269f

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(packets, zero, limit):
    out=[]
    for tag,payload in packets:
        if tag=='audio':
            out.extend(payload)
        elif tag=='silence':
            out.extend([zero]*max(0,payload))
        else:
            continue
        if len(out)>=limit:
            out=out[:max(0,limit-1)]
            break
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 8)), [130, 131, 128, 128, 129])
check('oracle 2', solve(*([['silence', 0], ['audio', [5]]], 128, 5)), [5])
check('oracle 3', solve(*([['metadata', []], ['audio', [1, 2]]], 0, 4)), [1, 2])
check('oracle 4', solve(*([['audio', [1, 2, 3]], ['silence', 2]], 0, 2)), [1, 2])
check('oracle 5', solve(*([], 128, 5)), [])
check('oracle 6', solve(*([['silence', -1], ['silence', 2]], 128, 3)), [128, 128])
check('oracle 7', solve(*([['audio', [1]], ['audio', [2]]], 0, 0)), [])
if N == 1: check('variant packet 1', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 16]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 2: check('variant packet 2', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 24]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 3: check('variant packet 3', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 32]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 4: check('variant packet 4', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 40]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 5: check('variant packet 5', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 48]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
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[130, 131, 128, 128, 129][130, 131, 128, 128, 129]Passed
oracle 2[5][5]Passed
oracle 3[1, 2][1, 2]Passed
oracle 4[1][1, 2]Failed
oracle 5[][]Passed
oracle 6[128, 128][128, 128]Passed
oracle 7[][]Passed
variant packet 1[130, 131, 128, 128, 129, 130, 131, 128, 128, 129][130, 131, 128, 128, 129, 130, 131, 128, 128, 129]Passed

SHA-256 / 000894e80aec7e45172a5a0199ceb435e52fecb84cb6995343631f2d3d1c0148

3 / The verified repair

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

N = 1
observations = []
def solve(packets, zero, limit):
    out=[]
    for tag,payload in packets:
        if tag=='audio':
            out.extend(payload)
        elif tag=='silence':
            out.extend([zero]*max(0,payload))
        else:
            continue
        if len(out)>=limit:
            out=out[:limit]
            break
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 8)), [130, 131, 128, 128, 129])
check('oracle 2', solve(*([['silence', 0], ['audio', [5]]], 128, 5)), [5])
check('oracle 3', solve(*([['metadata', []], ['audio', [1, 2]]], 0, 4)), [1, 2])
check('oracle 4', solve(*([['audio', [1, 2, 3]], ['silence', 2]], 0, 2)), [1, 2])
check('oracle 5', solve(*([], 128, 5)), [])
check('oracle 6', solve(*([['silence', -1], ['silence', 2]], 128, 3)), [128, 128])
check('oracle 7', solve(*([['audio', [1]], ['audio', [2]]], 0, 0)), [])
if N == 1: check('variant packet 1', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 16]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 2: check('variant packet 2', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 24]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 3: check('variant packet 3', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 32]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 4: check('variant packet 4', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 40]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
if N == 5: check('variant packet 5', solve(*[[['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]], ['audio', [130, 131]], ['silence', 2], ['audio', [129]]], 128, 48]), [130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129, 130, 131, 128, 128, 129])
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[130, 131, 128, 128, 129][130, 131, 128, 128, 129]Passed
oracle 2[5][5]Passed
oracle 3[1, 2][1, 2]Passed
oracle 4[1, 2][1, 2]Passed
oracle 5[][]Passed
oracle 6[128, 128][128, 128]Passed
oracle 7[][]Passed
variant packet 1[130, 131, 128, 128, 129, 130, 131, 128, 128, 129][130, 131, 128, 128, 129, 130, 131, 128, 128, 129]Passed

SHA-256 / 3564ee83964e727d419515e371414bd9730c01bd6ce4cca7cf4536b2a29c8f0b

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

Case digest / 4a5271088714454c662410f9fe1046671665cb181e473d752cd32e13061f8534