FAILURE MAP
← Case archive

FA-48966 / PCM sample encoding / Open access

Mulaw expansion: wire complement · case 01

The companded wire complement is omitted.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The companded wire complement is omitted.

VERIFIED REPAIR

Use the stated conversion contract at wire complement.

Unsuccessful approach: Flipping only the sign leaves segment and mantissa inverted.

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 fixtureActualExpectedOutcome
oracle 1[-32124, 32124, 0, 0][0, 0, -32124, 32124]Failed
oracle 2[-31100, -30076, -29052][8, 16, 24]Failed
oracle 3[-16764, -15996, -8316][120, 132, 372]Failed
oracle 4[132, 396, 1980][-15996, -7932, -1884]Failed
oracle 5[][]Passed
oracle 6[-876, -1884, -3900, -7932][4092, 1980, 924, 396]Failed
oracle 7[8, 16, 31100][-31100, -30076, -8]Failed
variant packet 1[-32124, 32124, 0, 0, -32124, 32124, 0, 0][0, 0, -32124, 32124, 0, 0, -32124, 32124]Failed

SHA-256 / 46ee730ea8f42362037d3649b8c5fa7531ec86026a82347515e4386933ae451a

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^128
        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 fixtureActualExpectedOutcome
oracle 1[32124, -32124, 0, 0][0, 0, -32124, 32124]Failed
oracle 2[31100, 30076, 29052][8, 16, 24]Failed
oracle 3[16764, 15996, 8316][120, 132, 372]Failed
oracle 4[-132, -396, -1980][-15996, -7932, -1884]Failed
oracle 5[][]Passed
oracle 6[876, 1884, 3900, 7932][4092, 1980, 924, 396]Failed
oracle 7[-8, -16, -31100][-31100, -30076, -8]Failed
variant packet 1[32124, -32124, 0, 0, 32124, -32124, 0, 0][0, 0, -32124, 32124, 0, 0, -32124, 32124]Failed

SHA-256 / 7b1fe018df7c0659162195c9fb8008ec88e674230154fcc70e5a5323488f816c

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 fixtureActualExpectedOutcome
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.605357+00:00.

Case digest / 38d6a0fa3972011716fb5b66f9d21f42da496d26473f589d46914fc9eb2615b9