FA-10786 / PCM sample encoding / Open access
Signed sixteen little endian decode · case 01
Byte order swaps the significance of each PCM sample byte.
ROOT CAUSE
Byte order swaps the significance of each PCM sample byte.
VERIFIED REPAIR
Apply the explicit PCM/playback contract: Decode a byte-value list of even length as signed 16-bit little-endian PCM samples.
Unsuccessful approach: Correcting endianness while retaining unsigned interpretation makes negative samples positive.
Case contract
Decode a byte-value list of even length as signed 16-bit little-endian PCM samples.
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+2]),"big",signed=True) for i in range(0,len(data),2)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([0, 128, 255, 127],)),[-32768, 32767])
check('fixture 2',solve(*([1, 0, 255, 255],)),[1, -1])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [128, -129] | [-32768, 32767] | Failed |
| fixture 2 | [256, -1] | [1, -1] | Failed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [0] | [0] | Passed |
SHA-256 / 2c408f56b3210792e500d13ad15f053d221dba75fbe09f268d1fc4fde74e5d69
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=False) for i in range(0,len(data),2)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([0, 128, 255, 127],)),[-32768, 32767])
check('fixture 2',solve(*([1, 0, 255, 255],)),[1, -1])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [32768, 32767] | [-32768, 32767] | Failed |
| fixture 2 | [1, 65535] | [1, -1] | Failed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [0] | [0] | Passed |
SHA-256 / ee9c6af23b414cb72ed3ab04494c652a933730d23b8e3d3a20d676667ef4063e
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+2]),"little",signed=True) for i in range(0,len(data),2)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([0, 128, 255, 127],)),[-32768, 32767])
check('fixture 2',solve(*([1, 0, 255, 255],)),[1, -1])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | [-32768, 32767] | [-32768, 32767] | Passed |
| fixture 2 | [1, -1] | [1, -1] | Passed |
| fixture 3 | [] | [] | Passed |
| fixture 4 | [0] | [0] | Passed |
SHA-256 / 83eb6a9f56d0fe3d08b73e06e594d3839ee93665de4ab9f1a84c139d2a026e49
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.227296+00:00.
Case digest / 45475bacb7284ac1d5130dccd9d1f251908ab195dea74f9c92d13f805d488e3d