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

N = 1
observations = []
def solve(d):
    try:
        out_offsets=[0]; out_child=[]; out_valid=[]
        for offsets,child,child_valid,parent_valid in d:
            start=offsets[0]; stop=offsets[-1]
            base=len(out_child)
            out_child.extend(child[i] for i in range(start,stop))
            out_offsets.extend(base+x-start for x in offsets[1:])
            out_valid.extend(parent_valid)
        return [out_offsets,out_child,out_valid]
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('two batches', solve([[[0, 2], [1, 2], [True, True], [True]], [[0, 1], [3], [True], [True]]]), [[0, 2, 3], [1, 2, 3], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 1, 2, 99], [True, True, True, True], [True]]]), [[0, 2], [1, 2], [True]])
    check('null children', solve([[[0, 2], [1, 2], [False, True], [True]]]), [[0, 2], [None, 2], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [1], [True], [False]]]), [[0, 1], [1], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [1], [True], [True]]]), [[0, 1], [1], [True]])
elif N == 2:
    check('two batches', solve([[[0, 2], [2, 3], [True, True], [True]], [[0, 1], [4], [True], [True]]]), [[0, 2, 3], [2, 3, 4], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 2, 3, 99], [True, True, True, True], [True]]]), [[0, 2], [2, 3], [True]])
    check('null children', solve([[[0, 2], [2, 3], [False, True], [True]]]), [[0, 2], [None, 3], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [2], [True], [False]]]), [[0, 1], [2], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [2], [True], [True]]]), [[0, 1], [2], [True]])
elif N == 3:
    check('two batches', solve([[[0, 2], [3, 4], [True, True], [True]], [[0, 1], [5], [True], [True]]]), [[0, 2, 3], [3, 4, 5], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 3, 4, 99], [True, True, True, True], [True]]]), [[0, 2], [3, 4], [True]])
    check('null children', solve([[[0, 2], [3, 4], [False, True], [True]]]), [[0, 2], [None, 4], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [3], [True], [False]]]), [[0, 1], [3], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [3], [True], [True]]]), [[0, 1], [3], [True]])
elif N == 4:
    check('two batches', solve([[[0, 2], [4, 5], [True, True], [True]], [[0, 1], [6], [True], [True]]]), [[0, 2, 3], [4, 5, 6], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 4, 5, 99], [True, True, True, True], [True]]]), [[0, 2], [4, 5], [True]])
    check('null children', solve([[[0, 2], [4, 5], [False, True], [True]]]), [[0, 2], [None, 5], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [4], [True], [False]]]), [[0, 1], [4], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [4], [True], [True]]]), [[0, 1], [4], [True]])
elif N == 5:
    check('two batches', solve([[[0, 2], [5, 6], [True, True], [True]], [[0, 1], [7], [True], [True]]]), [[0, 2, 3], [5, 6, 7], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 5, 6, 99], [True, True, True, True], [True]]]), [[0, 2], [5, 6], [True]])
    check('null children', solve([[[0, 2], [5, 6], [False, True], [True]]]), [[0, 2], [None, 6], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [5], [True], [False]]]), [[0, 1], [5], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [5], [True], [True]]]), [[0, 1], [5], [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(d):
    try:
        out_offsets=[0]; out_child=[]; out_valid=[]
        for offsets,child,child_valid,parent_valid in d:
            start=offsets[0]; stop=offsets[-1]
            base=len(out_child)
            out_child.extend(child[i] for i in range(start,stop) if child_valid[i])
            out_offsets.extend(base+x-start for x in offsets[1:])
            out_valid.extend(parent_valid)
        return [out_offsets,out_child,out_valid]
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('two batches', solve([[[0, 2], [1, 2], [True, True], [True]], [[0, 1], [3], [True], [True]]]), [[0, 2, 3], [1, 2, 3], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 1, 2, 99], [True, True, True, True], [True]]]), [[0, 2], [1, 2], [True]])
    check('null children', solve([[[0, 2], [1, 2], [False, True], [True]]]), [[0, 2], [None, 2], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [1], [True], [False]]]), [[0, 1], [1], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [1], [True], [True]]]), [[0, 1], [1], [True]])
