FA-49431 / PCM sample encoding / Open access
Pcm sparse impulses: duplicate event · case 01
Repeated sample events are summed rather than last-writer replaced.
ROOT CAUSE
Repeated sample events are summed rather than last-writer replaced.
VERIFIED REPAIR
Use the stated conversion contract at duplicate event.
Unsuccessful approach: First-writer semantics ignore corrected amplitude events.
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 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 | [258, 128, 128, 257] | [130, 128, 128, 129] | Failed |
| oracle 2 | [0, 12, 0] | [0, 7, 0] | Failed |
| 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 | [385] | [129] | Failed |
| variant packet 1 | [388, 128, 128, 386, 128] | [130, 128, 128, 129, 128] | Failed |
SHA-256 / 78ac1ecf74c7c02faa60126f4e06ad9101b880ebafd648ee3f65116917f3dc53
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 0<=index<length:
out[index]=out[index] if out[index]!=zero else 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, 5, 0] | [0, 7, 0] | Failed |
| 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 / c3fef104c8ac7c7db17e55068e3ac9cfdcdcc2b9cf838fde4e5122a895a04555
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.909092+00:00.
Case digest / 285335eb1cd1bb5e4bcae359f726e208d1e9249e832e53b818a9cd1481eb5d97