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

N = 1
observations = []
def solve(d):
    try:
        tags,offsets,names,children,valid,parent,selection=d
        out=[]
        for row in selection:
            tag=tags[0]
            name=names[str(tag)]
            offset=offsets[row]
            value=children[name][offset] if valid[name][offset] else None
            out.append([name,value] if parent[row] else None)
        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('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [1, 2, 3], 'b': [4, 5, 6]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 1], ['a', 2], ['b', 4]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 2]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], [0, 0]]), [['a', 1], ['a', 1]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 4]])
elif N == 2:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [2, 3, 4], 'b': [5, 6, 7]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 2], ['a', 3], ['b', 5]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 3]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], [0, 0]]), [['a', 2], ['a', 2]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 5]])
elif N == 3:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [3, 4, 5], 'b': [6, 7, 8]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 3], ['a', 4], ['b', 6]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 4]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], [0, 0]]), [['a', 3], ['a', 3]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 6]])
elif N == 4:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [4, 5, 6], 'b': [7, 8, 9]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 4], ['a', 5], ['b', 7]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 5]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], [0, 0]]), [['a', 4], ['a', 4]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 7]])
elif N == 5:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [5, 6, 7], 'b': [8, 9, 10]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 5], ['a', 6], ['b', 8]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 6]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], [0, 0]]), [['a', 5], ['a', 5]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 8]])
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:
        tags,offsets,names,children,valid,parent,selection=d
        out=[]
        for row in selection:
            tag=tags[-1]
            name=names[str(tag)]
            offset=offsets[row]
            value=children[name][offset] if valid[name][offset] else None
            out.append([name,value] if parent[row] else None)
        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('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [1, 2, 3], 'b': [4, 5, 6]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 1], ['a', 2], ['b', 4]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 2]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], [0, 0]]), [['a', 1], ['a', 1]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 4]])
elif N == 2:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [2, 3, 4], 'b': [5, 6, 7]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 2], ['a', 3], ['b', 5]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 3]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], [0, 0]]), [['a', 2], ['a', 2]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 5]])
elif N == 3:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [3, 4, 5], 'b': [6, 7, 8]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 3], ['a', 4], ['b', 6]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 4]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], [0, 0]]), [['a', 3], ['a', 3]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 6]])
elif N == 4:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [4, 5, 6], 'b': [7, 8, 9]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 4], ['a', 5], ['b', 7]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 5]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], [0, 0]]), [['a', 4], ['a', 4]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 7]])
elif N == 5:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [5, 6, 7], 'b': [8, 9, 10]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 5], ['a', 6], ['b', 8]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 6]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], [0, 0]]), [['a', 5], ['a', 5]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 8]])
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:
Dense union decoding reuses the first row tag.

Decode a dense tagged union. Tags select named child buffers through a tag map; offsets address those buffers independently of output position. Parent and selected child validity both apply. Emit [child-name,value] for valid parents, None for null parents.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        tags,offsets,names,children,valid,parent,selection=d
        out=[]
        for row in selection:
            tag=tags[row]
            name=list(children)[0]
            offset=offsets[row]
            value=children[name][offset] if valid[name][offset] else None
            out.append([name,value] if parent[row] else None)
        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('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [1, 2, 3], 'b': [4, 5, 6]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 1], ['a', 2], ['b', 4]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 2]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], [0, 0]]), [['a', 1], ['a', 1]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 4]])
elif N == 2:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [2, 3, 4], 'b': [5, 6, 7]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 2], ['a', 3], ['b', 5]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 3]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], [0, 0]]), [['a', 2], ['a', 2]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 5]])
elif N == 3:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [3, 4, 5], 'b': [6, 7, 8]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 3], ['a', 4], ['b', 6]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 4]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], [0, 0]]), [['a', 3], ['a', 3]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 6]])
elif N == 4:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [4, 5, 6], 'b': [7, 8, 9]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 4], ['a', 5], ['b', 7]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 5]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], [0, 0]]), [['a', 4], ['a', 4]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 7]])
elif N == 5:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [5, 6, 7], 'b': [8, 9, 10]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 5], ['a', 6], ['b', 8]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 6]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], [0, 0]]), [['a', 5], ['a', 5]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 8]])
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:
        tags,offsets,names,children,valid,parent,selection=d
        out=[]
        for row in selection:
            tag=tags[row]
            name=list(children)[-1]
            offset=offsets[row]
            value=children[name][offset] if valid[name][offset] else None
            out.append([name,value] if parent[row] else None)
        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('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [1, 2, 3], 'b': [4, 5, 6]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 1], ['a', 2], ['b', 4]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 2]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], [0, 0]]), [['a', 1], ['a', 1]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 4]])
elif N == 2:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [2, 3, 4], 'b': [5, 6, 7]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 2], ['a', 3], ['b', 5]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 3]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], [0, 0]]), [['a', 2], ['a', 2]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 5]])
elif N == 3:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [3, 4, 5], 'b': [6, 7, 8]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 3], ['a', 4], ['b', 6]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 4]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], [0, 0]]), [['a', 3], ['a', 3]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 6]])
elif N == 4:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [4, 5, 6], 'b': [7, 8, 9]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 4], ['a', 5], ['b', 7]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 5]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], [0, 0]]), [['a', 4], ['a', 4]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 7]])
elif N == 5:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [5, 6, 7], 'b': [8, 9, 10]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 5], ['a', 6], ['b', 8]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 6]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], [0, 0]]), [['a', 5], ['a', 5]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 8]])
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:
Dense union tag dispatch ignores the declared tag map.

