FAILURE MAP
← Case archive

FA-10791 / PCM sample encoding / Open access

Signed twenty four sign extension · case 01

A 24-bit negative sample is decoded without sign extension.

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

ROOT CAUSE

A 24-bit negative sample is decoded without sign extension.

VERIFIED REPAIR

Apply the explicit PCM/playback contract: Decode byte-value list length divisible by three as signed little-endian 24-bit PCM.

Unsuccessful approach: Reading only two bytes truncates the high byte and changes dynamic range.

Case contract

Decode byte-value list length divisible by three as signed little-endian 24-bit PCM.

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(data):
    return [int.from_bytes(bytes(data[i:i+3]),"little",signed=False) for i in range(0,len(data),3)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([0, 0, 128],)),[-8388608])
check('fixture 2',solve(*([255, 255, 127],)),[8388607])
check('fixture 3',solve(*([255, 255, 255],)),[-1])
check('fixture 4',solve(*([1, 0, 0],)),[1])
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[8388608][-8388608]Failed
fixture 2[8388607][8388607]Passed
fixture 3[16777215][-1]Failed
fixture 4[1][1]Passed

SHA-256 / 384ad8c1f8c0561373d0595b79b93c70ae14f090b8a32b321eb759a9642c2d98

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(data):
    return [int.from_bytes(bytes(data[i:i+2]),"little",signed=True) for i in range(0,len(data),3)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([0, 0, 128],)),[-8388608])
check('fixture 2',solve(*([255, 255, 127],)),[8388607])
check('fixture 3',solve(*([255, 255, 255],)),[-1])
check('fixture 4',solve(*([1, 0, 0],)),[1])
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][-8388608]Failed
fixture 2[-1][8388607]Failed
fixture 3[-1][-1]Passed
fixture 4[1][1]Passed

SHA-256 / 4814a3a0ba821a345690417b7955212e2625f93730617d74c611791bcb03d512

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(data):
    return [int.from_bytes(bytes(data[i:i+3]),"little",signed=True) for i in range(0,len(data),3)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([0, 0, 128],)),[-8388608])
check('fixture 2',solve(*([255, 255, 127],)),[8388607])
check('fixture 3',solve(*([255, 255, 255],)),[-1])
check('fixture 4',solve(*([1, 0, 0],)),[1])
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[-8388608][-8388608]Passed
fixture 2[8388607][8388607]Passed
fixture 3[-1][-1]Passed
fixture 4[1][1]Passed

SHA-256 / c6221f2306339f044484bb9cd2fc0539131c5486758b3c63914cf3e9b6ae5747

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

Case digest / 002525d268f80eab246cc8c914ebf1638f2f14a32cf32fc05e379f2c94bb7f7d