FAILURE MAP
← Case archive

FA-10881 / Audio frame buffers / Open access

Overrun drops oldest frames · case 01

Truncating the tail retains stale buffered audio and drops newest input.

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

ROOT CAUSE

Truncating the tail retains stale buffered audio and drops newest input.

VERIFIED REPAIR

Apply the explicit PCM/playback contract: Append mono samples and retain the newest at most nonnegative capacity samples for a drop-oldest real-time buffer.

Unsuccessful approach: Replacing the buffer with only incoming audio discards still-useful old samples before capacity is reached.

Case contract

Append mono samples and retain the newest at most nonnegative capacity samples for a drop-oldest real-time buffer.

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

SHA-256 / cc171a3a2a3c4c72c734d0d8ef734d8d0f4c6b0e5f703ab2eb26313d70e200d0

2 / The unsuccessful fix

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

SHA-256 / fd71ce966e1bdc64fd34d224bc0efa492e49a650844da08b07bd93dec7212267

3 / The verified repair

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

SHA-256 / d961728abc99b77e5a70e112d3bee639cd6f127f33e0d6941ec24433aa6e82bb

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

Case digest / 0c131fecd7be182019ad9b0e92610fca26343ef0851c36470110f757755ebe78