FA-11016 / Audio channel mixing / Open access
Mid side encode normalization · case 01
An unnormalized mid/side matrix doubles channel amplitudes.
ROOT CAUSE
An unnormalized mid/side matrix doubles channel amplitudes.
VERIFIED REPAIR
Apply the explicit PCM/playback contract: Encode stereo left/right frames as normalized mid=(L+R)/2 and side=(L-R)/2 for a sum/difference channel representation.
Unsuccessful approach: Reversed subtraction swaps the spatial sign of the side channel.
Case contract
Encode stereo left/right frames as normalized mid=(L+R)/2 and side=(L-R)/2 for a sum/difference channel representation.
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 [[left+right,left-right] for left,right in frames]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[1, 1]],)),[[1, 0]])
check('fixture 2',solve(*([[1, -1]],)),[[0, 1]])
check('fixture 3',solve(*([[0, 1]],)),[[0.5, -0.5]])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [[2, 0]] | [[1, 0]] | Failed |
| fixture 2 | [[0, 2]] | [[0, 1]] | Failed |
| fixture 3 | [[1, -1]] | [[0.5, -0.5]] | Failed |
| fixture 4 | [] | [] | Passed |
SHA-256 / 2ac788778a9d11777f2a6f7b3a851c2f78a0ba1c7fb8bcdf9806241b784aa283
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 [[(left+right)/2,(right-left)/2] for left,right in frames]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[1, 1]],)),[[1, 0]])
check('fixture 2',solve(*([[1, -1]],)),[[0, 1]])
check('fixture 3',solve(*([[0, 1]],)),[[0.5, -0.5]])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [[1.0, 0.0]] | [[1, 0]] | Passed |
| fixture 2 | [[0.0, -1.0]] | [[0, 1]] | Failed |
| fixture 3 | [[0.5, 0.5]] | [[0.5, -0.5]] | Failed |
| fixture 4 | [] | [] | Passed |
SHA-256 / 6b947d37b4134574e7b511ee71ba73f78d2fca09ab748ab3734763e57c2a1c52
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 [[(left+right)/2,(left-right)/2] for left,right in frames]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[1, 1]],)),[[1, 0]])
check('fixture 2',solve(*([[1, -1]],)),[[0, 1]])
check('fixture 3',solve(*([[0, 1]],)),[[0.5, -0.5]])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [[1.0, 0.0]] | [[1, 0]] | Passed |
| fixture 2 | [[0.0, 1.0]] | [[0, 1]] | Passed |
| fixture 3 | [[0.5, -0.5]] | [[0.5, -0.5]] | Passed |
| fixture 4 | [] | [] | Passed |
SHA-256 / d6d11469bef7a57bf76c611aa7cf3e2b794aee7ba18b5d68bb64f096325f2474
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.302927+00:00.
Case digest / 194a188348c564fab8a59f4f14bd9d10fa03b77299eb2e9dfa7edb84cbd13dad