FAILURE MAP
← Case archive

FA-10971 / Audio playback scheduling / Open access

Stream end stops after tail · case 01

The last callback claims requested frames beyond stream end.

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

ROOT CAUSE

The last callback claims requested frames beyond stream end.

VERIFIED REPAIR

Apply the explicit PCM/playback contract: Position is in [0,length]. Return [available frames to render,finished after this request], including a final partial block before stopping.

Unsuccessful approach: Stopping immediately at a crossing drops the valid final tail.

Case contract

Position is in [0,length]. Return [available frames to render,finished after this request], including a final partial block before stopping.

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

SHA-256 / d2c8e9d159dc0e10e823e0d7f097e2e77e21b0fac8762997069e06d56a194fae

2 / The unsuccessful fix

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

SHA-256 / 38bd410eb20275e528602f69e538af1ec6e6d15e81576fc51c9a95bc329c7207

3 / The verified repair

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

SHA-256 / 882fd4651a3404ecb38b6b3d37ba114687efe25493c0687e32412157feec1e64

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

Case digest / 411bd6660d67ba4d6b89353aba36a875c7e65e69baf1d5d4fe8116b7dc32b1a2