FAILURE MAP
← Case archive

FA-49781 / PCM sample encoding / Open access

Pcm nibble block order: valid unit · case 01

Nibble count is interpreted as octet count, exposing pad codes.

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

ROOT CAUSE

Nibble count is interpreted as octet count, exposing pad codes.

VERIFIED REPAIR

Use the stated conversion contract at valid unit.

Unsuccessful approach: Dividing by two discards valid encoded samples.

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] if high_first else [low,high])
    count=min(max(valid_nibbles,0)*2,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]]Failed
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]]Failed
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]]Failed

SHA-256 / 8f232f7a98550b3d5e248b8f352965da6fc791e5f7c79117ca07a384e90c6261

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([high,low] if high_first else [low,high])
    count=min(max(valid_nibbles,0)//2,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]]Failed
oracle 2[[2, 1], [4, 3]][[2, 1, 4, 3], []]Failed
oracle 3[[10], [11]][[10, 11], []]Failed
oracle 4[[], []][[], []]Passed
oracle 5[[], [0, 8]][[0], [8]]Failed
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]]Failed

SHA-256 / c96a6083b4aa69d3c5f202aa8f255ffe457abf340a7c91262f584608b08d2f6f

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

Case digest / 57b1a352579136da5936353473ee69d04b8d071bfd0640d25df16e92a67cd111