FAILURE MAP
← Case archive

FA-10831 / Audio frame buffers / Open access

Sample count to frame count · case 01

Sample count is reported as frame count in multichannel audio.

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

ROOT CAUSE

Sample count is reported as frame count in multichannel audio.

VERIFIED REPAIR

Apply the explicit PCM/playback contract: Return complete frame count for a flat sample sequence and positive channel count; partial trailing frame is not counted.

Unsuccessful approach: Rounding upward counts an incomplete trailing frame.

Case contract

Return complete frame count for a flat sample sequence and positive channel count; partial trailing frame is not counted.

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(samples, channels):
    return len(samples)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([1, 2, 3, 4], 2)),2)
check('fixture 2',solve(*([1, 2, 3], 2)),1)
check('fixture 3',solve(*([], 2)),0)
check('fixture 4',solve(*([1, 2, 3], 1)),3)
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 142Failed
fixture 231Failed
fixture 300Passed
fixture 433Passed

SHA-256 / 1080c237d24dd6e9f3b7ce5ae9fb4c5703ff04a24470df00d6f0efd183510ce4

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(samples, channels):
    return math.ceil(len(samples)/channels)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([1, 2, 3, 4], 2)),2)
check('fixture 2',solve(*([1, 2, 3], 2)),1)
check('fixture 3',solve(*([], 2)),0)
check('fixture 4',solve(*([1, 2, 3], 1)),3)
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 122Passed
fixture 221Failed
fixture 300Passed
fixture 433Passed

SHA-256 / c63053a0073d1c2d949ee0f8901c7a5940b2a152d80cc66a00c3934242862772

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(samples, channels):
    return len(samples)//channels
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([1, 2, 3, 4], 2)),2)
check('fixture 2',solve(*([1, 2, 3], 2)),1)
check('fixture 3',solve(*([], 2)),0)
check('fixture 4',solve(*([1, 2, 3], 1)),3)
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 122Passed
fixture 211Passed
fixture 300Passed
fixture 433Passed

SHA-256 / 6c5b24475c928fc2ad92a193e0014f7a9e3c026ec6a9cc152a44bf3c27e8df1c

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

Case digest / e51dfa66fe765493fff3780df01c18428b9ebb678c367f56c224bc1b40770515