elif N == 2:
    check('two batches', solve([[[0, 2], [2, 3], [True, True], [True]], [[0, 1], [4], [True], [True]]]), [[0, 2, 3], [2, 3, 4], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 2, 3, 99], [True, True, True, True], [True]]]), [[0, 2], [2, 3], [True]])
    check('null children', solve([[[0, 2], [2, 3], [False, True], [True]]]), [[0, 2], [None, 3], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [2], [True], [False]]]), [[0, 1], [2], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [2], [True], [True]]]), [[0, 1], [2], [True]])
elif N == 3:
    check('two batches', solve([[[0, 2], [3, 4], [True, True], [True]], [[0, 1], [5], [True], [True]]]), [[0, 2, 3], [3, 4, 5], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 3, 4, 99], [True, True, True, True], [True]]]), [[0, 2], [3, 4], [True]])
    check('null children', solve([[[0, 2], [3, 4], [False, True], [True]]]), [[0, 2], [None, 4], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [3], [True], [False]]]), [[0, 1], [3], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [3], [True], [True]]]), [[0, 1], [3], [True]])
elif N == 4:
    check('two batches', solve([[[0, 2], [4, 5], [True, True], [True]], [[0, 1], [6], [True], [True]]]), [[0, 2, 3], [4, 5, 6], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 4, 5, 99], [True, True, True, True], [True]]]), [[0, 2], [4, 5], [True]])
    check('null children', solve([[[0, 2], [4, 5], [False, True], [True]]]), [[0, 2], [None, 5], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [4], [True], [False]]]), [[0, 1], [4], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [4], [True], [True]]]), [[0, 1], [4], [True]])
elif N == 5:
    check('two batches', solve([[[0, 2], [5, 6], [True, True], [True]], [[0, 1], [7], [True], [True]]]), [[0, 2, 3], [5, 6, 7], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 5, 6, 99], [True, True, True, True], [True]]]), [[0, 2], [5, 6], [True]])
    check('null children', solve([[[0, 2], [5, 6], [False, True], [True]]]), [[0, 2], [None, 6], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [5], [True], [False]]]), [[0, 1], [5], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [5], [True], [True]]]), [[0, 1], [5], [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:
List concatenation exposes hidden child null payloads.

Concatenate offset-based list batches into one compact child buffer. Rebase every row offset, copy only each batch referenced child span, preserve parent validity, and preserve child nulls. Output [offsets,visible-child,parent-validity].

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        out_offsets=[0]; out_child=[]; out_valid=[]
        for offsets,child,child_valid,parent_valid in d:
            start=offsets[0]; stop=offsets[-1]
            base=len(out_child)
            out_child.extend(child[i] if child_valid[i] else None for i in range(start,stop))
            out_offsets.extend(base+x-start for x in offsets[1:])
            out_valid.extend(offsets[i+1]>offsets[i] for i in range(len(parent_valid)))
        return [out_offsets,out_child,out_valid]
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('two batches', solve([[[0, 2], [1, 2], [True, True], [True]], [[0, 1], [3], [True], [True]]]), [[0, 2, 3], [1, 2, 3], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 1, 2, 99], [True, True, True, True], [True]]]), [[0, 2], [1, 2], [True]])
    check('null children', solve([[[0, 2], [1, 2], [False, True], [True]]]), [[0, 2], [None, 2], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [1], [True], [False]]]), [[0, 1], [1], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [1], [True], [True]]]), [[0, 1], [1], [True]])
elif N == 2:
    check('two batches', solve([[[0, 2], [2, 3], [True, True], [True]], [[0, 1], [4], [True], [True]]]), [[0, 2, 3], [2, 3, 4], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 2, 3, 99], [True, True, True, True], [True]]]), [[0, 2], [2, 3], [True]])
    check('null children', solve([[[0, 2], [2, 3], [False, True], [True]]]), [[0, 2], [None, 3], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [2], [True], [False]]]), [[0, 1], [2], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [2], [True], [True]]]), [[0, 1], [2], [True]])
