FA-48971 / PCM sample encoding / Open access
Mulaw expansion: mantissa placement · case 01
Mantissa contribution has the wrong reconstruction weight.
ROOT CAUSE
Mantissa contribution has the wrong reconstruction weight.
VERIFIED REPAIR
Use the stated conversion contract at mantissa placement.
Unsuccessful approach: Halving the mistaken weight again loses a valid low amplitude step.
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<<4)+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, -47484, 47484] | [0, 0, -32124, 32124] | Failed |
| oracle 2 | [16, 32, 48] | [8, 16, 24] | Failed |
| oracle 3 | [240, 132, 612] | [120, 132, 372] | Failed |
| oracle 4 | [-23676, -11772, -2844] | [-15996, -7932, -1884] | Failed |
| oracle 5 | [] | [] | Passed |
| oracle 6 | [4092, 1980, 924, 396] | [4092, 1980, 924, 396] | Passed |
| oracle 7 | [-45436, -43388, -16] | [-31100, -30076, -8] | Failed |
| variant packet 1 | [0, 0, -47484, 47484, 0, 0, -47484, 47484] | [0, 0, -32124, 32124, 0, 0, -32124, 32124] | Failed |
SHA-256 / f2409cb691e53d922ddc756cfa200b8bfd240a63493e4bbae08689decdf81fe7
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<<2)+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, -24444, 24444] | [0, 0, -32124, 32124] | Failed |
| oracle 2 | [4, 8, 12] | [8, 16, 24] | Failed |
| oracle 3 | [60, 132, 252] | [120, 132, 372] | Failed |
| oracle 4 | [-12156, -6012, -1404] | [-15996, -7932, -1884] | Failed |
| oracle 5 | [] | [] | Passed |
| oracle 6 | [4092, 1980, 924, 396] | [4092, 1980, 924, 396] | Passed |
| oracle 7 | [-23932, -23420, -4] | [-31100, -30076, -8] | Failed |
| variant packet 1 | [0, 0, -24444, 24444, 0, 0, -24444, 24444] | [0, 0, -32124, 32124, 0, 0, -32124, 32124] | Failed |
SHA-256 / b64164d85016ec1effcee52390d60f3ec67a9cfd36d48cbf0d2bdd9a168bc2c5
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.612047+00:00.
Case digest / 00aa79f637bb6d43d082272dc4bf1c1d846b63d9ddc9b4f3fa09b3cecc503c38