FAILURE MAP
← Case archive

FA-10876 / Audio frame buffers / Open access

Underrun zero fill · case 01

A device callback returns fewer samples than the hardware requested.

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

ROOT CAUSE

A device callback returns fewer samples than the hardware requested.

VERIFIED REPAIR

Apply the explicit PCM/playback contract: Produce exactly nonnegative requested mono signed-PCM samples, filling a shortage with zero and excluding surplus.

Unsuccessful approach: Padding without trimming supplies excess samples on non-underrun callbacks.

Case contract

Produce exactly nonnegative requested mono signed-PCM samples, filling a shortage with zero and excluding surplus.

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(available, requested):
    return list(available[:requested])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([1], 3)),[1, 0, 0])
check('fixture 2',solve(*([1, 2, 3], 2)),[1, 2])
check('fixture 3',solve(*([], 2)),[0, 0])
check('fixture 4',solve(*([1], 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 fixtureActualExpectedOutcome
fixture 1[1][1, 0, 0]Failed
fixture 2[1, 2][1, 2]Passed
fixture 3[][0, 0]Failed
fixture 4[][]Passed

SHA-256 / 78adc35af967f66873183bc1d455f07148b45d4ac76d8d9b54d7c9d388ebb325

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(available, requested):
    return list(available)+[0]*max(0,requested-len(available))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([1], 3)),[1, 0, 0])
check('fixture 2',solve(*([1, 2, 3], 2)),[1, 2])
check('fixture 3',solve(*([], 2)),[0, 0])
check('fixture 4',solve(*([1], 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 fixtureActualExpectedOutcome
fixture 1[1, 0, 0][1, 0, 0]Passed
fixture 2[1, 2, 3][1, 2]Failed
fixture 3[0, 0][0, 0]Passed
fixture 4[1][]Failed

SHA-256 / e26a797e0a0421521a8ded74b7d25d30cbec11982f241663f1d1f8b16dcebff9

3 / The verified repair

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

SHA-256 / 487bd1356c02756686cceaf7a29c355e973acf09f3d2f5b6b27dc6ecc12aaa1a

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

Case digest / 394e507a0602d277b85c3af82b9d9a7eb7873d656ab15fbf97849023cb1fd99e