elif N == 3:
    check('two batches', solve([[[0, 2], [3, 4], [True, True], [True]], [[0, 1], [5], [True], [True]]]), [[0, 2, 3], [3, 4, 5], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 3, 4, 99], [True, True, True, True], [True]]]), [[0, 2], [3, 4], [True]])
    check('null children', solve([[[0, 2], [3, 4], [False, True], [True]]]), [[0, 2], [None, 4], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [3], [True], [False]]]), [[0, 1], [3], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [3], [True], [True]]]), [[0, 1], [3], [True]])
elif N == 4:
    check('two batches', solve([[[0, 2], [4, 5], [True, True], [True]], [[0, 1], [6], [True], [True]]]), [[0, 2, 3], [4, 5, 6], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 4, 5, 99], [True, True, True, True], [True]]]), [[0, 2], [4, 5], [True]])
    check('null children', solve([[[0, 2], [4, 5], [False, True], [True]]]), [[0, 2], [None, 5], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [4], [True], [False]]]), [[0, 1], [4], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [4], [True], [True]]]), [[0, 1], [4], [True]])
elif N == 5:
    check('two batches', solve([[[0, 2], [5, 6], [True, True], [True]], [[0, 1], [7], [True], [True]]]), [[0, 2, 3], [5, 6, 7], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 5, 6, 99], [True, True, True, True], [True]]]), [[0, 2], [5, 6], [True]])
    check('null children', solve([[[0, 2], [5, 6], [False, True], [True]]]), [[0, 2], [None, 6], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [5], [True], [False]]]), [[0, 1], [5], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [5], [True], [True]]]), [[0, 1], [5], [True]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(d):
    try:
        out_offsets=[0]; out_child=[]; out_valid=[]
        for offsets,child,child_valid,parent_valid in d:
            start=offsets[0]; stop=offsets[-1]
            base=len(out_child)
            out_child.extend(child[i] if child_valid[i] else None for i in range(start,stop))
            out_offsets.extend(base+x-start for x in offsets[1:])
            out_valid.extend(True for _ in parent_valid)
        return [out_offsets,out_child,out_valid]
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('two batches', solve([[[0, 2], [1, 2], [True, True], [True]], [[0, 1], [3], [True], [True]]]), [[0, 2, 3], [1, 2, 3], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 1, 2, 99], [True, True, True, True], [True]]]), [[0, 2], [1, 2], [True]])
    check('null children', solve([[[0, 2], [1, 2], [False, True], [True]]]), [[0, 2], [None, 2], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [1], [True], [False]]]), [[0, 1], [1], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [1], [True], [True]]]), [[0, 1], [1], [True]])
elif N == 2:
    check('two batches', solve([[[0, 2], [2, 3], [True, True], [True]], [[0, 1], [4], [True], [True]]]), [[0, 2, 3], [2, 3, 4], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 2, 3, 99], [True, True, True, True], [True]]]), [[0, 2], [2, 3], [True]])
    check('null children', solve([[[0, 2], [2, 3], [False, True], [True]]]), [[0, 2], [None, 3], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [2], [True], [False]]]), [[0, 1], [2], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [2], [True], [True]]]), [[0, 1], [2], [True]])
elif N == 3:
    check('two batches', solve([[[0, 2], [3, 4], [True, True], [True]], [[0, 1], [5], [True], [True]]]), [[0, 2, 3], [3, 4, 5], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 3, 4, 99], [True, True, True, True], [True]]]), [[0, 2], [3, 4], [True]])
    check('null children', solve([[[0, 2], [3, 4], [False, True], [True]]]), [[0, 2], [None, 4], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [3], [True], [False]]]), [[0, 1], [3], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [3], [True], [True]]]), [[0, 1], [3], [True]])
elif N == 4:
    check('two batches', solve([[[0, 2], [4, 5], [True, True], [True]], [[0, 1], [6], [True], [True]]]), [[0, 2, 3], [4, 5, 6], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 4, 5, 99], [True, True, True, True], [True]]]), [[0, 2], [4, 5], [True]])
    check('null children', solve([[[0, 2], [4, 5], [False, True], [True]]]), [[0, 2], [None, 5], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [4], [True], [False]]]), [[0, 1], [4], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [4], [True], [True]]]), [[0, 1], [4], [True]])
