broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(slots, width):
    out=[]
    mask=(1<<width)-1
    for slot in slots:
        payload=slot&mask
        valid=not bool(slot&(1<<width))
        parity=(slot>>(width+1))&1
        parity_ok=((bin(payload).count("1")+int(not valid)+parity)%2)==0
        sample=payload-(1<<width) if payload&(1<<(width-1)) else payload
        out.append([sample if valid or parity_ok else None,valid,parity_ok])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 1, 33, 16, 48], 4)), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
check('oracle 2', solve(*([15, 47, 8, 40], 4)), [[-1, True, True], [None, True, False], [None, True, False], [-8, True, True]])
check('oracle 3', solve(*([], 4)), [])
check('oracle 4', solve(*([0, 1, 2, 3, 4, 5, 6, 7], 1)), [[0, True, True], [None, True, False], [None, False, False], [None, False, True], [None, True, False], [-1, True, True], [None, False, True], [None, False, False]])
check('oracle 5', solve(*([7, 23, 8, 24], 3)), [[None, True, False], [-1, True, True], [None, False, False], [None, False, True]])
check('oracle 6', solve(*([2, 3, 4, 5, 6], 4)), [[None, True, False], [3, True, True], [None, True, False], [5, True, True], [6, True, True]])
check('oracle 7', solve(*([255, 767, 256, 768], 8)), [[-1, True, True], [None, True, False], [None, False, False], [None, False, True]])
if N == 1: check('variant packet 1', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 2: check('variant packet 2', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 3: check('variant packet 3', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 4: check('variant packet 4', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 5: check('variant packet 5', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(slots, width):
    out=[]
    mask=(1<<width)-1
    for slot in slots:
        payload=slot&mask
        valid=not bool(slot&(1<<width))
        parity=(slot>>(width+1))&1
        parity_ok=((bin(payload).count("1")+int(not valid)+parity)%2)==0
        sample=payload-(1<<width) if payload&(1<<(width-1)) else payload
        out.append([sample if parity_ok else None,valid,parity_ok])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 1, 33, 16, 48], 4)), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
check('oracle 2', solve(*([15, 47, 8, 40], 4)), [[-1, True, True], [None, True, False], [None, True, False], [-8, True, True]])
check('oracle 3', solve(*([], 4)), [])
check('oracle 4', solve(*([0, 1, 2, 3, 4, 5, 6, 7], 1)), [[0, True, True], [None, True, False], [None, False, False], [None, False, True], [None, True, False], [-1, True, True], [None, False, True], [None, False, False]])
check('oracle 5', solve(*([7, 23, 8, 24], 3)), [[None, True, False], [-1, True, True], [None, False, False], [None, False, True]])
check('oracle 6', solve(*([2, 3, 4, 5, 6], 4)), [[None, True, False], [3, True, True], [None, True, False], [5, True, True], [6, True, True]])
check('oracle 7', solve(*([255, 767, 256, 768], 8)), [[-1, True, True], [None, True, False], [None, False, False], [None, False, True]])
if N == 1: check('variant packet 1', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 2: check('variant packet 2', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 3: check('variant packet 3', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 4: check('variant packet 4', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 5: check('variant packet 5', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
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)

prompt:
A valid flag bypasses a detected parity error.

Decode a stipulated slot: signed payload, one invalid bit, then even parity covering payload and invalid bit; invalid or corrupt samples return null plus status.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(slots, width):
    out=[]
    mask=(1<<width)-1
    for slot in slots:
        payload=slot
        valid=not bool(slot&(1<<width))
        parity=(slot>>(width+1))&1
        parity_ok=((bin(payload).count("1")+int(not valid)+parity)%2)==0
        sample=payload-(1<<width) if payload&(1<<(width-1)) else payload
        out.append([sample if valid and parity_ok else None,valid,parity_ok])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 1, 33, 16, 48], 4)), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
check('oracle 2', solve(*([15, 47, 8, 40], 4)), [[-1, True, True], [None, True, False], [None, True, False], [-8, True, True]])
check('oracle 3', solve(*([], 4)), [])
check('oracle 4', solve(*([0, 1, 2, 3, 4, 5, 6, 7], 1)), [[0, True, True], [None, True, False], [None, False, False], [None, False, True], [None, True, False], [-1, True, True], [None, False, True], [None, False, False]])
check('oracle 5', solve(*([7, 23, 8, 24], 3)), [[None, True, False], [-1, True, True], [None, False, False], [None, False, True]])
check('oracle 6', solve(*([2, 3, 4, 5, 6], 4)), [[None, True, False], [3, True, True], [None, True, False], [5, True, True], [6, True, True]])
check('oracle 7', solve(*([255, 767, 256, 768], 8)), [[-1, True, True], [None, True, False], [None, False, False], [None, False, True]])
if N == 1: check('variant packet 1', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 2: check('variant packet 2', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 3: check('variant packet 3', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 4: check('variant packet 4', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 5: check('variant packet 5', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(slots, width):
    out=[]
    mask=(1<<width)-1
    for slot in slots:
        payload=slot&(mask>>1)
        valid=not bool(slot&(1<<width))
        parity=(slot>>(width+1))&1
        parity_ok=((bin(payload).count("1")+int(not valid)+parity)%2)==0
        sample=payload-(1<<width) if payload&(1<<(width-1)) else payload
        out.append([sample if valid and parity_ok else None,valid,parity_ok])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([0, 1, 33, 16, 48], 4)), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
check('oracle 2', solve(*([15, 47, 8, 40], 4)), [[-1, True, True], [None, True, False], [None, True, False], [-8, True, True]])
check('oracle 3', solve(*([], 4)), [])
check('oracle 4', solve(*([0, 1, 2, 3, 4, 5, 6, 7], 1)), [[0, True, True], [None, True, False], [None, False, False], [None, False, True], [None, True, False], [-1, True, True], [None, False, True], [None, False, False]])
check('oracle 5', solve(*([7, 23, 8, 24], 3)), [[None, True, False], [-1, True, True], [None, False, False], [None, False, True]])
check('oracle 6', solve(*([2, 3, 4, 5, 6], 4)), [[None, True, False], [3, True, True], [None, True, False], [5, True, True], [6, True, True]])
check('oracle 7', solve(*([255, 767, 256, 768], 8)), [[-1, True, True], [None, True, False], [None, False, False], [None, False, True]])
if N == 1: check('variant packet 1', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 2: check('variant packet 2', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 3: check('variant packet 3', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 4: check('variant packet 4', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
if N == 5: check('variant packet 5', solve(*[[0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48, 0, 1, 33, 16, 48], 4]), [[0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True], [0, True, True], [None, True, False], [1, True, True], [None, False, False], [None, False, True]])
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)

prompt:
Status bits are retained in numerical PCM reconstruction.

Decode a stipulated slot: signed payload, one invalid bit, then even parity covering payload and invalid bit; invalid or corrupt samples return null plus status.

split: open-access


prompt:
PCM packet wraparound is interpreted as an old packet.

Bounded PCM packet sequence adapter with one null marker per lost packet (not per lost sample); reject old or half-cycle-ambiguous packets and retain modular cursor.

split: open-access


prompt:
The ambiguous half-cycle packet is accepted as a forward gap.

Bounded PCM packet sequence adapter with one null marker per lost packet (not per lost sample); reject old or half-cycle-ambiguous packets and retain modular cursor.

split: open-access


prompt:
Missing packet units become valid digital-silence samples.

Bounded PCM packet sequence adapter with one null marker per lost packet (not per lost sample); reject old or half-cycle-ambiguous packets and retain modular cursor.

split: open-access


prompt:
Cursor advances from the old expected sequence after a gap.

Bounded PCM packet sequence adapter with one null marker per lost packet (not per lost sample); reject old or half-cycle-ambiguous packets and retain modular cursor.

split: open-access


prompt:
Contiguous PCM packet cursor escapes its sequence field at wrap.

Bounded PCM packet sequence adapter with one null marker per lost packet (not per lost sample); reject old or half-cycle-ambiguous packets and retain modular cursor.

split: open-access


prompt:
Negative valid counts trigger Python negative slicing.

Decode a stipulated fixed-capacity PCM slot whose declared valid prefix is clamped to physical storage; verify zero padding only inside the slot.

split: open-access


prompt:
A short physical payload is reported as containing unavailable samples.

Decode a stipulated fixed-capacity PCM slot whose declared valid prefix is clamped to physical storage; verify zero padding only inside the slot.

split: open-access


prompt:
Trailing transport bytes beyond the slot body fail sample padding validation.

Decode a stipulated fixed-capacity PCM slot whose declared valid prefix is clamped to physical storage; verify zero padding only inside the slot.

split: open-access


prompt:
One zero pad sample hides nonzero contamination.

Decode a stipulated fixed-capacity PCM slot whose declared valid prefix is clamped to physical storage; verify zero padding only inside the slot.

split: open-access


prompt:
Valid samples are taken from the slot tail instead of its prefix.

Decode a stipulated fixed-capacity PCM slot whose declared valid prefix is clamped to physical storage; verify zero padding only inside the slot.

split: open-access


prompt:
PCM difference reconstruction discards the packet seed.

Reconstruct bounded delta-coded PCM from a seed and explicit sample-index resets before residual application, returning the continuation predictor.

split: open-access


prompt:
Predictor reset takes effect one sample late.

Reconstruct bounded delta-coded PCM from a seed and explicit sample-index resets before residual application, returning the continuation predictor.

split: open-access


prompt:
Every PCM residual is added to the seed rather than prior reconstructed sample.

Reconstruct bounded delta-coded PCM from a seed and explicit sample-index resets before residual application, returning the continuation predictor.

split: open-access


prompt:
Residual codes are returned instead of reconstructed amplitudes.

Reconstruct bounded delta-coded PCM from a seed and explicit sample-index resets before residual application, returning the continuation predictor.

split: open-access


prompt:
Cross-packet continuation returns the old seed.

Reconstruct bounded delta-coded PCM from a seed and explicit sample-index resets before residual application, returning the continuation predictor.

split: open-access


prompt:
Delta PCM starts from zero instead of transmitted predictor seed.

Generate signed PCM residuals relative to the previous amplitude; reset at explicit sample positions and return the final amplitude continuation seed.

split: open-access


prompt:
Reset markers are interpreted after their target sample.

Generate signed PCM residuals relative to the previous amplitude; reset at explicit sample positions and return the final amplitude continuation seed.

split: open-access


prompt:
Residual polarity is reversed.

Generate signed PCM residuals relative to the previous amplitude; reset at explicit sample positions and return the final amplitude continuation seed.

split: open-access


prompt:
Encoder feeds its residual back as next amplitude predictor.

Generate signed PCM residuals relative to the previous amplitude; reset at explicit sample positions and return the final amplitude continuation seed.

split: open-access


prompt:
Encoder returns seed rather than final amplitude for continuation.

Generate signed PCM residuals relative to the previous amplitude; reset at explicit sample positions and return the final amplitude continuation seed.

split: open-access


prompt:
The side channel uses the inverse stereo residual orientation.

Encode stereo integer PCM through reversible floor lifting: side=L-R, mid=R+floor(side/2), with an explicit odd-side parity sideband.

split: open-access


prompt:
Truncation toward zero differs from floor on negative odd side codes.

Encode stereo integer PCM through reversible floor lifting: side=L-R, mid=R+floor(side/2), with an explicit odd-side parity sideband.

split: open-access


prompt:
Lifting adds half-side to left instead of right.

Encode stereo integer PCM through reversible floor lifting: side=L-R, mid=R+floor(side/2), with an explicit odd-side parity sideband.

split: open-access


prompt:
A residual parity sideband is derived from midpoint amplitude.

Encode stereo integer PCM through reversible floor lifting: side=L-R, mid=R+floor(side/2), with an explicit odd-side parity sideband.

split: open-access


prompt:
Lossless PCM midpoint and side fields are swapped.

Encode stereo integer PCM through reversible floor lifting: side=L-R, mid=R+floor(side/2), with an explicit odd-side parity sideband.

split: open-access


prompt:
PCM side parity is checked against midpoint bits.

Invert the stipulated reversible PCM midpoint/side code, rejecting parity-mismatched triples and preserving L,R destination order.

split: open-access


prompt:
Truncating negative odd side inverts the wrong lifting transform.

Invert the stipulated reversible PCM midpoint/side code, rejecting parity-mismatched triples and preserving L,R destination order.

split: open-access


prompt:
Residual and midpoint roles are confused during reconstruction.

Invert the stipulated reversible PCM midpoint/side code, rejecting parity-mismatched triples and preserving L,R destination order.

split: open-access


prompt:
Left amplitude subtracts the recovered base channel.

Invert the stipulated reversible PCM midpoint/side code, rejecting parity-mismatched triples and preserving L,R destination order.

split: open-access


prompt:
Recovered channel labels are swapped after lossless unlifting.

Invert the stipulated reversible PCM midpoint/side code, rejecting parity-mismatched triples and preserving L,R destination order.

split: open-access


prompt:
One in-range sample prevents shift needed by another sample in the block.

Bounded block-floating PCM: choose the smallest shared right shift fitting signed mantissas, cap exponent, saturate residual overflow and report reconstructed amplitudes.

split: open-access


prompt:
Block-floating PCM disallows the valid most-negative mantissa.

Bounded block-floating PCM: choose the smallest shared right shift fitting signed mantissas, cap exponent, saturate residual overflow and report reconstructed amplitudes.

split: open-access


prompt:
Exponent exceeds the packet field limit by one.

Bounded block-floating PCM: choose the smallest shared right shift fitting signed mantissas, cap exponent, saturate residual overflow and report reconstructed amplitudes.

split: open-access


prompt:
Mantissa truncation does not match the declared arithmetic shift on negative values.

Bounded block-floating PCM: choose the smallest shared right shift fitting signed mantissas, cap exponent, saturate residual overflow and report reconstructed amplitudes.

split: open-access


prompt:
Exponent metadata is ignored during block reconstruction.

Bounded block-floating PCM: choose the smallest shared right shift fitting signed mantissas, cap exponent, saturate residual overflow and report reconstructed amplitudes.

split: open-access


prompt:
Interchannel differential PCM reuses the first channel predictor.

Encode frame-major PCM residuals with independent per-channel amplitude predictors and frame-index resets; preserve residual frame shape.

split: open-access


prompt:
Per-channel predictor update overwrites only the first state lane.

Encode frame-major PCM residuals with independent per-channel amplitude predictors and frame-index resets; preserve residual frame shape.

split: open-access


prompt:
A channel reset discards transmitted nonzero seeds.

Encode frame-major PCM residuals with independent per-channel amplitude predictors and frame-index resets; preserve residual frame shape.

split: open-access


prompt:
PCM packet boundaries disappear when residual frames are flattened.

Encode frame-major PCM residuals with independent per-channel amplitude predictors and frame-index resets; preserve residual frame shape.

split: open-access


prompt:
Reset addresses are interpreted one frame early.

Encode frame-major PCM residuals with independent per-channel amplitude predictors and frame-index resets; preserve residual frame shape.

split: open-access


prompt:
Residual updates only the first PCM channel accumulator.

Decode channel-banked residual PCM, resetting predictors only at specified frame boundaries and exporting final per-channel amplitudes.

split: open-access


prompt:
All output channels read the first accumulator.

Decode channel-banked residual PCM, resetting predictors only at specified frame boundaries and exporting final per-channel amplitudes.

split: open-access


prompt:
Frame reset initializes digital zero instead of packet channel seeds.

Decode channel-banked residual PCM, resetting predictors only at specified frame boundaries and exporting final per-channel amplitudes.

split: open-access


prompt:
Decoded PCM frame boundaries are discarded.

Decode channel-banked residual PCM, resetting predictors only at specified frame boundaries and exporting final per-channel amplitudes.

split: open-access


prompt:
Continuation metadata carries initial channel levels.

Decode channel-banked residual PCM, resetting predictors only at specified frame boundaries and exporting final per-channel amplitudes.

split: open-access


prompt:
Silence runs use integer zero despite an explicit unsigned PCM zero code.

Decode tagged PCM literal and silence-run packets up to a sample capacity, honoring the declared digital-silence code and skipping unknown metadata.

split: open-access


prompt:
Silence run length loses its last sample.

Decode tagged PCM literal and silence-run packets up to a sample capacity, honoring the declared digital-silence code and skipping unknown metadata.

split: open-access


prompt:
An unknown metadata packet terminates subsequent PCM data.

Decode tagged PCM literal and silence-run packets up to a sample capacity, honoring the declared digital-silence code and skipping unknown metadata.

split: open-access


prompt:
A bounded decode retains the latest tail instead of earliest samples.

Decode tagged PCM literal and silence-run packets up to a sample capacity, honoring the declared digital-silence code and skipping unknown metadata.

split: open-access


prompt:
Literal PCM sample packets become nested arrays.

Decode tagged PCM literal and silence-run packets up to a sample capacity, honoring the declared digital-silence code and skipping unknown metadata.

split: open-access


prompt:
Unspecified PCM positions are initialized with the wrong silence code.

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.

split: open-access


prompt:
Negative event positions wrap to the end of the Python sample array.

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.

split: open-access


prompt:
Final in-range impulse is excluded.

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.

split: open-access


prompt:
Repeated sample events are summed rather than last-writer replaced.

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.

split: open-access


prompt:
Absolute PCM event values are interpreted as offsets from silence.

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.

split: open-access


prompt:
Progressive PCM scales coarse samples by bit count instead of bit weight.

Restore PCM from arithmetic-shift coarse samples and optional unsigned low-bit refinements; missing refinement bits are zero and out-of-field residual bits are masked.

split: open-access


prompt:
Every sample reuses the first refinement residual.

Restore PCM from arithmetic-shift coarse samples and optional unsigned low-bit refinements; missing refinement bits are zero and out-of-field residual bits are masked.

split: open-access


prompt:
Absent refinement bits are replaced with maximum positive low bits.

Restore PCM from arithmetic-shift coarse samples and optional unsigned low-bit refinements; missing refinement bits are zero and out-of-field residual bits are masked.

split: open-access


prompt:
A one-bit boundary mask replaces the low-bit refinement mask.

Restore PCM from arithmetic-shift coarse samples and optional unsigned low-bit refinements; missing refinement bits are zero and out-of-field residual bits are masked.

split: open-access


prompt:
Negative coarse PCM loses its sign before refinement.

Restore PCM from arithmetic-shift coarse samples and optional unsigned low-bit refinements; missing refinement bits are zero and out-of-field residual bits are masked.

split: open-access


prompt:
PCM byte spans include the RIFF-style chunk header.

Locate PCM spans in a bounded RIFF-like list of chunk descriptors with eight-byte headers and even-byte padding, requiring a preceding format chunk.

split: open-access


prompt:
Odd metadata chunks shift later PCM spans when pad bytes are omitted.

Locate PCM spans in a bounded RIFF-like list of chunk descriptors with eight-byte headers and even-byte padding, requiring a preceding format chunk.

split: open-access


prompt:
PCM data is exposed before a format declaration is available.

Locate PCM spans in a bounded RIFF-like list of chunk descriptors with eight-byte headers and even-byte padding, requiring a preceding format chunk.

split: open-access


prompt:
Unknown chunks after format are presented as PCM sample spans.

Locate PCM spans in a bounded RIFF-like list of chunk descriptors with eight-byte headers and even-byte padding, requiring a preceding format chunk.

split: open-access


prompt:
Later PCM chunks overwrite earlier sample spans.

Locate PCM spans in a bounded RIFF-like list of chunk descriptors with eight-byte headers and even-byte padding, requiring a preceding format chunk.

split: open-access


prompt:
PCM sound offset is measured before the sound-data preamble.

For stipulated AIFF-like sound chunks, exclude the eight-byte offset/block preamble and offset prefix, count complete PCM frames and inspect absolute block alignment.

split: open-access


prompt:
Sound-data metadata bytes are counted as samples.

For stipulated AIFF-like sound chunks, exclude the eight-byte offset/block preamble and offset prefix, count complete PCM frames and inspect absolute block alignment.

split: open-access


prompt:
Partial PCM frame bytes are counted as a complete frame.

For stipulated AIFF-like sound chunks, exclude the eight-byte offset/block preamble and offset prefix, count complete PCM frames and inspect absolute block alignment.

split: open-access


prompt:
Partial frame status includes sound preamble bytes.

For stipulated AIFF-like sound chunks, exclude the eight-byte offset/block preamble and offset prefix, count complete PCM frames and inspect absolute block alignment.

split: open-access


prompt:
Block alignment is checked at the enclosing chunk instead of first PCM byte.

For stipulated AIFF-like sound chunks, exclude the eight-byte offset/block preamble and offset prefix, count complete PCM frames and inspect absolute block alignment.

split: open-access


prompt:
Encoder priming samples remain audible at the start.

Present a PCM packet table after globally removing declared priming and remainder sample counts; retain raw cumulative sample offsets for each packet.

split: open-access


prompt:
Trailing encoder remainder samples leak into presentation.

Present a PCM packet table after globally removing declared priming and remainder sample counts; retain raw cumulative sample offsets for each packet.

split: open-access


prompt:
Packet offsets are reported as packet indices instead of sample positions.

Present a PCM packet table after globally removing declared priming and remainder sample counts; retain raw cumulative sample offsets for each packet.

split: open-access


prompt:
PCM samples reverse inside each table packet.

Present a PCM packet table after globally removing declared priming and remainder sample counts; retain raw cumulative sample offsets for each packet.

split: open-access


prompt:
Computed trailing remainder exclusion is ignored by the output slice.

Present a PCM packet table after globally removing declared priming and remainder sample counts; retain raw cumulative sample offsets for each packet.

split: open-access


prompt:
Annotation/header bytes are decoded as PCM payload.

Locate a bounded AU-like PCM byte body at an absolute data offset; -1 alone means unknown size, and incomplete frame bytes are returned separately.

split: open-access


prompt:
The unknown-length sentinel is not recognized.

Locate a bounded AU-like PCM byte body at an absolute data offset; -1 alone means unknown size, and incomplete frame bytes are returned separately.

split: open-access


prompt:
A byte-size declaration is multiplied as though it counted frames.

Locate a bounded AU-like PCM byte body at an absolute data offset; -1 alone means unknown size, and incomplete frame bytes are returned separately.

split: open-access


prompt:
Incomplete sample-frame bytes are returned as playable data.

Locate a bounded AU-like PCM byte body at an absolute data offset; -1 alone means unknown size, and incomplete frame bytes are returned separately.

split: open-access


prompt:
Partial trailing bytes are reported as the complete audio prefix.

Locate a bounded AU-like PCM byte body at an absolute data offset; -1 alone means unknown size, and incomplete frame bytes are returned separately.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunks, extended_sizes, sentinel):
    used={}
    out=[]
    for tag,size in chunks:
        if tag in extended_sizes:
            ordinal=used.get(tag,0)
            matches=extended_sizes.get(tag,[])
            resolved=matches[ordinal] if ordinal<len(matches) else None
            used[tag]=ordinal+1
        else:
            resolved=size
        out.append([tag,resolved])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['data', 99], ['data', 99]], {'data': [4, 8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 2', solve(*([['data', 4], ['data', 99]], {'data': [8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 3', solve(*([['data', 99], ['JUNK', 99], ['data', 99]], {'data': [4, 8], 'JUNK': [3]}, 99)), [['data', 4], ['JUNK', 3], ['data', 8]])
check('oracle 4', solve(*([], {}, 99)), [])
check('oracle 5', solve(*([['data', 99]], {}, 99)), [['data', None]])
check('oracle 6', solve(*([['data', 99], ['data', 99]], {'data': [5]}, 99)), [['data', 5], ['data', None]])
check('oracle 7', solve(*([['data', 98]], {'data': [10]}, 99)), [['data', 98]])
if N == 1: check('variant packet 1', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None]])
if N == 2: check('variant packet 2', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 3: check('variant packet 3', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 4: check('variant packet 4', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 5: check('variant packet 5', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunks, extended_sizes, sentinel):
    used={}
    out=[]
    for tag,size in chunks:
        if size>=sentinel-1:
            ordinal=used.get(tag,0)
            matches=extended_sizes.get(tag,[])
            resolved=matches[ordinal] if ordinal<len(matches) else None
            used[tag]=ordinal+1
        else:
            resolved=size
        out.append([tag,resolved])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['data', 99], ['data', 99]], {'data': [4, 8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 2', solve(*([['data', 4], ['data', 99]], {'data': [8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 3', solve(*([['data', 99], ['JUNK', 99], ['data', 99]], {'data': [4, 8], 'JUNK': [3]}, 99)), [['data', 4], ['JUNK', 3], ['data', 8]])
check('oracle 4', solve(*([], {}, 99)), [])
check('oracle 5', solve(*([['data', 99]], {}, 99)), [['data', None]])
check('oracle 6', solve(*([['data', 99], ['data', 99]], {'data': [5]}, 99)), [['data', 5], ['data', None]])
check('oracle 7', solve(*([['data', 98]], {'data': [10]}, 99)), [['data', 98]])
if N == 1: check('variant packet 1', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None]])
if N == 2: check('variant packet 2', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 3: check('variant packet 3', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 4: check('variant packet 4', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 5: check('variant packet 5', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
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)

prompt:
An extended table overrides ordinary explicit chunk sizes.

Resolve sentinel PCM chunk lengths from per-tag occurrence-ordered extended size tables, preserving ordinary sizes and null for missing table entries.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunks, extended_sizes, sentinel):
    used={}
    out=[]
    for tag,size in chunks:
        if size==sentinel:
            ordinal=0
            matches=extended_sizes.get(tag,[])
            resolved=matches[ordinal] if ordinal<len(matches) else None
            used[tag]=ordinal+1
        else:
            resolved=size
        out.append([tag,resolved])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['data', 99], ['data', 99]], {'data': [4, 8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 2', solve(*([['data', 4], ['data', 99]], {'data': [8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 3', solve(*([['data', 99], ['JUNK', 99], ['data', 99]], {'data': [4, 8], 'JUNK': [3]}, 99)), [['data', 4], ['JUNK', 3], ['data', 8]])
check('oracle 4', solve(*([], {}, 99)), [])
check('oracle 5', solve(*([['data', 99]], {}, 99)), [['data', None]])
check('oracle 6', solve(*([['data', 99], ['data', 99]], {'data': [5]}, 99)), [['data', 5], ['data', None]])
check('oracle 7', solve(*([['data', 98]], {'data': [10]}, 99)), [['data', 98]])
if N == 1: check('variant packet 1', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None]])
if N == 2: check('variant packet 2', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 3: check('variant packet 3', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 4: check('variant packet 4', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 5: check('variant packet 5', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunks, extended_sizes, sentinel):
    used={}
    out=[]
    for tag,size in chunks:
        if size==sentinel:
            ordinal=sum(used.values())
            matches=extended_sizes.get(tag,[])
            resolved=matches[ordinal] if ordinal<len(matches) else None
            used[tag]=ordinal+1
        else:
            resolved=size
        out.append([tag,resolved])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['data', 99], ['data', 99]], {'data': [4, 8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 2', solve(*([['data', 4], ['data', 99]], {'data': [8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 3', solve(*([['data', 99], ['JUNK', 99], ['data', 99]], {'data': [4, 8], 'JUNK': [3]}, 99)), [['data', 4], ['JUNK', 3], ['data', 8]])
check('oracle 4', solve(*([], {}, 99)), [])
check('oracle 5', solve(*([['data', 99]], {}, 99)), [['data', None]])
check('oracle 6', solve(*([['data', 99], ['data', 99]], {'data': [5]}, 99)), [['data', 5], ['data', None]])
check('oracle 7', solve(*([['data', 98]], {'data': [10]}, 99)), [['data', 98]])
if N == 1: check('variant packet 1', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None]])
if N == 2: check('variant packet 2', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 3: check('variant packet 3', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 4: check('variant packet 4', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 5: check('variant packet 5', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
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)

prompt:
Repeated PCM chunks reuse the first extended length.

Resolve sentinel PCM chunk lengths from per-tag occurrence-ordered extended size tables, preserving ordinary sizes and null for missing table entries.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunks, extended_sizes, sentinel):
    used={}
    out=[]
    for tag,size in chunks:
        if size==sentinel:
            ordinal=used.get(tag,0)
            matches=extended_sizes.get('data',[])
            resolved=matches[ordinal] if ordinal<len(matches) else None
            used[tag]=ordinal+1
        else:
            resolved=size
        out.append([tag,resolved])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['data', 99], ['data', 99]], {'data': [4, 8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 2', solve(*([['data', 4], ['data', 99]], {'data': [8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 3', solve(*([['data', 99], ['JUNK', 99], ['data', 99]], {'data': [4, 8], 'JUNK': [3]}, 99)), [['data', 4], ['JUNK', 3], ['data', 8]])
check('oracle 4', solve(*([], {}, 99)), [])
check('oracle 5', solve(*([['data', 99]], {}, 99)), [['data', None]])
check('oracle 6', solve(*([['data', 99], ['data', 99]], {'data': [5]}, 99)), [['data', 5], ['data', None]])
check('oracle 7', solve(*([['data', 98]], {'data': [10]}, 99)), [['data', 98]])
if N == 1: check('variant packet 1', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None]])
if N == 2: check('variant packet 2', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 3: check('variant packet 3', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 4: check('variant packet 4', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 5: check('variant packet 5', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunks, extended_sizes, sentinel):
    used={}
    out=[]
    for tag,size in chunks:
        if size==sentinel:
            ordinal=used.get(tag,0)
            matches=[]
            resolved=matches[ordinal] if ordinal<len(matches) else None
            used[tag]=ordinal+1
        else:
            resolved=size
        out.append([tag,resolved])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['data', 99], ['data', 99]], {'data': [4, 8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 2', solve(*([['data', 4], ['data', 99]], {'data': [8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 3', solve(*([['data', 99], ['JUNK', 99], ['data', 99]], {'data': [4, 8], 'JUNK': [3]}, 99)), [['data', 4], ['JUNK', 3], ['data', 8]])
check('oracle 4', solve(*([], {}, 99)), [])
check('oracle 5', solve(*([['data', 99]], {}, 99)), [['data', None]])
check('oracle 6', solve(*([['data', 99], ['data', 99]], {'data': [5]}, 99)), [['data', 5], ['data', None]])
check('oracle 7', solve(*([['data', 98]], {'data': [10]}, 99)), [['data', 98]])
if N == 1: check('variant packet 1', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None]])
if N == 2: check('variant packet 2', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 3: check('variant packet 3', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 4: check('variant packet 4', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 5: check('variant packet 5', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
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)

prompt:
Every extended chunk consumes the audio data size table.

Resolve sentinel PCM chunk lengths from per-tag occurrence-ordered extended size tables, preserving ordinary sizes and null for missing table entries.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunks, extended_sizes, sentinel):
    used={}
    out=[]
    for tag,size in chunks:
        if size==sentinel:
            ordinal=used.get(tag,0)
            matches=extended_sizes.get(tag,[])
            resolved=matches[ordinal] if ordinal<len(matches) else 0
            used[tag]=ordinal+1
        else:
            resolved=size
        out.append([tag,resolved])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['data', 99], ['data', 99]], {'data': [4, 8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 2', solve(*([['data', 4], ['data', 99]], {'data': [8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 3', solve(*([['data', 99], ['JUNK', 99], ['data', 99]], {'data': [4, 8], 'JUNK': [3]}, 99)), [['data', 4], ['JUNK', 3], ['data', 8]])
check('oracle 4', solve(*([], {}, 99)), [])
check('oracle 5', solve(*([['data', 99]], {}, 99)), [['data', None]])
check('oracle 6', solve(*([['data', 99], ['data', 99]], {'data': [5]}, 99)), [['data', 5], ['data', None]])
check('oracle 7', solve(*([['data', 98]], {'data': [10]}, 99)), [['data', 98]])
if N == 1: check('variant packet 1', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None]])
if N == 2: check('variant packet 2', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 3: check('variant packet 3', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 4: check('variant packet 4', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 5: check('variant packet 5', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunks, extended_sizes, sentinel):
    used={}
    out=[]
    for tag,size in chunks:
        if size==sentinel:
            ordinal=used.get(tag,0)
            matches=extended_sizes.get(tag,[])
            resolved=matches[ordinal] if ordinal<len(matches) else (matches[-1] if matches else 0)
            used[tag]=ordinal+1
        else:
            resolved=size
        out.append([tag,resolved])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['data', 99], ['data', 99]], {'data': [4, 8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 2', solve(*([['data', 4], ['data', 99]], {'data': [8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 3', solve(*([['data', 99], ['JUNK', 99], ['data', 99]], {'data': [4, 8], 'JUNK': [3]}, 99)), [['data', 4], ['JUNK', 3], ['data', 8]])
check('oracle 4', solve(*([], {}, 99)), [])
check('oracle 5', solve(*([['data', 99]], {}, 99)), [['data', None]])
check('oracle 6', solve(*([['data', 99], ['data', 99]], {'data': [5]}, 99)), [['data', 5], ['data', None]])
check('oracle 7', solve(*([['data', 98]], {'data': [10]}, 99)), [['data', 98]])
if N == 1: check('variant packet 1', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None]])
if N == 2: check('variant packet 2', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 3: check('variant packet 3', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 4: check('variant packet 4', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 5: check('variant packet 5', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
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)

prompt:
Missing extended lengths become falsely known empty chunks.

Resolve sentinel PCM chunk lengths from per-tag occurrence-ordered extended size tables, preserving ordinary sizes and null for missing table entries.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunks, extended_sizes, sentinel):
    used={}
    out=[]
    for tag,size in chunks:
        if size==sentinel:
            ordinal=used.get(tag,0)
            matches=extended_sizes.get(tag,[])
            resolved=matches[ordinal] if ordinal<len(matches) else None
            used[tag]=ordinal
        else:
            resolved=size
        out.append([tag,resolved])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['data', 99], ['data', 99]], {'data': [4, 8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 2', solve(*([['data', 4], ['data', 99]], {'data': [8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 3', solve(*([['data', 99], ['JUNK', 99], ['data', 99]], {'data': [4, 8], 'JUNK': [3]}, 99)), [['data', 4], ['JUNK', 3], ['data', 8]])
check('oracle 4', solve(*([], {}, 99)), [])
check('oracle 5', solve(*([['data', 99]], {}, 99)), [['data', None]])
check('oracle 6', solve(*([['data', 99], ['data', 99]], {'data': [5]}, 99)), [['data', 5], ['data', None]])
check('oracle 7', solve(*([['data', 98]], {'data': [10]}, 99)), [['data', 98]])
if N == 1: check('variant packet 1', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None]])
if N == 2: check('variant packet 2', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 3: check('variant packet 3', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 4: check('variant packet 4', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 5: check('variant packet 5', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(chunks, extended_sizes, sentinel):
    used={}
    out=[]
    for tag,size in chunks:
        if size==sentinel:
            ordinal=used.get(tag,0)
            matches=extended_sizes.get(tag,[])
            resolved=matches[ordinal] if ordinal<len(matches) else None
            used[tag]=ordinal+2
        else:
            resolved=size
        out.append([tag,resolved])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([['data', 99], ['data', 99]], {'data': [4, 8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 2', solve(*([['data', 4], ['data', 99]], {'data': [8]}, 99)), [['data', 4], ['data', 8]])
check('oracle 3', solve(*([['data', 99], ['JUNK', 99], ['data', 99]], {'data': [4, 8], 'JUNK': [3]}, 99)), [['data', 4], ['JUNK', 3], ['data', 8]])
check('oracle 4', solve(*([], {}, 99)), [])
check('oracle 5', solve(*([['data', 99]], {}, 99)), [['data', None]])
check('oracle 6', solve(*([['data', 99], ['data', 99]], {'data': [5]}, 99)), [['data', 5], ['data', None]])
check('oracle 7', solve(*([['data', 98]], {'data': [10]}, 99)), [['data', 98]])
if N == 1: check('variant packet 1', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None]])
if N == 2: check('variant packet 2', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 3: check('variant packet 3', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 4: check('variant packet 4', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
if N == 5: check('variant packet 5', solve(*[[['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99], ['data', 99]], {'data': [4, 8]}, 99]), [['data', 4], ['data', 8], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None], ['data', None]])
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)

prompt:
Repeated sentinel chunks never advance their matching size entry.

Resolve sentinel PCM chunk lengths from per-tag occurrence-ordered extended size tables, preserving ordinary sizes and null for missing table entries.

split: open-access


prompt:
Quantization error is fed back with the opposite sign.

Integer PCM precision reducer with first-order error feedback, even positive step, ties toward positive infinity, explicit reset positions and returned error state.

split: open-access


prompt:
Feedback excludes accumulated prior quantization error.

Integer PCM precision reducer with first-order error feedback, even positive step, ties toward positive infinity, explicit reset positions and returned error state.

split: open-access


prompt:
Feedback treats output code as original-domain amplitude.

Integer PCM precision reducer with first-order error feedback, even positive step, ties toward positive infinity, explicit reset positions and returned error state.

split: open-access


prompt:
Packet reset clears noise-shaping error after its target sample.

Integer PCM precision reducer with first-order error feedback, even positive step, ties toward positive infinity, explicit reset positions and returned error state.

split: open-access


prompt:
Error-feedback conversion uses floor instead of nearest midpoint bins.

Integer PCM precision reducer with first-order error feedback, even positive step, ties toward positive infinity, explicit reset positions and returned error state.

split: open-access


prompt:
A deterministic PCM dither stream starts at the wrong sample phase.

Stipulated subtractive-dither PCM converter with a repeating explicit integer noise sequence, even quantizer step, and both wire codes and reconstructed amplitudes.

split: open-access


prompt:
Dither is omitted before PCM precision reduction.

Stipulated subtractive-dither PCM converter with a repeating explicit integer noise sequence, even quantizer step, and both wire codes and reconstructed amplitudes.

split: open-access


prompt:
Decoded PCM retains deterministic dither instead of subtracting it.

Stipulated subtractive-dither PCM converter with a repeating explicit integer noise sequence, even quantizer step, and both wire codes and reconstructed amplitudes.

split: open-access


prompt:
Dithered amplitude is emitted without division into PCM code bins.

Stipulated subtractive-dither PCM converter with a repeating explicit integer noise sequence, even quantizer step, and both wire codes and reconstructed amplitudes.

split: open-access


prompt:
Wire code and restored amplitude fields are swapped.

Stipulated subtractive-dither PCM converter with a repeating explicit integer noise sequence, even quantizer step, and both wire codes and reconstructed amplitudes.

split: open-access


prompt:
Two supplied uniform draws are added rather than differenced for centered dither.

Construct a bounded deterministic highpass triangular PCM dither sequence from paired supplied draws; return raw-noise delay for packet continuation.

split: open-access


prompt:
Dither amplitude is used as a DC bias instead of gain.

Construct a bounded deterministic highpass triangular PCM dither sequence from paired supplied draws; return raw-noise delay for packet continuation.

split: open-access


prompt:
Highpass dither adds consecutive noise samples.

Construct a bounded deterministic highpass triangular PCM dither sequence from paired supplied draws; return raw-noise delay for packet continuation.

split: open-access


prompt:
Dither delay stores filtered rather than raw noise.

Construct a bounded deterministic highpass triangular PCM dither sequence from paired supplied draws; return raw-noise delay for packet continuation.

split: open-access


prompt:
Packet continuation resets the dither delay.

Construct a bounded deterministic highpass triangular PCM dither sequence from paired supplied draws; return raw-noise delay for packet continuation.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(samples, limit, error):
    out=[]
    for sample in samples:
        candidate=sample+error
        quantized=(candidate+1)//2
        code=max(-limit,min(limit,quantized))
        clipped=abs(code)==limit
        error=0 if clipped else candidate-code*2
        out.append([code,clipped])
    return [out,error]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 1, 20, 1, 1], 3, 0)), [[[1, False], [0, False], [3, True], [1, False], [0, False]], 0])
check('oracle 2', solve(*([-20, -1, -1], 3, 1)), [[[-3, True], [0, False], [-1, False]], 0])
check('oracle 3', solve(*([6, -6], 3, 0)), [[[3, False], [-3, False]], 0])
check('oracle 4', solve(*([], 3, -1)), [[], -1])
check('oracle 5', solve(*([0, 1, 2, 3], 2, -1)), [[[0, False], [0, False], [1, False], [2, False]], -1])
check('oracle 6', solve(*([7, 0, -7, 0], 3, 0)), [[[3, True], [0, False], [-3, False], [0, False]], -1])
check('oracle 7', solve(*([2, 2, 2], 1, 1)), [[[1, True], [1, False], [1, False]], 0])
if N == 1: check('variant packet 1', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 2: check('variant packet 2', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 3: check('variant packet 3', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 4: check('variant packet 4', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 5: check('variant packet 5', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(samples, limit, error):
    out=[]
    for sample in samples:
        candidate=sample+error
        quantized=(candidate+1)//2
        code=max(-limit,min(limit,quantized))
        clipped=abs(sample)>limit
        error=0 if clipped else candidate-code*2
        out.append([code,clipped])
    return [out,error]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 1, 20, 1, 1], 3, 0)), [[[1, False], [0, False], [3, True], [1, False], [0, False]], 0])
check('oracle 2', solve(*([-20, -1, -1], 3, 1)), [[[-3, True], [0, False], [-1, False]], 0])
check('oracle 3', solve(*([6, -6], 3, 0)), [[[3, False], [-3, False]], 0])
check('oracle 4', solve(*([], 3, -1)), [[], -1])
check('oracle 5', solve(*([0, 1, 2, 3], 2, -1)), [[[0, False], [0, False], [1, False], [2, False]], -1])
check('oracle 6', solve(*([7, 0, -7, 0], 3, 0)), [[[3, True], [0, False], [-3, False], [0, False]], -1])
check('oracle 7', solve(*([2, 2, 2], 1, 1)), [[[1, True], [1, False], [1, False]], 0])
if N == 1: check('variant packet 1', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 2: check('variant packet 2', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 3: check('variant packet 3', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 4: check('variant packet 4', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 5: check('variant packet 5', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 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)

prompt:
Representable endpoint codes are incorrectly flagged as clipping.

Bounded PCM error-feedback precision reduction with overload detection and explicit anti-windup reset only when output code saturation changes quantized value.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(samples, limit, error):
    out=[]
    for sample in samples:
        candidate=sample+error
        quantized=(candidate+1)//2
        code=max(-limit,min(limit,quantized))
        clipped=code!=quantized
        error=candidate-code*2
        out.append([code,clipped])
    return [out,error]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 1, 20, 1, 1], 3, 0)), [[[1, False], [0, False], [3, True], [1, False], [0, False]], 0])
check('oracle 2', solve(*([-20, -1, -1], 3, 1)), [[[-3, True], [0, False], [-1, False]], 0])
check('oracle 3', solve(*([6, -6], 3, 0)), [[[3, False], [-3, False]], 0])
check('oracle 4', solve(*([], 3, -1)), [[], -1])
check('oracle 5', solve(*([0, 1, 2, 3], 2, -1)), [[[0, False], [0, False], [1, False], [2, False]], -1])
check('oracle 6', solve(*([7, 0, -7, 0], 3, 0)), [[[3, True], [0, False], [-3, False], [0, False]], -1])
check('oracle 7', solve(*([2, 2, 2], 1, 1)), [[[1, True], [1, False], [1, False]], 0])
if N == 1: check('variant packet 1', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 2: check('variant packet 2', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 3: check('variant packet 3', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 4: check('variant packet 4', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 5: check('variant packet 5', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(samples, limit, error):
    out=[]
    for sample in samples:
        candidate=sample+error
        quantized=(candidate+1)//2
        code=max(-limit,min(limit,quantized))
        clipped=code!=quantized
        error=0
        out.append([code,clipped])
    return [out,error]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 1, 20, 1, 1], 3, 0)), [[[1, False], [0, False], [3, True], [1, False], [0, False]], 0])
check('oracle 2', solve(*([-20, -1, -1], 3, 1)), [[[-3, True], [0, False], [-1, False]], 0])
check('oracle 3', solve(*([6, -6], 3, 0)), [[[3, False], [-3, False]], 0])
check('oracle 4', solve(*([], 3, -1)), [[], -1])
check('oracle 5', solve(*([0, 1, 2, 3], 2, -1)), [[[0, False], [0, False], [1, False], [2, False]], -1])
check('oracle 6', solve(*([7, 0, -7, 0], 3, 0)), [[[3, True], [0, False], [-3, False], [0, False]], -1])
check('oracle 7', solve(*([2, 2, 2], 1, 1)), [[[1, True], [1, False], [1, False]], 0])
if N == 1: check('variant packet 1', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 2: check('variant packet 2', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 3: check('variant packet 3', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 4: check('variant packet 4', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 5: check('variant packet 5', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 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)

prompt:
Saturated PCM retains unbounded overload error that contaminates following samples.

Bounded PCM error-feedback precision reduction with overload detection and explicit anti-windup reset only when output code saturation changes quantized value.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(samples, limit, error):
    out=[]
    for sample in samples:
        candidate=sample
        quantized=(candidate+1)//2
        code=max(-limit,min(limit,quantized))
        clipped=code!=quantized
        error=0 if clipped else candidate-code*2
        out.append([code,clipped])
    return [out,error]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 1, 20, 1, 1], 3, 0)), [[[1, False], [0, False], [3, True], [1, False], [0, False]], 0])
check('oracle 2', solve(*([-20, -1, -1], 3, 1)), [[[-3, True], [0, False], [-1, False]], 0])
check('oracle 3', solve(*([6, -6], 3, 0)), [[[3, False], [-3, False]], 0])
check('oracle 4', solve(*([], 3, -1)), [[], -1])
check('oracle 5', solve(*([0, 1, 2, 3], 2, -1)), [[[0, False], [0, False], [1, False], [2, False]], -1])
check('oracle 6', solve(*([7, 0, -7, 0], 3, 0)), [[[3, True], [0, False], [-3, False], [0, False]], -1])
check('oracle 7', solve(*([2, 2, 2], 1, 1)), [[[1, True], [1, False], [1, False]], 0])
if N == 1: check('variant packet 1', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 2: check('variant packet 2', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 3: check('variant packet 3', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 4: check('variant packet 4', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 5: check('variant packet 5', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(samples, limit, error):
    out=[]
    for sample in samples:
        candidate=sample+abs(error)
        quantized=(candidate+1)//2
        code=max(-limit,min(limit,quantized))
        clipped=code!=quantized
        error=0 if clipped else candidate-code*2
        out.append([code,clipped])
    return [out,error]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 1, 20, 1, 1], 3, 0)), [[[1, False], [0, False], [3, True], [1, False], [0, False]], 0])
check('oracle 2', solve(*([-20, -1, -1], 3, 1)), [[[-3, True], [0, False], [-1, False]], 0])
check('oracle 3', solve(*([6, -6], 3, 0)), [[[3, False], [-3, False]], 0])
check('oracle 4', solve(*([], 3, -1)), [[], -1])
check('oracle 5', solve(*([0, 1, 2, 3], 2, -1)), [[[0, False], [0, False], [1, False], [2, False]], -1])
check('oracle 6', solve(*([7, 0, -7, 0], 3, 0)), [[[3, True], [0, False], [-3, False], [0, False]], -1])
check('oracle 7', solve(*([2, 2, 2], 1, 1)), [[[1, True], [1, False], [1, False]], 0])
if N == 1: check('variant packet 1', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 2: check('variant packet 2', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 3: check('variant packet 3', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 4: check('variant packet 4', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 5: check('variant packet 5', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 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)

prompt:
Current PCM conversion ignores accumulated error.

Bounded PCM error-feedback precision reduction with overload detection and explicit anti-windup reset only when output code saturation changes quantized value.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(samples, limit, error):
    out=[]
    for sample in samples:
        candidate=sample+error
        quantized=(candidate+1)//2
        code=max(-limit,min(limit,candidate))
        clipped=code!=quantized
        error=0 if clipped else candidate-code*2
        out.append([code,clipped])
    return [out,error]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 1, 20, 1, 1], 3, 0)), [[[1, False], [0, False], [3, True], [1, False], [0, False]], 0])
check('oracle 2', solve(*([-20, -1, -1], 3, 1)), [[[-3, True], [0, False], [-1, False]], 0])
check('oracle 3', solve(*([6, -6], 3, 0)), [[[3, False], [-3, False]], 0])
check('oracle 4', solve(*([], 3, -1)), [[], -1])
check('oracle 5', solve(*([0, 1, 2, 3], 2, -1)), [[[0, False], [0, False], [1, False], [2, False]], -1])
check('oracle 6', solve(*([7, 0, -7, 0], 3, 0)), [[[3, True], [0, False], [-3, False], [0, False]], -1])
check('oracle 7', solve(*([2, 2, 2], 1, 1)), [[[1, True], [1, False], [1, False]], 0])
if N == 1: check('variant packet 1', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 2: check('variant packet 2', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 3: check('variant packet 3', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 4: check('variant packet 4', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 5: check('variant packet 5', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(samples, limit, error):
    out=[]
    for sample in samples:
        candidate=sample+error
        quantized=(candidate+1)//2
        code=max(0,min(limit,quantized))
        clipped=code!=quantized
        error=0 if clipped else candidate-code*2
        out.append([code,clipped])
    return [out,error]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([1, 1, 20, 1, 1], 3, 0)), [[[1, False], [0, False], [3, True], [1, False], [0, False]], 0])
check('oracle 2', solve(*([-20, -1, -1], 3, 1)), [[[-3, True], [0, False], [-1, False]], 0])
check('oracle 3', solve(*([6, -6], 3, 0)), [[[3, False], [-3, False]], 0])
check('oracle 4', solve(*([], 3, -1)), [[], -1])
check('oracle 5', solve(*([0, 1, 2, 3], 2, -1)), [[[0, False], [0, False], [1, False], [2, False]], -1])
check('oracle 6', solve(*([7, 0, -7, 0], 3, 0)), [[[3, True], [0, False], [-3, False], [0, False]], -1])
check('oracle 7', solve(*([2, 2, 2], 1, 1)), [[[1, True], [1, False], [1, False]], 0])
if N == 1: check('variant packet 1', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 2: check('variant packet 2', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 3: check('variant packet 3', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 4: check('variant packet 4', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 0])
if N == 5: check('variant packet 5', solve(*[[1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1, 1, 1, 20, 1, 1], 3, 0]), [[[1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False], [1, False], [0, False], [3, True], [1, False], [0, False]], 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)

prompt:
Input-domain amplitude is clamped directly as output code.

Bounded PCM error-feedback precision reduction with overload detection and explicit anti-windup reset only when output code saturation changes quantized value.

split: open-access