FA-48976 / PCM sample encoding / Open access
Mulaw expansion: segment bias · case 01
The segment shift is applied only to bias, not mantissa.
ROOT CAUSE
The segment shift is applied only to bias, not mantissa.
VERIFIED REPAIR
Use the stated conversion contract at segment bias.
Unsuccessful approach: Applying the shift only to mantissa omits segment-scaled bias.
Case contract
Decode eight-bit mu-law codewords using complement, three-bit segment, four-bit mantissa and reconstruction bias132; return signed integer PCM 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(codes):
out=[]
for raw in codes:
code=(~raw)&255
mantissa=code&15
exponent=(code>>4)&7
amplitude=(mantissa<<3)+(132<<exponent)
amplitude-=132
out.append(-amplitude if code&128 else amplitude)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([255, 127, 0, 128],)), [0, 0, -32124, 32124])
check('oracle 2', solve(*([254, 253, 252],)), [8, 16, 24])
check('oracle 3', solve(*([240, 239, 224],)), [120, 132, 372])
check('oracle 4', solve(*([16, 32, 64],)), [-15996, -7932, -1884])
check('oracle 5', solve(*([],)), [])
check('oracle 6', solve(*([175, 191, 207, 223],)), [4092, 1980, 924, 396])
check('oracle 7', solve(*([1, 2, 126],)), [-31100, -30076, -8])
if N == 1: check('variant packet 1', solve(*[[255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 2: check('variant packet 2', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 3: check('variant packet 3', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 4: check('variant packet 4', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 5: check('variant packet 5', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
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, 0, -16884, 16884] | [0, 0, -32124, 32124] | Failed |
| oracle 2 | [8, 16, 24] | [8, 16, 24] | Passed |
| oracle 3 | [120, 132, 252] | [120, 132, 372] | Failed |
| oracle 4 | [-8436, -4212, -1044] | [-15996, -7932, -1884] | Failed |
| oracle 5 | [] | [] | Passed |
| oracle 6 | [4092, 1980, 924, 396] | [4092, 1980, 924, 396] | Passed |
| oracle 7 | [-16876, -16868, -8] | [-31100, -30076, -8] | Failed |
| variant packet 1 | [0, 0, -16884, 16884, 0, 0, -16884, 16884] | [0, 0, -32124, 32124, 0, 0, -32124, 32124] | Failed |
SHA-256 / 63bf9bd387fa32067640f2799d0a25ad2a7255f23e39c888f8faeacd0347dc35
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(codes):
out=[]
for raw in codes:
code=(~raw)&255
mantissa=code&15
exponent=(code>>4)&7
amplitude=((mantissa<<3)<<exponent)+132
amplitude-=132
out.append(-amplitude if code&128 else amplitude)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([255, 127, 0, 128],)), [0, 0, -32124, 32124])
check('oracle 2', solve(*([254, 253, 252],)), [8, 16, 24])
check('oracle 3', solve(*([240, 239, 224],)), [120, 132, 372])
check('oracle 4', solve(*([16, 32, 64],)), [-15996, -7932, -1884])
check('oracle 5', solve(*([],)), [])
check('oracle 6', solve(*([175, 191, 207, 223],)), [4092, 1980, 924, 396])
check('oracle 7', solve(*([1, 2, 126],)), [-31100, -30076, -8])
if N == 1: check('variant packet 1', solve(*[[255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 2: check('variant packet 2', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 3: check('variant packet 3', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 4: check('variant packet 4', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 5: check('variant packet 5', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
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, 0, -15360, 15360] | [0, 0, -32124, 32124] | Failed |
| oracle 2 | [8, 16, 24] | [8, 16, 24] | Passed |
| oracle 3 | [120, 0, 240] | [120, 132, 372] | Failed |
| oracle 4 | [-7680, -3840, -960] | [-15996, -7932, -1884] | Failed |
| oracle 5 | [] | [] | Passed |
| oracle 6 | [0, 0, 0, 0] | [4092, 1980, 924, 396] | Failed |
| oracle 7 | [-14336, -13312, -8] | [-31100, -30076, -8] | Failed |
| variant packet 1 | [0, 0, -15360, 15360, 0, 0, -15360, 15360] | [0, 0, -32124, 32124, 0, 0, -32124, 32124] | Failed |
SHA-256 / cbfe19347d349997f8e68a738fa10e91db4a07607d652901427aa55c71fc87f3
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(codes):
out=[]
for raw in codes:
code=(~raw)&255
mantissa=code&15
exponent=(code>>4)&7
amplitude=((mantissa<<3)+132)<<exponent
amplitude-=132
out.append(-amplitude if code&128 else amplitude)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([255, 127, 0, 128],)), [0, 0, -32124, 32124])
check('oracle 2', solve(*([254, 253, 252],)), [8, 16, 24])
check('oracle 3', solve(*([240, 239, 224],)), [120, 132, 372])
check('oracle 4', solve(*([16, 32, 64],)), [-15996, -7932, -1884])
check('oracle 5', solve(*([],)), [])
check('oracle 6', solve(*([175, 191, 207, 223],)), [4092, 1980, 924, 396])
check('oracle 7', solve(*([1, 2, 126],)), [-31100, -30076, -8])
if N == 1: check('variant packet 1', solve(*[[255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 2: check('variant packet 2', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 3: check('variant packet 3', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 4: check('variant packet 4', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
if N == 5: check('variant packet 5', solve(*[[255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128, 255, 127, 0, 128]]), [0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124, 0, 0, -32124, 32124])
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, 0, -32124, 32124] | [0, 0, -32124, 32124] | Passed |
| oracle 2 | [8, 16, 24] | [8, 16, 24] | Passed |
| oracle 3 | [120, 132, 372] | [120, 132, 372] | Passed |
| oracle 4 | [-15996, -7932, -1884] | [-15996, -7932, -1884] | Passed |
| oracle 5 | [] | [] | Passed |
| oracle 6 | [4092, 1980, 924, 396] | [4092, 1980, 924, 396] | Passed |
| oracle 7 | [-31100, -30076, -8] | [-31100, -30076, -8] | Passed |
| variant packet 1 | [0, 0, -32124, 32124, 0, 0, -32124, 32124] | [0, 0, -32124, 32124, 0, 0, -32124, 32124] | Passed |
SHA-256 / 9ccd6e94810f4fe44df29ea64443af5f55b5ebc2fd0cf11e11073f4702c4b1cb
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:55.689431+00:00.
Case digest / cf9f18365415759211c1abe04ac3c72a88c50c0bb4244d337128fa4cecd8231a