FA-49741 / PCM sample encoding / Open access
Pcm adaptive nibble selection: difference predictor · case 01
Adaptive PCM encoder omits the reconstructed predictor.
ROOT CAUSE
Adaptive PCM encoder omits the reconstructed predictor.
VERIFIED REPAIR
Use the stated conversion contract at difference predictor.
Unsuccessful approach: Reversing the residual changes the sign nibble.
Case contract
Bounded fixed-step adaptive-nibble PCM encoder: greedy magnitude bits, a half-bin base, and predictor feedback from reconstructed rather than original amplitudes.
Why this case matters
Offline PCM interchange uses these exact bounded packet and sample representation decisions.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(samples, predictor, step):
out=[]
for sample in samples:
difference=sample
sign=8 if difference<0 else 0
magnitude=abs(difference)
code=0
restored=step//8
for bit,part in [(4,step),(2,step//2),(1,step//4)]:
if magnitude>=part:
code|=bit
magnitude-=part
restored+=part
predictor+=-restored if sign else restored
out.append(sign|code)
return [out,predictor]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([2, 6, -4, 10], 0, 8)), [[1, 1, 13, 7], 10])
check('oracle 2', solve(*([10, 10, 10], 3, 12)), [[2, 0, 8], 10])
check('oracle 3', solve(*([-5, -10, 0], 0, 8)), [[10, 10, 5], 1])
check('oracle 4', solve(*([], 4, 8)), [[], 4])
check('oracle 5', solve(*([0, 1, 2, 3], 0, 16)), [[0, 8, 0, 0], 4])
check('oracle 6', solve(*([8, 16, 24], 0, 8)), [[4, 3, 4], 25])
check('oracle 7', solve(*([6, -6, 6], 1, 4)), [[5, 15, 7], 6])
if N == 1: check('variant packet 1', solve(*[[2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7], 10])
if N == 2: check('variant packet 2', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 10])
if N == 3: check('variant packet 3', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 10])
if N == 4: check('variant packet 4', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 10])
if N == 5: check('variant packet 5', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 1 | [[1, 3, 10, 5], 16] | [[1, 1, 13, 7], 10] | Failed |
| oracle 2 | [[3, 3, 3], 33] | [[2, 0, 8], 10] | Failed |
| oracle 3 | [[10, 13, 0], -15] | [[10, 10, 5], 1] | Failed |
| oracle 4 | [[], 4] | [[], 4] | Passed |
| oracle 5 | [[0, 0, 0, 0], 8] | [[0, 8, 0, 0], 4] | Failed |
| oracle 6 | [[4, 7, 7], 39] | [[4, 3, 4], 25] | Failed |
| oracle 7 | [[6, 14, 6], 7] | [[5, 15, 7], 6] | Failed |
| variant packet 1 | [[1, 3, 10, 5, 1, 3, 10, 5], 32] | [[1, 1, 13, 7, 12, 2, 13, 7], 10] | Failed |
SHA-256 / 824eb9828dd009235e6fecbb270a73a349528578828a7d8cefb341ef990ead7f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(samples, predictor, step):
out=[]
for sample in samples:
difference=predictor-sample
sign=8 if difference<0 else 0
magnitude=abs(difference)
code=0
restored=step//8
for bit,part in [(4,step),(2,step//2),(1,step//4)]:
if magnitude>=part:
code|=bit
magnitude-=part
restored+=part
predictor+=-restored if sign else restored
out.append(sign|code)
return [out,predictor]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([2, 6, -4, 10], 0, 8)), [[1, 1, 13, 7], 10])
check('oracle 2', solve(*([10, 10, 10], 3, 12)), [[2, 0, 8], 10])
check('oracle 3', solve(*([-5, -10, 0], 0, 8)), [[10, 10, 5], 1])
check('oracle 4', solve(*([], 4, 8)), [[], 4])
check('oracle 5', solve(*([0, 1, 2, 3], 0, 16)), [[0, 8, 0, 0], 4])
check('oracle 6', solve(*([8, 16, 24], 0, 8)), [[4, 3, 4], 25])
check('oracle 7', solve(*([6, -6, 6], 1, 4)), [[5, 15, 7], 6])
if N == 1: check('variant packet 1', solve(*[[2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7], 10])
if N == 2: check('variant packet 2', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 10])
if N == 3: check('variant packet 3', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 10])
if N == 4: check('variant packet 4', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 10])
if N == 5: check('variant packet 5', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 1 | [[9, 12, 12, 15], -36] | [[1, 1, 13, 7], 10] | Failed |
| oracle 2 | [[10, 12, 15], -39] | [[2, 0, 8], 10] | Failed |
| oracle 3 | [[2, 7, 7], 35] | [[10, 10, 5], 1] | Failed |
| oracle 4 | [[], 4] | [[], 4] | Passed |
| oracle 5 | [[0, 0, 0, 0], 8] | [[0, 8, 0, 0], 4] | Failed |
| oracle 6 | [[12, 15, 15], -39] | [[4, 3, 4], 25] | Failed |
| oracle 7 | [[13, 2, 15], -9] | [[5, 15, 7], 6] | Failed |
| variant packet 1 | [[9, 12, 12, 15, 15, 15, 15, 15], -96] | [[1, 1, 13, 7, 12, 2, 13, 7], 10] | Failed |
SHA-256 / 3ed9ff90e9ce8402cfd5742da9a43939d4ab9e653c4b47e0371b8d879e905347
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(samples, predictor, step):
out=[]
for sample in samples:
difference=sample-predictor
sign=8 if difference<0 else 0
magnitude=abs(difference)
code=0
restored=step//8
for bit,part in [(4,step),(2,step//2),(1,step//4)]:
if magnitude>=part:
code|=bit
magnitude-=part
restored+=part
predictor+=-restored if sign else restored
out.append(sign|code)
return [out,predictor]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([2, 6, -4, 10], 0, 8)), [[1, 1, 13, 7], 10])
check('oracle 2', solve(*([10, 10, 10], 3, 12)), [[2, 0, 8], 10])
check('oracle 3', solve(*([-5, -10, 0], 0, 8)), [[10, 10, 5], 1])
check('oracle 4', solve(*([], 4, 8)), [[], 4])
check('oracle 5', solve(*([0, 1, 2, 3], 0, 16)), [[0, 8, 0, 0], 4])
check('oracle 6', solve(*([8, 16, 24], 0, 8)), [[4, 3, 4], 25])
check('oracle 7', solve(*([6, -6, 6], 1, 4)), [[5, 15, 7], 6])
if N == 1: check('variant packet 1', solve(*[[2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7], 10])
if N == 2: check('variant packet 2', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 10])
if N == 3: check('variant packet 3', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 10])
if N == 4: check('variant packet 4', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 10])
if N == 5: check('variant packet 5', solve(*[[2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10, 2, 6, -4, 10], 0, 8]), [[1, 1, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7, 12, 2, 13, 7], 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 1 | [[1, 1, 13, 7], 10] | [[1, 1, 13, 7], 10] | Passed |
| oracle 2 | [[2, 0, 8], 10] | [[2, 0, 8], 10] | Passed |
| oracle 3 | [[10, 10, 5], 1] | [[10, 10, 5], 1] | Passed |
| oracle 4 | [[], 4] | [[], 4] | Passed |
| oracle 5 | [[0, 8, 0, 0], 4] | [[0, 8, 0, 0], 4] | Passed |
| oracle 6 | [[4, 3, 4], 25] | [[4, 3, 4], 25] | Passed |
| oracle 7 | [[5, 15, 7], 6] | [[5, 15, 7], 6] | Passed |
| variant packet 1 | [[1, 1, 13, 7, 12, 2, 13, 7], 10] | [[1, 1, 13, 7, 12, 2, 13, 7], 10] | Passed |
SHA-256 / 534d9e881616e3a48d8bf1858d3373a1afd0e6587667e3ba78af3402ed89fa60
Verification & scope
Stipulated finite model; no claim of hardware timing or full file-format conformance. 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:45:02.773002+00:00.
Case digest / 53aad2e2c9beebcdbce1b33d9d1c76e61b3b662b91ad28e387f636790d51c2bc