FA-49736 / PCM sample encoding / Open access
Pcm adaptive nibble reconstruction: feedback index · case 01
Each nibble replaces the step index rather than adapting prior state.
ROOT CAUSE
Each nibble replaces the step index rather than adapting prior state.
VERIFIED REPAIR
Use the stated conversion contract at feedback index.
Unsuccessful approach: Reversing the adaptation direction decreases precision for quiet codes.
Case contract
Stipulated bounded adaptive differential PCM nibble model with a 16-entry step table, magnitude adaptation, signed predictor saturation and exported predictor/index state.
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(codes, predictor, step_index):
steps=[7,8,9,10,11,12,13,14,16,17,19,21,23,25,28,31]
adjust=[-1,-1,-1,-1,2,4,6,8]
out=[]
for code in codes:
step=steps[step_index]
delta=step//8
if code&1: delta+=step//4
if code&2: delta+=step//2
if code&4: delta+=step
predictor+=-delta if code&8 else delta
predictor=max(-128,min(127,predictor))
step_index=max(0,min(len(steps)-1,adjust[code&7]))
out.append(predictor)
return [out,predictor,step_index]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 1, 2, 3, 4, 7, 8, 15], 0, 4)), [[1, 4, 9, 16, 23, 39, 37, 6], 6, 15])
check('oracle 2', solve(*([7, 7, 7], 120, 14)), [[127, 127, 127], 127, 15])
check('oracle 3', solve(*([15, 15], -120, 15)), [[-128, -128], -128, 15])
check('oracle 4', solve(*([], 4, 2)), [[], 4, 2])
check('oracle 5', solve(*([0, 0, 0], 0, 1)), [[1, 1, 1], 1, 0])
check('oracle 6', solve(*([4, 12, 6, 14], 3, 8)), [[21, 0, 36, -13], -13, 15])
check('oracle 7', solve(*([1, 9, 2, 10], -4, 5)), [[0, -3, 3, -2], -2, 1])
if N == 1: check('variant packet 1', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66], 66, 15])
if N == 2: check('variant packet 2', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72], 72, 15])
if N == 3: check('variant packet 3', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72], 72, 15])
if N == 4: check('variant packet 4', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72], 72, 15])
if N == 5: check('variant packet 5', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72], 72, 15])
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, 2, 5, 9, 16, 32, 30, 19], 19, 8] | [[1, 4, 9, 16, 23, 39, 37, 6], 6, 15] | Failed |
| oracle 2 | [[127, 127, 127], 127, 8] | [[127, 127, 127], 127, 15] | Failed |
| oracle 3 | [[-128, -128], -128, 8] | [[-128, -128], -128, 15] | Failed |
| oracle 4 | [[], 4, 2] | [[], 4, 2] | Passed |
| oracle 5 | [[1, 1, 1], 1, 0] | [[1, 1, 1], 1, 0] | Passed |
| oracle 6 | [[21, 11, 25, 5], 5, 6] | [[21, 0, 36, -13], -13, 15] | Failed |
| oracle 7 | [[0, -1, 2, -1], -1, 0] | [[0, -3, 3, -2], -2, 1] | Failed |
| variant packet 1 | [[1, 2, 5, 9, 16, 32, 30, 19, 21, 22, 25, 29, 36, 52, 50, 39], 39, 8] | [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66], 66, 15] | Failed |
SHA-256 / 74181a70bc350bd8c01bec9fe695ebcf8fcf5ab832ce1070989e7e9e059e7b2b
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(codes, predictor, step_index):
steps=[7,8,9,10,11,12,13,14,16,17,19,21,23,25,28,31]
adjust=[-1,-1,-1,-1,2,4,6,8]
out=[]
for code in codes:
step=steps[step_index]
delta=step//8
if code&1: delta+=step//4
if code&2: delta+=step//2
if code&4: delta+=step
predictor+=-delta if code&8 else delta
predictor=max(-128,min(127,predictor))
step_index=max(0,min(len(steps)-1,step_index-adjust[code&7]))
out.append(predictor)
return [out,predictor,step_index]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 1, 2, 3, 4, 7, 8, 15], 0, 4)), [[1, 4, 9, 16, 23, 39, 37, 6], 6, 15])
check('oracle 2', solve(*([7, 7, 7], 120, 14)), [[127, 127, 127], 127, 15])
check('oracle 3', solve(*([15, 15], -120, 15)), [[-128, -128], -128, 15])
check('oracle 4', solve(*([], 4, 2)), [[], 4, 2])
check('oracle 5', solve(*([0, 0, 0], 0, 1)), [[1, 1, 1], 1, 0])
check('oracle 6', solve(*([4, 12, 6, 14], 3, 8)), [[21, 0, 36, -13], -13, 15])
check('oracle 7', solve(*([1, 9, 2, 10], -4, 5)), [[0, -3, 3, -2], -2, 1])
if N == 1: check('variant packet 1', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66], 66, 15])
if N == 2: check('variant packet 2', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72], 72, 15])
if N == 3: check('variant packet 3', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72], 72, 15])
if N == 4: check('variant packet 4', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72], 72, 15])
if N == 5: check('variant packet 5', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72], 72, 15])
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, 5, 12, 23, 41, 64, 64, 49], 49, 0] | [[1, 4, 9, 16, 23, 39, 37, 6], 6, 15] | Failed |
| oracle 2 | [[127, 127, 127], 127, 0] | [[127, 127, 127], 127, 15] | Failed |
| oracle 3 | [[-128, -128], -128, 0] | [[-128, -128], -128, 15] | Failed |
| oracle 4 | [[], 4, 2] | [[], 4, 2] | Passed |
| oracle 5 | [[1, 2, 3], 3, 4] | [[1, 1, 1], 1, 0] | Failed |
| oracle 6 | [[21, 7, 24, 14], 14, 0] | [[21, 0, 36, -13], -13, 15] | Failed |
| oracle 7 | [[0, -4, 4, -6], -6, 9] | [[0, -3, 3, -2], -2, 1] | Failed |
| variant packet 1 | [[1, 5, 12, 23, 41, 64, 64, 49, 49, 52, 57, 65, 77, 93, 93, 78], 78, 0] | [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66], 66, 15] | Failed |
SHA-256 / 96f6c2e4f6ba0dac9c7ec67b07985d081751e1898f2b0cd2ba6536e810e738ae
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(codes, predictor, step_index):
steps=[7,8,9,10,11,12,13,14,16,17,19,21,23,25,28,31]
adjust=[-1,-1,-1,-1,2,4,6,8]
out=[]
for code in codes:
step=steps[step_index]
delta=step//8
if code&1: delta+=step//4
if code&2: delta+=step//2
if code&4: delta+=step
predictor+=-delta if code&8 else delta
predictor=max(-128,min(127,predictor))
step_index=max(0,min(len(steps)-1,step_index+adjust[code&7]))
out.append(predictor)
return [out,predictor,step_index]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 1, 2, 3, 4, 7, 8, 15], 0, 4)), [[1, 4, 9, 16, 23, 39, 37, 6], 6, 15])
check('oracle 2', solve(*([7, 7, 7], 120, 14)), [[127, 127, 127], 127, 15])
check('oracle 3', solve(*([15, 15], -120, 15)), [[-128, -128], -128, 15])
check('oracle 4', solve(*([], 4, 2)), [[], 4, 2])
check('oracle 5', solve(*([0, 0, 0], 0, 1)), [[1, 1, 1], 1, 0])
check('oracle 6', solve(*([4, 12, 6, 14], 3, 8)), [[21, 0, 36, -13], -13, 15])
check('oracle 7', solve(*([1, 9, 2, 10], -4, 5)), [[0, -3, 3, -2], -2, 1])
if N == 1: check('variant packet 1', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66], 66, 15])
if N == 2: check('variant packet 2', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72], 72, 15])
if N == 3: check('variant packet 3', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72], 72, 15])
if N == 4: check('variant packet 4', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72], 72, 15])
if N == 5: check('variant packet 5', solve(*[[0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15, 0, 1, 2, 3, 4, 7, 8, 15], 0, 4]), [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66, 69, 79, 94, 112, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72, 75, 85, 100, 118, 127, 127, 124, 72], 72, 15])
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, 4, 9, 16, 23, 39, 37, 6], 6, 15] | [[1, 4, 9, 16, 23, 39, 37, 6], 6, 15] | Passed |
| oracle 2 | [[127, 127, 127], 127, 15] | [[127, 127, 127], 127, 15] | Passed |
| oracle 3 | [[-128, -128], -128, 15] | [[-128, -128], -128, 15] | Passed |
| oracle 4 | [[], 4, 2] | [[], 4, 2] | Passed |
| oracle 5 | [[1, 1, 1], 1, 0] | [[1, 1, 1], 1, 0] | Passed |
| oracle 6 | [[21, 0, 36, -13], -13, 15] | [[21, 0, 36, -13], -13, 15] | Passed |
| oracle 7 | [[0, -3, 3, -2], -2, 1] | [[0, -3, 3, -2], -2, 1] | Passed |
| variant packet 1 | [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66], 66, 15] | [[1, 4, 9, 16, 23, 39, 37, 6, 9, 19, 34, 52, 75, 121, 118, 66], 66, 15] | Passed |
SHA-256 / 2a132c685144716a4dd75f0dc0256939536edea1d2b830a2fdf440014140e03c
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.746337+00:00.
Case digest / 4fdb9b257635fe282d40a44a7970b6334c77537f01e51b144089b65e4c236ad8