FAILURE MAP
← Case archive

FA-49311 / PCM sample encoding / Open access

Pcm mid side unlifting: channel order · case 01

Recovered channel labels are swapped after lossless unlifting.

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

ROOT CAUSE

Recovered channel labels are swapped after lossless unlifting.

VERIFIED REPAIR

Use the stated conversion contract at channel order.

Unsuccessful approach: Duplicating left discards recovered right information.

Case contract

Invert the stipulated reversible PCM midpoint/side code, rejecting parity-mismatched triples and preserving L,R destination order.

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(triples):
    out=[]
    for mid,side,parity in triples:
        if parity!=(side&1):
            out.append(None)
            continue
        right=mid-side//2
        left=side+right
        out.append([right,left])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[3, 3, 1], [3, -3, 1]],)), [[5, 2], [2, 5]])
check('oracle 2', solve(*([[0, 0, 0], [1, 0, 0]],)), [[0, 0], [1, 1]])
check('oracle 3', solve(*([[0, -5, 1]],)), [[-2, 3]])
check('oracle 4', solve(*([],)), [])
check('oracle 5', solve(*([[3, 2, 1], [3, 2, 0]],)), [None, [4, 2]])
check('oracle 6', solve(*([[-2, -1, 1], [4, 1, 1]],)), [[-2, -1], [5, 4]])
check('oracle 7', solve(*([[3, 0, 1]],)), [None])
if N == 1: check('variant packet 1', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5]])
if N == 2: check('variant packet 2', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
if N == 3: check('variant packet 3', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
if N == 4: check('variant packet 4', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
if N == 5: check('variant packet 5', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
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[[2, 5], [5, 2]][[5, 2], [2, 5]]Failed
oracle 2[[0, 0], [1, 1]][[0, 0], [1, 1]]Passed
oracle 3[[3, -2]][[-2, 3]]Failed
oracle 4[][]Passed
oracle 5[None, [2, 4]][None, [4, 2]]Failed
oracle 6[[-1, -2], [4, 5]][[-2, -1], [5, 4]]Failed
oracle 7[None][None]Passed
variant packet 1[[2, 5], [5, 2], [2, 5], [5, 2]][[5, 2], [2, 5], [5, 2], [2, 5]]Failed

SHA-256 / 741e03d81a6a779f7c1f2363c8f0bdb3421947c906acbe4abf107e5b53f66e27

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(triples):
    out=[]
    for mid,side,parity in triples:
        if parity!=(side&1):
            out.append(None)
            continue
        right=mid-side//2
        left=side+right
        out.append([left,left])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[3, 3, 1], [3, -3, 1]],)), [[5, 2], [2, 5]])
check('oracle 2', solve(*([[0, 0, 0], [1, 0, 0]],)), [[0, 0], [1, 1]])
check('oracle 3', solve(*([[0, -5, 1]],)), [[-2, 3]])
check('oracle 4', solve(*([],)), [])
check('oracle 5', solve(*([[3, 2, 1], [3, 2, 0]],)), [None, [4, 2]])
check('oracle 6', solve(*([[-2, -1, 1], [4, 1, 1]],)), [[-2, -1], [5, 4]])
check('oracle 7', solve(*([[3, 0, 1]],)), [None])
if N == 1: check('variant packet 1', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5]])
if N == 2: check('variant packet 2', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
if N == 3: check('variant packet 3', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
if N == 4: check('variant packet 4', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
if N == 5: check('variant packet 5', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
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[[5, 5], [2, 2]][[5, 2], [2, 5]]Failed
oracle 2[[0, 0], [1, 1]][[0, 0], [1, 1]]Passed
oracle 3[[-2, -2]][[-2, 3]]Failed
oracle 4[][]Passed
oracle 5[None, [4, 4]][None, [4, 2]]Failed
oracle 6[[-2, -2], [5, 5]][[-2, -1], [5, 4]]Failed
oracle 7[None][None]Passed
variant packet 1[[5, 5], [2, 2], [5, 5], [2, 2]][[5, 2], [2, 5], [5, 2], [2, 5]]Failed

SHA-256 / 1253eb03cd45e901b3b308ceda479cd8b08a4c0d9d071af9f778753c87e7c992

3 / The verified repair

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

N = 1
observations = []
def solve(triples):
    out=[]
    for mid,side,parity in triples:
        if parity!=(side&1):
            out.append(None)
            continue
        right=mid-side//2
        left=side+right
        out.append([left,right])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[3, 3, 1], [3, -3, 1]],)), [[5, 2], [2, 5]])
check('oracle 2', solve(*([[0, 0, 0], [1, 0, 0]],)), [[0, 0], [1, 1]])
check('oracle 3', solve(*([[0, -5, 1]],)), [[-2, 3]])
check('oracle 4', solve(*([],)), [])
check('oracle 5', solve(*([[3, 2, 1], [3, 2, 0]],)), [None, [4, 2]])
check('oracle 6', solve(*([[-2, -1, 1], [4, 1, 1]],)), [[-2, -1], [5, 4]])
check('oracle 7', solve(*([[3, 0, 1]],)), [None])
if N == 1: check('variant packet 1', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5]])
if N == 2: check('variant packet 2', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
if N == 3: check('variant packet 3', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
if N == 4: check('variant packet 4', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
if N == 5: check('variant packet 5', solve(*[[[3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1], [3, 3, 1], [3, -3, 1]]]), [[5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5], [5, 2], [2, 5]])
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[[5, 2], [2, 5]][[5, 2], [2, 5]]Passed
oracle 2[[0, 0], [1, 1]][[0, 0], [1, 1]]Passed
oracle 3[[-2, 3]][[-2, 3]]Passed
oracle 4[][]Passed
oracle 5[None, [4, 2]][None, [4, 2]]Passed
oracle 6[[-2, -1], [5, 4]][[-2, -1], [5, 4]]Passed
oracle 7[None][None]Passed
variant packet 1[[5, 2], [2, 5], [5, 2], [2, 5]][[5, 2], [2, 5], [5, 2], [2, 5]]Passed

SHA-256 / dcd1da4deb9bf58e5fb35568551230cfeecabdfc0b0d635dbf866d27d82da225

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

Case digest / f61a6a02910e135173bfef41ab06b891d3e1ebf84c888584b66e8a0542d4ab64