Decode a dense tagged union. Tags select named child buffers through a tag map; offsets address those buffers independently of output position. Parent and selected child validity both apply. Emit [child-name,value] for valid parents, None for null parents.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        tags,offsets,names,children,valid,parent,selection=d
        out=[]
        for row in selection:
            tag=tags[row]
            name=names[str(tag)]
            offset=min(row,len(children[name])-1)
            value=children[name][offset] if valid[name][offset] else None
            out.append([name,value] if parent[row] else None)
        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('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [1, 2, 3], 'b': [4, 5, 6]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 1], ['a', 2], ['b', 4]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 2]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], [0, 0]]), [['a', 1], ['a', 1]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 4]])
elif N == 2:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [2, 3, 4], 'b': [5, 6, 7]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 2], ['a', 3], ['b', 5]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 3]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], [0, 0]]), [['a', 2], ['a', 2]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 5]])
elif N == 3:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [3, 4, 5], 'b': [6, 7, 8]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 3], ['a', 4], ['b', 6]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 4]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], [0, 0]]), [['a', 3], ['a', 3]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 6]])
elif N == 4:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [4, 5, 6], 'b': [7, 8, 9]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 4], ['a', 5], ['b', 7]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 5]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], [0, 0]]), [['a', 4], ['a', 4]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 7]])
elif N == 5:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [5, 6, 7], 'b': [8, 9, 10]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 5], ['a', 6], ['b', 8]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 6]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], [0, 0]]), [['a', 5], ['a', 5]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 8]])
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:
        tags,offsets,names,children,valid,parent,selection=d
        out=[]
        for row in selection:
            tag=tags[row]
            name=names[str(tag)]
            offset=0
            value=children[name][offset] if valid[name][offset] else None
            out.append([name,value] if parent[row] else None)
        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('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [1, 2, 3], 'b': [4, 5, 6]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 1], ['a', 2], ['b', 4]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 2]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], [0, 0]]), [['a', 1], ['a', 1]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 4]])
elif N == 2:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [2, 3, 4], 'b': [5, 6, 7]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 2], ['a', 3], ['b', 5]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 3]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], [0, 0]]), [['a', 2], ['a', 2]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 5]])
elif N == 3:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [3, 4, 5], 'b': [6, 7, 8]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 3], ['a', 4], ['b', 6]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 4]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], [0, 0]]), [['a', 3], ['a', 3]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 6]])
elif N == 4:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [4, 5, 6], 'b': [7, 8, 9]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 4], ['a', 5], ['b', 7]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 5]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], [0, 0]]), [['a', 4], ['a', 4]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 7]])
elif N == 5:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [5, 6, 7], 'b': [8, 9, 10]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 5], ['a', 6], ['b', 8]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 6]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], [0, 0]]), [['a', 5], ['a', 5]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 8]])
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:
Dense union child offsets are replaced by row addresses.

