FAILURE MAP
← Case archive

FA-49776 / PCM sample encoding / Open access

Pcm nibble block order: low mask · case 01

Low nibble loses its adaptive sign bit.

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

ROOT CAUSE

Low nibble loses its adaptive sign bit.

VERIFIED REPAIR

Use the stated conversion contract at low mask.

Unsuccessful approach: Leaving the entire octet mixes neighboring sample codes.

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

SHA-256 / 0cb6d5aba6251820c14e137daeebd7f24d278209d7e708e2563421985e524342

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&255
        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, 24, 15], [242]][[1, 8, 15], [2]]Failed
oracle 2[[18, 1, 52, 3], []][[2, 1, 4, 3], []]Failed
oracle 3[[10, 171], []][[10, 11], []]Failed
oracle 4[[], []][[], []]Passed
oracle 5[[128], [8]][[0], [8]]Failed
oracle 6[[], [15, 255]][[], [15, 15]]Failed
oracle 7[[87, 5, 121, 7], []][[7, 5, 9, 7], []]Failed
variant packet 1[[1, 24, 15, 242, 1, 24], [15, 242]][[1, 8, 15, 2, 1, 8], [15, 2]]Failed

SHA-256 / 675e59cefa5085f0a7759203842447d603a5dfbf17baf4f7afc91fcc85269576

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

Case digest / 74a4e781ede90d9eaa71f174a01af006671e6fb692b696a72a4e60aad624bd6e