elif N == 5:
    check('two batches', solve([[[0, 2], [5, 6], [True, True], [True]], [[0, 1], [7], [True], [True]]]), [[0, 2, 3], [5, 6, 7], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 5, 6, 99], [True, True, True, True], [True]]]), [[0, 2], [5, 6], [True]])
    check('null children', solve([[[0, 2], [5, 6], [False, True], [True]]]), [[0, 2], [None, 6], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [5], [True], [False]]]), [[0, 1], [5], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [5], [True], [True]]]), [[0, 1], [5], [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:
List concatenation fabricates validity from list length.

Concatenate offset-based list batches into one compact child buffer. Rebase every row offset, copy only each batch referenced child span, preserve parent validity, and preserve child nulls. Output [offsets,visible-child,parent-validity].

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        out_offsets=[0]; out_child=[]; out_valid=[]
        for offsets,child,child_valid,parent_valid in d:
            start=offsets[0]; stop=offsets[-1]
            base=len(out_valid)
            out_child.extend(child[i] if child_valid[i] else None for i in range(start,stop))
            out_offsets.extend(base+x-start for x in offsets[1:])
            out_valid.extend(parent_valid)
        return [out_offsets,out_child,out_valid]
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('two batches', solve([[[0, 2], [1, 2], [True, True], [True]], [[0, 1], [3], [True], [True]]]), [[0, 2, 3], [1, 2, 3], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 1, 2, 99], [True, True, True, True], [True]]]), [[0, 2], [1, 2], [True]])
    check('null children', solve([[[0, 2], [1, 2], [False, True], [True]]]), [[0, 2], [None, 2], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [1], [True], [False]]]), [[0, 1], [1], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [1], [True], [True]]]), [[0, 1], [1], [True]])
elif N == 2:
    check('two batches', solve([[[0, 2], [2, 3], [True, True], [True]], [[0, 1], [4], [True], [True]]]), [[0, 2, 3], [2, 3, 4], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 2, 3, 99], [True, True, True, True], [True]]]), [[0, 2], [2, 3], [True]])
    check('null children', solve([[[0, 2], [2, 3], [False, True], [True]]]), [[0, 2], [None, 3], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [2], [True], [False]]]), [[0, 1], [2], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [2], [True], [True]]]), [[0, 1], [2], [True]])
elif N == 3:
    check('two batches', solve([[[0, 2], [3, 4], [True, True], [True]], [[0, 1], [5], [True], [True]]]), [[0, 2, 3], [3, 4, 5], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 3, 4, 99], [True, True, True, True], [True]]]), [[0, 2], [3, 4], [True]])
    check('null children', solve([[[0, 2], [3, 4], [False, True], [True]]]), [[0, 2], [None, 4], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [3], [True], [False]]]), [[0, 1], [3], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [3], [True], [True]]]), [[0, 1], [3], [True]])
elif N == 4:
    check('two batches', solve([[[0, 2], [4, 5], [True, True], [True]], [[0, 1], [6], [True], [True]]]), [[0, 2, 3], [4, 5, 6], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 4, 5, 99], [True, True, True, True], [True]]]), [[0, 2], [4, 5], [True]])
    check('null children', solve([[[0, 2], [4, 5], [False, True], [True]]]), [[0, 2], [None, 5], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [4], [True], [False]]]), [[0, 1], [4], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [4], [True], [True]]]), [[0, 1], [4], [True]])
elif N == 5:
    check('two batches', solve([[[0, 2], [5, 6], [True, True], [True]], [[0, 1], [7], [True], [True]]]), [[0, 2, 3], [5, 6, 7], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 5, 6, 99], [True, True, True, True], [True]]]), [[0, 2], [5, 6], [True]])
    check('null children', solve([[[0, 2], [5, 6], [False, True], [True]]]), [[0, 2], [None, 6], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [5], [True], [False]]]), [[0, 1], [5], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [5], [True], [True]]]), [[0, 1], [5], [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(d):
    try:
        out_offsets=[0]; out_child=[]; out_valid=[]
        for offsets,child,child_valid,parent_valid in d:
            start=offsets[0]; stop=offsets[-1]
            base=len(out_offsets)
            out_child.extend(child[i] if child_valid[i] else None for i in range(start,stop))
            out_offsets.extend(base+x-start for x in offsets[1:])
            out_valid.extend(parent_valid)
        return [out_offsets,out_child,out_valid]
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('two batches', solve([[[0, 2], [1, 2], [True, True], [True]], [[0, 1], [3], [True], [True]]]), [[0, 2, 3], [1, 2, 3], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 1, 2, 99], [True, True, True, True], [True]]]), [[0, 2], [1, 2], [True]])
    check('null children', solve([[[0, 2], [1, 2], [False, True], [True]]]), [[0, 2], [None, 2], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [1], [True], [False]]]), [[0, 1], [1], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [1], [True], [True]]]), [[0, 1], [1], [True]])
