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=0 if clipped else sample-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 if clipped else candidate-code
        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:
Unclipped error calculation discards prior feedback contribution.

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


meaning: Fixture-count band, not measured model difficulty

deps: stdlib

prompt:
A bounded PCM-to-one-bit density adapter discards fractional accumulated level each sample.

Convert bounded nonnegative PCM levels no greater than denominator into a deterministic one-bit pulse-density stream, preserving fractional accumulator state.

split: open-access


prompt:
An exact pulse threshold is delayed by one sample.

Convert bounded nonnegative PCM levels no greater than denominator into a deterministic one-bit pulse-density stream, preserving fractional accumulator state.

split: open-access


prompt:
Emitting a pulse discards the fractional overshoot remainder.

Convert bounded nonnegative PCM levels no greater than denominator into a deterministic one-bit pulse-density stream, preserving fractional accumulator state.

split: open-access


prompt:
Output bit polarity is inverted for the stipulated density link.

Convert bounded nonnegative PCM levels no greater than denominator into a deterministic one-bit pulse-density stream, preserving fractional accumulator state.

split: open-access


prompt:
Packet continuation loses the fractional density residue.

Convert bounded nonnegative PCM levels no greater than denominator into a deterministic one-bit pulse-density stream, preserving fractional accumulator state.

split: open-access


prompt:
Adaptive PCM code reconstruction omits its half-bin base increment.

Stipulated bounded adaptive differential PCM nibble model with a 16-entry step table, magnitude adaptation, signed predictor saturation and exported predictor/index state.

split: open-access


prompt:
Adaptive nibble polarity is reversed.

Stipulated bounded adaptive differential PCM nibble model with a 16-entry step table, magnitude adaptation, signed predictor saturation and exported predictor/index state.

split: open-access


prompt:
Adaptation loses the highest magnitude bit.

Stipulated bounded adaptive differential PCM nibble model with a 16-entry step table, magnitude adaptation, signed predictor saturation and exported predictor/index state.

split: open-access


prompt:
Adaptive reconstructed PCM wraps at overload.

Stipulated bounded adaptive differential PCM nibble model with a 16-entry step table, magnitude adaptation, signed predictor saturation and exported predictor/index state.

split: open-access


prompt:
Each nibble replaces the step index rather than adapting prior state.

Stipulated bounded adaptive differential PCM nibble model with a 16-entry step table, magnitude adaptation, signed predictor saturation and exported predictor/index state.

split: open-access


prompt:
Adaptive PCM encoder omits the reconstructed predictor.

Bounded fixed-step adaptive-nibble PCM encoder: greedy magnitude bits, a half-bin base, and predictor feedback from reconstructed rather than original amplitudes.

split: open-access


prompt:
Negative residuals are not converted to magnitude before bit decisions.

Bounded fixed-step adaptive-nibble PCM encoder: greedy magnitude bits, a half-bin base, and predictor feedback from reconstructed rather than original amplitudes.

split: open-access


prompt:
Low weighted adaptive bits consume residual before high bits are considered.

Bounded fixed-step adaptive-nibble PCM encoder: greedy magnitude bits, a half-bin base, and predictor feedback from reconstructed rather than original amplitudes.

split: open-access


prompt:
A selected magnitude bit does not reduce the remaining residual.

Bounded fixed-step adaptive-nibble PCM encoder: greedy magnitude bits, a half-bin base, and predictor feedback from reconstructed rather than original amplitudes.

split: open-access


prompt:
Encoder feeds the unquantized source into predictor state, diverging from decoder.

Bounded fixed-step adaptive-nibble PCM encoder: greedy magnitude bits, a half-bin base, and predictor feedback from reconstructed rather than original amplitudes.

split: open-access


prompt:
Adaptive PCM nibble reader ignores low-first packet declaration.

Extract adaptive PCM nibble codes in declared within-octet order; valid count is in nibbles and remaining codes are returned separately as padding.

split: open-access


prompt:
Transport bits above the octet leak into the high nibble.

Extract adaptive PCM nibble codes in declared within-octet order; valid count is in nibbles and remaining codes are returned separately as padding.

split: open-access


prompt:
Low nibble loses its adaptive sign bit.

Extract adaptive PCM nibble codes in declared within-octet order; valid count is in nibbles and remaining codes are returned separately as padding.

split: open-access


prompt:
Nibble count is interpreted as octet count, exposing pad codes.

Extract adaptive PCM nibble codes in declared within-octet order; valid count is in nibbles and remaining codes are returned separately as padding.

split: open-access


prompt:
Unconsumed padding codes are confused with valid codes.

Extract adaptive PCM nibble codes in declared within-octet order; valid count is in nibbles and remaining codes are returned separately as padding.

split: open-access


prompt:
Two-tap PCM history coefficients are assigned to reversed sample ages.

Stipulated two-history adaptive PCM decoder with explicit integer predictor coefficients, floor divisor, signed residual nibble and fixed residual amplitude scale.

split: open-access


prompt:
Dividing predictor terms separately changes integer rounding.

Stipulated two-history adaptive PCM decoder with explicit integer predictor coefficients, floor divisor, signed residual nibble and fixed residual amplitude scale.

split: open-access


prompt:
Adaptive PCM residual nibble is interpreted as sign magnitude.

Stipulated two-history adaptive PCM decoder with explicit integer predictor coefficients, floor divisor, signed residual nibble and fixed residual amplitude scale.

split: open-access


prompt:
Delta scale is incorrectly applied to the predicted PCM level.

Stipulated two-history adaptive PCM decoder with explicit integer predictor coefficients, floor divisor, signed residual nibble and fixed residual amplitude scale.

split: open-access


prompt:
Both predictor taps retain the newest decoded sample.

