FAILURE MAP
← Case archive

FA-49166 / PCM sample encoding / Open access

Pcm frame sequence: sequence modulus · case 01

PCM packet wraparound is interpreted as an old packet.

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

ROOT CAUSE

PCM packet wraparound is interpreted as an old packet.

VERIFIED REPAIR

Use the stated conversion contract at sequence modulus.

Unsuccessful approach: Reversing sequence distance mistakes late packets for gaps.

Case contract

Bounded PCM packet sequence adapter with one null marker per lost packet (not per lost sample); reject old or half-cycle-ambiguous packets and retain modular cursor.

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, start, modulus):
    expected=start
    out=[]
    for sequence,samples in packets:
        delta=sequence-expected
        if delta==0:
            out.extend(samples)
            expected=(expected+1)%modulus
        elif delta<modulus//2:
            out.extend([None]*delta)
            out.extend(samples)
            expected=(sequence+1)%modulus
    return [out,expected]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[7, [4]], [0, [5]], [1, [6]]], 7, 8)), [[4, 5, 6], 2])
check('oracle 2', solve(*([[0, [1]], [2, [3]], [3, [4]]], 0, 8)), [[1, None, 3, 4], 4])
check('oracle 3', solve(*([[4, [9]], [0, [2]]], 0, 8)), [[2], 1])
check('oracle 4', solve(*([[7, [9]], [0, [1]]], 0, 8)), [[1], 1])
check('oracle 5', solve(*([], 3, 8)), [[], 3])
check('oracle 6', solve(*([[6, [1]], [1, [2]]], 6, 8)), [[1, None, None, 2], 2])
check('oracle 7', solve(*([[0, [1, 2]], [0, [3]], [1, [4]]], 0, 8)), [[1, 2, 4], 2])
if N == 1: check('variant packet 1', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 2: check('variant packet 2', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 3: check('variant packet 3', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 4: check('variant packet 4', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 5: check('variant packet 5', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
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[[4, 5, 6], 2][[4, 5, 6], 2]Passed
oracle 2[[1, None, 3, 4], 4][[1, None, 3, 4], 4]Passed
oracle 3[[2], 1][[2], 1]Passed
oracle 4[[1], 1][[1], 1]Passed
oracle 5[[], 3][[], 3]Passed
oracle 6[[1, 2], 2][[1, None, None, 2], 2]Failed
oracle 7[[1, 2, 3, 4], 2][[1, 2, 4], 2]Failed
variant packet 1[[4, 5, 6, 5, 6], 2][[4, 5, 6], 2]Failed

SHA-256 / 6a1db45431aa802f0e55d6ee1ca3d898c9b216a505376039fb8fb026f7c114d0

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(packets, start, modulus):
    expected=start
    out=[]
    for sequence,samples in packets:
        delta=(expected-sequence)%modulus
        if delta==0:
            out.extend(samples)
            expected=(expected+1)%modulus
        elif delta<modulus//2:
            out.extend([None]*delta)
            out.extend(samples)
            expected=(sequence+1)%modulus
    return [out,expected]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[7, [4]], [0, [5]], [1, [6]]], 7, 8)), [[4, 5, 6], 2])
check('oracle 2', solve(*([[0, [1]], [2, [3]], [3, [4]]], 0, 8)), [[1, None, 3, 4], 4])
check('oracle 3', solve(*([[4, [9]], [0, [2]]], 0, 8)), [[2], 1])
check('oracle 4', solve(*([[7, [9]], [0, [1]]], 0, 8)), [[1], 1])
check('oracle 5', solve(*([], 3, 8)), [[], 3])
check('oracle 6', solve(*([[6, [1]], [1, [2]]], 6, 8)), [[1, None, None, 2], 2])
check('oracle 7', solve(*([[0, [1, 2]], [0, [3]], [1, [4]]], 0, 8)), [[1, 2, 4], 2])
if N == 1: check('variant packet 1', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 2: check('variant packet 2', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 3: check('variant packet 3', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 4: check('variant packet 4', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 5: check('variant packet 5', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
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[[4, 5, 6], 2][[4, 5, 6], 2]Passed
oracle 2[[1], 1][[1, None, 3, 4], 4]Failed
oracle 3[[2], 1][[2], 1]Passed
oracle 4[[None, 9, 1], 1][[1], 1]Failed
oracle 5[[], 3][[], 3]Passed
oracle 6[[1], 7][[1, None, None, 2], 2]Failed
oracle 7[[1, 2, None, 3, 4], 2][[1, 2, 4], 2]Failed
variant packet 1[[4, 5, 6, None, None, None, 4, 5, 6], 2][[4, 5, 6], 2]Failed

SHA-256 / efe1573595c2571e2bb99e2263b23f50606ab02d73a076d21a952d6ed989c9ac

3 / The verified repair

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

N = 1
observations = []
def solve(packets, start, modulus):
    expected=start
    out=[]
    for sequence,samples in packets:
        delta=(sequence-expected)%modulus
        if delta==0:
            out.extend(samples)
            expected=(expected+1)%modulus
        elif delta<modulus//2:
            out.extend([None]*delta)
            out.extend(samples)
            expected=(sequence+1)%modulus
    return [out,expected]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[7, [4]], [0, [5]], [1, [6]]], 7, 8)), [[4, 5, 6], 2])
check('oracle 2', solve(*([[0, [1]], [2, [3]], [3, [4]]], 0, 8)), [[1, None, 3, 4], 4])
check('oracle 3', solve(*([[4, [9]], [0, [2]]], 0, 8)), [[2], 1])
check('oracle 4', solve(*([[7, [9]], [0, [1]]], 0, 8)), [[1], 1])
check('oracle 5', solve(*([], 3, 8)), [[], 3])
check('oracle 6', solve(*([[6, [1]], [1, [2]]], 6, 8)), [[1, None, None, 2], 2])
check('oracle 7', solve(*([[0, [1, 2]], [0, [3]], [1, [4]]], 0, 8)), [[1, 2, 4], 2])
if N == 1: check('variant packet 1', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 2: check('variant packet 2', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 3: check('variant packet 3', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 4: check('variant packet 4', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
if N == 5: check('variant packet 5', solve(*[[[7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]], [7, [4]], [0, [5]], [1, [6]]], 7, 8]), [[4, 5, 6], 2])
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[[4, 5, 6], 2][[4, 5, 6], 2]Passed
oracle 2[[1, None, 3, 4], 4][[1, None, 3, 4], 4]Passed
oracle 3[[2], 1][[2], 1]Passed
oracle 4[[1], 1][[1], 1]Passed
oracle 5[[], 3][[], 3]Passed
oracle 6[[1, None, None, 2], 2][[1, None, None, 2], 2]Passed
oracle 7[[1, 2, 4], 2][[1, 2, 4], 2]Passed
variant packet 1[[4, 5, 6], 2][[4, 5, 6], 2]Passed

SHA-256 / 77f56d5c81666a70a87e514b0dbd130c5bbb4cd6d07d3d0c13f6f21f55c36222

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

Case digest / 4143e9469bbf4cccd9422ac7f1bbcacc8eb10151192ba277b08b55ca1cbce7ef