FA-49731 / PCM sample encoding / Open access
Pcm adaptive nibble reconstruction: predictor saturation · case 01
Adaptive reconstructed PCM wraps at overload.
ROOT CAUSE
Adaptive reconstructed PCM wraps at overload.
VERIFIED REPAIR
Use the stated conversion contract at predictor saturation.
Unsuccessful approach: Symmetric limits exclude the valid negative endpoint of the declared output field.
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=((predictor+128)%256)-128
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 | [[-84, -28, 28], 28, 15] | [[127, 127, 127], 127, 15] | Failed |
| oracle 3 | [[80, 24], 24, 15] | [[-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, 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 / 5442fa43caf4f8f14caaf971ab293206707c234fb428de43bb5584807707176f
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(-127,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 | [[-127, -127], -127, 15] | [[-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, 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 / 14917ae55e85851e146826c8b7691861c8c0875a8d7b7a1b5c8ee24078a67ed9
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.726263+00:00.
Case digest / 9c8b62e25228e8e745cdb5722b0733bfe9eb4ebba0bd0895a74f649021137b2f