FA-49771 / PCM sample encoding / Open access
Pcm nibble block order: high mask · case 01
Transport bits above the octet leak into the high nibble.
ROOT CAUSE
Transport bits above the octet leak into the high nibble.
VERIFIED REPAIR
Use the stated conversion contract at high mask.
Unsuccessful approach: Reusing low nibble duplicates the second sample code.
Case contract
Extract adaptive PCM nibble codes in declared within-octet order; valid count is in nibbles and remaining codes are returned separately as padding.
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(octets, high_first, valid_nibbles):
values=[]
for byte in octets:
high=byte>>4
low=byte&15
values.extend([high,low] if high_first else [low,high])
count=min(max(valid_nibbles,0),len(values))
return [values[:count],values[count:]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([24, 242], True, 3)), [[1, 8, 15], [2]])
check('oracle 2', solve(*([18, 52], False, 4)), [[2, 1, 4, 3], []])
check('oracle 3', solve(*([427], True, 2)), [[10, 11], []])
check('oracle 4', solve(*([], False, 0)), [[], []])
check('oracle 5', solve(*([128], False, 1)), [[0], [8]])
check('oracle 6', solve(*([255], True, 0)), [[], [15, 15]])
check('oracle 7', solve(*([87, 121], False, 8)), [[7, 5, 9, 7], []])
if N == 1: check('variant packet 1', solve(*[[24, 242, 24, 242], True, 6]), [[1, 8, 15, 2, 1, 8], [15, 2]])
if N == 2: check('variant packet 2', solve(*[[24, 242, 24, 242, 24, 242], True, 9]), [[1, 8, 15, 2, 1, 8, 15, 2, 1], [8, 15, 2]])
if N == 3: check('variant packet 3', solve(*[[24, 242, 24, 242, 24, 242, 24, 242], True, 12]), [[1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2], [1, 8, 15, 2]])
if N == 4: check('variant packet 4', solve(*[[24, 242, 24, 242, 24, 242, 24, 242, 24, 242], True, 15]), [[1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15], [2, 1, 8, 15, 2]])
if N == 5: check('variant packet 5', solve(*[[24, 242, 24, 242, 24, 242, 24, 242, 24, 242, 24, 242], True, 18]), [[1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2, 1, 8], [15, 2, 1, 8, 15, 2]])
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 | [[1, 8, 15], [2]] | [[1, 8, 15], [2]] | Passed |
| oracle 2 | [[2, 1, 4, 3], []] | [[2, 1, 4, 3], []] | Passed |
| oracle 3 | [[26, 11], []] | [[10, 11], []] | Failed |
| oracle 4 | [[], []] | [[], []] | Passed |
| oracle 5 | [[0], [8]] | [[0], [8]] | Passed |
| oracle 6 | [[], [15, 15]] | [[], [15, 15]] | Passed |
| oracle 7 | [[7, 5, 9, 7], []] | [[7, 5, 9, 7], []] | Passed |
| variant packet 1 | [[1, 8, 15, 2, 1, 8], [15, 2]] | [[1, 8, 15, 2, 1, 8], [15, 2]] | Passed |
SHA-256 / 853bb1c3d573ecf066fec705bb2d6fd81ab8f982136a22ccd2c9eb29c6d737f4
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(octets, high_first, valid_nibbles):
values=[]
for byte in octets:
high=byte&15
low=byte&15
values.extend([high,low] if high_first else [low,high])
count=min(max(valid_nibbles,0),len(values))
return [values[:count],values[count:]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([24, 242], True, 3)), [[1, 8, 15], [2]])
check('oracle 2', solve(*([18, 52], False, 4)), [[2, 1, 4, 3], []])
check('oracle 3', solve(*([427], True, 2)), [[10, 11], []])
check('oracle 4', solve(*([], False, 0)), [[], []])
check('oracle 5', solve(*([128], False, 1)), [[0], [8]])
check('oracle 6', solve(*([255], True, 0)), [[], [15, 15]])
check('oracle 7', solve(*([87, 121], False, 8)), [[7, 5, 9, 7], []])
if N == 1: check('variant packet 1', solve(*[[24, 242, 24, 242], True, 6]), [[1, 8, 15, 2, 1, 8], [15, 2]])
if N == 2: check('variant packet 2', solve(*[[24, 242, 24, 242, 24, 242], True, 9]), [[1, 8, 15, 2, 1, 8, 15, 2, 1], [8, 15, 2]])
if N == 3: check('variant packet 3', solve(*[[24, 242, 24, 242, 24, 242, 24, 242], True, 12]), [[1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2], [1, 8, 15, 2]])
if N == 4: check('variant packet 4', solve(*[[24, 242, 24, 242, 24, 242, 24, 242, 24, 242], True, 15]), [[1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15], [2, 1, 8, 15, 2]])
if N == 5: check('variant packet 5', solve(*[[24, 242, 24, 242, 24, 242, 24, 242, 24, 242, 24, 242], True, 18]), [[1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2, 1, 8], [15, 2, 1, 8, 15, 2]])
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, 2], [2]] | [[1, 8, 15], [2]] | Failed |
| oracle 2 | [[2, 2, 4, 4], []] | [[2, 1, 4, 3], []] | Failed |
| oracle 3 | [[11, 11], []] | [[10, 11], []] | Failed |
| oracle 4 | [[], []] | [[], []] | Passed |
| oracle 5 | [[0], [0]] | [[0], [8]] | Failed |
| oracle 6 | [[], [15, 15]] | [[], [15, 15]] | Passed |
| oracle 7 | [[7, 7, 9, 9], []] | [[7, 5, 9, 7], []] | Failed |
| variant packet 1 | [[8, 8, 2, 2, 8, 8], [2, 2]] | [[1, 8, 15, 2, 1, 8], [15, 2]] | Failed |
SHA-256 / 3459eaae1962085f920471f7b82bdbf9cebcdec9b72c112f593775b056ae3eea
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(octets, high_first, valid_nibbles):
values=[]
for byte in octets:
high=(byte>>4)&15
low=byte&15
values.extend([high,low] if high_first else [low,high])
count=min(max(valid_nibbles,0),len(values))
return [values[:count],values[count:]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([24, 242], True, 3)), [[1, 8, 15], [2]])
check('oracle 2', solve(*([18, 52], False, 4)), [[2, 1, 4, 3], []])
check('oracle 3', solve(*([427], True, 2)), [[10, 11], []])
check('oracle 4', solve(*([], False, 0)), [[], []])
check('oracle 5', solve(*([128], False, 1)), [[0], [8]])
check('oracle 6', solve(*([255], True, 0)), [[], [15, 15]])
check('oracle 7', solve(*([87, 121], False, 8)), [[7, 5, 9, 7], []])
if N == 1: check('variant packet 1', solve(*[[24, 242, 24, 242], True, 6]), [[1, 8, 15, 2, 1, 8], [15, 2]])
if N == 2: check('variant packet 2', solve(*[[24, 242, 24, 242, 24, 242], True, 9]), [[1, 8, 15, 2, 1, 8, 15, 2, 1], [8, 15, 2]])
if N == 3: check('variant packet 3', solve(*[[24, 242, 24, 242, 24, 242, 24, 242], True, 12]), [[1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2], [1, 8, 15, 2]])
if N == 4: check('variant packet 4', solve(*[[24, 242, 24, 242, 24, 242, 24, 242, 24, 242], True, 15]), [[1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15], [2, 1, 8, 15, 2]])
if N == 5: check('variant packet 5', solve(*[[24, 242, 24, 242, 24, 242, 24, 242, 24, 242, 24, 242], True, 18]), [[1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2, 1, 8, 15, 2, 1, 8], [15, 2, 1, 8, 15, 2]])
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 | [[1, 8, 15], [2]] | [[1, 8, 15], [2]] | Passed |
| oracle 2 | [[2, 1, 4, 3], []] | [[2, 1, 4, 3], []] | Passed |
| oracle 3 | [[10, 11], []] | [[10, 11], []] | Passed |
| oracle 4 | [[], []] | [[], []] | Passed |
| oracle 5 | [[0], [8]] | [[0], [8]] | Passed |
| oracle 6 | [[], [15, 15]] | [[], [15, 15]] | Passed |
| oracle 7 | [[7, 5, 9, 7], []] | [[7, 5, 9, 7], []] | Passed |
| variant packet 1 | [[1, 8, 15, 2, 1, 8], [15, 2]] | [[1, 8, 15, 2, 1, 8], [15, 2]] | Passed |
SHA-256 / 4f6a87c43584421013fac17a5e9bec4afd624413bad1362e9bea4f2fd23f9dba
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:03.057234+00:00.
Case digest / af8073e622ce50593abb4f9b3e72aa08e6681c8c3b6b3602b5926ef8b1739958