FAILURE MAP
← Case archive

FA-10916 / Audio channel mixing / Open access

Channel gains independent · case 01

A single gain replaces separately configured channel volumes.

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

ROOT CAUSE

A single gain replaces separately configured channel volumes.

VERIFIED REPAIR

Apply the explicit PCM/playback contract: Apply a corresponding scalar gain per channel to each equal-width frame; gains length equals frame width.

Unsuccessful approach: Gain index follows time-frame position rather than channel position.

Case contract

Apply a corresponding scalar gain per channel to each equal-width frame; gains length equals frame width.

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, gains):
    return [[x*gains[0] 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, 1], [1, 1]], [0.25, 0.75])),[[0.25, 0.75], [0.25, 0.75]])
check('fixture 2',solve(*([[2, 4]], [0, 0.5])),[[0, 2]])
check('fixture 3',solve(*([], [1, 1])),[])
check('fixture 4',solve(*([[1], [2]], [0.5])),[[0.5], [1]])
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.25, 0.25], [0.25, 0.25]][[0.25, 0.75], [0.25, 0.75]]Failed
fixture 2[[0, 0]][[0, 2]]Failed
fixture 3[][]Passed
fixture 4[[0.5], [1.0]][[0.5], [1]]Passed

SHA-256 / 43ccbe8bd980d68cfab9326d717180f6f754d976583de74327ff48f5f36acc6c

2 / The unsuccessful fix

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

SHA-256 / cb1a58e19e6217dd9a53c69617856661595753325da818c308c7701886664238

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(frames, gains):
    return [[x*g for x,g in zip(frame,gains)] 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, 1], [1, 1]], [0.25, 0.75])),[[0.25, 0.75], [0.25, 0.75]])
check('fixture 2',solve(*([[2, 4]], [0, 0.5])),[[0, 2]])
check('fixture 3',solve(*([], [1, 1])),[])
check('fixture 4',solve(*([[1], [2]], [0.5])),[[0.5], [1]])
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.25, 0.75], [0.25, 0.75]][[0.25, 0.75], [0.25, 0.75]]Passed
fixture 2[[0, 2.0]][[0, 2]]Passed
fixture 3[][]Passed
fixture 4[[0.5], [1.0]][[0.5], [1]]Passed

SHA-256 / 913aa0972e4495c357bde94b320db8e22e11be91c9ae4f4a160952e4893fc910

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

Case digest / bd3b59c31c739a178c2c217d6bc259e823075b3e3e43ae9adf24d455a0d3df97