FA-49421 / PCM sample encoding / Open access
Pcm sparse impulses: negative index · case 01
Negative event positions wrap to the end of the Python sample array.
ROOT CAUSE
Negative event positions wrap to the end of the Python sample array.
VERIFIED REPAIR
Use the stated conversion contract at negative index.
Unsuccessful approach: Accepting by absolute distance still indexes negative positions from the end.
Case contract
Reconstruct a sparse PCM packet into a fixed sample span using explicit silence, ignore out-of-range events and apply duplicate positions in arrival order.
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(events, length, zero):
out=[zero]*length
for index,value in events:
if index<length:
out[index]=value
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[0, 130], [3, 129]], 4, 128)), [130, 128, 128, 129])
check('oracle 2', solve(*([[1, 5], [1, 7]], 3, 0)), [0, 7, 0])
check('oracle 3', solve(*([[-1, 3], [1, 4]], 3, 0)), [0, 4, 0])
check('oracle 4', solve(*([], 3, 128)), [128, 128, 128])
check('oracle 5', solve(*([[3, 7], [0, 2]], 3, 0)), [2, 0, 0])
check('oracle 6', solve(*([], 0, 128)), [])
check('oracle 7', solve(*([[0, 128], [0, 129]], 1, 128)), [129])
if N == 1: check('variant packet 1', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129]], 5, 128]), [130, 128, 128, 129, 128])
if N == 2: check('variant packet 2', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 6, 128]), [130, 128, 128, 129, 128, 128])
if N == 3: check('variant packet 3', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 7, 128]), [130, 128, 128, 129, 128, 128, 128])
if N == 4: check('variant packet 4', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 8, 128]), [130, 128, 128, 129, 128, 128, 128, 128])
if N == 5: check('variant packet 5', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 9, 128]), [130, 128, 128, 129, 128, 128, 128, 128, 128])
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 | [130, 128, 128, 129] | [130, 128, 128, 129] | Passed |
| oracle 2 | [0, 7, 0] | [0, 7, 0] | Passed |
| oracle 3 | [0, 4, 3] | [0, 4, 0] | Failed |
| oracle 4 | [128, 128, 128] | [128, 128, 128] | Passed |
| oracle 5 | [2, 0, 0] | [2, 0, 0] | Passed |
| oracle 6 | [] | [] | Passed |
| oracle 7 | [129] | [129] | Passed |
| variant packet 1 | [130, 128, 128, 129, 128] | [130, 128, 128, 129, 128] | Passed |
SHA-256 / 70cf8f249b0bd9a46e30e9b968a4f4f0420174bdaf8edd2784af973e56625a2d
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(events, length, zero):
out=[zero]*length
for index,value in events:
if abs(index)<length:
out[index]=value
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[0, 130], [3, 129]], 4, 128)), [130, 128, 128, 129])
check('oracle 2', solve(*([[1, 5], [1, 7]], 3, 0)), [0, 7, 0])
check('oracle 3', solve(*([[-1, 3], [1, 4]], 3, 0)), [0, 4, 0])
check('oracle 4', solve(*([], 3, 128)), [128, 128, 128])
check('oracle 5', solve(*([[3, 7], [0, 2]], 3, 0)), [2, 0, 0])
check('oracle 6', solve(*([], 0, 128)), [])
check('oracle 7', solve(*([[0, 128], [0, 129]], 1, 128)), [129])
if N == 1: check('variant packet 1', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129]], 5, 128]), [130, 128, 128, 129, 128])
if N == 2: check('variant packet 2', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 6, 128]), [130, 128, 128, 129, 128, 128])
if N == 3: check('variant packet 3', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 7, 128]), [130, 128, 128, 129, 128, 128, 128])
if N == 4: check('variant packet 4', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 8, 128]), [130, 128, 128, 129, 128, 128, 128, 128])
if N == 5: check('variant packet 5', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 9, 128]), [130, 128, 128, 129, 128, 128, 128, 128, 128])
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 | [130, 128, 128, 129] | [130, 128, 128, 129] | Passed |
| oracle 2 | [0, 7, 0] | [0, 7, 0] | Passed |
| oracle 3 | [0, 4, 3] | [0, 4, 0] | Failed |
| oracle 4 | [128, 128, 128] | [128, 128, 128] | Passed |
| oracle 5 | [2, 0, 0] | [2, 0, 0] | Passed |
| oracle 6 | [] | [] | Passed |
| oracle 7 | [129] | [129] | Passed |
| variant packet 1 | [130, 128, 128, 129, 128] | [130, 128, 128, 129, 128] | Passed |
SHA-256 / 53078e671658437e09b7bacaa7d0ba2ae81f9661e7f04a7b2110d5d72605a1e7
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(events, length, zero):
out=[zero]*length
for index,value in events:
if 0<=index<length:
out[index]=value
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[0, 130], [3, 129]], 4, 128)), [130, 128, 128, 129])
check('oracle 2', solve(*([[1, 5], [1, 7]], 3, 0)), [0, 7, 0])
check('oracle 3', solve(*([[-1, 3], [1, 4]], 3, 0)), [0, 4, 0])
check('oracle 4', solve(*([], 3, 128)), [128, 128, 128])
check('oracle 5', solve(*([[3, 7], [0, 2]], 3, 0)), [2, 0, 0])
check('oracle 6', solve(*([], 0, 128)), [])
check('oracle 7', solve(*([[0, 128], [0, 129]], 1, 128)), [129])
if N == 1: check('variant packet 1', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129]], 5, 128]), [130, 128, 128, 129, 128])
if N == 2: check('variant packet 2', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 6, 128]), [130, 128, 128, 129, 128, 128])
if N == 3: check('variant packet 3', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 7, 128]), [130, 128, 128, 129, 128, 128, 128])
if N == 4: check('variant packet 4', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 8, 128]), [130, 128, 128, 129, 128, 128, 128, 128])
if N == 5: check('variant packet 5', solve(*[[[0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129], [0, 130], [3, 129]], 9, 128]), [130, 128, 128, 129, 128, 128, 128, 128, 128])
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 | [130, 128, 128, 129] | [130, 128, 128, 129] | Passed |
| oracle 2 | [0, 7, 0] | [0, 7, 0] | Passed |
| oracle 3 | [0, 4, 0] | [0, 4, 0] | Passed |
| oracle 4 | [128, 128, 128] | [128, 128, 128] | Passed |
| oracle 5 | [2, 0, 0] | [2, 0, 0] | Passed |
| oracle 6 | [] | [] | Passed |
| oracle 7 | [129] | [129] | Passed |
| variant packet 1 | [130, 128, 128, 129, 128] | [130, 128, 128, 129, 128] | Passed |
SHA-256 / d4d329f9b7f97e81ef35b06cea7cef9c1050f94f1d687a1bc126e5f206eaf9b3
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:59.894087+00:00.
Case digest / 08646f61d27eb47a8b06e7957d323d40dee98b18891f11882dd0b7246294448d