FAILURE MAP
← Case archive

FA-49786 / PCM sample encoding / Open access

Pcm nibble block order: tail partition · case 01

Unconsumed padding codes are confused with valid codes.

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

ROOT CAUSE

Unconsumed padding codes are confused with valid codes.

VERIFIED REPAIR

Use the stated conversion contract at tail partition.

Unsuccessful approach: Skipping the first unconsumed nibble hides padding contamination.

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),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], [1, 8, 15]][[1, 8, 15], [2]]Failed
oracle 2[[2, 1, 4, 3], [2, 1, 4, 3]][[2, 1, 4, 3], []]Failed
oracle 3[[10, 11], [10, 11]][[10, 11], []]Failed
oracle 4[[], []][[], []]Passed
oracle 5[[0], [0]][[0], [8]]Failed
oracle 6[[], []][[], [15, 15]]Failed
oracle 7[[7, 5, 9, 7], [7, 5, 9, 7]][[7, 5, 9, 7], []]Failed
variant packet 1[[1, 8, 15, 2, 1, 8], [1, 8, 15, 2, 1, 8]][[1, 8, 15, 2, 1, 8], [15, 2]]Failed

SHA-256 / e84406fed9100ff2af9739dea83d9683c8de19213c9fc40c50d2d88eae27f100

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),len(values))
    return [values[:count],values[count+1:]]
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], []][[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], []][[0], [8]]Failed
oracle 6[[], [15]][[], [15, 15]]Failed
oracle 7[[7, 5, 9, 7], []][[7, 5, 9, 7], []]Passed
variant packet 1[[1, 8, 15, 2, 1, 8], [2]][[1, 8, 15, 2, 1, 8], [15, 2]]Failed

SHA-256 / 06485f312ca5349fb5a751c2a8a83b1c14e9e4c99859e7abb1a0a52094f72b5b

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

Case digest / 8d413b54ce8b80766c220e4c5ad74e96539976435934b54ec95030843c9b9ecf