Stipulated two-history adaptive PCM decoder with explicit integer predictor coefficients, floor divisor, signed residual nibble and fixed residual amplitude scale.

split: open-access


prompt:
PCM adaptation table lookup discards a significant nibble index bit.

Apply a stipulated 16-code fixed-point PCM adaptation table sequentially, enforcing a minimum positive amplitude delta and returning continuation scale.

split: open-access


prompt:
Adaptation always scales the minimum rather than evolving delta.

Apply a stipulated 16-code fixed-point PCM adaptation table sequentially, enforcing a minimum positive amplitude delta and returning continuation scale.

split: open-access


prompt:
Adaptation factor uses the wrong binary fixed-point denominator.

Apply a stipulated 16-code fixed-point PCM adaptation table sequentially, enforcing a minimum positive amplitude delta and returning continuation scale.

split: open-access


prompt:
Quiet residuals shrink PCM step below the stipulated minimum.

Apply a stipulated 16-code fixed-point PCM adaptation table sequentially, enforcing a minimum positive amplitude delta and returning continuation scale.

split: open-access


prompt:
Packet continuation resets adaptive delta to its lower bound.

Apply a stipulated 16-code fixed-point PCM adaptation table sequentially, enforcing a minimum positive amplitude delta and returning continuation scale.

split: open-access


prompt:
Mu-law segment selection omits reconstruction bias.

Bounded mu-law-style selection model: clamp magnitude32635, add bias132, select segment and mantissa then complement the full eight-bit code.

split: open-access


prompt:
An exact companding segment boundary stays in the lower segment.

Bounded mu-law-style selection model: clamp magnitude32635, add bias132, select segment and mantissa then complement the full eight-bit code.

split: open-access


prompt:
Mu-law mantissa extraction leaves three discarded precision bits.

Bounded mu-law-style selection model: clamp magnitude32635, add bias132, select segment and mantissa then complement the full eight-bit code.

split: open-access


prompt:
Companded PCM polarity bit uses the inverse convention.

Bounded mu-law-style selection model: clamp magnitude32635, add bias132, select segment and mantissa then complement the full eight-bit code.

split: open-access


prompt:
The companded output omits wire complement.

Bounded mu-law-style selection model: clamp magnitude32635, add bias132, select segment and mantissa then complement the full eight-bit code.

split: open-access


prompt:
A-law negative input omits its complement offset at quantization boundaries.

Stipulated bounded A-law-style PCM encoder with negative complement offset, thirteen-bit working magnitude, segment-specific shifts and alternating wire mask.

split: open-access


prompt:
A-law input reduction keeps one extra precision bit.

Stipulated bounded A-law-style PCM encoder with negative complement offset, thirteen-bit working magnitude, segment-specific shifts and alternating wire mask.

split: open-access


prompt:
The first segment uses the general exponent rule instead of its special mantissa shift.

Stipulated bounded A-law-style PCM encoder with negative complement offset, thirteen-bit working magnitude, segment-specific shifts and alternating wire mask.

split: open-access


prompt:
Exact segment thresholds select the previous code segment.

Stipulated bounded A-law-style PCM encoder with negative complement offset, thirteen-bit working magnitude, segment-specific shifts and alternating wire mask.

split: open-access


prompt:
A-law code omits alternating-bit transmission mask.

Stipulated bounded A-law-style PCM encoder with negative complement offset, thirteen-bit working magnitude, segment-specific shifts and alternating wire mask.

split: open-access


prompt:
Negative PCM codewords index from the end of a calibration table.

Decode an explicitly calibrated nonlinear PCM code table relative to its designated zero entry; invalid indices return null rather than a plausible sample.

split: open-access


prompt:
The final reconstruction code is rejected as if the table endpoint were exclusive.

Decode an explicitly calibrated nonlinear PCM code table relative to its designated zero entry; invalid indices return null rather than a plausible sample.

split: open-access


prompt:
Reconstruction leaves the calibration-table DC offset.

Decode an explicitly calibrated nonlinear PCM code table relative to its designated zero entry; invalid indices return null rather than a plausible sample.

split: open-access


prompt:
Invalid PCM codes become plausible silence amplitudes.

Decode an explicitly calibrated nonlinear PCM code table relative to its designated zero entry; invalid indices return null rather than a plausible sample.

split: open-access


prompt:
Calibration table code order is reversed.

Decode an explicitly calibrated nonlinear PCM code table relative to its designated zero entry; invalid indices return null rather than a plausible sample.

split: open-access


prompt:
Signed distance always favors one end of the PCM reconstruction table.

Encode PCM amplitudes to nearest entries of an explicit possibly repeated calibration table, with a declared lowest/highest code-index tie policy.

split: open-access


prompt:
Encoder chooses the farthest calibrated level.

Encode PCM amplitudes to nearest entries of an explicit possibly repeated calibration table, with a declared lowest/highest code-index tie policy.

split: open-access


prompt:
Encoder emits distance values instead of codeword indices.

Encode PCM amplitudes to nearest entries of an explicit possibly repeated calibration table, with a declared lowest/highest code-index tie policy.

split: open-access


prompt:
Highest-code tie selection is ignored.

Encode PCM amplitudes to nearest entries of an explicit possibly repeated calibration table, with a declared lowest/highest code-index tie policy.

split: open-access


prompt:
Every sample is encoded using the first sample target.

Encode PCM amplitudes to nearest entries of an explicit possibly repeated calibration table, with a declared lowest/highest code-index tie policy.

split: open-access


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

N = 1
observations = []
def solve(samples, edges, shifts):
    out=[]
    for sample in samples:
        negative=sample<0
        magnitude=abs(sample)
        segment=0
        while segment+1<len(edges) and magnitude>edges[segment+1]:
            segment+=1
        residual=max(0,magnitude-edges[segment])
        mantissa=residual>>shifts[segment]
        out.append([negative,segment,mantissa])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([-15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3])), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 2', solve(*([0, 2, 3, 8], [0, 3, 8], [0, 2, 2])), [[False, 0, 0], [False, 0, 2], [False, 1, 0], [False, 2, 0]])