elif N == 2:
    check('two batches', solve([[[0, 2], [2, 3], [True, True], [True]], [[0, 1], [4], [True], [True]]]), [[0, 2, 3], [2, 3, 4], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 2, 3, 99], [True, True, True, True], [True]]]), [[0, 2], [2, 3], [True]])
    check('null children', solve([[[0, 2], [2, 3], [False, True], [True]]]), [[0, 2], [None, 3], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [2], [True], [False]]]), [[0, 1], [2], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [2], [True], [True]]]), [[0, 1], [2], [True]])
elif N == 3:
    check('two batches', solve([[[0, 2], [3, 4], [True, True], [True]], [[0, 1], [5], [True], [True]]]), [[0, 2, 3], [3, 4, 5], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 3, 4, 99], [True, True, True, True], [True]]]), [[0, 2], [3, 4], [True]])
    check('null children', solve([[[0, 2], [3, 4], [False, True], [True]]]), [[0, 2], [None, 4], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [3], [True], [False]]]), [[0, 1], [3], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [3], [True], [True]]]), [[0, 1], [3], [True]])
elif N == 4:
    check('two batches', solve([[[0, 2], [4, 5], [True, True], [True]], [[0, 1], [6], [True], [True]]]), [[0, 2, 3], [4, 5, 6], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 4, 5, 99], [True, True, True, True], [True]]]), [[0, 2], [4, 5], [True]])
    check('null children', solve([[[0, 2], [4, 5], [False, True], [True]]]), [[0, 2], [None, 5], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [4], [True], [False]]]), [[0, 1], [4], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [4], [True], [True]]]), [[0, 1], [4], [True]])
