FA-50281 / PCM sample encoding / Open access
Pcm common trailing zero shift: signed coarse · case 01
Removing common zero bits drops PCM polarity.
ROOT CAUSE
Removing common zero bits drops PCM polarity.
VERIFIED REPAIR
Use the stated conversion contract at signed coarse.
Unsuccessful approach: Shifting left increases precision instead of factoring common low 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 nonzero:
while shift<maximum and all((x&((1<<(shift+1))-1))==0 for x in nonzero):
shift+=1
coarse=[abs(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]] | Failed |
| 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]] | Failed |
| oracle 6 | [2, [4, 8]] | [2, [4, 8]] | Passed |
| oracle 7 | [0, [3, 8]] | [0, [3, -8]] | Failed |
| variant packet 1 | [2, [2, 3, 0, 2, 3, 0]] | [2, [2, -3, 0, 2, -3, 0]] | Failed |
SHA-256 / 34b8a868150500a4814a11c8f3fc90f5583168c40333a94c4df0de141d87db80
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 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, [32, -48, 0]] | [2, [2, -3, 0]] | Failed |
| oracle 2 | [0, [0, 0]] | [0, [0, 0]] | Passed |
| oracle 3 | [1, [16, 12]] | [1, [4, 3]] | Failed |
| oracle 4 | [0, []] | [0, []] | Passed |
| oracle 5 | [2, [-32, -16]] | [2, [-2, -1]] | Failed |
| oracle 6 | [2, [64, 128]] | [2, [4, 8]] | Failed |
| oracle 7 | [0, [3, -8]] | [0, [3, -8]] | Passed |
| variant packet 1 | [2, [32, -48, 0, 32, -48, 0]] | [2, [2, -3, 0, 2, -3, 0]] | Failed |
SHA-256 / c872ff99a2f5ea451d2fc700262c23b91738bac6b42ebcd68ec42de1e7fe4327
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.545623+00:00.
Case digest / addd17d5ee1155bfa02edf4ff073073c37cd4c48f1c1504c7079009534597bde