FA-49006 / PCM sample encoding / Open access
Alaw expansion: segment shift · case 01
Higher A-law segments receive one extra shift.
ROOT CAUSE
Higher A-law segments receive one extra shift.
VERIFIED REPAIR
Use the stated conversion contract at segment shift.
Unsuccessful approach: A fixed shift fixes one segment while flattening all higher segments.
Case contract
Decode eight-bit A-law codes into signed integer PCM using alternating-bit mask85, midpoint reconstruction and explicit segment rules.
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^85
segment=(code>>4)&7
mantissa=code&15
amplitude=(mantissa<<4)+8
if segment:
amplitude+=256
if segment>1:
amplitude<<=segment
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(*([213, 85, 212, 84],)), [8, -8, 24, -24])
check('oracle 2', solve(*([197, 69, 245, 117],)), [264, -264, 528, -528])
check('oracle 3', solve(*([165, 37, 181, 53],)), [16896, -16896, 8448, -8448])
check('oracle 4', solve(*([0, 128, 255],)), [-5504, 5504, 848])
check('oracle 5', solve(*([],)), [])
check('oracle 6', solve(*([214, 86, 196, 68],)), [56, -56, 280, -280])
check('oracle 7', solve(*([149, 21, 133, 5],)), [2112, -2112, 4224, -4224])
if N == 1: check('variant packet 1', solve(*[[213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24])
if N == 2: check('variant packet 2', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
if N == 3: check('variant packet 3', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
if N == 4: check('variant packet 4', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
if N == 5: check('variant packet 5', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
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 | [8, -8, 24, -24] | [8, -8, 24, -24] | Passed |
| oracle 2 | [264, -264, 1056, -1056] | [264, -264, 528, -528] | Failed |
| oracle 3 | [33792, -33792, 16896, -16896] | [16896, -16896, 8448, -8448] | Failed |
| oracle 4 | [-11008, 11008, 1696] | [-5504, 5504, 848] | Failed |
| oracle 5 | [] | [] | Passed |
| oracle 6 | [56, -56, 280, -280] | [56, -56, 280, -280] | Passed |
| oracle 7 | [4224, -4224, 8448, -8448] | [2112, -2112, 4224, -4224] | Failed |
| variant packet 1 | [8, -8, 24, -24, 8, -8, 24, -24] | [8, -8, 24, -24, 8, -8, 24, -24] | Passed |
SHA-256 / 4cca9da4805caa752173e0ac683a6915caa81de79ad596e7aa4db024e42c8ea5
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^85
segment=(code>>4)&7
mantissa=code&15
amplitude=(mantissa<<4)+8
if segment:
amplitude+=256
if segment>1:
amplitude<<=1
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(*([213, 85, 212, 84],)), [8, -8, 24, -24])
check('oracle 2', solve(*([197, 69, 245, 117],)), [264, -264, 528, -528])
check('oracle 3', solve(*([165, 37, 181, 53],)), [16896, -16896, 8448, -8448])
check('oracle 4', solve(*([0, 128, 255],)), [-5504, 5504, 848])
check('oracle 5', solve(*([],)), [])
check('oracle 6', solve(*([214, 86, 196, 68],)), [56, -56, 280, -280])
check('oracle 7', solve(*([149, 21, 133, 5],)), [2112, -2112, 4224, -4224])
if N == 1: check('variant packet 1', solve(*[[213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24])
if N == 2: check('variant packet 2', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
if N == 3: check('variant packet 3', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
if N == 4: check('variant packet 4', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
if N == 5: check('variant packet 5', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
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 | [8, -8, 24, -24] | [8, -8, 24, -24] | Passed |
| oracle 2 | [264, -264, 528, -528] | [264, -264, 528, -528] | Passed |
| oracle 3 | [528, -528, 528, -528] | [16896, -16896, 8448, -8448] | Failed |
| oracle 4 | [-688, 688, 848] | [-5504, 5504, 848] | Failed |
| oracle 5 | [] | [] | Passed |
| oracle 6 | [56, -56, 280, -280] | [56, -56, 280, -280] | Passed |
| oracle 7 | [528, -528, 528, -528] | [2112, -2112, 4224, -4224] | Failed |
| variant packet 1 | [8, -8, 24, -24, 8, -8, 24, -24] | [8, -8, 24, -24, 8, -8, 24, -24] | Passed |
SHA-256 / 79e3bdfc168a561a6c47f06ac0e3eb1918614269455e9fcf829593db06a14063
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^85
segment=(code>>4)&7
mantissa=code&15
amplitude=(mantissa<<4)+8
if segment:
amplitude+=256
if segment>1:
amplitude<<=segment-1
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(*([213, 85, 212, 84],)), [8, -8, 24, -24])
check('oracle 2', solve(*([197, 69, 245, 117],)), [264, -264, 528, -528])
check('oracle 3', solve(*([165, 37, 181, 53],)), [16896, -16896, 8448, -8448])
check('oracle 4', solve(*([0, 128, 255],)), [-5504, 5504, 848])
check('oracle 5', solve(*([],)), [])
check('oracle 6', solve(*([214, 86, 196, 68],)), [56, -56, 280, -280])
check('oracle 7', solve(*([149, 21, 133, 5],)), [2112, -2112, 4224, -4224])
if N == 1: check('variant packet 1', solve(*[[213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24])
if N == 2: check('variant packet 2', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
if N == 3: check('variant packet 3', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
if N == 4: check('variant packet 4', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
if N == 5: check('variant packet 5', solve(*[[213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84, 213, 85, 212, 84]]), [8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24, 8, -8, 24, -24])
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 | [8, -8, 24, -24] | [8, -8, 24, -24] | Passed |
| oracle 2 | [264, -264, 528, -528] | [264, -264, 528, -528] | Passed |
| oracle 3 | [16896, -16896, 8448, -8448] | [16896, -16896, 8448, -8448] | Passed |
| oracle 4 | [-5504, 5504, 848] | [-5504, 5504, 848] | Passed |
| oracle 5 | [] | [] | Passed |
| oracle 6 | [56, -56, 280, -280] | [56, -56, 280, -280] | Passed |
| oracle 7 | [2112, -2112, 4224, -4224] | [2112, -2112, 4224, -4224] | Passed |
| variant packet 1 | [8, -8, 24, -24, 8, -8, 24, -24] | [8, -8, 24, -24, 8, -8, 24, -24] | Passed |
SHA-256 / 86375ee9ce48759ec2ddcfd7d48f2426685fdacd10c9765d2fc3ad0ce12d7296
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.912148+00:00.
Case digest / 1abf964eb8a4017bb8e73d18b9c08dbc753ed440f5969d71040b011049fb1900