FAILURE MAP
← Case archive

FA-10991 / Audio playback scheduling / Open access

Read ring logical order · case 01

A slice stops at the physical buffer end instead of wrapping.

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

ROOT CAUSE

A slice stops at the physical buffer end instead of wrapping.

VERIFIED REPAIR

Apply the explicit PCM/playback contract: Read nonnegative count samples, at most ring capacity, in logical order from a valid cursor in a nonempty ring.

Unsuccessful approach: Reading the prefix ignores the current logical cursor.

Case contract

Read nonnegative count samples, at most ring capacity, in logical order from a valid cursor in a nonempty ring.

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, position, count):
    return buffer[position:position+count]
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, 3)),[4, 1, 2])
check('fixture 2',solve(*([1, 2], 0, 2)),[1, 2])
check('fixture 3',solve(*([1], 0, 0)),[])
check('fixture 4',solve(*([1, 2, 3], 1, 1)),[2])
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][4, 1, 2]Failed
fixture 2[1, 2][1, 2]Passed
fixture 3[][]Passed
fixture 4[2][2]Passed

SHA-256 / 05dd4a9d325c6b79e824b359e0a5dddc07cb6b3f1dd068290c3623ac192210e0

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(buffer, position, count):
    return buffer[:count]
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, 3)),[4, 1, 2])
check('fixture 2',solve(*([1, 2], 0, 2)),[1, 2])
check('fixture 3',solve(*([1], 0, 0)),[])
check('fixture 4',solve(*([1, 2, 3], 1, 1)),[2])
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][4, 1, 2]Failed
fixture 2[1, 2][1, 2]Passed
fixture 3[][]Passed
fixture 4[1][2]Failed

SHA-256 / 19e070266312d0d1fefb20139e1a41549dc22058f2595ceea58b37821383a267

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(buffer, position, count):
    return [buffer[(position+i)%len(buffer)] for i in range(count)]
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, 3)),[4, 1, 2])
check('fixture 2',solve(*([1, 2], 0, 2)),[1, 2])
check('fixture 3',solve(*([1], 0, 0)),[])
check('fixture 4',solve(*([1, 2, 3], 1, 1)),[2])
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, 1, 2][4, 1, 2]Passed
fixture 2[1, 2][1, 2]Passed
fixture 3[][]Passed
fixture 4[2][2]Passed

SHA-256 / eff310c00738cb13e180cab61ee347bad147670ac26749e08d166d161a17074b

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

Case digest / 7b5c58e41a42884e30066ceca6938a5cf6ae0ce7f20f2ad650059855c6631daf