elif N == 5:
    check('two batches', solve([[[0, 2], [5, 6], [True, True], [True]], [[0, 1], [7], [True], [True]]]), [[0, 2, 3], [5, 6, 7], [True, True]])
    check('sliced child', solve([[[1, 3], [0, 5, 6, 99], [True, True, True, True], [True]]]), [[0, 2], [5, 6], [True]])
    check('null children', solve([[[0, 2], [5, 6], [False, True], [True]]]), [[0, 2], [None, 6], [True]])
    check('empty valid row', solve([[[0, 0], [], [], [True]]]), [[0, 0], [], [True]])
    check('null parent storage', solve([[[0, 1], [5], [True], [False]]]), [[0, 1], [5], [False]])
    check('no batches', solve([]), [[0], [], []])
    check('empty batch then row', solve([[[0], [], [], []], [[0, 1], [5], [True], [True]]]), [[0, 1], [5], [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:
List concatenation rebases child offsets by parent-row count.

Concatenate offset-based list batches into one compact child buffer. Rebase every row offset, copy only each batch referenced child span, preserve parent validity, and preserve child nulls. Output [offsets,visible-child,parent-validity].

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in pairs:
            if not av[ai] or not bv[bi]: out.append(None); continue
            a=ad[ac[ai]]
            b=bd[bc[bi]]
            out.append(ac[ai]==bc[bi])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in pairs:
            if not av[ai] or not bv[bi]: out.append(None); continue
            a=ad[ac[ai]]
            b=bd[bc[bi]]
            out.append(ac[ai]==bc[bi] and a==b)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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:
Dictionary equality compares unrelated local integer codes.

Compare two dictionary vectors row by row using decoded values, not local codes. Null validity yields UNKNOWN(None), including two null lanes. Dictionary entries themselves are ordinary integer values. Output follows the supplied pair selection order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in pairs:
            if not av[ai] or not bv[bi]: out.append(None); continue
            a=bd[ac[ai]]
            b=bd[bc[bi]]
            out.append(a==b)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in pairs:
            if not av[ai] or not bv[bi]: out.append(None); continue
            a=ad[bc[bi]]
            b=bd[bc[bi]]
            out.append(a==b)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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:
Dictionary equality decodes the left code with the right dictionary.

Compare two dictionary vectors row by row using decoded values, not local codes. Null validity yields UNKNOWN(None), including two null lanes. Dictionary entries themselves are ordinary integer values. Output follows the supplied pair selection order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in pairs:
            if not av[ai] or not bv[bi]: out.append(None); continue
            a=ad[ac[ai]]
            b=ad[bc[bi]]
            out.append(a==b)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in pairs:
            if not av[ai] or not bv[bi]: out.append(None); continue
            a=ad[ac[ai]]
            b=bd[ac[ai]]
            out.append(a==b)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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:
Dictionary equality decodes the right code with the left dictionary.

Compare two dictionary vectors row by row using decoded values, not local codes. Null validity yields UNKNOWN(None), including two null lanes. Dictionary entries themselves are ordinary integer values. Output follows the supplied pair selection order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in pairs:
            if not av[ai] or not bv[bi]: out.append(False); continue
            a=ad[ac[ai]]
            b=bd[bc[bi]]
            out.append(a==b)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in pairs:
            if not av[ai] or not bv[bi]: out.append(not av[ai] and not bv[bi]); continue
            a=ad[ac[ai]]
            b=bd[bc[bi]]
            out.append(a==b)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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:
Dictionary equality reports false when either lane is null.

Compare two dictionary vectors row by row using decoded values, not local codes. Null validity yields UNKNOWN(None), including two null lanes. Dictionary entries themselves are ordinary integer values. Output follows the supplied pair selection order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in pairs:
            if not av[ai] or not bv[ai]: out.append(None); continue
            a=ad[ac[ai]]
            b=bd[bc[bi]]
            out.append(a==b)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in pairs:
            if not av[bi] or not bv[bi]: out.append(None); continue
            a=ad[ac[ai]]
            b=bd[bc[bi]]
            out.append(a==b)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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:
Dictionary comparison checks right validity with the left lane index.

Compare two dictionary vectors row by row using decoded values, not local codes. Null validity yields UNKNOWN(None), including two null lanes. Dictionary entries themselves are ordinary integer values. Output follows the supplied pair selection order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in sorted(pairs):
            if not av[ai] or not bv[bi]: out.append(None); continue
            a=ad[ac[ai]]
            b=bd[bc[bi]]
            out.append(a==b)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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(d):
    try:
        ad,ac,av,bd,bc,bv,pairs=d
        out=[]
        for ai,bi in dict.fromkeys(tuple(p) for p in pairs):
            if not av[ai] or not bv[bi]: out.append(None); continue
            a=ad[ac[ai]]
            b=bd[bc[bi]]
            out.append(a==b)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('different codebooks', solve([[1, 2], [0, 1], [True, True], [2, 1], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[1], [0], [False], [1], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[1], [0], [False], [1], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[1, 2], [0, 1], [True, False], [1, 2], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[1, 2], [0, 1], [True, True], [1, 2], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[1], [0], [True], [1], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[1], [0], [True], [1], [0], [True], []]), [])
elif N == 2:
    check('different codebooks', solve([[2, 3], [0, 1], [True, True], [3, 2], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[2], [0], [False], [2], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[2], [0], [False], [2], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[2, 3], [0, 1], [True, False], [2, 3], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[2, 3], [0, 1], [True, True], [2, 3], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[2], [0], [True], [2], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[2], [0], [True], [2], [0], [True], []]), [])
elif N == 3:
    check('different codebooks', solve([[3, 4], [0, 1], [True, True], [4, 3], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[3], [0], [False], [3], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[3], [0], [False], [3], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[3, 4], [0, 1], [True, False], [3, 4], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[3, 4], [0, 1], [True, True], [3, 4], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[3], [0], [True], [3], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[3], [0], [True], [3], [0], [True], []]), [])
elif N == 4:
    check('different codebooks', solve([[4, 5], [0, 1], [True, True], [5, 4], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[4], [0], [False], [4], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[4], [0], [False], [4], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[4, 5], [0, 1], [True, False], [4, 5], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[4, 5], [0, 1], [True, True], [4, 5], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[4], [0], [True], [4], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[4], [0], [True], [4], [0], [True], []]), [])
elif N == 5:
    check('different codebooks', solve([[5, 6], [0, 1], [True, True], [6, 5], [0, 1], [True, True], [[0, 1], [0, 0], [1, 0]]]), [True, False, True])
    check('unknown left', solve([[5], [0], [False], [5], [0], [True], [[0, 0]]]), [None])
    check('both unknown', solve([[5], [0], [False], [5], [0], [False], [[0, 0]]]), [None])
    check('pair validity', solve([[5, 6], [0, 1], [True, False], [5, 6], [0, 1], [False, True], [[0, 1], [1, 0]]]), [False, None])
    check('order', solve([[5, 6], [0, 1], [True, True], [5, 6], [0, 1], [True, True], [[1, 0], [0, 0]]]), [False, True])
    check('repeat', solve([[5], [0], [True], [5], [0], [True], [[0, 0], [0, 0]]]), [True, True])
    check('empty pairs', solve([[5], [0], [True], [5], [0], [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:
Dictionary comparison sorts its requested row-pair selection.

Compare two dictionary vectors row by row using decoded values, not local codes. Null validity yields UNKNOWN(None), including two null lanes. Dictionary entries themselves are ordinary integer values. Output follows the supplied pair selection order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        rows,budget=d
        batches=[]; current=[]; used=0
        for ident,size in rows:
            if current and used+size>=budget:
                batches.append(current); current=[]; used=0
            current.append(ident); used+=size
            if size>budget:
                batches.append(current); current=[]; used=0
        if current: batches.append(current)
        return batches
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])
    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])
    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])
    check('single partial', solve([[[1, 1]], 3]), [[1]])
    check('no rows', solve([[], 3]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])
elif N == 2:
    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])
    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])
    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])
    check('single partial', solve([[[1, 2]], 6]), [[1]])
    check('no rows', solve([[], 6]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])
