FA-49981 / PCM sample encoding / Open access
Pcm i2s delayed capture: payload polarity · case 01
Sign is inferred from the delay bit.
ROOT CAUSE
Sign is inferred from the delay bit.
VERIFIED REPAIR
Use the stated conversion contract at payload polarity.
Unsuccessful approach: Using final data bit makes polarity depend on sample oddness.
Case contract
Capture a stipulated I2S-like slot with one delay clock, MSB-first signed PCM payload and explicit trailing slot bits; reject incomplete slots.
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(slots, payload_bits, slot_bits):
out=[]
for bits in slots:
field=bits[1:1+payload_bits]
if len(bits)<slot_bits or len(field)!=payload_bits:
out.append(None)
continue
code=sum(bit<<(payload_bits-1-i) for i,bit in enumerate(field))
sample=code-(1<<payload_bits) if bits[0] else code
tail=bits[1+payload_bits:slot_bits]
out.append([sample,tail])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6)), [[-6, [0]], [7, [0]]])
check('oracle 2', solve(*([[0, 0, 0, 1, 1]], 3, 5)), [[1, [1]]])
check('oracle 3', solve(*([[1, 1, 1, 1]], 3, 5)), [None])
check('oracle 4', solve(*([], 4, 6)), [])
check('oracle 5', solve(*([[1, 0, 0, 0, 1, 1, 1]], 4, 6)), [[1, [1]]])
check('oracle 6', solve(*([[0, 1, 0]], 1, 3)), [[-1, [0]]])
check('oracle 7', solve(*([[0, 0, 1, 0, 0, 1]], 3, 5)), [[2, [0]]])
if N == 1: check('variant packet 1', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 2: check('variant packet 2', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 3: check('variant packet 3', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 4: check('variant packet 4', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 5: check('variant packet 5', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
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 | [[10, [0]], [-9, [0]]] | [[-6, [0]], [7, [0]]] | Failed |
| oracle 2 | [[1, [1]]] | [[1, [1]]] | Passed |
| oracle 3 | [None] | [None] | Passed |
| oracle 4 | [] | [] | Passed |
| oracle 5 | [[-15, [1]]] | [[1, [1]]] | Failed |
| oracle 6 | [[1, [0]]] | [[-1, [0]]] | Failed |
| oracle 7 | [[2, [0]]] | [[2, [0]]] | Passed |
| variant packet 1 | [[10, [0]], [-9, [0]], [10, [0]], [-9, [0]]] | [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]]] | Failed |
SHA-256 / 1afde136a17ca3df9aed18829e21d79c69b87e82544a8bf0092c28aa5ac3b915
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(slots, payload_bits, slot_bits):
out=[]
for bits in slots:
field=bits[1:1+payload_bits]
if len(bits)<slot_bits or len(field)!=payload_bits:
out.append(None)
continue
code=sum(bit<<(payload_bits-1-i) for i,bit in enumerate(field))
sample=code-(1<<payload_bits) if field[-1] else code
tail=bits[1+payload_bits:slot_bits]
out.append([sample,tail])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6)), [[-6, [0]], [7, [0]]])
check('oracle 2', solve(*([[0, 0, 0, 1, 1]], 3, 5)), [[1, [1]]])
check('oracle 3', solve(*([[1, 1, 1, 1]], 3, 5)), [None])
check('oracle 4', solve(*([], 4, 6)), [])
check('oracle 5', solve(*([[1, 0, 0, 0, 1, 1, 1]], 4, 6)), [[1, [1]]])
check('oracle 6', solve(*([[0, 1, 0]], 1, 3)), [[-1, [0]]])
check('oracle 7', solve(*([[0, 0, 1, 0, 0, 1]], 3, 5)), [[2, [0]]])
if N == 1: check('variant packet 1', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 2: check('variant packet 2', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 3: check('variant packet 3', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 4: check('variant packet 4', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 5: check('variant packet 5', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
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 | [[10, [0]], [-9, [0]]] | [[-6, [0]], [7, [0]]] | Failed |
| oracle 2 | [[-7, [1]]] | [[1, [1]]] | Failed |
| oracle 3 | [None] | [None] | Passed |
| oracle 4 | [] | [] | Passed |
| oracle 5 | [[-15, [1]]] | [[1, [1]]] | Failed |
| oracle 6 | [[-1, [0]]] | [[-1, [0]]] | Passed |
| oracle 7 | [[2, [0]]] | [[2, [0]]] | Passed |
| variant packet 1 | [[10, [0]], [-9, [0]], [10, [0]], [-9, [0]]] | [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]]] | Failed |
SHA-256 / af0e7c4ac64124044aaedb811c532f5924c5e4ebcf050f7a3e0161e3d130b0a5
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(slots, payload_bits, slot_bits):
out=[]
for bits in slots:
field=bits[1:1+payload_bits]
if len(bits)<slot_bits or len(field)!=payload_bits:
out.append(None)
continue
code=sum(bit<<(payload_bits-1-i) for i,bit in enumerate(field))
sample=code-(1<<payload_bits) if field[0] else code
tail=bits[1+payload_bits:slot_bits]
out.append([sample,tail])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6)), [[-6, [0]], [7, [0]]])
check('oracle 2', solve(*([[0, 0, 0, 1, 1]], 3, 5)), [[1, [1]]])
check('oracle 3', solve(*([[1, 1, 1, 1]], 3, 5)), [None])
check('oracle 4', solve(*([], 4, 6)), [])
check('oracle 5', solve(*([[1, 0, 0, 0, 1, 1, 1]], 4, 6)), [[1, [1]]])
check('oracle 6', solve(*([[0, 1, 0]], 1, 3)), [[-1, [0]]])
check('oracle 7', solve(*([[0, 0, 1, 0, 0, 1]], 3, 5)), [[2, [0]]])
if N == 1: check('variant packet 1', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 2: check('variant packet 2', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 3: check('variant packet 3', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 4: check('variant packet 4', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
if N == 5: check('variant packet 5', solve(*[[[0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0], [0, 1, 0, 1, 0, 0], [1, 0, 1, 1, 1, 0]], 4, 6]), [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]], [-6, [0]], [7, [0]]])
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 | [[-6, [0]], [7, [0]]] | [[-6, [0]], [7, [0]]] | Passed |
| oracle 2 | [[1, [1]]] | [[1, [1]]] | Passed |
| oracle 3 | [None] | [None] | Passed |
| oracle 4 | [] | [] | Passed |
| oracle 5 | [[1, [1]]] | [[1, [1]]] | Passed |
| oracle 6 | [[-1, [0]]] | [[-1, [0]]] | Passed |
| oracle 7 | [[2, [0]]] | [[2, [0]]] | Passed |
| variant packet 1 | [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]]] | [[-6, [0]], [7, [0]], [-6, [0]], [7, [0]]] | Passed |
SHA-256 / c02033517ac1c68106ee95b9a277ec9286001c78ae30e3f34579e5b8496ed32d
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:04.965646+00:00.
Case digest / 2cd77b1bb95bc55aca60765ee6eab7a70879b1262c9098ada7b353520b0a4392