FA-50266 / PCM sample encoding / Open access
Pcm common trailing zero shift: silence block canonical · case 01
An all-zero PCM block advertises arbitrary maximum wasted precision instead of canonical zero shift.
ROOT CAUSE
An all-zero PCM block advertises arbitrary maximum wasted precision instead of canonical zero shift.
VERIFIED REPAIR
Use the stated conversion contract at silence block canonical.
Unsuccessful approach: Processing only silence blocks misses real common trailing zeros.
Case contract
Losslessly factor the largest capped common trailing-zero count from signed PCM samples; zero samples do not constrain the count and all-silence blocks canonically use zero.
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, maximum):
shift=0
nonzero=[abs(x) for x in samples if x!=0]
if samples:
while shift<maximum and all((x&((1<<(shift+1))-1))==0 for x in nonzero):
shift+=1
coarse=[x>>shift for x in samples]
return [shift,coarse]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([8, -12, 0], 5)), [2, [2, -3, 0]])
check('oracle 2', solve(*([0, 0], 4)), [0, [0, 0]])
check('oracle 3', solve(*([8, 6], 4)), [1, [4, 3]])
check('oracle 4', solve(*([], 3)), [0, []])
check('oracle 5', solve(*([-8, -4], 5)), [2, [-2, -1]])
check('oracle 6', solve(*([16, 32], 2)), [2, [4, 8]])
check('oracle 7', solve(*([3, -8], 4)), [0, [3, -8]])
if N == 1: check('variant packet 1', solve(*[[8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0]])
if N == 2: check('variant packet 2', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0]])
if N == 3: check('variant packet 3', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0]])
if N == 4: check('variant packet 4', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0]])
if N == 5: check('variant packet 5', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0]])
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 | [2, [2, -3, 0]] | [2, [2, -3, 0]] | Passed |
| oracle 2 | [4, [0, 0]] | [0, [0, 0]] | Failed |
| oracle 3 | [1, [4, 3]] | [1, [4, 3]] | Passed |
| oracle 4 | [0, []] | [0, []] | Passed |
| oracle 5 | [2, [-2, -1]] | [2, [-2, -1]] | Passed |
| oracle 6 | [2, [4, 8]] | [2, [4, 8]] | Passed |
| oracle 7 | [0, [3, -8]] | [0, [3, -8]] | Passed |
| variant packet 1 | [2, [2, -3, 0, 2, -3, 0]] | [2, [2, -3, 0, 2, -3, 0]] | Passed |
SHA-256 / 7b6d3974e073fa75b6d879c030f61285f83e02d6e409a579401466e44d2d02e5
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(samples, maximum):
shift=0
nonzero=[abs(x) for x in samples if x!=0]
if not nonzero:
while shift<maximum and all((x&((1<<(shift+1))-1))==0 for x in nonzero):
shift+=1
coarse=[x>>shift for x in samples]
return [shift,coarse]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([8, -12, 0], 5)), [2, [2, -3, 0]])
check('oracle 2', solve(*([0, 0], 4)), [0, [0, 0]])
check('oracle 3', solve(*([8, 6], 4)), [1, [4, 3]])
check('oracle 4', solve(*([], 3)), [0, []])
check('oracle 5', solve(*([-8, -4], 5)), [2, [-2, -1]])
check('oracle 6', solve(*([16, 32], 2)), [2, [4, 8]])
check('oracle 7', solve(*([3, -8], 4)), [0, [3, -8]])
if N == 1: check('variant packet 1', solve(*[[8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0]])
if N == 2: check('variant packet 2', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0]])
if N == 3: check('variant packet 3', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0]])
if N == 4: check('variant packet 4', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0]])
if N == 5: check('variant packet 5', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0]])
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 | [0, [8, -12, 0]] | [2, [2, -3, 0]] | Failed |
| oracle 2 | [4, [0, 0]] | [0, [0, 0]] | Failed |
| oracle 3 | [0, [8, 6]] | [1, [4, 3]] | Failed |
| oracle 4 | [3, []] | [0, []] | Failed |
| oracle 5 | [0, [-8, -4]] | [2, [-2, -1]] | Failed |
| oracle 6 | [0, [16, 32]] | [2, [4, 8]] | Failed |
| oracle 7 | [0, [3, -8]] | [0, [3, -8]] | Passed |
| variant packet 1 | [0, [8, -12, 0, 8, -12, 0]] | [2, [2, -3, 0, 2, -3, 0]] | Failed |
SHA-256 / 73beb615640d42612d136a1d0ebdcac9111875e35252c1d103638c62829e47d3
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(samples, maximum):
shift=0
nonzero=[abs(x) for x in samples if x!=0]
if nonzero:
while shift<maximum and all((x&((1<<(shift+1))-1))==0 for x in nonzero):
shift+=1
coarse=[x>>shift for x in samples]
return [shift,coarse]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([8, -12, 0], 5)), [2, [2, -3, 0]])
check('oracle 2', solve(*([0, 0], 4)), [0, [0, 0]])
check('oracle 3', solve(*([8, 6], 4)), [1, [4, 3]])
check('oracle 4', solve(*([], 3)), [0, []])
check('oracle 5', solve(*([-8, -4], 5)), [2, [-2, -1]])
check('oracle 6', solve(*([16, 32], 2)), [2, [4, 8]])
check('oracle 7', solve(*([3, -8], 4)), [0, [3, -8]])
if N == 1: check('variant packet 1', solve(*[[8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0]])
if N == 2: check('variant packet 2', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0]])
if N == 3: check('variant packet 3', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0]])
if N == 4: check('variant packet 4', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0]])
if N == 5: check('variant packet 5', solve(*[[8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0, 8, -12, 0], 5]), [2, [2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0, 2, -3, 0]])
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 | [2, [2, -3, 0]] | [2, [2, -3, 0]] | Passed |
| oracle 2 | [0, [0, 0]] | [0, [0, 0]] | Passed |
| oracle 3 | [1, [4, 3]] | [1, [4, 3]] | Passed |
| oracle 4 | [0, []] | [0, []] | Passed |
| oracle 5 | [2, [-2, -1]] | [2, [-2, -1]] | Passed |
| oracle 6 | [2, [4, 8]] | [2, [4, 8]] | Passed |
| oracle 7 | [0, [3, -8]] | [0, [3, -8]] | Passed |
| variant packet 1 | [2, [2, -3, 0, 2, -3, 0]] | [2, [2, -3, 0, 2, -3, 0]] | Passed |
SHA-256 / 6685802ff7a99ffcc55132b69825144bf3bc94edfbe08b4d6e15a53c618d2c9d
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:07.502737+00:00.
Case digest / 50ccbb4a0d1638608e1468be5aa40c7bcfd784c91a0ba6744b44f53678f1bc60