Decode a dense tagged union. Tags select named child buffers through a tag map; offsets address those buffers independently of output position. Parent and selected child validity both apply. Emit [child-name,value] for valid parents, None for null parents.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        tags,offsets,names,children,valid,parent,selection=d
        out=[]
        for row in selection:
            tag=tags[row]
            name=names[str(tag)]
            offset=offsets[row]
            value=children[name][offset]
            out.append([name,value] if parent[row] else None)
        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('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [1, 2, 3], 'b': [4, 5, 6]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 1], ['a', 2], ['b', 4]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 2]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], [0, 0]]), [['a', 1], ['a', 1]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 4]])
elif N == 2:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [2, 3, 4], 'b': [5, 6, 7]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 2], ['a', 3], ['b', 5]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 3]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], [0, 0]]), [['a', 2], ['a', 2]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 5]])
elif N == 3:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [3, 4, 5], 'b': [6, 7, 8]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 3], ['a', 4], ['b', 6]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 4]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], [0, 0]]), [['a', 3], ['a', 3]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 6]])
elif N == 4:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [4, 5, 6], 'b': [7, 8, 9]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 4], ['a', 5], ['b', 7]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 5]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], [0, 0]]), [['a', 4], ['a', 4]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 7]])
elif N == 5:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [5, 6, 7], 'b': [8, 9, 10]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 5], ['a', 6], ['b', 8]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 6]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], [0, 0]]), [['a', 5], ['a', 5]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 8]])
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:
        tags,offsets,names,children,valid,parent,selection=d
        out=[]
        for row in selection:
            tag=tags[row]
            name=names[str(tag)]
            offset=offsets[row]
            value=children[name][offset] if all(valid[name]) else None
            out.append([name,value] if parent[row] else None)
        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('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [1, 2, 3], 'b': [4, 5, 6]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 1], ['a', 2], ['b', 4]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 2]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], [0, 0]]), [['a', 1], ['a', 1]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 4]])
elif N == 2:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [2, 3, 4], 'b': [5, 6, 7]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 2], ['a', 3], ['b', 5]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 3]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], [0, 0]]), [['a', 2], ['a', 2]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 5]])
elif N == 3:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [3, 4, 5], 'b': [6, 7, 8]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 3], ['a', 4], ['b', 6]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 4]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], [0, 0]]), [['a', 3], ['a', 3]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 6]])
elif N == 4:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [4, 5, 6], 'b': [7, 8, 9]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 4], ['a', 5], ['b', 7]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 5]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], [0, 0]]), [['a', 4], ['a', 4]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 7]])
elif N == 5:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [5, 6, 7], 'b': [8, 9, 10]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 5], ['a', 6], ['b', 8]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 6]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], [0, 0]]), [['a', 5], ['a', 5]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 8]])
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:
Dense union decoding exposes a null child payload.

Decode a dense tagged union. Tags select named child buffers through a tag map; offsets address those buffers independently of output position. Parent and selected child validity both apply. Emit [child-name,value] for valid parents, None for null parents.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        tags,offsets,names,children,valid,parent,selection=d
        out=[]
        for row in selection:
            tag=tags[row]
            name=names[str(tag)]
            offset=offsets[row]
            value=children[name][offset] if valid[name][offset] else None
            out.append([name,value])
        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('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [1, 2, 3], 'b': [4, 5, 6]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 1], ['a', 2], ['b', 4]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 2]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], [0, 0]]), [['a', 1], ['a', 1]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 4]])
elif N == 2:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [2, 3, 4], 'b': [5, 6, 7]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 2], ['a', 3], ['b', 5]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 3]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], [0, 0]]), [['a', 2], ['a', 2]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 5]])
elif N == 3:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [3, 4, 5], 'b': [6, 7, 8]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 3], ['a', 4], ['b', 6]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 4]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], [0, 0]]), [['a', 3], ['a', 3]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 6]])
elif N == 4:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [4, 5, 6], 'b': [7, 8, 9]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 4], ['a', 5], ['b', 7]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 5]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], [0, 0]]), [['a', 4], ['a', 4]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 7]])
elif N == 5:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [5, 6, 7], 'b': [8, 9, 10]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 5], ['a', 6], ['b', 8]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 6]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], [0, 0]]), [['a', 5], ['a', 5]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 8]])
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:
        tags,offsets,names,children,valid,parent,selection=d
        out=[]
        for row in selection:
            tag=tags[row]
            name=names[str(tag)]
            offset=offsets[row]
            value=children[name][offset] if valid[name][offset] else None
            out.append([name,value] if parent[row] else [name,None])
        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('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [1, 2, 3], 'b': [4, 5, 6]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 1], ['a', 2], ['b', 4]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [1, 2]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 2]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], [0, 0]]), [['a', 1], ['a', 1]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [1]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [1, 2], 'b': [3, 4]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 4]])
elif N == 2:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [2, 3, 4], 'b': [5, 6, 7]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 2], ['a', 3], ['b', 5]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [2, 3]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 3]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], [0, 0]]), [['a', 2], ['a', 2]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [2]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [2, 3], 'b': [4, 5]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 5]])
elif N == 3:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [3, 4, 5], 'b': [6, 7, 8]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 3], ['a', 4], ['b', 6]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [3, 4]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 4]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], [0, 0]]), [['a', 3], ['a', 3]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [3]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [3, 4], 'b': [5, 6]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 6]])
elif N == 4:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [4, 5, 6], 'b': [7, 8, 9]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 4], ['a', 5], ['b', 7]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [4, 5]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 5]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], [0, 0]]), [['a', 4], ['a', 4]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [4]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [4, 5], 'b': [6, 7]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 7]])
elif N == 5:
    check('mixed tags', solve([[7, 9, 7], [1, 0, 0], {'7': 'a', '9': 'b'}, {'a': [5, 6, 7], 'b': [8, 9, 10]}, {'a': [True, True, True], 'b': [True, True, True]}, [True, True, True], [2, 0, 1]]), [['a', 5], ['a', 6], ['b', 8]])
    check('child null', solve([[7, 7], [0, 1], {'7': 'a'}, {'a': [5, 6]}, {'a': [False, True]}, [True, True], [0, 1]]), [['a', None], ['a', 6]])
    check('parent null', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [False], [0]]), [None])
    check('repeat row', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], [0, 0]]), [['a', 5], ['a', 5]])
    check('empty selection', solve([[7], [0], {'7': 'a'}, {'a': [5]}, {'a': [True]}, [True], []]), [])
    check('second tag', solve([[9], [1], {'7': 'a', '9': 'b'}, {'a': [5, 6], 'b': [7, 8]}, {'a': [True, True], 'b': [True, True]}, [True], [0]]), [['b', 8]])
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:
Dense union decoding exposes a child under a null parent.

