FAILURE MAP
← Case archive

FA-49766 / PCM sample encoding / Open access

Pcm nibble block order: nibble order policy · case 01

Adaptive PCM nibble reader ignores low-first packet declaration.

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

ROOT CAUSE

Adaptive PCM nibble reader ignores low-first packet declaration.

VERIFIED REPAIR

Use the stated conversion contract at nibble order policy.

Unsuccessful approach: Inverting the declaration corrupts both packet orders.

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)&15
        low=byte&15
        values.extend([high,low])
    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 fixtureActualExpectedOutcome
oracle 1[[1, 8, 15], [2]][[1, 8, 15], [2]]Passed
oracle 2[[1, 2, 3, 4], []][[2, 1, 4, 3], []]Failed
oracle 3[[10, 11], []][[10, 11], []]Passed
oracle 4[[], []][[], []]Passed
oracle 5[[8], [0]][[0], [8]]Failed
oracle 6[[], [15, 15]][[], [15, 15]]Passed
oracle 7[[5, 7, 7, 9], []][[7, 5, 9, 7], []]Failed
variant packet 1[[1, 8, 15, 2, 1, 8], [15, 2]][[1, 8, 15, 2, 1, 8], [15, 2]]Passed

SHA-256 / c3b34164459faa878c71f00744cdeba1ebd8cbdcf50683a2ffa7a62790cba369

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>>4)&15
        low=byte&15
        values.extend([low,high] if high_first else [high,low])
    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 fixtureActualExpectedOutcome
oracle 1[[8, 1, 2], [15]][[1, 8, 15], [2]]Failed
oracle 2[[1, 2, 3, 4], []][[2, 1, 4, 3], []]Failed
oracle 3[[11, 10], []][[10, 11], []]Failed
oracle 4[[], []][[], []]Passed
oracle 5[[8], [0]][[0], [8]]Failed
oracle 6[[], [15, 15]][[], [15, 15]]Passed
oracle 7[[5, 7, 7, 9], []][[7, 5, 9, 7], []]Failed
variant packet 1[[8, 1, 2, 15, 8, 1], [2, 15]][[1, 8, 15, 2, 1, 8], [15, 2]]Failed

SHA-256 / b021d6f1b46da9fe56cabfa87ed0cbab128971faf1c10b61b08a46e22c424d0f

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

Case digest / d8c1534a4ae731fc894d21b72a157a60889b2ab29574b645f57117397726979c