FAILURE MAP
← Case archive

FA-10796 / PCM sample encoding / Open access

Signed sixteen encode little endian · case 01

Sample bytes are emitted in network order for a little-endian PCM sink.

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

ROOT CAUSE

Sample bytes are emitted in network order for a little-endian PCM sink.

VERIFIED REPAIR

Apply the explicit PCM/playback contract: Encode integer samples in signed 16-bit range into a flat little-endian byte-value list.

Unsuccessful approach: Encoding magnitudes removes the waveform negative half-cycle.

Case contract

Encode integer samples in signed 16-bit range into a flat little-endian byte-value list.

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(samples):
    return [b for x in samples for b in x.to_bytes(2,"big",signed=True)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([1, -1],)),[1, 0, 255, 255])
check('fixture 2',solve(*([-32768, 32767],)),[0, 128, 255, 127])
check('fixture 3',solve(*([],)),[])
check('fixture 4',solve(*([0],)),[0, 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[0, 1, 255, 255][1, 0, 255, 255]Failed
fixture 2[128, 0, 127, 255][0, 128, 255, 127]Failed
fixture 3[][]Passed
fixture 4[0, 0][0, 0]Passed

SHA-256 / efc3cfc63c7ec021d206bb35a1dc7a276b4e46ec3f27def60f46e50470df5c93

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(samples):
    return [b for x in samples for b in abs(x).to_bytes(2,"little",signed=False)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([1, -1],)),[1, 0, 255, 255])
check('fixture 2',solve(*([-32768, 32767],)),[0, 128, 255, 127])
check('fixture 3',solve(*([],)),[])
check('fixture 4',solve(*([0],)),[0, 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, 0, 1, 0][1, 0, 255, 255]Failed
fixture 2[0, 128, 255, 127][0, 128, 255, 127]Passed
fixture 3[][]Passed
fixture 4[0, 0][0, 0]Passed

SHA-256 / 08619c25c97d9f4c807f8d881701a4225db92bc072bbc68b553f0356b6b6ff46

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(samples):
    return [b for x in samples for b in x.to_bytes(2,"little",signed=True)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([1, -1],)),[1, 0, 255, 255])
check('fixture 2',solve(*([-32768, 32767],)),[0, 128, 255, 127])
check('fixture 3',solve(*([],)),[])
check('fixture 4',solve(*([0],)),[0, 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, 0, 255, 255][1, 0, 255, 255]Passed
fixture 2[0, 128, 255, 127][0, 128, 255, 127]Passed
fixture 3[][]Passed
fixture 4[0, 0][0, 0]Passed

SHA-256 / 4695b0ed0a87c50f70168e86e35473a1a0947085c17f1bc3047d41f1b5b5457f

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

Case digest / af447cc6720f2b3300cd2ed9d2009d66898c20976b6bbc8d79a8ad9c42da7397