check('oracle 3', solve(*([1, 2, 3], [0], [1])), [[False, 0, 0], [False, 0, 1], [False, 0, 1]])
check('oracle 4', solve(*([], [0, 8], [1, 3])), [])
check('oracle 5', solve(*([-8, 8, 9], [0, 8], [0, 3])), [[True, 1, 0], [False, 1, 0], [False, 1, 0]])
check('oracle 6', solve(*([0, 1, 16], [0, 1, 16], [0, 0, 2])), [[False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 7', solve(*([7, -7], [0, 4], [1, 0])), [[False, 1, 3], [True, 1, 3]])
if N == 1: check('variant packet 1', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 2: check('variant packet 2', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 3: check('variant packet 3', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 4: check('variant packet 4', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 5: check('variant packet 5', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 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, edges, shifts):
    out=[]
    for sample in samples:
        negative=sample<0
        magnitude=abs(sample)
        segment=0
        while segment+1<len(edges) and magnitude>=edges[segment]:
            segment+=1
        residual=max(0,magnitude-edges[segment])
        mantissa=residual>>shifts[segment]
        out.append([negative,segment,mantissa])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([-15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3])), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 2', solve(*([0, 2, 3, 8], [0, 3, 8], [0, 2, 2])), [[False, 0, 0], [False, 0, 2], [False, 1, 0], [False, 2, 0]])
check('oracle 3', solve(*([1, 2, 3], [0], [1])), [[False, 0, 0], [False, 0, 1], [False, 0, 1]])
check('oracle 4', solve(*([], [0, 8], [1, 3])), [])
check('oracle 5', solve(*([-8, 8, 9], [0, 8], [0, 3])), [[True, 1, 0], [False, 1, 0], [False, 1, 0]])
check('oracle 6', solve(*([0, 1, 16], [0, 1, 16], [0, 0, 2])), [[False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 7', solve(*([7, -7], [0, 4], [1, 0])), [[False, 1, 3], [True, 1, 3]])
if N == 1: check('variant packet 1', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 2: check('variant packet 2', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 3: check('variant packet 3', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 4: check('variant packet 4', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 5: check('variant packet 5', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 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:
Exact segment boundaries remain in their lower region.

Encode bounded PCM magnitude into an explicitly stipulated piecewise companding table: sign sideband, selected lower-bound segment and shifted residual mantissa.

split: open-access


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

N = 1
observations = []
def solve(samples, edges, shifts):
    out=[]
    for sample in samples:
        negative=sample<0
        magnitude=abs(sample)
        segment=0
        while segment+1<len(edges) and magnitude>=edges[segment+1]:
            segment+=1
        residual=max(0,magnitude)
        mantissa=residual>>shifts[segment]
        out.append([negative,segment,mantissa])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([-15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3])), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 2', solve(*([0, 2, 3, 8], [0, 3, 8], [0, 2, 2])), [[False, 0, 0], [False, 0, 2], [False, 1, 0], [False, 2, 0]])
check('oracle 3', solve(*([1, 2, 3], [0], [1])), [[False, 0, 0], [False, 0, 1], [False, 0, 1]])
check('oracle 4', solve(*([], [0, 8], [1, 3])), [])
check('oracle 5', solve(*([-8, 8, 9], [0, 8], [0, 3])), [[True, 1, 0], [False, 1, 0], [False, 1, 0]])
check('oracle 6', solve(*([0, 1, 16], [0, 1, 16], [0, 0, 2])), [[False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 7', solve(*([7, -7], [0, 4], [1, 0])), [[False, 1, 3], [True, 1, 3]])
if N == 1: check('variant packet 1', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 2: check('variant packet 2', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 3: check('variant packet 3', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 4: check('variant packet 4', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 5: check('variant packet 5', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 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, edges, shifts):
    out=[]
    for sample in samples:
        negative=sample<0
        magnitude=abs(sample)
        segment=0
        while segment+1<len(edges) and magnitude>=edges[segment+1]:
            segment+=1
        residual=max(0,magnitude-edges[0])
        mantissa=residual>>shifts[segment]
        out.append([negative,segment,mantissa])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([-15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3])), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 2', solve(*([0, 2, 3, 8], [0, 3, 8], [0, 2, 2])), [[False, 0, 0], [False, 0, 2], [False, 1, 0], [False, 2, 0]])
check('oracle 3', solve(*([1, 2, 3], [0], [1])), [[False, 0, 0], [False, 0, 1], [False, 0, 1]])
check('oracle 4', solve(*([], [0, 8], [1, 3])), [])
check('oracle 5', solve(*([-8, 8, 9], [0, 8], [0, 3])), [[True, 1, 0], [False, 1, 0], [False, 1, 0]])
check('oracle 6', solve(*([0, 1, 16], [0, 1, 16], [0, 0, 2])), [[False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 7', solve(*([7, -7], [0, 4], [1, 0])), [[False, 1, 3], [True, 1, 3]])
if N == 1: check('variant packet 1', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 2: check('variant packet 2', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 3: check('variant packet 3', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 4: check('variant packet 4', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 5: check('variant packet 5', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 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:
Companding mantissa includes the whole signal magnitude.

Encode bounded PCM magnitude into an explicitly stipulated piecewise companding table: sign sideband, selected lower-bound segment and shifted residual mantissa.

split: open-access


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

N = 1
observations = []
def solve(samples, edges, shifts):
    out=[]
    for sample in samples:
        negative=sample<0
        magnitude=abs(sample)
        segment=0
        while segment+1<len(edges) and magnitude>=edges[segment+1]:
            segment+=1
        residual=max(0,magnitude-edges[segment])
        mantissa=residual>>segment
        out.append([negative,segment,mantissa])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([-15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3])), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 2', solve(*([0, 2, 3, 8], [0, 3, 8], [0, 2, 2])), [[False, 0, 0], [False, 0, 2], [False, 1, 0], [False, 2, 0]])
check('oracle 3', solve(*([1, 2, 3], [0], [1])), [[False, 0, 0], [False, 0, 1], [False, 0, 1]])
check('oracle 4', solve(*([], [0, 8], [1, 3])), [])
check('oracle 5', solve(*([-8, 8, 9], [0, 8], [0, 3])), [[True, 1, 0], [False, 1, 0], [False, 1, 0]])
check('oracle 6', solve(*([0, 1, 16], [0, 1, 16], [0, 0, 2])), [[False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 7', solve(*([7, -7], [0, 4], [1, 0])), [[False, 1, 3], [True, 1, 3]])
if N == 1: check('variant packet 1', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 2: check('variant packet 2', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 3: check('variant packet 3', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 4: check('variant packet 4', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 5: check('variant packet 5', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 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, edges, shifts):
    out=[]
    for sample in samples:
        negative=sample<0
        magnitude=abs(sample)
        segment=0
        while segment+1<len(edges) and magnitude>=edges[segment+1]:
            segment+=1
        residual=max(0,magnitude-edges[segment])
        mantissa=residual>>shifts[0]
        out.append([negative,segment,mantissa])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([-15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3])), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 2', solve(*([0, 2, 3, 8], [0, 3, 8], [0, 2, 2])), [[False, 0, 0], [False, 0, 2], [False, 1, 0], [False, 2, 0]])
check('oracle 3', solve(*([1, 2, 3], [0], [1])), [[False, 0, 0], [False, 0, 1], [False, 0, 1]])
check('oracle 4', solve(*([], [0, 8], [1, 3])), [])
check('oracle 5', solve(*([-8, 8, 9], [0, 8], [0, 3])), [[True, 1, 0], [False, 1, 0], [False, 1, 0]])
check('oracle 6', solve(*([0, 1, 16], [0, 1, 16], [0, 0, 2])), [[False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 7', solve(*([7, -7], [0, 4], [1, 0])), [[False, 1, 3], [True, 1, 3]])
if N == 1: check('variant packet 1', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 2: check('variant packet 2', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 3: check('variant packet 3', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 4: check('variant packet 4', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 5: check('variant packet 5', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 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:
Segment number is assumed to equal its declared quantization shift.

Encode bounded PCM magnitude into an explicitly stipulated piecewise companding table: sign sideband, selected lower-bound segment and shifted residual mantissa.

split: open-access


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

N = 1
observations = []
def solve(samples, edges, shifts):
    out=[]
    for sample in samples:
        negative=sample<=0
        magnitude=abs(sample)
        segment=0
        while segment+1<len(edges) and magnitude>=edges[segment+1]:
            segment+=1
        residual=max(0,magnitude-edges[segment])
        mantissa=residual>>shifts[segment]
        out.append([negative,segment,mantissa])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([-15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3])), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 2', solve(*([0, 2, 3, 8], [0, 3, 8], [0, 2, 2])), [[False, 0, 0], [False, 0, 2], [False, 1, 0], [False, 2, 0]])
check('oracle 3', solve(*([1, 2, 3], [0], [1])), [[False, 0, 0], [False, 0, 1], [False, 0, 1]])
check('oracle 4', solve(*([], [0, 8], [1, 3])), [])
check('oracle 5', solve(*([-8, 8, 9], [0, 8], [0, 3])), [[True, 1, 0], [False, 1, 0], [False, 1, 0]])
check('oracle 6', solve(*([0, 1, 16], [0, 1, 16], [0, 0, 2])), [[False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 7', solve(*([7, -7], [0, 4], [1, 0])), [[False, 1, 3], [True, 1, 3]])
if N == 1: check('variant packet 1', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 2: check('variant packet 2', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 3: check('variant packet 3', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 4: check('variant packet 4', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 5: check('variant packet 5', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 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, edges, shifts):
    out=[]
    for sample in samples:
        negative=sample>0
        magnitude=abs(sample)
        segment=0
        while segment+1<len(edges) and magnitude>=edges[segment+1]:
            segment+=1
        residual=max(0,magnitude-edges[segment])
        mantissa=residual>>shifts[segment]
        out.append([negative,segment,mantissa])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([-15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3])), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 2', solve(*([0, 2, 3, 8], [0, 3, 8], [0, 2, 2])), [[False, 0, 0], [False, 0, 2], [False, 1, 0], [False, 2, 0]])
check('oracle 3', solve(*([1, 2, 3], [0], [1])), [[False, 0, 0], [False, 0, 1], [False, 0, 1]])
check('oracle 4', solve(*([], [0, 8], [1, 3])), [])
check('oracle 5', solve(*([-8, 8, 9], [0, 8], [0, 3])), [[True, 1, 0], [False, 1, 0], [False, 1, 0]])
check('oracle 6', solve(*([0, 1, 16], [0, 1, 16], [0, 0, 2])), [[False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 7', solve(*([7, -7], [0, 4], [1, 0])), [[False, 1, 3], [True, 1, 3]])
if N == 1: check('variant packet 1', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 2: check('variant packet 2', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 3: check('variant packet 3', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 4: check('variant packet 4', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 5: check('variant packet 5', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 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:
Numerical zero receives a negative PCM sign tag.

Encode bounded PCM magnitude into an explicitly stipulated piecewise companding table: sign sideband, selected lower-bound segment and shifted residual mantissa.

split: open-access


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

N = 1
observations = []
def solve(samples, edges, shifts):
    out=[]
    for sample in samples:
        negative=sample<0
        magnitude=sample
        segment=0
        while segment+1<len(edges) and magnitude>=edges[segment+1]:
            segment+=1
        residual=max(0,magnitude-edges[segment])
        mantissa=residual>>shifts[segment]
        out.append([negative,segment,mantissa])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([-15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3])), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 2', solve(*([0, 2, 3, 8], [0, 3, 8], [0, 2, 2])), [[False, 0, 0], [False, 0, 2], [False, 1, 0], [False, 2, 0]])
check('oracle 3', solve(*([1, 2, 3], [0], [1])), [[False, 0, 0], [False, 0, 1], [False, 0, 1]])
check('oracle 4', solve(*([], [0, 8], [1, 3])), [])
check('oracle 5', solve(*([-8, 8, 9], [0, 8], [0, 3])), [[True, 1, 0], [False, 1, 0], [False, 1, 0]])
check('oracle 6', solve(*([0, 1, 16], [0, 1, 16], [0, 0, 2])), [[False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 7', solve(*([7, -7], [0, 4], [1, 0])), [[False, 1, 3], [True, 1, 3]])
if N == 1: check('variant packet 1', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 2: check('variant packet 2', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 3: check('variant packet 3', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 4: check('variant packet 4', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 5: check('variant packet 5', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 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, edges, shifts):
    out=[]
    for sample in samples:
        negative=sample<0
        magnitude=abs(samples[0])
        segment=0
        while segment+1<len(edges) and magnitude>=edges[segment+1]:
            segment+=1
        residual=max(0,magnitude-edges[segment])
        mantissa=residual>>shifts[segment]
        out.append([negative,segment,mantissa])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([-15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3])), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 2', solve(*([0, 2, 3, 8], [0, 3, 8], [0, 2, 2])), [[False, 0, 0], [False, 0, 2], [False, 1, 0], [False, 2, 0]])
check('oracle 3', solve(*([1, 2, 3], [0], [1])), [[False, 0, 0], [False, 0, 1], [False, 0, 1]])
check('oracle 4', solve(*([], [0, 8], [1, 3])), [])
check('oracle 5', solve(*([-8, 8, 9], [0, 8], [0, 3])), [[True, 1, 0], [False, 1, 0], [False, 1, 0]])
check('oracle 6', solve(*([0, 1, 16], [0, 1, 16], [0, 0, 2])), [[False, 0, 0], [False, 1, 0], [False, 2, 0]])
check('oracle 7', solve(*([7, -7], [0, 4], [1, 0])), [[False, 1, 3], [True, 1, 3]])
if N == 1: check('variant packet 1', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 2: check('variant packet 2', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 3: check('variant packet 3', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 4: check('variant packet 4', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0]])
if N == 5: check('variant packet 5', solve(*[[-15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15, -15, -4, 0, 4, 15], [0, 4, 12], [0, 1, 3]]), [[True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 0], [True, 2, 0], [True, 1, 0], [False, 0, 0], [False, 1, 0], [False, 2, 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:
Negative amplitudes cannot advance through magnitude segments.

Encode bounded PCM magnitude into an explicitly stipulated piecewise companding table: sign sideband, selected lower-bound segment and shifted residual mantissa.

split: open-access


prompt:
Serial PCM captures the clock-delay bit as sample MSB.

Capture a stipulated I2S-like slot with one delay clock, MSB-first signed PCM payload and explicit trailing slot bits; reject incomplete slots.

split: open-access


prompt:
A short transport slot is accepted merely because payload bits fit.

Capture a stipulated I2S-like slot with one delay clock, MSB-first signed PCM payload and explicit trailing slot bits; reject incomplete slots.

split: open-access


prompt:
Serial PCM field bits are reconstructed least-significant-first.

Capture a stipulated I2S-like slot with one delay clock, MSB-first signed PCM payload and explicit trailing slot bits; reject incomplete slots.

split: open-access


prompt:
Sign is inferred from the delay bit.

Capture a stipulated I2S-like slot with one delay clock, MSB-first signed PCM payload and explicit trailing slot bits; reject incomplete slots.

split: open-access


prompt:
Pad inspection includes the last PCM payload bit.

Capture a stipulated I2S-like slot with one delay clock, MSB-first signed PCM payload and explicit trailing slot bits; reject incomplete slots.

split: open-access


prompt:
Active TDM mask is interpreted with reversed slot numbering.

Stipulated TDM PCM extractor: active mask bits name ascending physical slots; ignore mask bits above slot count and reject incomplete physical frames.

split: open-access


prompt:
Bits beyond declared TDM slot count create nonexistent channel lanes.

Stipulated TDM PCM extractor: active mask bits name ascending physical slots; ignore mask bits above slot count and reject incomplete physical frames.

split: open-access


prompt:
A truncated physical TDM frame passes because only active count is checked.

Stipulated TDM PCM extractor: active mask bits name ascending physical slots; ignore mask bits above slot count and reject incomplete physical frames.

split: open-access


prompt:
Inactive physical slots are mistaken for dense PCM channels.

Stipulated TDM PCM extractor: active mask bits name ascending physical slots; ignore mask bits above slot count and reject incomplete physical frames.

split: open-access


prompt:
A truncated TDM frame is reported as a valid empty channel frame.

Stipulated TDM PCM extractor: active mask bits name ascending physical slots; ignore mask bits above slot count and reject incomplete physical frames.

split: open-access


prompt:
Partial one-bit audio window is appended after new bits.

Bounded one-bit-density to PCM adapter using nonoverlapping box windows; zero/one map to -1/+1 and incomplete input bits carry across packets.

split: open-access


prompt:
Decimation windows advance by a bit instead of output block width.

Bounded one-bit-density to PCM adapter using nonoverlapping box windows; zero/one map to -1/+1 and incomplete input bits carry across packets.

split: open-access


prompt:
Density output remains unsigned instead of centered PCM.

Bounded one-bit-density to PCM adapter using nonoverlapping box windows; zero/one map to -1/+1 and incomplete input bits carry across packets.

split: open-access


prompt:
Carry starts at output-count rather than consumed bit count.

Bounded one-bit-density to PCM adapter using nonoverlapping box windows; zero/one map to -1/+1 and incomplete input bits carry across packets.

split: open-access


prompt:
An exactly complete final decimation window is withheld.

Bounded one-bit-density to PCM adapter using nonoverlapping box windows; zero/one map to -1/+1 and incomplete input bits carry across packets.

split: open-access


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

N = 1
observations = []
def solve(subframes, block_length):
    blocks=[]
    current=[]
    for start,audio,status in subframes:
        if False:
            if current:
                blocks.append([current,False])
            current=[]
        current.append([audio,status&1])
        if len(current)==block_length:
            blocks.append([current,True])
            current=[]
    return [blocks,current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[True, 1, 3], [False, 2, 0], [False, 3, 1]], 3)), [[[[[1, 1], [2, 0], [3, 1]], True]], []])
check('oracle 2', solve(*([[True, 1, 0], [True, 2, 1], [False, 3, 2]], 3)), [[[[[1, 0]], False]], [[2, 1], [3, 0]]])
check('oracle 3', solve(*([[False, 1, 1], [False, 2, 0], [False, 3, 1], [False, 4, 0]], 2)), [[[[[1, 1], [2, 0]], True], [[[3, 1], [4, 0]], True]], []])
check('oracle 4', solve(*([], 3)), [[], []])
check('oracle 5', solve(*([[True, 1, 1]], 1)), [[[[[1, 1]], True]], []])
check('oracle 6', solve(*([[False, 1, 2]], 3)), [[], [[1, 0]]])
check('oracle 7', solve(*([[True, 1, 0], [False, 2, 1], [True, 3, 0]], 2)), [[[[[1, 0], [2, 1]], True]], [[3, 0]]])
if N == 1: check('variant packet 1', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 2: check('variant packet 2', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 3: check('variant packet 3', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 4: check('variant packet 4', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 5: check('variant packet 5', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], 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(subframes, block_length):
    blocks=[]
    current=[]
    for start,audio,status in subframes:
        if start and not current:
            if current:
                blocks.append([current,False])
            current=[]
        current.append([audio,status&1])
        if len(current)==block_length:
            blocks.append([current,True])
            current=[]
    return [blocks,current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[True, 1, 3], [False, 2, 0], [False, 3, 1]], 3)), [[[[[1, 1], [2, 0], [3, 1]], True]], []])
check('oracle 2', solve(*([[True, 1, 0], [True, 2, 1], [False, 3, 2]], 3)), [[[[[1, 0]], False]], [[2, 1], [3, 0]]])
check('oracle 3', solve(*([[False, 1, 1], [False, 2, 0], [False, 3, 1], [False, 4, 0]], 2)), [[[[[1, 1], [2, 0]], True], [[[3, 1], [4, 0]], True]], []])
check('oracle 4', solve(*([], 3)), [[], []])
check('oracle 5', solve(*([[True, 1, 1]], 1)), [[[[[1, 1]], True]], []])
check('oracle 6', solve(*([[False, 1, 2]], 3)), [[], [[1, 0]]])
check('oracle 7', solve(*([[True, 1, 0], [False, 2, 1], [True, 3, 0]], 2)), [[[[[1, 0], [2, 1]], True]], [[3, 0]]])
if N == 1: check('variant packet 1', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 2: check('variant packet 2', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 3: check('variant packet 3', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 4: check('variant packet 4', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 5: check('variant packet 5', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], 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 new status-block start does not terminate the partial prior PCM block.

Group stipulated audio subframes into fixed-size channel-status blocks, preserving PCM samples and one status bit; a new start marks prior partial data incomplete.

split: open-access


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

N = 1
observations = []
def solve(subframes, block_length):
    blocks=[]
    current=[]
    for start,audio,status in subframes:
        if start:
            if current:
                blocks.append([current,True])
            current=[]
        current.append([audio,status&1])
        if len(current)==block_length:
            blocks.append([current,True])
            current=[]
    return [blocks,current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[True, 1, 3], [False, 2, 0], [False, 3, 1]], 3)), [[[[[1, 1], [2, 0], [3, 1]], True]], []])
check('oracle 2', solve(*([[True, 1, 0], [True, 2, 1], [False, 3, 2]], 3)), [[[[[1, 0]], False]], [[2, 1], [3, 0]]])
check('oracle 3', solve(*([[False, 1, 1], [False, 2, 0], [False, 3, 1], [False, 4, 0]], 2)), [[[[[1, 1], [2, 0]], True], [[[3, 1], [4, 0]], True]], []])
check('oracle 4', solve(*([], 3)), [[], []])
check('oracle 5', solve(*([[True, 1, 1]], 1)), [[[[[1, 1]], True]], []])
check('oracle 6', solve(*([[False, 1, 2]], 3)), [[], [[1, 0]]])
check('oracle 7', solve(*([[True, 1, 0], [False, 2, 1], [True, 3, 0]], 2)), [[[[[1, 0], [2, 1]], True]], [[3, 0]]])
if N == 1: check('variant packet 1', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 2: check('variant packet 2', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 3: check('variant packet 3', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 4: check('variant packet 4', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 5: check('variant packet 5', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], 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(subframes, block_length):
    blocks=[]
    current=[]
    for start,audio,status in subframes:
        if start:
            if current:
                blocks.append([[],False])
            current=[]
        current.append([audio,status&1])
        if len(current)==block_length:
            blocks.append([current,True])
            current=[]
    return [blocks,current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[True, 1, 3], [False, 2, 0], [False, 3, 1]], 3)), [[[[[1, 1], [2, 0], [3, 1]], True]], []])
check('oracle 2', solve(*([[True, 1, 0], [True, 2, 1], [False, 3, 2]], 3)), [[[[[1, 0]], False]], [[2, 1], [3, 0]]])
check('oracle 3', solve(*([[False, 1, 1], [False, 2, 0], [False, 3, 1], [False, 4, 0]], 2)), [[[[[1, 1], [2, 0]], True], [[[3, 1], [4, 0]], True]], []])
check('oracle 4', solve(*([], 3)), [[], []])
check('oracle 5', solve(*([[True, 1, 1]], 1)), [[[[[1, 1]], True]], []])
check('oracle 6', solve(*([[False, 1, 2]], 3)), [[], [[1, 0]]])
check('oracle 7', solve(*([[True, 1, 0], [False, 2, 1], [True, 3, 0]], 2)), [[[[[1, 0], [2, 1]], True]], [[3, 0]]])
if N == 1: check('variant packet 1', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 2: check('variant packet 2', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 3: check('variant packet 3', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 4: check('variant packet 4', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 5: check('variant packet 5', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], 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 start-truncated status block is falsely marked complete.

Group stipulated audio subframes into fixed-size channel-status blocks, preserving PCM samples and one status bit; a new start marks prior partial data incomplete.

split: open-access


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

N = 1
observations = []
def solve(subframes, block_length):
    blocks=[]
    current=[]
    for start,audio,status in subframes:
        if start:
            if current:
                blocks.append([current,False])
            current=[]
        current.append([audio,status])
        if len(current)==block_length:
            blocks.append([current,True])
            current=[]
    return [blocks,current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[True, 1, 3], [False, 2, 0], [False, 3, 1]], 3)), [[[[[1, 1], [2, 0], [3, 1]], True]], []])
check('oracle 2', solve(*([[True, 1, 0], [True, 2, 1], [False, 3, 2]], 3)), [[[[[1, 0]], False]], [[2, 1], [3, 0]]])
check('oracle 3', solve(*([[False, 1, 1], [False, 2, 0], [False, 3, 1], [False, 4, 0]], 2)), [[[[[1, 1], [2, 0]], True], [[[3, 1], [4, 0]], True]], []])
check('oracle 4', solve(*([], 3)), [[], []])
check('oracle 5', solve(*([[True, 1, 1]], 1)), [[[[[1, 1]], True]], []])
check('oracle 6', solve(*([[False, 1, 2]], 3)), [[], [[1, 0]]])
check('oracle 7', solve(*([[True, 1, 0], [False, 2, 1], [True, 3, 0]], 2)), [[[[[1, 0], [2, 1]], True]], [[3, 0]]])
if N == 1: check('variant packet 1', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 2: check('variant packet 2', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 3: check('variant packet 3', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 4: check('variant packet 4', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 5: check('variant packet 5', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], 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(subframes, block_length):
    blocks=[]
    current=[]
    for start,audio,status in subframes:
        if start:
            if current:
                blocks.append([current,False])
            current=[]
        current.append([audio,(status>>1)&1])
        if len(current)==block_length:
            blocks.append([current,True])
            current=[]
    return [blocks,current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[True, 1, 3], [False, 2, 0], [False, 3, 1]], 3)), [[[[[1, 1], [2, 0], [3, 1]], True]], []])
check('oracle 2', solve(*([[True, 1, 0], [True, 2, 1], [False, 3, 2]], 3)), [[[[[1, 0]], False]], [[2, 1], [3, 0]]])
check('oracle 3', solve(*([[False, 1, 1], [False, 2, 0], [False, 3, 1], [False, 4, 0]], 2)), [[[[[1, 1], [2, 0]], True], [[[3, 1], [4, 0]], True]], []])
check('oracle 4', solve(*([], 3)), [[], []])
check('oracle 5', solve(*([[True, 1, 1]], 1)), [[[[[1, 1]], True]], []])
check('oracle 6', solve(*([[False, 1, 2]], 3)), [[], [[1, 0]]])
check('oracle 7', solve(*([[True, 1, 0], [False, 2, 1], [True, 3, 0]], 2)), [[[[[1, 0], [2, 1]], True]], [[3, 0]]])
if N == 1: check('variant packet 1', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 2: check('variant packet 2', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 3: check('variant packet 3', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 4: check('variant packet 4', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 5: check('variant packet 5', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], 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:
Transport status high bits leak into the one-bit channel-status lane.

Group stipulated audio subframes into fixed-size channel-status blocks, preserving PCM samples and one status bit; a new start marks prior partial data incomplete.

split: open-access


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

N = 1
observations = []
def solve(subframes, block_length):
    blocks=[]
    current=[]
    for start,audio,status in subframes:
        if start:
            if current:
                blocks.append([current,False])
            current=[]
        current.append([audio,status&1])
        if len(current)==block_length-1:
            blocks.append([current,True])
            current=[]
    return [blocks,current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[True, 1, 3], [False, 2, 0], [False, 3, 1]], 3)), [[[[[1, 1], [2, 0], [3, 1]], True]], []])
check('oracle 2', solve(*([[True, 1, 0], [True, 2, 1], [False, 3, 2]], 3)), [[[[[1, 0]], False]], [[2, 1], [3, 0]]])
check('oracle 3', solve(*([[False, 1, 1], [False, 2, 0], [False, 3, 1], [False, 4, 0]], 2)), [[[[[1, 1], [2, 0]], True], [[[3, 1], [4, 0]], True]], []])
check('oracle 4', solve(*([], 3)), [[], []])
check('oracle 5', solve(*([[True, 1, 1]], 1)), [[[[[1, 1]], True]], []])
check('oracle 6', solve(*([[False, 1, 2]], 3)), [[], [[1, 0]]])
check('oracle 7', solve(*([[True, 1, 0], [False, 2, 1], [True, 3, 0]], 2)), [[[[[1, 0], [2, 1]], True]], [[3, 0]]])
if N == 1: check('variant packet 1', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 2: check('variant packet 2', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 3: check('variant packet 3', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 4: check('variant packet 4', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 5: check('variant packet 5', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], 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(subframes, block_length):
    blocks=[]
    current=[]
    for start,audio,status in subframes:
        if start:
            if current:
                blocks.append([current,False])
            current=[]
        current.append([audio,status&1])
        if len(current)>block_length:
            blocks.append([current,True])
            current=[]
    return [blocks,current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[True, 1, 3], [False, 2, 0], [False, 3, 1]], 3)), [[[[[1, 1], [2, 0], [3, 1]], True]], []])
check('oracle 2', solve(*([[True, 1, 0], [True, 2, 1], [False, 3, 2]], 3)), [[[[[1, 0]], False]], [[2, 1], [3, 0]]])
check('oracle 3', solve(*([[False, 1, 1], [False, 2, 0], [False, 3, 1], [False, 4, 0]], 2)), [[[[[1, 1], [2, 0]], True], [[[3, 1], [4, 0]], True]], []])
check('oracle 4', solve(*([], 3)), [[], []])
check('oracle 5', solve(*([[True, 1, 1]], 1)), [[[[[1, 1]], True]], []])
check('oracle 6', solve(*([[False, 1, 2]], 3)), [[], [[1, 0]]])
check('oracle 7', solve(*([[True, 1, 0], [False, 2, 1], [True, 3, 0]], 2)), [[[[[1, 0], [2, 1]], True]], [[3, 0]]])
if N == 1: check('variant packet 1', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 2: check('variant packet 2', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 3: check('variant packet 3', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 4: check('variant packet 4', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 5: check('variant packet 5', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], 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 complete status block is emitted one subframe early.

Group stipulated audio subframes into fixed-size channel-status blocks, preserving PCM samples and one status bit; a new start marks prior partial data incomplete.

split: open-access


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

N = 1
observations = []
def solve(subframes, block_length):
    blocks=[]
    current=[]
    for start,audio,status in subframes:
        if start:
            if current:
                blocks.append([current,False])
            current=[]
        current.append([audio,status&1])
        if len(current)==block_length:
            blocks.append([current,True])
            current=current[-1:]
    return [blocks,current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[True, 1, 3], [False, 2, 0], [False, 3, 1]], 3)), [[[[[1, 1], [2, 0], [3, 1]], True]], []])
check('oracle 2', solve(*([[True, 1, 0], [True, 2, 1], [False, 3, 2]], 3)), [[[[[1, 0]], False]], [[2, 1], [3, 0]]])
check('oracle 3', solve(*([[False, 1, 1], [False, 2, 0], [False, 3, 1], [False, 4, 0]], 2)), [[[[[1, 1], [2, 0]], True], [[[3, 1], [4, 0]], True]], []])
check('oracle 4', solve(*([], 3)), [[], []])
check('oracle 5', solve(*([[True, 1, 1]], 1)), [[[[[1, 1]], True]], []])
check('oracle 6', solve(*([[False, 1, 2]], 3)), [[], [[1, 0]]])
check('oracle 7', solve(*([[True, 1, 0], [False, 2, 1], [True, 3, 0]], 2)), [[[[[1, 0], [2, 1]], True]], [[3, 0]]])
if N == 1: check('variant packet 1', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 2: check('variant packet 2', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 3: check('variant packet 3', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 4: check('variant packet 4', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 5: check('variant packet 5', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], 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(subframes, block_length):
    blocks=[]
    current=[]
    for start,audio,status in subframes:
        if start:
            if current:
                blocks.append([current,False])
            current=[]
        current.append([audio,status&1])
        if len(current)==block_length:
            blocks.append([current,True])
            current=current[:]
    return [blocks,current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oracle 1', solve(*([[True, 1, 3], [False, 2, 0], [False, 3, 1]], 3)), [[[[[1, 1], [2, 0], [3, 1]], True]], []])
check('oracle 2', solve(*([[True, 1, 0], [True, 2, 1], [False, 3, 2]], 3)), [[[[[1, 0]], False]], [[2, 1], [3, 0]]])
check('oracle 3', solve(*([[False, 1, 1], [False, 2, 0], [False, 3, 1], [False, 4, 0]], 2)), [[[[[1, 1], [2, 0]], True], [[[3, 1], [4, 0]], True]], []])
check('oracle 4', solve(*([], 3)), [[], []])
check('oracle 5', solve(*([[True, 1, 1]], 1)), [[[[[1, 1]], True]], []])
check('oracle 6', solve(*([[False, 1, 2]], 3)), [[], [[1, 0]]])
check('oracle 7', solve(*([[True, 1, 0], [False, 2, 1], [True, 3, 0]], 2)), [[[[[1, 0], [2, 1]], True]], [[3, 0]]])
if N == 1: check('variant packet 1', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 2: check('variant packet 2', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 3: check('variant packet 3', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 4: check('variant packet 4', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True]], []])
if N == 5: check('variant packet 5', solve(*[[[True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1], [True, 1, 3], [False, 2, 0], [False, 3, 1]], 3]), [[[[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], True], [[[1, 1], [2, 0], [3, 1]], 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:
Last PCM subframe is duplicated into the next metadata block.

Group stipulated audio subframes into fixed-size channel-status blocks, preserving PCM samples and one status bit; a new start marks prior partial data incomplete.

split: open-access