elif N == 3:
    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])
    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])
    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])
    check('single partial', solve([[[1, 3]], 9]), [[1]])
    check('no rows', solve([[], 9]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])
elif N == 4:
    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])
    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])
    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])
    check('single partial', solve([[[1, 4]], 12]), [[1]])
    check('no rows', solve([[], 12]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])
elif N == 5:
    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])
    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])
    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])
    check('single partial', solve([[[1, 5]], 15]), [[1]])
    check('no rows', solve([[], 15]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])
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(d):
    try:
        rows,budget=d
        batches=[]; current=[]; used=0
        for ident,size in rows:
            if current and used+size>budget-1:
                batches.append(current); current=[]; used=0
            current.append(ident); used+=size
            if size>budget:
                batches.append(current); current=[]; used=0
        if current: batches.append(current)
        return batches
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])
    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])
    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])
    check('single partial', solve([[[1, 1]], 3]), [[1]])
    check('no rows', solve([[], 3]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])
elif N == 2:
    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])
    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])
    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])
    check('single partial', solve([[[1, 2]], 6]), [[1]])
    check('no rows', solve([[], 6]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])
elif N == 3:
    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])
    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])
    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])
    check('single partial', solve([[[1, 3]], 9]), [[1]])
    check('no rows', solve([[], 9]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])
elif N == 4:
    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])
    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])
    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])
    check('single partial', solve([[[1, 4]], 12]), [[1]])
    check('no rows', solve([[], 12]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])
elif N == 5:
    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])
    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])
    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])
    check('single partial', solve([[[1, 5]], 15]), [[1]])
    check('no rows', solve([[], 15]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])
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:
Batch packing flushes before a row that exactly fits.

Pack indivisible [id,size] rows into ordered batches under a positive byte budget. A row exceeding budget occupies its own batch. Flush before an overflowing row, permit exact fits, and omit empty batches.

split: open-access