Decode a dense tagged union. Tags select named child buffers through a tag map; offsets address those buffers independently of output position. Parent and selected child validity both apply. Emit [child-name,value] for valid parents, None for null parents.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left[:next((i for i,c in enumerate(left) if not c),len(left))] for v in chunk]
        b=[v for chunk in right for v in chunk]
        rows=[[a[i],b[i]] for i in range(len(a))]
        rows=rows[start:start+length]
        return rows
    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 boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left if chunk for v in chunk if v is not None]
        b=[v for chunk in right for v in chunk]
        rows=[[a[i],b[i]] for i in range(len(a))]
        rows=rows[start:start+length]
        return rows
    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 boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
An empty left chunk terminates the logical column.

Assemble two equally long logical columns from independent chunk layouts. Empty chunks carry no rows. Zip by global row ordinal, retain null values, and apply the requested half-open row slice after alignment.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left for v in chunk]
        b=(right[0] if right else []) + [None]*sum(map(len,right[1:]))
        rows=[[a[i],b[i]] for i in range(len(a))]
        rows=rows[start:start+length]
        return rows
    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 boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left for v in chunk]
        b=[v for chunk in reversed(right) for v in chunk]
        rows=[[a[i],b[i]] for i in range(len(a))]
        rows=rows[start:start+length]
        return rows
    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 boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Only the first physical right chunk participates in row assembly.

Assemble two equally long logical columns from independent chunk layouts. Empty chunks carry no rows. Zip by global row ordinal, retain null values, and apply the requested half-open row slice after alignment.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left for v in chunk]
        b=[v for chunk in right for v in chunk]
        rows=[[b[i],a[i]] for i in range(len(a))]
        rows=rows[start:start+length]
        return rows
    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 boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left for v in chunk]
        b=[v for chunk in right for v in chunk]
        rows=[[a[i],b[-i-1]] for i in range(len(a))]
        rows=rows[start:start+length]
        return rows
    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 boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Chunked row assembly reverses column positions.

Assemble two equally long logical columns from independent chunk layouts. Empty chunks carry no rows. Zip by global row ordinal, retain null values, and apply the requested half-open row slice after alignment.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left for v in chunk]
        b=[v for chunk in right for v in chunk]
        rows=[[a[i],b[i]] for i in range(len(a))]
        rows=rows[:length]
        return rows
    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 boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left for v in chunk]
        b=[v for chunk in right for v in chunk]
        rows=[[a[i],b[i]] for i in range(len(a))]
        rows=rows[start:length]
        return rows
    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 boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A chunked row slice ignores its global starting ordinal.

