FAILURE MAP
← Case archive

FA-49296 / PCM sample encoding / Open access

Pcm mid side unlifting: inverse half · case 01

Truncating negative odd side inverts the wrong lifting transform.

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

ROOT CAUSE

Truncating negative odd side inverts the wrong lifting transform.

VERIFIED REPAIR

Use the stated conversion contract at inverse half.

Unsuccessful approach: Ceiling inversion offsets positive odd pairs.

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-int(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], [1, 4]][[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, [4, 2]][None, [4, 2]]Passed
oracle 6[[-3, -2], [5, 4]][[-2, -1], [5, 4]]Failed
oracle 7[None][None]Passed
variant packet 1[[5, 2], [1, 4], [5, 2], [1, 4]][[5, 2], [2, 5], [5, 2], [2, 5]]Failed

SHA-256 / 7994cc2097a6de564f4adb73a9364b4c292e3df8f04a2ac1ec415f9b0b6fec7e

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+1)//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[[4, 1], [1, 4]][[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, [4, 2]][None, [4, 2]]Passed
oracle 6[[-3, -2], [4, 3]][[-2, -1], [5, 4]]Failed
oracle 7[None][None]Passed
variant packet 1[[4, 1], [1, 4], [4, 1], [1, 4]][[5, 2], [2, 5], [5, 2], [2, 5]]Failed

SHA-256 / a80666edbd1517e4b784e404455123be74cb0eacd6edc05a01114422a4a17548

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

Case digest / 7fc37900fb65ec8ade8169dd14c156fa81a797a41b7f27edb243f17c4179d5e1