FAILURE MAP
← Case archive

FA-10961 / Audio playback scheduling / Open access

Loop playback wrap offset · case 01

Modulo uses the loop length without restoring the nonzero loop origin.

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

ROOT CAUSE

Modulo uses the loop length without restoring the nonzero loop origin.

VERIFIED REPAIR

Apply the explicit PCM/playback contract: Position lies in nonempty integer loop [start,end). Advance nonnegative frames, wrapping arbitrary multiple times and preserving overshoot.

Unsuccessful approach: Jumping to loop start discards residual advance beyond the boundary.

Case contract

Position lies in nonempty integer loop [start,end). Advance nonnegative frames, wrapping arbitrary multiple times and preserving overshoot.

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, advance, start, end):
    return (position+advance)%(end-start)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(12, 4, 10, 15)),11)
check('fixture 2',solve(*(12, 14, 10, 15)),11)
check('fixture 3',solve(*(10, 0, 10, 15)),10)
check('fixture 4',solve(*(14, 1, 10, 15)),10)
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 1111Failed
fixture 2111Failed
fixture 3010Failed
fixture 4010Failed

SHA-256 / f9a74c38654c87757a80220fc797651ddaa05dca376790ea45aa4dbd6ffe9bc1

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(position, advance, start, end):
    return start if position+advance>=end else position+advance
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(12, 4, 10, 15)),11)
check('fixture 2',solve(*(12, 14, 10, 15)),11)
check('fixture 3',solve(*(10, 0, 10, 15)),10)
check('fixture 4',solve(*(14, 1, 10, 15)),10)
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 11011Failed
fixture 21011Failed
fixture 31010Passed
fixture 41010Passed

SHA-256 / 3188f408d7bd10cad3450357e7c056dc32a6a11efe21d07c670f44fc238f7341

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(position, advance, start, end):
    return start+(position-start+advance)%(end-start)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(12, 4, 10, 15)),11)
check('fixture 2',solve(*(12, 14, 10, 15)),11)
check('fixture 3',solve(*(10, 0, 10, 15)),10)
check('fixture 4',solve(*(14, 1, 10, 15)),10)
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 11111Passed
fixture 21111Passed
fixture 31010Passed
fixture 41010Passed

SHA-256 / e3b1770a488c3c4a8cdaa02e6ee41aaf06ef26d593fbedb395bf936176b6d2fd

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

Case digest / f5041ea729f47c684d130a94328f3f863ab7b140cda8c044e12e17bf9708cf35