Assemble two equally long logical columns from independent chunk layouts. Empty chunks carry no rows. Zip by global row ordinal, retain null values, and apply the requested half-open row slice after alignment.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left for v in chunk]
        b=[v for chunk in right for v in chunk]
        rows=[[a[i],b[i]] for i in range(len(a))]
        rows=rows[start:start+length]
        return [row for row in rows if None not in row]
    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 boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        left,right,start,length=d
        a=[v for chunk in left for v in chunk]
        b=[v for chunk in right for v in chunk]
        rows=[[a[i],b[i]] for i in range(len(a))]
        rows=rows[start:start+length]
        return [[0 if v is None else v for v in row] for row in rows]
    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 boundaries', solve([[[1, 2], [3]], [[4], [5, 6]], 0, 3]), [[1, 4], [2, 5], [3, 6]])
    check('empty internal chunks', solve([[[1], [], [2]], [[], [3, 4]], 0, 2]), [[1, 3], [2, 4]])
    check('global slice', solve([[[1], [2, 3]], [[4, 5], [6]], 1, 2]), [[2, 5], [3, 6]])
    check('null field', solve([[[None, 1]], [[2, None]], 0, 2]), [[None, 2], [1, None]])
    check('repeated rows', solve([[[1, 1]], [[2, 2]], 0, 2]), [[1, 2], [1, 2]])
    check('zero length', solve([[[1]], [[2]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 2:
    check('different boundaries', solve([[[2, 3], [4]], [[5], [6, 7]], 0, 3]), [[2, 5], [3, 6], [4, 7]])
    check('empty internal chunks', solve([[[2], [], [3]], [[], [4, 5]], 0, 2]), [[2, 4], [3, 5]])
    check('global slice', solve([[[2], [3, 4]], [[5, 6], [7]], 1, 2]), [[3, 6], [4, 7]])
    check('null field', solve([[[None, 2]], [[3, None]], 0, 2]), [[None, 3], [2, None]])
    check('repeated rows', solve([[[2, 2]], [[3, 3]], 0, 2]), [[2, 3], [2, 3]])
    check('zero length', solve([[[2]], [[3]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 3:
    check('different boundaries', solve([[[3, 4], [5]], [[6], [7, 8]], 0, 3]), [[3, 6], [4, 7], [5, 8]])
    check('empty internal chunks', solve([[[3], [], [4]], [[], [5, 6]], 0, 2]), [[3, 5], [4, 6]])
    check('global slice', solve([[[3], [4, 5]], [[6, 7], [8]], 1, 2]), [[4, 7], [5, 8]])
    check('null field', solve([[[None, 3]], [[4, None]], 0, 2]), [[None, 4], [3, None]])
    check('repeated rows', solve([[[3, 3]], [[4, 4]], 0, 2]), [[3, 4], [3, 4]])
    check('zero length', solve([[[3]], [[4]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 4:
    check('different boundaries', solve([[[4, 5], [6]], [[7], [8, 9]], 0, 3]), [[4, 7], [5, 8], [6, 9]])
    check('empty internal chunks', solve([[[4], [], [5]], [[], [6, 7]], 0, 2]), [[4, 6], [5, 7]])
    check('global slice', solve([[[4], [5, 6]], [[7, 8], [9]], 1, 2]), [[5, 8], [6, 9]])
    check('null field', solve([[[None, 4]], [[5, None]], 0, 2]), [[None, 5], [4, None]])
    check('repeated rows', solve([[[4, 4]], [[5, 5]], 0, 2]), [[4, 5], [4, 5]])
    check('zero length', solve([[[4]], [[5]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
elif N == 5:
    check('different boundaries', solve([[[5, 6], [7]], [[8], [9, 10]], 0, 3]), [[5, 8], [6, 9], [7, 10]])
    check('empty internal chunks', solve([[[5], [], [6]], [[], [7, 8]], 0, 2]), [[5, 7], [6, 8]])
    check('global slice', solve([[[5], [6, 7]], [[8, 9], [10]], 1, 2]), [[6, 9], [7, 10]])
    check('null field', solve([[[None, 5]], [[6, None]], 0, 2]), [[None, 6], [5, None]])
    check('repeated rows', solve([[[5, 5]], [[6, 6]], 0, 2]), [[5, 6], [5, 6]])
    check('zero length', solve([[[5]], [[6]], 0, 0]), [])
    check('no physical chunks', solve([[], [], 0, 0]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A row assembler discards rows containing null fields.

Assemble two equally long logical columns from independent chunk layouts. Empty chunks carry no rows. Zip by global row ordinal, retain null values, and apply the requested half-open row slice after alignment.

split: open-access