FA-11026 / Audio channel mixing / Open access
Polarity invert selected channels · case 01
Inverting a selected channel applies polarity inversion to every channel.
ROOT CAUSE
Inverting a selected channel applies polarity inversion to every channel.
VERIFIED REPAIR
Apply the explicit PCM/playback contract: Invert the sign of samples only on selected channel indices, preserving frame layout and unselected channels; use floating or unbounded integer intermediates.
Unsuccessful approach: Rectifying magnitudes removes negative waveform halves instead of inverting polarity.
Case contract
Invert the sign of samples only on selected channel indices, preserving frame layout and unselected channels; use floating or unbounded integer intermediates.
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, selected):
return [[-x for x in frame] for frame in frames]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[1, -2], [-3, 4]], [0])),[[-1, -2], [3, 4]])
check('fixture 2',solve(*([[1, -2]], [])),[[1, -2]])
check('fixture 3',solve(*([[1, -2]], [0, 1])),[[-1, 2]])
check('fixture 4',solve(*([], [0])),[])
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, 2], [3, -4]] | [[-1, -2], [3, 4]] | Failed |
| fixture 2 | [[-1, 2]] | [[1, -2]] | Failed |
| fixture 3 | [[-1, 2]] | [[-1, 2]] | Passed |
| fixture 4 | [] | [] | Passed |
SHA-256 / 7245d281c91207078a1488398a18c54956364a79a7b859729ec65b113c0d7970
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(frames, selected):
return [[abs(x) if c in selected else x for c,x in enumerate(frame)] for frame in frames]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[1, -2], [-3, 4]], [0])),[[-1, -2], [3, 4]])
check('fixture 2',solve(*([[1, -2]], [])),[[1, -2]])
check('fixture 3',solve(*([[1, -2]], [0, 1])),[[-1, 2]])
check('fixture 4',solve(*([], [0])),[])
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, -2], [3, 4]] | [[-1, -2], [3, 4]] | Failed |
| fixture 2 | [[1, -2]] | [[1, -2]] | Passed |
| fixture 3 | [[1, 2]] | [[-1, 2]] | Failed |
| fixture 4 | [] | [] | Passed |
SHA-256 / 572785ae17489175cabe62e07f769e692612868c7074b557df8d6b94c1b56a68
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(frames, selected):
return [[-x if c in selected else x for c,x in enumerate(frame)] for frame in frames]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[1, -2], [-3, 4]], [0])),[[-1, -2], [3, 4]])
check('fixture 2',solve(*([[1, -2]], [])),[[1, -2]])
check('fixture 3',solve(*([[1, -2]], [0, 1])),[[-1, 2]])
check('fixture 4',solve(*([], [0])),[])
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, -2], [3, 4]] | [[-1, -2], [3, 4]] | Passed |
| fixture 2 | [[1, -2]] | [[1, -2]] | Passed |
| fixture 3 | [[-1, 2]] | [[-1, 2]] | Passed |
| fixture 4 | [] | [] | Passed |
SHA-256 / d7c03ae30b6a5b6558c862e5a6b9607b04eb779fdc153f3a5b38858217b20014
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.340555+00:00.
Case digest / b188820cbd49e718dd31696ffed2604ac79bf47bc5108bc4ae8a200f8240b048