FA-49446 / PCM sample encoding / Open access
Pcm progressive refinement: residual address · case 01
Every sample reuses the first refinement residual.
ROOT CAUSE
Every sample reuses the first refinement residual.
VERIFIED REPAIR
Use the stated conversion contract at residual address.
Unsuccessful approach: Reading residuals backwards attaches precision bits to the wrong sample.
Case contract
Restore PCM from arithmetic-shift coarse samples and optional unsigned low-bit refinements; missing refinement bits are zero and out-of-field residual bits are masked.
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(coarse, residuals, missing_bits):
scale=1<<missing_bits
out=[]
for index,base in enumerate(coarse):
tail=residuals[0] if residuals else 0
tail &= scale-1
out.append(base*scale+tail)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, -2, 3], [3, 1, 2], 2)), [7, -7, 14])
check('oracle 2', solve(*([-1, 0], [7, 4], 2)), [-1, 0])
check('oracle 3', solve(*([2, 3, 4], [1], 3)), [17, 24, 32])
check('oracle 4', solve(*([], [], 2)), [])
check('oracle 5', solve(*([1, -1], [0, 0], 0)), [1, -1])
check('oracle 6', solve(*([0, 0], [3, -1], 2)), [3, 3])
check('oracle 7', solve(*([3, -3], [2, 1], 1)), [6, -5])
if N == 1: check('variant packet 1', solve(*[[1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12])
if N == 2: check('variant packet 2', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12])
if N == 3: check('variant packet 3', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12, 4, -8, 12])
if N == 4: check('variant packet 4', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12, 4, -8, 12, 4, -8, 12])
if N == 5: check('variant packet 5', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12, 4, -8, 12, 4, -8, 12, 4, -8, 12])
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 | [7, -5, 15] | [7, -7, 14] | Failed |
| oracle 2 | [-1, 3] | [-1, 0] | Failed |
| oracle 3 | [17, 25, 33] | [17, 24, 32] | Failed |
| oracle 4 | [] | [] | Passed |
| oracle 5 | [1, -1] | [1, -1] | Passed |
| oracle 6 | [3, 3] | [3, 3] | Passed |
| oracle 7 | [6, -6] | [6, -5] | Failed |
| variant packet 1 | [7, -5, 15, 7, -5, 15] | [7, -7, 14, 4, -8, 12] | Failed |
SHA-256 / 687cb4eb714267227602d38f8506abe4f5f4b24195ab706a000523f42325af71
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(coarse, residuals, missing_bits):
scale=1<<missing_bits
out=[]
for index,base in enumerate(coarse):
tail=residuals[-1-index] if index<len(residuals) else 0
tail &= scale-1
out.append(base*scale+tail)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, -2, 3], [3, 1, 2], 2)), [7, -7, 14])
check('oracle 2', solve(*([-1, 0], [7, 4], 2)), [-1, 0])
check('oracle 3', solve(*([2, 3, 4], [1], 3)), [17, 24, 32])
check('oracle 4', solve(*([], [], 2)), [])
check('oracle 5', solve(*([1, -1], [0, 0], 0)), [1, -1])
check('oracle 6', solve(*([0, 0], [3, -1], 2)), [3, 3])
check('oracle 7', solve(*([3, -3], [2, 1], 1)), [6, -5])
if N == 1: check('variant packet 1', solve(*[[1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12])
if N == 2: check('variant packet 2', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12])
if N == 3: check('variant packet 3', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12, 4, -8, 12])
if N == 4: check('variant packet 4', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12, 4, -8, 12, 4, -8, 12])
if N == 5: check('variant packet 5', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12, 4, -8, 12, 4, -8, 12, 4, -8, 12])
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 | [6, -7, 15] | [7, -7, 14] | Failed |
| oracle 2 | [-4, 3] | [-1, 0] | Failed |
| oracle 3 | [17, 24, 32] | [17, 24, 32] | Passed |
| oracle 4 | [] | [] | Passed |
| oracle 5 | [1, -1] | [1, -1] | Passed |
| oracle 6 | [3, 3] | [3, 3] | Passed |
| oracle 7 | [7, -6] | [6, -5] | Failed |
| variant packet 1 | [6, -7, 15, 4, -8, 12] | [7, -7, 14, 4, -8, 12] | Failed |
SHA-256 / d55145149b60e5cb5d007692c7e55bcf733799dad2e783645fcfd4082b3496f4
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(coarse, residuals, missing_bits):
scale=1<<missing_bits
out=[]
for index,base in enumerate(coarse):
tail=residuals[index] if index<len(residuals) else 0
tail &= scale-1
out.append(base*scale+tail)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, -2, 3], [3, 1, 2], 2)), [7, -7, 14])
check('oracle 2', solve(*([-1, 0], [7, 4], 2)), [-1, 0])
check('oracle 3', solve(*([2, 3, 4], [1], 3)), [17, 24, 32])
check('oracle 4', solve(*([], [], 2)), [])
check('oracle 5', solve(*([1, -1], [0, 0], 0)), [1, -1])
check('oracle 6', solve(*([0, 0], [3, -1], 2)), [3, 3])
check('oracle 7', solve(*([3, -3], [2, 1], 1)), [6, -5])
if N == 1: check('variant packet 1', solve(*[[1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12])
if N == 2: check('variant packet 2', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12])
if N == 3: check('variant packet 3', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12, 4, -8, 12])
if N == 4: check('variant packet 4', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12, 4, -8, 12, 4, -8, 12])
if N == 5: check('variant packet 5', solve(*[[1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3, 1, -2, 3], [3, 1, 2], 2]), [7, -7, 14, 4, -8, 12, 4, -8, 12, 4, -8, 12, 4, -8, 12, 4, -8, 12])
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 | [7, -7, 14] | [7, -7, 14] | Passed |
| oracle 2 | [-1, 0] | [-1, 0] | Passed |
| oracle 3 | [17, 24, 32] | [17, 24, 32] | Passed |
| oracle 4 | [] | [] | Passed |
| oracle 5 | [1, -1] | [1, -1] | Passed |
| oracle 6 | [3, 3] | [3, 3] | Passed |
| oracle 7 | [6, -5] | [6, -5] | Passed |
| variant packet 1 | [7, -7, 14, 4, -8, 12] | [7, -7, 14, 4, -8, 12] | Passed |
SHA-256 / 8bea1a4700c378aff21411c9a049fc5b0a4e68405eb7934ec7cfee54df52d31f
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:00.035528+00:00.
Case digest / f3c910299e199f5c229e859df0fd70cfe0a045ea3b37f8fdb60dd458e3ec5906