FA-49031 / PCM sample encoding / Open access
Excess code recenter: positive headroom · case 01
Positive headroom is confused with the silence code.
ROOT CAUSE
Positive headroom is confused with the silence code.
VERIFIED REPAIR
Use the stated conversion contract at positive headroom.
Unsuccessful approach: Including the exclusive code endpoint overstates headroom by one.
Case contract
Recenter bounded unsigned PCM around an explicitly calibrated zero code and report asymmetric representable headroom; clamp invalid code inputs before recentering.
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, width, zero_code):
limit=(1<<width)-1
out=[]
for code in codes:
bounded=max(0,min(limit,code))
delta=bounded-zero_code
low=-zero_code
high=zero_code
out.append([delta,low,high])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 3, 7, 8], 3, 3)), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
check('oracle 2', solve(*([-1, 0, 10], 3, 2)), [[-2, -2, 5], [-2, -2, 5], [5, -2, 5]])
check('oracle 3', solve(*([1, 2, 3], 2, 1)), [[0, -1, 2], [1, -1, 2], [2, -1, 2]])
check('oracle 4', solve(*([], 4, 5)), [])
check('oracle 5', solve(*([0, 15, 16], 4, 6)), [[-6, -6, 9], [9, -6, 9], [9, -6, 9]])
check('oracle 6', solve(*([0, 1], 1, 0)), [[0, 0, 1], [1, 0, 1]])
check('oracle 7', solve(*([2, 4, 7], 3, 5)), [[-3, -5, 2], [-1, -5, 2], [2, -5, 2]])
if N == 1: check('variant packet 1', solve(*[[0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 2: check('variant packet 2', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 3: check('variant packet 3', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 4: check('variant packet 4', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 5: check('variant packet 5', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
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 | [[-3, -3, 3], [0, -3, 3], [4, -3, 3], [4, -3, 3]] | [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]] | Failed |
| oracle 2 | [[-2, -2, 2], [-2, -2, 2], [5, -2, 2]] | [[-2, -2, 5], [-2, -2, 5], [5, -2, 5]] | Failed |
| oracle 3 | [[0, -1, 1], [1, -1, 1], [2, -1, 1]] | [[0, -1, 2], [1, -1, 2], [2, -1, 2]] | Failed |
| oracle 4 | [] | [] | Passed |
| oracle 5 | [[-6, -6, 6], [9, -6, 6], [9, -6, 6]] | [[-6, -6, 9], [9, -6, 9], [9, -6, 9]] | Failed |
| oracle 6 | [[0, 0, 0], [1, 0, 0]] | [[0, 0, 1], [1, 0, 1]] | Failed |
| oracle 7 | [[-3, -5, 5], [-1, -5, 5], [2, -5, 5]] | [[-3, -5, 2], [-1, -5, 2], [2, -5, 2]] | Failed |
| variant packet 1 | [[-3, -3, 3], [0, -3, 3], [4, -3, 3], [4, -3, 3], [-3, -3, 3], [0, -3, 3], [4, -3, 3], [4, -3, 3]] | [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]] | Failed |
SHA-256 / 8ee6b16c4b842901b90c4d18a7f8937261fa643806e1b7139b11590449d9d32a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(codes, width, zero_code):
limit=(1<<width)-1
out=[]
for code in codes:
bounded=max(0,min(limit,code))
delta=bounded-zero_code
low=-zero_code
high=(1<<width)-zero_code
out.append([delta,low,high])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 3, 7, 8], 3, 3)), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
check('oracle 2', solve(*([-1, 0, 10], 3, 2)), [[-2, -2, 5], [-2, -2, 5], [5, -2, 5]])
check('oracle 3', solve(*([1, 2, 3], 2, 1)), [[0, -1, 2], [1, -1, 2], [2, -1, 2]])
check('oracle 4', solve(*([], 4, 5)), [])
check('oracle 5', solve(*([0, 15, 16], 4, 6)), [[-6, -6, 9], [9, -6, 9], [9, -6, 9]])
check('oracle 6', solve(*([0, 1], 1, 0)), [[0, 0, 1], [1, 0, 1]])
check('oracle 7', solve(*([2, 4, 7], 3, 5)), [[-3, -5, 2], [-1, -5, 2], [2, -5, 2]])
if N == 1: check('variant packet 1', solve(*[[0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 2: check('variant packet 2', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 3: check('variant packet 3', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 4: check('variant packet 4', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 5: check('variant packet 5', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
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 | [[-3, -3, 5], [0, -3, 5], [4, -3, 5], [4, -3, 5]] | [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]] | Failed |
| oracle 2 | [[-2, -2, 6], [-2, -2, 6], [5, -2, 6]] | [[-2, -2, 5], [-2, -2, 5], [5, -2, 5]] | Failed |
| oracle 3 | [[0, -1, 3], [1, -1, 3], [2, -1, 3]] | [[0, -1, 2], [1, -1, 2], [2, -1, 2]] | Failed |
| oracle 4 | [] | [] | Passed |
| oracle 5 | [[-6, -6, 10], [9, -6, 10], [9, -6, 10]] | [[-6, -6, 9], [9, -6, 9], [9, -6, 9]] | Failed |
| oracle 6 | [[0, 0, 2], [1, 0, 2]] | [[0, 0, 1], [1, 0, 1]] | Failed |
| oracle 7 | [[-3, -5, 3], [-1, -5, 3], [2, -5, 3]] | [[-3, -5, 2], [-1, -5, 2], [2, -5, 2]] | Failed |
| variant packet 1 | [[-3, -3, 5], [0, -3, 5], [4, -3, 5], [4, -3, 5], [-3, -3, 5], [0, -3, 5], [4, -3, 5], [4, -3, 5]] | [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]] | Failed |
SHA-256 / c06ba8fd0c8a21afafa1a32de3c13e04a49d3be3197188f6c301a5f6aeb16da3
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(codes, width, zero_code):
limit=(1<<width)-1
out=[]
for code in codes:
bounded=max(0,min(limit,code))
delta=bounded-zero_code
low=-zero_code
high=limit-zero_code
out.append([delta,low,high])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 3, 7, 8], 3, 3)), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
check('oracle 2', solve(*([-1, 0, 10], 3, 2)), [[-2, -2, 5], [-2, -2, 5], [5, -2, 5]])
check('oracle 3', solve(*([1, 2, 3], 2, 1)), [[0, -1, 2], [1, -1, 2], [2, -1, 2]])
check('oracle 4', solve(*([], 4, 5)), [])
check('oracle 5', solve(*([0, 15, 16], 4, 6)), [[-6, -6, 9], [9, -6, 9], [9, -6, 9]])
check('oracle 6', solve(*([0, 1], 1, 0)), [[0, 0, 1], [1, 0, 1]])
check('oracle 7', solve(*([2, 4, 7], 3, 5)), [[-3, -5, 2], [-1, -5, 2], [2, -5, 2]])
if N == 1: check('variant packet 1', solve(*[[0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 2: check('variant packet 2', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 3: check('variant packet 3', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 4: check('variant packet 4', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
if N == 5: check('variant packet 5', solve(*[[0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8, 0, 3, 7, 8], 3, 3]), [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]])
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 | [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]] | [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]] | Passed |
| oracle 2 | [[-2, -2, 5], [-2, -2, 5], [5, -2, 5]] | [[-2, -2, 5], [-2, -2, 5], [5, -2, 5]] | Passed |
| oracle 3 | [[0, -1, 2], [1, -1, 2], [2, -1, 2]] | [[0, -1, 2], [1, -1, 2], [2, -1, 2]] | Passed |
| oracle 4 | [] | [] | Passed |
| oracle 5 | [[-6, -6, 9], [9, -6, 9], [9, -6, 9]] | [[-6, -6, 9], [9, -6, 9], [9, -6, 9]] | Passed |
| oracle 6 | [[0, 0, 1], [1, 0, 1]] | [[0, 0, 1], [1, 0, 1]] | Passed |
| oracle 7 | [[-3, -5, 2], [-1, -5, 2], [2, -5, 2]] | [[-3, -5, 2], [-1, -5, 2], [2, -5, 2]] | Passed |
| variant packet 1 | [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]] | [[-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4], [-3, -3, 4], [0, -3, 4], [4, -3, 4], [4, -3, 4]] | Passed |
SHA-256 / 4bee2d113c8af57521233324d4c110375fb668889d8937d131525b924361fd69
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:44:56.218573+00:00.
Case digest / 21c92aa0cdec099e24ab081fab6f6b297f27d286f30ff4e7d03d5483c8fd1b11