FA-49191 / PCM sample encoding / Open access
Pcm payload valid prefix: negative declaration · case 01
Negative valid counts trigger Python negative slicing.
ROOT CAUSE
Negative valid counts trigger Python negative slicing.
VERIFIED REPAIR
Use the stated conversion contract at negative declaration.
Unsuccessful approach: Taking absolute value makes malformed negative counts consume samples.
Case contract
Decode a stipulated fixed-capacity PCM slot whose declared valid prefix is clamped to physical storage; verify zero padding only inside the slot.
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(packets, capacity):
out=[]
for declared,payload in packets:
used=min(declared,capacity,len(payload))
data=list(payload[:used])
tail=list(payload[used:capacity])
canonical=all(x==0 for x in tail)
out.append([data,used,canonical])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4)), [[[1, 2], 2, True], [[1, 2], 2, False]])
check('oracle 2', solve(*([[0, [0, 0]], [-1, [3, 4]]], 2)), [[[], 0, True], [[], 0, False]])
check('oracle 3', solve(*([[5, [1, 2]]], 4)), [[[1, 2], 2, True]])
check('oracle 4', solve(*([[2, [1, 2, 0, 9]]], 3)), [[[1, 2], 2, True]])
check('oracle 5', solve(*([], 4)), [])
check('oracle 6', solve(*([[2, [1, 2]]], 2)), [[[1, 2], 2, True]])
check('oracle 7', solve(*([[8, [1, 2, 3, 4]]], 3)), [[[1, 2, 3], 3, True]])
if N == 1: check('variant packet 1', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 2: check('variant packet 2', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 3: check('variant packet 3', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 4: check('variant packet 4', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 5: check('variant packet 5', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
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, 2], 2, True], [[1, 2], 2, False]] | [[[1, 2], 2, True], [[1, 2], 2, False]] | Passed |
| oracle 2 | [[[], 0, True], [[3], -1, False]] | [[[], 0, True], [[], 0, False]] | Failed |
| oracle 3 | [[[1, 2], 2, True]] | [[[1, 2], 2, True]] | Passed |
| oracle 4 | [[[1, 2], 2, True]] | [[[1, 2], 2, True]] | Passed |
| oracle 5 | [] | [] | Passed |
| oracle 6 | [[[1, 2], 2, True]] | [[[1, 2], 2, True]] | Passed |
| oracle 7 | [[[1, 2, 3], 3, True]] | [[[1, 2, 3], 3, True]] | Passed |
| variant packet 1 | [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]] | [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]] | Passed |
SHA-256 / 97e156c006329095c2ac4e77c78dd28908955cc621c6c33bf7d9bf9810e25350
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(packets, capacity):
out=[]
for declared,payload in packets:
used=min(abs(declared),capacity,len(payload))
data=list(payload[:used])
tail=list(payload[used:capacity])
canonical=all(x==0 for x in tail)
out.append([data,used,canonical])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4)), [[[1, 2], 2, True], [[1, 2], 2, False]])
check('oracle 2', solve(*([[0, [0, 0]], [-1, [3, 4]]], 2)), [[[], 0, True], [[], 0, False]])
check('oracle 3', solve(*([[5, [1, 2]]], 4)), [[[1, 2], 2, True]])
check('oracle 4', solve(*([[2, [1, 2, 0, 9]]], 3)), [[[1, 2], 2, True]])
check('oracle 5', solve(*([], 4)), [])
check('oracle 6', solve(*([[2, [1, 2]]], 2)), [[[1, 2], 2, True]])
check('oracle 7', solve(*([[8, [1, 2, 3, 4]]], 3)), [[[1, 2, 3], 3, True]])
if N == 1: check('variant packet 1', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 2: check('variant packet 2', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 3: check('variant packet 3', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 4: check('variant packet 4', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 5: check('variant packet 5', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
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, 2], 2, True], [[1, 2], 2, False]] | [[[1, 2], 2, True], [[1, 2], 2, False]] | Passed |
| oracle 2 | [[[], 0, True], [[3], 1, False]] | [[[], 0, True], [[], 0, False]] | Failed |
| oracle 3 | [[[1, 2], 2, True]] | [[[1, 2], 2, True]] | Passed |
| oracle 4 | [[[1, 2], 2, True]] | [[[1, 2], 2, True]] | Passed |
| oracle 5 | [] | [] | Passed |
| oracle 6 | [[[1, 2], 2, True]] | [[[1, 2], 2, True]] | Passed |
| oracle 7 | [[[1, 2, 3], 3, True]] | [[[1, 2, 3], 3, True]] | Passed |
| variant packet 1 | [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]] | [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]] | Passed |
SHA-256 / 12f42d7682c03f3f5784aba24acdf16909c7a442627ab4d31453e8662b169222
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(packets, capacity):
out=[]
for declared,payload in packets:
used=min(max(declared,0),capacity,len(payload))
data=list(payload[:used])
tail=list(payload[used:capacity])
canonical=all(x==0 for x in tail)
out.append([data,used,canonical])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4)), [[[1, 2], 2, True], [[1, 2], 2, False]])
check('oracle 2', solve(*([[0, [0, 0]], [-1, [3, 4]]], 2)), [[[], 0, True], [[], 0, False]])
check('oracle 3', solve(*([[5, [1, 2]]], 4)), [[[1, 2], 2, True]])
check('oracle 4', solve(*([[2, [1, 2, 0, 9]]], 3)), [[[1, 2], 2, True]])
check('oracle 5', solve(*([], 4)), [])
check('oracle 6', solve(*([[2, [1, 2]]], 2)), [[[1, 2], 2, True]])
check('oracle 7', solve(*([[8, [1, 2, 3, 4]]], 3)), [[[1, 2, 3], 3, True]])
if N == 1: check('variant packet 1', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 2: check('variant packet 2', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 3: check('variant packet 3', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 4: check('variant packet 4', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
if N == 5: check('variant packet 5', solve(*[[[2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]], [2, [1, 2, 0, 0]], [2, [1, 2, 0, 9]]], 4]), [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]])
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, 2], 2, True], [[1, 2], 2, False]] | [[[1, 2], 2, True], [[1, 2], 2, False]] | Passed |
| oracle 2 | [[[], 0, True], [[], 0, False]] | [[[], 0, True], [[], 0, False]] | Passed |
| oracle 3 | [[[1, 2], 2, True]] | [[[1, 2], 2, True]] | Passed |
| oracle 4 | [[[1, 2], 2, True]] | [[[1, 2], 2, True]] | Passed |
| oracle 5 | [] | [] | Passed |
| oracle 6 | [[[1, 2], 2, True]] | [[[1, 2], 2, True]] | Passed |
| oracle 7 | [[[1, 2, 3], 3, True]] | [[[1, 2, 3], 3, True]] | Passed |
| variant packet 1 | [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]] | [[[1, 2], 2, True], [[1, 2], 2, False], [[1, 2], 2, True], [[1, 2], 2, False]] | Passed |
SHA-256 / 58fac89e06d805610ff0dd7a0d75f794020bb267c8750356b573c3625563e5be
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:44:57.679457+00:00.
Case digest / 30daaf1dff50e2be844ce29fd0abd707ede461c50e9709cec82ba14ac79c4bed