FAILURE MAP
← Case archive

FA-11021 / Audio channel mixing / Open access

Mid side decode reconstruction · case 01

Decoder halves amplitudes even though normalization was already applied during encoding.

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

ROOT CAUSE

Decoder halves amplitudes even though normalization was already applied during encoding.

VERIFIED REPAIR

Apply the explicit PCM/playback contract: Decode normalized mid/side frames into left=mid+side and right=mid-side, exactly inverting the half-scaled encoder.

Unsuccessful approach: Reversing only the right reconstruction inverts that output channel polarity.

Case contract

Decode normalized mid/side frames into left=mid+side and right=mid-side, exactly inverting the half-scaled encoder.

Why this case matters

A pure Python local audio pipeline stage with explicit sample formats and frame conventions; no real-time device or signal-spectrum claims.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(frames):
    return [[(mid+side)/2,(mid-side)/2] for mid,side in frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[1, 0]],)),[[1, 1]])
check('fixture 2',solve(*([[0, 1]],)),[[1, -1]])
check('fixture 3',solve(*([[0.5, -0.5]],)),[[0, 1]])
check('fixture 4',solve(*([],)),[])
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
fixture 1[[0.5, 0.5]][[1, 1]]Failed
fixture 2[[0.5, -0.5]][[1, -1]]Failed
fixture 3[[0.0, 0.5]][[0, 1]]Failed
fixture 4[][]Passed

SHA-256 / 1d8537934851a0d57c0c5f76b154dc54807017b3c65b36746c9b6cc7bba6a7c7

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(frames):
    return [[mid+side,side-mid] for mid,side in frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[1, 0]],)),[[1, 1]])
check('fixture 2',solve(*([[0, 1]],)),[[1, -1]])
check('fixture 3',solve(*([[0.5, -0.5]],)),[[0, 1]])
check('fixture 4',solve(*([],)),[])
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
fixture 1[[1, -1]][[1, 1]]Failed
fixture 2[[1, 1]][[1, -1]]Failed
fixture 3[[0.0, -1.0]][[0, 1]]Failed
fixture 4[][]Passed

SHA-256 / e0474615dbb74f4f5afd85cc73a25308df37577912ac59414f4a27d7c4c24b8f

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(frames):
    return [[mid+side,mid-side] for mid,side in frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[1, 0]],)),[[1, 1]])
check('fixture 2',solve(*([[0, 1]],)),[[1, -1]])
check('fixture 3',solve(*([[0.5, -0.5]],)),[[0, 1]])
check('fixture 4',solve(*([],)),[])
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
fixture 1[[1, 1]][[1, 1]]Passed
fixture 2[[1, -1]][[1, -1]]Passed
fixture 3[[0.0, 1.0]][[0, 1]]Passed
fixture 4[][]Passed

SHA-256 / e02e8a14efce584e815c39dff5d37ba024de216f81f9c511760457629e9b209a

Verification & scope

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

Case digest / 330153a4522e55f3edeb4385c091c534ebd44c2f5fb0e66303427a694e60f7da