FA-49331 / PCM sample encoding / Open access
Pcm block exponent: sample quantization · case 01
Mantissa truncation does not match the declared arithmetic shift on negative values.
ROOT CAUSE
Mantissa truncation does not match the declared arithmetic shift on negative values.
VERIFIED REPAIR
Use the stated conversion contract at sample quantization.
Unsuccessful approach: An extra shift halves the reconstructed signal.
Case contract
Bounded block-floating PCM: choose the smallest shared right shift fitting signed mantissas, cap exponent, saturate residual overflow and report reconstructed 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, mantissa_bits, max_shift):
shift=0
low=-(1<<(mantissa_bits-1))
high=(1<<(mantissa_bits-1))-1
while shift<max_shift and any((x>>shift)<low or (x>>shift)>high for x in samples):
shift+=1
mantissas=[max(low,min(high,int(x/(1<<shift)))) for x in samples]
restored=[x<<shift for x in mantissas]
return [shift,mantissas,restored]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 8, -9], 4, 3)), [1, [0, 4, -5], [0, 8, -10]])
check('oracle 2', solve(*([7, -8], 4, 3)), [0, [7, -8], [7, -8]])
check('oracle 3', solve(*([0, 100, -100], 4, 2)), [2, [0, 7, -8], [0, 28, -32]])
check('oracle 4', solve(*([], 4, 3)), [0, [], []])
check('oracle 5', solve(*([-17, 3], 4, 4)), [2, [-5, 0], [-20, 0]])
check('oracle 6', solve(*([1, 2], 3, 0)), [0, [1, 2], [1, 2]])
check('oracle 7', solve(*([16, -16], 4, 1)), [1, [7, -8], [14, -16]])
if N == 1: check('variant packet 1', solve(*[[1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10]])
if N == 2: check('variant packet 2', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10]])
if N == 3: check('variant packet 3', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10]])
if N == 4: check('variant packet 4', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10]])
if N == 5: check('variant packet 5', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -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, [0, 4, -4], [0, 8, -8]] | [1, [0, 4, -5], [0, 8, -10]] | Failed |
| oracle 2 | [0, [7, -8], [7, -8]] | [0, [7, -8], [7, -8]] | Passed |
| oracle 3 | [2, [0, 7, -8], [0, 28, -32]] | [2, [0, 7, -8], [0, 28, -32]] | Passed |
| oracle 4 | [0, [], []] | [0, [], []] | Passed |
| oracle 5 | [2, [-4, 0], [-16, 0]] | [2, [-5, 0], [-20, 0]] | Failed |
| oracle 6 | [0, [1, 2], [1, 2]] | [0, [1, 2], [1, 2]] | Passed |
| oracle 7 | [1, [7, -8], [14, -16]] | [1, [7, -8], [14, -16]] | Passed |
| variant packet 1 | [1, [0, 4, -4, 0, 4, -4], [0, 8, -8, 0, 8, -8]] | [1, [0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10]] | Failed |
SHA-256 / ec2de6431eb0224c3e561b4b2ba7ecb2b00cba61976d151c73bd94d0d205481d
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(samples, mantissa_bits, max_shift):
shift=0
low=-(1<<(mantissa_bits-1))
high=(1<<(mantissa_bits-1))-1
while shift<max_shift and any((x>>shift)<low or (x>>shift)>high for x in samples):
shift+=1
mantissas=[max(low,min(high,x>>(shift+1))) for x in samples]
restored=[x<<shift for x in mantissas]
return [shift,mantissas,restored]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 8, -9], 4, 3)), [1, [0, 4, -5], [0, 8, -10]])
check('oracle 2', solve(*([7, -8], 4, 3)), [0, [7, -8], [7, -8]])
check('oracle 3', solve(*([0, 100, -100], 4, 2)), [2, [0, 7, -8], [0, 28, -32]])
check('oracle 4', solve(*([], 4, 3)), [0, [], []])
check('oracle 5', solve(*([-17, 3], 4, 4)), [2, [-5, 0], [-20, 0]])
check('oracle 6', solve(*([1, 2], 3, 0)), [0, [1, 2], [1, 2]])
check('oracle 7', solve(*([16, -16], 4, 1)), [1, [7, -8], [14, -16]])
if N == 1: check('variant packet 1', solve(*[[1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10]])
if N == 2: check('variant packet 2', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10]])
if N == 3: check('variant packet 3', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10]])
if N == 4: check('variant packet 4', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10]])
if N == 5: check('variant packet 5', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -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, [0, 2, -3], [0, 4, -6]] | [1, [0, 4, -5], [0, 8, -10]] | Failed |
| oracle 2 | [0, [3, -4], [3, -4]] | [0, [7, -8], [7, -8]] | Failed |
| oracle 3 | [2, [0, 7, -8], [0, 28, -32]] | [2, [0, 7, -8], [0, 28, -32]] | Passed |
| oracle 4 | [0, [], []] | [0, [], []] | Passed |
| oracle 5 | [2, [-3, 0], [-12, 0]] | [2, [-5, 0], [-20, 0]] | Failed |
| oracle 6 | [0, [0, 1], [0, 1]] | [0, [1, 2], [1, 2]] | Failed |
| oracle 7 | [1, [4, -4], [8, -8]] | [1, [7, -8], [14, -16]] | Failed |
| variant packet 1 | [1, [0, 2, -3, 0, 2, -3], [0, 4, -6, 0, 4, -6]] | [1, [0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10]] | Failed |
SHA-256 / 16746bc46d7082bd7a3e113d6aac7fb7f13e9c2c7e95fbba17a7d521cc33df52
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(samples, mantissa_bits, max_shift):
shift=0
low=-(1<<(mantissa_bits-1))
high=(1<<(mantissa_bits-1))-1
while shift<max_shift and any((x>>shift)<low or (x>>shift)>high for x in samples):
shift+=1
mantissas=[max(low,min(high,x>>shift)) for x in samples]
restored=[x<<shift for x in mantissas]
return [shift,mantissas,restored]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 8, -9], 4, 3)), [1, [0, 4, -5], [0, 8, -10]])
check('oracle 2', solve(*([7, -8], 4, 3)), [0, [7, -8], [7, -8]])
check('oracle 3', solve(*([0, 100, -100], 4, 2)), [2, [0, 7, -8], [0, 28, -32]])
check('oracle 4', solve(*([], 4, 3)), [0, [], []])
check('oracle 5', solve(*([-17, 3], 4, 4)), [2, [-5, 0], [-20, 0]])
check('oracle 6', solve(*([1, 2], 3, 0)), [0, [1, 2], [1, 2]])
check('oracle 7', solve(*([16, -16], 4, 1)), [1, [7, -8], [14, -16]])
if N == 1: check('variant packet 1', solve(*[[1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10]])
if N == 2: check('variant packet 2', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10]])
if N == 3: check('variant packet 3', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10]])
if N == 4: check('variant packet 4', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10]])
if N == 5: check('variant packet 5', solve(*[[1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9, 1, 8, -9], 4, 3]), [1, [0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -10, 0, 8, -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, [0, 4, -5], [0, 8, -10]] | [1, [0, 4, -5], [0, 8, -10]] | Passed |
| oracle 2 | [0, [7, -8], [7, -8]] | [0, [7, -8], [7, -8]] | Passed |
| oracle 3 | [2, [0, 7, -8], [0, 28, -32]] | [2, [0, 7, -8], [0, 28, -32]] | Passed |
| oracle 4 | [0, [], []] | [0, [], []] | Passed |
| oracle 5 | [2, [-5, 0], [-20, 0]] | [2, [-5, 0], [-20, 0]] | Passed |
| oracle 6 | [0, [1, 2], [1, 2]] | [0, [1, 2], [1, 2]] | Passed |
| oracle 7 | [1, [7, -8], [14, -16]] | [1, [7, -8], [14, -16]] | Passed |
| variant packet 1 | [1, [0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10]] | [1, [0, 4, -5, 0, 4, -5], [0, 8, -10, 0, 8, -10]] | Passed |
SHA-256 / 5b4678c919089b750980866f16a66618f4415c764c95475c5be721cddefd9c3f
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:59.029633+00:00.
Case digest / 83588e72711b5c49809c774fba88d9423ef562f45098d20d78da89ba534e2df8