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

N = 1
observations = []
def solve(d):
    try:
        target,source=d
        state=dict(target)
        keys=[k for k,v in source]
        if len(set(keys))!=len(keys): return ['CARDINALITY',sorted(target)]
        for key,value in source:
            if key in state: state[key]=value
        return ['OK',sorted([[k,v] for k,v in state.items()])]
    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('matched update', solve([[[10, 1]], [[10, 2]]]), ['OK', [[10, 2]]])
    check('unmatched insert', solve([[[10, 1]], [[11, 2]]]), ['OK', [[10, 1], [11, 2]]])
    check('new duplicate keys', solve([[], [[10, 1], [10, 2]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 1]], [[10, 2], [10, 3]]]), ['CARDINALITY', [[10, 1]]])
    check('duplicate payload not key', solve([[], [[10, 1], [11, 1]]]), ['OK', [[10, 1], [11, 1]]])
    check('empty source', solve([[[10, 1]], []]), ['OK', [[10, 1]]])
    check('empty target', solve([[], [[10, 1]]]), ['OK', [[10, 1]]])
elif N == 2:
    check('matched update', solve([[[10, 2]], [[10, 3]]]), ['OK', [[10, 3]]])
    check('unmatched insert', solve([[[10, 2]], [[11, 3]]]), ['OK', [[10, 2], [11, 3]]])
    check('new duplicate keys', solve([[], [[10, 2], [10, 3]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 2]], [[10, 3], [10, 4]]]), ['CARDINALITY', [[10, 2]]])
    check('duplicate payload not key', solve([[], [[10, 2], [11, 2]]]), ['OK', [[10, 2], [11, 2]]])
    check('empty source', solve([[[10, 2]], []]), ['OK', [[10, 2]]])
    check('empty target', solve([[], [[10, 2]]]), ['OK', [[10, 2]]])
elif N == 3:
    check('matched update', solve([[[10, 3]], [[10, 4]]]), ['OK', [[10, 4]]])
    check('unmatched insert', solve([[[10, 3]], [[11, 4]]]), ['OK', [[10, 3], [11, 4]]])
    check('new duplicate keys', solve([[], [[10, 3], [10, 4]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 3]], [[10, 4], [10, 5]]]), ['CARDINALITY', [[10, 3]]])
    check('duplicate payload not key', solve([[], [[10, 3], [11, 3]]]), ['OK', [[10, 3], [11, 3]]])
    check('empty source', solve([[[10, 3]], []]), ['OK', [[10, 3]]])
    check('empty target', solve([[], [[10, 3]]]), ['OK', [[10, 3]]])
elif N == 4:
    check('matched update', solve([[[10, 4]], [[10, 5]]]), ['OK', [[10, 5]]])
    check('unmatched insert', solve([[[10, 4]], [[11, 5]]]), ['OK', [[10, 4], [11, 5]]])
    check('new duplicate keys', solve([[], [[10, 4], [10, 5]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 4]], [[10, 5], [10, 6]]]), ['CARDINALITY', [[10, 4]]])
    check('duplicate payload not key', solve([[], [[10, 4], [11, 4]]]), ['OK', [[10, 4], [11, 4]]])
    check('empty source', solve([[[10, 4]], []]), ['OK', [[10, 4]]])
    check('empty target', solve([[], [[10, 4]]]), ['OK', [[10, 4]]])
elif N == 5:
    check('matched update', solve([[[10, 5]], [[10, 6]]]), ['OK', [[10, 6]]])
    check('unmatched insert', solve([[[10, 5]], [[11, 6]]]), ['OK', [[10, 5], [11, 6]]])
    check('new duplicate keys', solve([[], [[10, 5], [10, 6]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 5]], [[10, 6], [10, 7]]]), ['CARDINALITY', [[10, 5]]])
    check('duplicate payload not key', solve([[], [[10, 5], [11, 5]]]), ['OK', [[10, 5], [11, 5]]])
    check('empty source', solve([[[10, 5]], []]), ['OK', [[10, 5]]])
    check('empty target', solve([[], [[10, 5]]]), ['OK', [[10, 5]]])
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:
        target,source=d
        state=dict(target)
        keys=[k for k,v in source]
        if len(set(keys))!=len(keys): return ['CARDINALITY',sorted(target)]
        for key,value in source:
            if state: state[key]=value
        return ['OK',sorted([[k,v] for k,v in state.items()])]
    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('matched update', solve([[[10, 1]], [[10, 2]]]), ['OK', [[10, 2]]])
    check('unmatched insert', solve([[[10, 1]], [[11, 2]]]), ['OK', [[10, 1], [11, 2]]])
    check('new duplicate keys', solve([[], [[10, 1], [10, 2]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 1]], [[10, 2], [10, 3]]]), ['CARDINALITY', [[10, 1]]])
    check('duplicate payload not key', solve([[], [[10, 1], [11, 1]]]), ['OK', [[10, 1], [11, 1]]])
    check('empty source', solve([[[10, 1]], []]), ['OK', [[10, 1]]])
    check('empty target', solve([[], [[10, 1]]]), ['OK', [[10, 1]]])
elif N == 2:
    check('matched update', solve([[[10, 2]], [[10, 3]]]), ['OK', [[10, 3]]])
    check('unmatched insert', solve([[[10, 2]], [[11, 3]]]), ['OK', [[10, 2], [11, 3]]])
    check('new duplicate keys', solve([[], [[10, 2], [10, 3]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 2]], [[10, 3], [10, 4]]]), ['CARDINALITY', [[10, 2]]])
    check('duplicate payload not key', solve([[], [[10, 2], [11, 2]]]), ['OK', [[10, 2], [11, 2]]])
    check('empty source', solve([[[10, 2]], []]), ['OK', [[10, 2]]])
    check('empty target', solve([[], [[10, 2]]]), ['OK', [[10, 2]]])
elif N == 3:
    check('matched update', solve([[[10, 3]], [[10, 4]]]), ['OK', [[10, 4]]])
    check('unmatched insert', solve([[[10, 3]], [[11, 4]]]), ['OK', [[10, 3], [11, 4]]])
    check('new duplicate keys', solve([[], [[10, 3], [10, 4]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 3]], [[10, 4], [10, 5]]]), ['CARDINALITY', [[10, 3]]])
    check('duplicate payload not key', solve([[], [[10, 3], [11, 3]]]), ['OK', [[10, 3], [11, 3]]])
    check('empty source', solve([[[10, 3]], []]), ['OK', [[10, 3]]])
    check('empty target', solve([[], [[10, 3]]]), ['OK', [[10, 3]]])
elif N == 4:
    check('matched update', solve([[[10, 4]], [[10, 5]]]), ['OK', [[10, 5]]])
    check('unmatched insert', solve([[[10, 4]], [[11, 5]]]), ['OK', [[10, 4], [11, 5]]])
    check('new duplicate keys', solve([[], [[10, 4], [10, 5]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 4]], [[10, 5], [10, 6]]]), ['CARDINALITY', [[10, 4]]])
    check('duplicate payload not key', solve([[], [[10, 4], [11, 4]]]), ['OK', [[10, 4], [11, 4]]])
    check('empty source', solve([[[10, 4]], []]), ['OK', [[10, 4]]])
    check('empty target', solve([[], [[10, 4]]]), ['OK', [[10, 4]]])
elif N == 5:
    check('matched update', solve([[[10, 5]], [[10, 6]]]), ['OK', [[10, 6]]])
    check('unmatched insert', solve([[[10, 5]], [[11, 6]]]), ['OK', [[10, 5], [11, 6]]])
    check('new duplicate keys', solve([[], [[10, 5], [10, 6]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 5]], [[10, 6], [10, 7]]]), ['CARDINALITY', [[10, 5]]])
    check('duplicate payload not key', solve([[], [[10, 5], [11, 5]]]), ['OK', [[10, 5], [11, 5]]])
    check('empty source', solve([[[10, 5]], []]), ['OK', [[10, 5]]])
    check('empty target', solve([[], [[10, 5]]]), ['OK', [[10, 5]]])
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:
MERGE updates matched rows but drops new source keys.

Merge source [key,value] into a target unique-key table. Any repeated source key is CARDINALITY and leaves target unchanged; otherwise matched keys replace payloads and unmatched keys insert. Return status and sorted final rows. Source null keys are ordinary distinct keys in this stipulated integer-key model only (inputs here are integer keys).

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        target,source=d
        state=dict(target)
        keys=[k for k,v in source]
        if len(set(keys))!=len(keys): return ['CARDINALITY',sorted(target)]
        for key,value in source:
            state[value]=key
        return ['OK',sorted([[k,v] for k,v in state.items()])]
    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('matched update', solve([[[10, 1]], [[10, 2]]]), ['OK', [[10, 2]]])
    check('unmatched insert', solve([[[10, 1]], [[11, 2]]]), ['OK', [[10, 1], [11, 2]]])
    check('new duplicate keys', solve([[], [[10, 1], [10, 2]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 1]], [[10, 2], [10, 3]]]), ['CARDINALITY', [[10, 1]]])
    check('duplicate payload not key', solve([[], [[10, 1], [11, 1]]]), ['OK', [[10, 1], [11, 1]]])
    check('empty source', solve([[[10, 1]], []]), ['OK', [[10, 1]]])
    check('empty target', solve([[], [[10, 1]]]), ['OK', [[10, 1]]])
elif N == 2:
    check('matched update', solve([[[10, 2]], [[10, 3]]]), ['OK', [[10, 3]]])
    check('unmatched insert', solve([[[10, 2]], [[11, 3]]]), ['OK', [[10, 2], [11, 3]]])
    check('new duplicate keys', solve([[], [[10, 2], [10, 3]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 2]], [[10, 3], [10, 4]]]), ['CARDINALITY', [[10, 2]]])
    check('duplicate payload not key', solve([[], [[10, 2], [11, 2]]]), ['OK', [[10, 2], [11, 2]]])
    check('empty source', solve([[[10, 2]], []]), ['OK', [[10, 2]]])
    check('empty target', solve([[], [[10, 2]]]), ['OK', [[10, 2]]])
elif N == 3:
    check('matched update', solve([[[10, 3]], [[10, 4]]]), ['OK', [[10, 4]]])
    check('unmatched insert', solve([[[10, 3]], [[11, 4]]]), ['OK', [[10, 3], [11, 4]]])
    check('new duplicate keys', solve([[], [[10, 3], [10, 4]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 3]], [[10, 4], [10, 5]]]), ['CARDINALITY', [[10, 3]]])
    check('duplicate payload not key', solve([[], [[10, 3], [11, 3]]]), ['OK', [[10, 3], [11, 3]]])
    check('empty source', solve([[[10, 3]], []]), ['OK', [[10, 3]]])
    check('empty target', solve([[], [[10, 3]]]), ['OK', [[10, 3]]])
elif N == 4:
    check('matched update', solve([[[10, 4]], [[10, 5]]]), ['OK', [[10, 5]]])
    check('unmatched insert', solve([[[10, 4]], [[11, 5]]]), ['OK', [[10, 4], [11, 5]]])
    check('new duplicate keys', solve([[], [[10, 4], [10, 5]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 4]], [[10, 5], [10, 6]]]), ['CARDINALITY', [[10, 4]]])
    check('duplicate payload not key', solve([[], [[10, 4], [11, 4]]]), ['OK', [[10, 4], [11, 4]]])
    check('empty source', solve([[[10, 4]], []]), ['OK', [[10, 4]]])
    check('empty target', solve([[], [[10, 4]]]), ['OK', [[10, 4]]])
elif N == 5:
    check('matched update', solve([[[10, 5]], [[10, 6]]]), ['OK', [[10, 6]]])
    check('unmatched insert', solve([[[10, 5]], [[11, 6]]]), ['OK', [[10, 5], [11, 6]]])
    check('new duplicate keys', solve([[], [[10, 5], [10, 6]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 5]], [[10, 6], [10, 7]]]), ['CARDINALITY', [[10, 5]]])
    check('duplicate payload not key', solve([[], [[10, 5], [11, 5]]]), ['OK', [[10, 5], [11, 5]]])
    check('empty source', solve([[[10, 5]], []]), ['OK', [[10, 5]]])
    check('empty target', solve([[], [[10, 5]]]), ['OK', [[10, 5]]])
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:
        target,source=d
        state=dict(target)
        keys=[k for k,v in source]
        if len(set(keys))!=len(keys): return ['CARDINALITY',sorted(target)]
        for key,value in source:
            state[value]=value
        return ['OK',sorted([[k,v] for k,v in state.items()])]
    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('matched update', solve([[[10, 1]], [[10, 2]]]), ['OK', [[10, 2]]])
    check('unmatched insert', solve([[[10, 1]], [[11, 2]]]), ['OK', [[10, 1], [11, 2]]])
    check('new duplicate keys', solve([[], [[10, 1], [10, 2]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 1]], [[10, 2], [10, 3]]]), ['CARDINALITY', [[10, 1]]])
    check('duplicate payload not key', solve([[], [[10, 1], [11, 1]]]), ['OK', [[10, 1], [11, 1]]])
    check('empty source', solve([[[10, 1]], []]), ['OK', [[10, 1]]])
    check('empty target', solve([[], [[10, 1]]]), ['OK', [[10, 1]]])
elif N == 2:
    check('matched update', solve([[[10, 2]], [[10, 3]]]), ['OK', [[10, 3]]])
    check('unmatched insert', solve([[[10, 2]], [[11, 3]]]), ['OK', [[10, 2], [11, 3]]])
    check('new duplicate keys', solve([[], [[10, 2], [10, 3]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 2]], [[10, 3], [10, 4]]]), ['CARDINALITY', [[10, 2]]])
    check('duplicate payload not key', solve([[], [[10, 2], [11, 2]]]), ['OK', [[10, 2], [11, 2]]])
    check('empty source', solve([[[10, 2]], []]), ['OK', [[10, 2]]])
    check('empty target', solve([[], [[10, 2]]]), ['OK', [[10, 2]]])
elif N == 3:
    check('matched update', solve([[[10, 3]], [[10, 4]]]), ['OK', [[10, 4]]])
    check('unmatched insert', solve([[[10, 3]], [[11, 4]]]), ['OK', [[10, 3], [11, 4]]])
    check('new duplicate keys', solve([[], [[10, 3], [10, 4]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 3]], [[10, 4], [10, 5]]]), ['CARDINALITY', [[10, 3]]])
    check('duplicate payload not key', solve([[], [[10, 3], [11, 3]]]), ['OK', [[10, 3], [11, 3]]])
    check('empty source', solve([[[10, 3]], []]), ['OK', [[10, 3]]])
    check('empty target', solve([[], [[10, 3]]]), ['OK', [[10, 3]]])
elif N == 4:
    check('matched update', solve([[[10, 4]], [[10, 5]]]), ['OK', [[10, 5]]])
    check('unmatched insert', solve([[[10, 4]], [[11, 5]]]), ['OK', [[10, 4], [11, 5]]])
    check('new duplicate keys', solve([[], [[10, 4], [10, 5]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 4]], [[10, 5], [10, 6]]]), ['CARDINALITY', [[10, 4]]])
    check('duplicate payload not key', solve([[], [[10, 4], [11, 4]]]), ['OK', [[10, 4], [11, 4]]])
    check('empty source', solve([[[10, 4]], []]), ['OK', [[10, 4]]])
    check('empty target', solve([[], [[10, 4]]]), ['OK', [[10, 4]]])
elif N == 5:
    check('matched update', solve([[[10, 5]], [[10, 6]]]), ['OK', [[10, 6]]])
    check('unmatched insert', solve([[[10, 5]], [[11, 6]]]), ['OK', [[10, 5], [11, 6]]])
    check('new duplicate keys', solve([[], [[10, 5], [10, 6]]]), ['CARDINALITY', []])
    check('existing duplicate keys', solve([[[10, 5]], [[10, 6], [10, 7]]]), ['CARDINALITY', [[10, 5]]])
    check('duplicate payload not key', solve([[], [[10, 5], [11, 5]]]), ['OK', [[10, 5], [11, 5]]])
    check('empty source', solve([[[10, 5]], []]), ['OK', [[10, 5]]])
    check('empty target', solve([[], [[10, 5]]]), ['OK', [[10, 5]]])
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:
MERGE writes payloads as target identities.

Merge source [key,value] into a target unique-key table. Any repeated source key is CARDINALITY and leaves target unchanged; otherwise matched keys replace payloads and unmatched keys insert. Return status and sorted final rows. Source null keys are ordinary distinct keys in this stipulated integer-key model only (inputs here are integer keys).

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            remaining=offset
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit: return out
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            if not branch: remaining=offset
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit: return out
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
UNION pagination resets its offset for each branch.

Concatenate ordered input branches with bag semantics, then apply one global nonnegative offset and limit. Branch-local boundaries, empty branches, and repeated rows do not reset pagination counters. Output order is branch order then row order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            for row in branch:
                if remaining: remaining-=1; continue
                if branch.index(row)>=limit: break
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            for row in branch:
                if remaining: remaining-=1; continue
                if branch.index(row)>=limit: continue
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
UNION pagination applies output limit independently to each branch.

Concatenate ordered input branches with bag semantics, then apply one global nonnegative offset and limit. Branch-local boundaries, empty branches, and repeated rows do not reset pagination counters. Output order is branch order then row order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            if branch is not branches[0]: remaining=0
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit: return out
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            remaining=min(remaining,len(branch))
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit: return out
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
UNION pagination stops skipping after the first branch.

Concatenate ordered input branches with bag semantics, then apply one global nonnegative offset and limit. Branch-local boundaries, empty branches, and repeated rows do not reset pagination counters. Output order is branch order then row order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in reversed(branches):
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit: return out
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in sorted(branches,key=len):
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit: return out
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
UNION pagination reverses branch traversal.

Concatenate ordered input branches with bag semantics, then apply one global nonnegative offset and limit. Branch-local boundaries, empty branches, and repeated rows do not reset pagination counters. Output order is branch order then row order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit: return out
                if row not in out: out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit: return out
                if not out or out[-1]!=row: out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
UNION pagination discards duplicate result rows.

Concatenate ordered input branches with bag semantics, then apply one global nonnegative offset and limit. Branch-local boundaries, empty branches, and repeated rows do not reset pagination counters. Output order is branch order then row order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>limit: return out
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit+1: return out
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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:
UNION pagination allows one row past its global limit.

Concatenate ordered input branches with bag semantics, then apply one global nonnegative offset and limit. Branch-local boundaries, empty branches, and repeated rows do not reset pagination counters. Output order is branch order then row order.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        groups,low,high=d
        out=[]
        for ident,minimum,maximum,nulls,count in groups:
            if count==0: continue
            if nulls==count: continue
            if minimum is None or minimum>high: continue
            if maximum is not None and maximum<low: continue
            out.append(ident)
        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('inclusive low', solve([[[1, -1, 1, 0, 3]], 1, 3]), [1])
    check('inclusive high', solve([[[1, 3, 5, 0, 3]], 1, 3]), [1])
    check('missing minimum', solve([[[1, None, 3, 0, 3]], 1, 3]), [1])
    check('missing maximum', solve([[[1, 1, None, 0, 3]], 1, 3]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 1, 3]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 1, 3]), [])
    check('disjoint bounds', solve([[[1, -3, 0, 0, 3], [2, 4, 6, 0, 3]], 1, 3]), [])
elif N == 2:
    check('inclusive low', solve([[[1, 0, 2, 0, 3]], 2, 4]), [1])
    check('inclusive high', solve([[[1, 4, 6, 0, 3]], 2, 4]), [1])
    check('missing minimum', solve([[[1, None, 4, 0, 3]], 2, 4]), [1])
    check('missing maximum', solve([[[1, 2, None, 0, 3]], 2, 4]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 2, 4]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 2, 4]), [])
    check('disjoint bounds', solve([[[1, -2, 1, 0, 3], [2, 5, 7, 0, 3]], 2, 4]), [])
elif N == 3:
    check('inclusive low', solve([[[1, 1, 3, 0, 3]], 3, 5]), [1])
    check('inclusive high', solve([[[1, 5, 7, 0, 3]], 3, 5]), [1])
    check('missing minimum', solve([[[1, None, 5, 0, 3]], 3, 5]), [1])
    check('missing maximum', solve([[[1, 3, None, 0, 3]], 3, 5]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 3, 5]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 3, 5]), [])
    check('disjoint bounds', solve([[[1, -1, 2, 0, 3], [2, 6, 8, 0, 3]], 3, 5]), [])
elif N == 4:
    check('inclusive low', solve([[[1, 2, 4, 0, 3]], 4, 6]), [1])
    check('inclusive high', solve([[[1, 6, 8, 0, 3]], 4, 6]), [1])
    check('missing minimum', solve([[[1, None, 6, 0, 3]], 4, 6]), [1])
    check('missing maximum', solve([[[1, 4, None, 0, 3]], 4, 6]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 4, 6]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 4, 6]), [])
    check('disjoint bounds', solve([[[1, 0, 3, 0, 3], [2, 7, 9, 0, 3]], 4, 6]), [])
elif N == 5:
    check('inclusive low', solve([[[1, 3, 5, 0, 3]], 5, 7]), [1])
    check('inclusive high', solve([[[1, 7, 9, 0, 3]], 5, 7]), [1])
    check('missing minimum', solve([[[1, None, 7, 0, 3]], 5, 7]), [1])
    check('missing maximum', solve([[[1, 5, None, 0, 3]], 5, 7]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 5, 7]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 5, 7]), [])
    check('disjoint bounds', solve([[[1, 1, 4, 0, 3], [2, 8, 10, 0, 3]], 5, 7]), [])
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:
        groups,low,high=d
        out=[]
        for ident,minimum,maximum,nulls,count in groups:
            if count==0: continue
            if nulls==count: continue
            if minimum is None and maximum is not None: continue
            if minimum is not None and minimum>high: continue
            if maximum is not None and maximum<low: continue
            out.append(ident)
        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('inclusive low', solve([[[1, -1, 1, 0, 3]], 1, 3]), [1])
    check('inclusive high', solve([[[1, 3, 5, 0, 3]], 1, 3]), [1])
    check('missing minimum', solve([[[1, None, 3, 0, 3]], 1, 3]), [1])
    check('missing maximum', solve([[[1, 1, None, 0, 3]], 1, 3]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 1, 3]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 1, 3]), [])
    check('disjoint bounds', solve([[[1, -3, 0, 0, 3], [2, 4, 6, 0, 3]], 1, 3]), [])
elif N == 2:
    check('inclusive low', solve([[[1, 0, 2, 0, 3]], 2, 4]), [1])
    check('inclusive high', solve([[[1, 4, 6, 0, 3]], 2, 4]), [1])
    check('missing minimum', solve([[[1, None, 4, 0, 3]], 2, 4]), [1])
    check('missing maximum', solve([[[1, 2, None, 0, 3]], 2, 4]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 2, 4]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 2, 4]), [])
    check('disjoint bounds', solve([[[1, -2, 1, 0, 3], [2, 5, 7, 0, 3]], 2, 4]), [])
elif N == 3:
    check('inclusive low', solve([[[1, 1, 3, 0, 3]], 3, 5]), [1])
    check('inclusive high', solve([[[1, 5, 7, 0, 3]], 3, 5]), [1])
    check('missing minimum', solve([[[1, None, 5, 0, 3]], 3, 5]), [1])
    check('missing maximum', solve([[[1, 3, None, 0, 3]], 3, 5]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 3, 5]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 3, 5]), [])
    check('disjoint bounds', solve([[[1, -1, 2, 0, 3], [2, 6, 8, 0, 3]], 3, 5]), [])
elif N == 4:
    check('inclusive low', solve([[[1, 2, 4, 0, 3]], 4, 6]), [1])
    check('inclusive high', solve([[[1, 6, 8, 0, 3]], 4, 6]), [1])
    check('missing minimum', solve([[[1, None, 6, 0, 3]], 4, 6]), [1])
    check('missing maximum', solve([[[1, 4, None, 0, 3]], 4, 6]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 4, 6]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 4, 6]), [])
    check('disjoint bounds', solve([[[1, 0, 3, 0, 3], [2, 7, 9, 0, 3]], 4, 6]), [])
elif N == 5:
    check('inclusive low', solve([[[1, 3, 5, 0, 3]], 5, 7]), [1])
    check('inclusive high', solve([[[1, 7, 9, 0, 3]], 5, 7]), [1])
    check('missing minimum', solve([[[1, None, 7, 0, 3]], 5, 7]), [1])
    check('missing maximum', solve([[[1, 5, None, 0, 3]], 5, 7]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 5, 7]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 5, 7]), [])
    check('disjoint bounds', solve([[[1, 1, 4, 0, 3], [2, 8, 10, 0, 3]], 5, 7]), [])
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:
Row-group pruning drops groups with missing minimum statistics.

Choose row groups that may satisfy an inclusive equality/range scan. Metadata [id,min,max,null_count,row_count] describes known integer values; unknown min/max cannot prove exclusion. Null-only and empty groups cannot satisfy a non-null range. Return candidate IDs without claiming every candidate contains a match.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        groups,low,high=d
        out=[]
        for ident,minimum,maximum,nulls,count in groups:
            if count==0: continue
            if nulls==count: continue
            if minimum is not None and minimum>high: continue
            if maximum is None or maximum<low: continue
            out.append(ident)
        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('inclusive low', solve([[[1, -1, 1, 0, 3]], 1, 3]), [1])
    check('inclusive high', solve([[[1, 3, 5, 0, 3]], 1, 3]), [1])
    check('missing minimum', solve([[[1, None, 3, 0, 3]], 1, 3]), [1])
    check('missing maximum', solve([[[1, 1, None, 0, 3]], 1, 3]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 1, 3]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 1, 3]), [])
    check('disjoint bounds', solve([[[1, -3, 0, 0, 3], [2, 4, 6, 0, 3]], 1, 3]), [])
elif N == 2:
    check('inclusive low', solve([[[1, 0, 2, 0, 3]], 2, 4]), [1])
    check('inclusive high', solve([[[1, 4, 6, 0, 3]], 2, 4]), [1])
    check('missing minimum', solve([[[1, None, 4, 0, 3]], 2, 4]), [1])
    check('missing maximum', solve([[[1, 2, None, 0, 3]], 2, 4]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 2, 4]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 2, 4]), [])
    check('disjoint bounds', solve([[[1, -2, 1, 0, 3], [2, 5, 7, 0, 3]], 2, 4]), [])
elif N == 3:
    check('inclusive low', solve([[[1, 1, 3, 0, 3]], 3, 5]), [1])
    check('inclusive high', solve([[[1, 5, 7, 0, 3]], 3, 5]), [1])
    check('missing minimum', solve([[[1, None, 5, 0, 3]], 3, 5]), [1])
    check('missing maximum', solve([[[1, 3, None, 0, 3]], 3, 5]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 3, 5]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 3, 5]), [])
    check('disjoint bounds', solve([[[1, -1, 2, 0, 3], [2, 6, 8, 0, 3]], 3, 5]), [])
elif N == 4:
    check('inclusive low', solve([[[1, 2, 4, 0, 3]], 4, 6]), [1])
    check('inclusive high', solve([[[1, 6, 8, 0, 3]], 4, 6]), [1])
    check('missing minimum', solve([[[1, None, 6, 0, 3]], 4, 6]), [1])
    check('missing maximum', solve([[[1, 4, None, 0, 3]], 4, 6]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 4, 6]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 4, 6]), [])
    check('disjoint bounds', solve([[[1, 0, 3, 0, 3], [2, 7, 9, 0, 3]], 4, 6]), [])
elif N == 5:
    check('inclusive low', solve([[[1, 3, 5, 0, 3]], 5, 7]), [1])
    check('inclusive high', solve([[[1, 7, 9, 0, 3]], 5, 7]), [1])
    check('missing minimum', solve([[[1, None, 7, 0, 3]], 5, 7]), [1])
    check('missing maximum', solve([[[1, 5, None, 0, 3]], 5, 7]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 5, 7]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 5, 7]), [])
    check('disjoint bounds', solve([[[1, 1, 4, 0, 3], [2, 8, 10, 0, 3]], 5, 7]), [])
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:
        groups,low,high=d
        out=[]
        for ident,minimum,maximum,nulls,count in groups:
            if count==0: continue
            if nulls==count: continue
            if minimum is not None and minimum>high: continue
            if maximum is None and minimum is not None: continue
            if maximum is not None and maximum<low: continue
            out.append(ident)
        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('inclusive low', solve([[[1, -1, 1, 0, 3]], 1, 3]), [1])
    check('inclusive high', solve([[[1, 3, 5, 0, 3]], 1, 3]), [1])
    check('missing minimum', solve([[[1, None, 3, 0, 3]], 1, 3]), [1])
    check('missing maximum', solve([[[1, 1, None, 0, 3]], 1, 3]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 1, 3]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 1, 3]), [])
    check('disjoint bounds', solve([[[1, -3, 0, 0, 3], [2, 4, 6, 0, 3]], 1, 3]), [])
elif N == 2:
    check('inclusive low', solve([[[1, 0, 2, 0, 3]], 2, 4]), [1])
    check('inclusive high', solve([[[1, 4, 6, 0, 3]], 2, 4]), [1])
    check('missing minimum', solve([[[1, None, 4, 0, 3]], 2, 4]), [1])
    check('missing maximum', solve([[[1, 2, None, 0, 3]], 2, 4]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 2, 4]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 2, 4]), [])
    check('disjoint bounds', solve([[[1, -2, 1, 0, 3], [2, 5, 7, 0, 3]], 2, 4]), [])
elif N == 3:
    check('inclusive low', solve([[[1, 1, 3, 0, 3]], 3, 5]), [1])
    check('inclusive high', solve([[[1, 5, 7, 0, 3]], 3, 5]), [1])
    check('missing minimum', solve([[[1, None, 5, 0, 3]], 3, 5]), [1])
    check('missing maximum', solve([[[1, 3, None, 0, 3]], 3, 5]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 3, 5]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 3, 5]), [])
    check('disjoint bounds', solve([[[1, -1, 2, 0, 3], [2, 6, 8, 0, 3]], 3, 5]), [])
elif N == 4:
    check('inclusive low', solve([[[1, 2, 4, 0, 3]], 4, 6]), [1])
    check('inclusive high', solve([[[1, 6, 8, 0, 3]], 4, 6]), [1])
    check('missing minimum', solve([[[1, None, 6, 0, 3]], 4, 6]), [1])
    check('missing maximum', solve([[[1, 4, None, 0, 3]], 4, 6]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 4, 6]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 4, 6]), [])
    check('disjoint bounds', solve([[[1, 0, 3, 0, 3], [2, 7, 9, 0, 3]], 4, 6]), [])
elif N == 5:
    check('inclusive low', solve([[[1, 3, 5, 0, 3]], 5, 7]), [1])
    check('inclusive high', solve([[[1, 7, 9, 0, 3]], 5, 7]), [1])
    check('missing minimum', solve([[[1, None, 7, 0, 3]], 5, 7]), [1])
    check('missing maximum', solve([[[1, 5, None, 0, 3]], 5, 7]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 5, 7]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 5, 7]), [])
    check('disjoint bounds', solve([[[1, 1, 4, 0, 3], [2, 8, 10, 0, 3]], 5, 7]), [])
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:
Row-group pruning drops groups with missing maximum statistics.

Choose row groups that may satisfy an inclusive equality/range scan. Metadata [id,min,max,null_count,row_count] describes known integer values; unknown min/max cannot prove exclusion. Null-only and empty groups cannot satisfy a non-null range. Return candidate IDs without claiming every candidate contains a match.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        groups,low,high=d
        out=[]
        for ident,minimum,maximum,nulls,count in groups:
            if count==0: continue
            if nulls==count: continue
            if minimum is not None and minimum>high: continue
            if maximum is not None and maximum<=low: continue
            out.append(ident)
        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('inclusive low', solve([[[1, -1, 1, 0, 3]], 1, 3]), [1])
    check('inclusive high', solve([[[1, 3, 5, 0, 3]], 1, 3]), [1])
    check('missing minimum', solve([[[1, None, 3, 0, 3]], 1, 3]), [1])
    check('missing maximum', solve([[[1, 1, None, 0, 3]], 1, 3]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 1, 3]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 1, 3]), [])
    check('disjoint bounds', solve([[[1, -3, 0, 0, 3], [2, 4, 6, 0, 3]], 1, 3]), [])
elif N == 2:
    check('inclusive low', solve([[[1, 0, 2, 0, 3]], 2, 4]), [1])
    check('inclusive high', solve([[[1, 4, 6, 0, 3]], 2, 4]), [1])
    check('missing minimum', solve([[[1, None, 4, 0, 3]], 2, 4]), [1])
    check('missing maximum', solve([[[1, 2, None, 0, 3]], 2, 4]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 2, 4]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 2, 4]), [])
    check('disjoint bounds', solve([[[1, -2, 1, 0, 3], [2, 5, 7, 0, 3]], 2, 4]), [])
elif N == 3:
    check('inclusive low', solve([[[1, 1, 3, 0, 3]], 3, 5]), [1])
    check('inclusive high', solve([[[1, 5, 7, 0, 3]], 3, 5]), [1])
    check('missing minimum', solve([[[1, None, 5, 0, 3]], 3, 5]), [1])
    check('missing maximum', solve([[[1, 3, None, 0, 3]], 3, 5]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 3, 5]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 3, 5]), [])
    check('disjoint bounds', solve([[[1, -1, 2, 0, 3], [2, 6, 8, 0, 3]], 3, 5]), [])
elif N == 4:
    check('inclusive low', solve([[[1, 2, 4, 0, 3]], 4, 6]), [1])
    check('inclusive high', solve([[[1, 6, 8, 0, 3]], 4, 6]), [1])
    check('missing minimum', solve([[[1, None, 6, 0, 3]], 4, 6]), [1])
    check('missing maximum', solve([[[1, 4, None, 0, 3]], 4, 6]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 4, 6]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 4, 6]), [])
    check('disjoint bounds', solve([[[1, 0, 3, 0, 3], [2, 7, 9, 0, 3]], 4, 6]), [])
elif N == 5:
    check('inclusive low', solve([[[1, 3, 5, 0, 3]], 5, 7]), [1])
    check('inclusive high', solve([[[1, 7, 9, 0, 3]], 5, 7]), [1])
    check('missing minimum', solve([[[1, None, 7, 0, 3]], 5, 7]), [1])
    check('missing maximum', solve([[[1, 5, None, 0, 3]], 5, 7]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 5, 7]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 5, 7]), [])
    check('disjoint bounds', solve([[[1, 1, 4, 0, 3], [2, 8, 10, 0, 3]], 5, 7]), [])
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:
        groups,low,high=d
        out=[]
        for ident,minimum,maximum,nulls,count in groups:
            if count==0: continue
            if nulls==count: continue
            if minimum is not None and minimum>high: continue
            if maximum is not None and maximum<low+1: continue
            out.append(ident)
        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('inclusive low', solve([[[1, -1, 1, 0, 3]], 1, 3]), [1])
    check('inclusive high', solve([[[1, 3, 5, 0, 3]], 1, 3]), [1])
    check('missing minimum', solve([[[1, None, 3, 0, 3]], 1, 3]), [1])
    check('missing maximum', solve([[[1, 1, None, 0, 3]], 1, 3]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 1, 3]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 1, 3]), [])
    check('disjoint bounds', solve([[[1, -3, 0, 0, 3], [2, 4, 6, 0, 3]], 1, 3]), [])
elif N == 2:
    check('inclusive low', solve([[[1, 0, 2, 0, 3]], 2, 4]), [1])
    check('inclusive high', solve([[[1, 4, 6, 0, 3]], 2, 4]), [1])
    check('missing minimum', solve([[[1, None, 4, 0, 3]], 2, 4]), [1])
    check('missing maximum', solve([[[1, 2, None, 0, 3]], 2, 4]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 2, 4]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 2, 4]), [])
    check('disjoint bounds', solve([[[1, -2, 1, 0, 3], [2, 5, 7, 0, 3]], 2, 4]), [])
elif N == 3:
    check('inclusive low', solve([[[1, 1, 3, 0, 3]], 3, 5]), [1])
    check('inclusive high', solve([[[1, 5, 7, 0, 3]], 3, 5]), [1])
    check('missing minimum', solve([[[1, None, 5, 0, 3]], 3, 5]), [1])
    check('missing maximum', solve([[[1, 3, None, 0, 3]], 3, 5]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 3, 5]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 3, 5]), [])
    check('disjoint bounds', solve([[[1, -1, 2, 0, 3], [2, 6, 8, 0, 3]], 3, 5]), [])
elif N == 4:
    check('inclusive low', solve([[[1, 2, 4, 0, 3]], 4, 6]), [1])
    check('inclusive high', solve([[[1, 6, 8, 0, 3]], 4, 6]), [1])
    check('missing minimum', solve([[[1, None, 6, 0, 3]], 4, 6]), [1])
    check('missing maximum', solve([[[1, 4, None, 0, 3]], 4, 6]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 4, 6]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 4, 6]), [])
    check('disjoint bounds', solve([[[1, 0, 3, 0, 3], [2, 7, 9, 0, 3]], 4, 6]), [])
elif N == 5:
    check('inclusive low', solve([[[1, 3, 5, 0, 3]], 5, 7]), [1])
    check('inclusive high', solve([[[1, 7, 9, 0, 3]], 5, 7]), [1])
    check('missing minimum', solve([[[1, None, 7, 0, 3]], 5, 7]), [1])
    check('missing maximum', solve([[[1, 5, None, 0, 3]], 5, 7]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 5, 7]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 5, 7]), [])
    check('disjoint bounds', solve([[[1, 1, 4, 0, 3], [2, 8, 10, 0, 3]], 5, 7]), [])
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:
Row-group pruning excludes a maximum equal to the range lower bound.

Choose row groups that may satisfy an inclusive equality/range scan. Metadata [id,min,max,null_count,row_count] describes known integer values; unknown min/max cannot prove exclusion. Null-only and empty groups cannot satisfy a non-null range. Return candidate IDs without claiming every candidate contains a match.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        groups,low,high=d
        out=[]
        for ident,minimum,maximum,nulls,count in groups:
            if count==0: continue
            if nulls==count: continue
            if minimum is not None and minimum>=high: continue
            if maximum is not None and maximum<low: continue
            out.append(ident)
        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('inclusive low', solve([[[1, -1, 1, 0, 3]], 1, 3]), [1])
    check('inclusive high', solve([[[1, 3, 5, 0, 3]], 1, 3]), [1])
    check('missing minimum', solve([[[1, None, 3, 0, 3]], 1, 3]), [1])
    check('missing maximum', solve([[[1, 1, None, 0, 3]], 1, 3]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 1, 3]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 1, 3]), [])
    check('disjoint bounds', solve([[[1, -3, 0, 0, 3], [2, 4, 6, 0, 3]], 1, 3]), [])
elif N == 2:
    check('inclusive low', solve([[[1, 0, 2, 0, 3]], 2, 4]), [1])
    check('inclusive high', solve([[[1, 4, 6, 0, 3]], 2, 4]), [1])
    check('missing minimum', solve([[[1, None, 4, 0, 3]], 2, 4]), [1])
    check('missing maximum', solve([[[1, 2, None, 0, 3]], 2, 4]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 2, 4]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 2, 4]), [])
    check('disjoint bounds', solve([[[1, -2, 1, 0, 3], [2, 5, 7, 0, 3]], 2, 4]), [])
elif N == 3:
    check('inclusive low', solve([[[1, 1, 3, 0, 3]], 3, 5]), [1])
    check('inclusive high', solve([[[1, 5, 7, 0, 3]], 3, 5]), [1])
    check('missing minimum', solve([[[1, None, 5, 0, 3]], 3, 5]), [1])
    check('missing maximum', solve([[[1, 3, None, 0, 3]], 3, 5]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 3, 5]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 3, 5]), [])
    check('disjoint bounds', solve([[[1, -1, 2, 0, 3], [2, 6, 8, 0, 3]], 3, 5]), [])
elif N == 4:
    check('inclusive low', solve([[[1, 2, 4, 0, 3]], 4, 6]), [1])
    check('inclusive high', solve([[[1, 6, 8, 0, 3]], 4, 6]), [1])
    check('missing minimum', solve([[[1, None, 6, 0, 3]], 4, 6]), [1])
    check('missing maximum', solve([[[1, 4, None, 0, 3]], 4, 6]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 4, 6]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 4, 6]), [])
    check('disjoint bounds', solve([[[1, 0, 3, 0, 3], [2, 7, 9, 0, 3]], 4, 6]), [])
elif N == 5:
    check('inclusive low', solve([[[1, 3, 5, 0, 3]], 5, 7]), [1])
    check('inclusive high', solve([[[1, 7, 9, 0, 3]], 5, 7]), [1])
    check('missing minimum', solve([[[1, None, 7, 0, 3]], 5, 7]), [1])
    check('missing maximum', solve([[[1, 5, None, 0, 3]], 5, 7]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 5, 7]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 5, 7]), [])
    check('disjoint bounds', solve([[[1, 1, 4, 0, 3], [2, 8, 10, 0, 3]], 5, 7]), [])
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:
        groups,low,high=d
        out=[]
        for ident,minimum,maximum,nulls,count in groups:
            if count==0: continue
            if nulls==count: continue
            if minimum is not None and minimum>high-1: continue
            if maximum is not None and maximum<low: continue
            out.append(ident)
        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('inclusive low', solve([[[1, -1, 1, 0, 3]], 1, 3]), [1])
    check('inclusive high', solve([[[1, 3, 5, 0, 3]], 1, 3]), [1])
    check('missing minimum', solve([[[1, None, 3, 0, 3]], 1, 3]), [1])
    check('missing maximum', solve([[[1, 1, None, 0, 3]], 1, 3]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 1, 3]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 1, 3]), [])
    check('disjoint bounds', solve([[[1, -3, 0, 0, 3], [2, 4, 6, 0, 3]], 1, 3]), [])
elif N == 2:
    check('inclusive low', solve([[[1, 0, 2, 0, 3]], 2, 4]), [1])
    check('inclusive high', solve([[[1, 4, 6, 0, 3]], 2, 4]), [1])
    check('missing minimum', solve([[[1, None, 4, 0, 3]], 2, 4]), [1])
    check('missing maximum', solve([[[1, 2, None, 0, 3]], 2, 4]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 2, 4]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 2, 4]), [])
    check('disjoint bounds', solve([[[1, -2, 1, 0, 3], [2, 5, 7, 0, 3]], 2, 4]), [])
elif N == 3:
    check('inclusive low', solve([[[1, 1, 3, 0, 3]], 3, 5]), [1])
    check('inclusive high', solve([[[1, 5, 7, 0, 3]], 3, 5]), [1])
    check('missing minimum', solve([[[1, None, 5, 0, 3]], 3, 5]), [1])
    check('missing maximum', solve([[[1, 3, None, 0, 3]], 3, 5]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 3, 5]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 3, 5]), [])
    check('disjoint bounds', solve([[[1, -1, 2, 0, 3], [2, 6, 8, 0, 3]], 3, 5]), [])
elif N == 4:
    check('inclusive low', solve([[[1, 2, 4, 0, 3]], 4, 6]), [1])
    check('inclusive high', solve([[[1, 6, 8, 0, 3]], 4, 6]), [1])
    check('missing minimum', solve([[[1, None, 6, 0, 3]], 4, 6]), [1])
    check('missing maximum', solve([[[1, 4, None, 0, 3]], 4, 6]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 4, 6]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 4, 6]), [])
    check('disjoint bounds', solve([[[1, 0, 3, 0, 3], [2, 7, 9, 0, 3]], 4, 6]), [])
elif N == 5:
    check('inclusive low', solve([[[1, 3, 5, 0, 3]], 5, 7]), [1])
    check('inclusive high', solve([[[1, 7, 9, 0, 3]], 5, 7]), [1])
    check('missing minimum', solve([[[1, None, 7, 0, 3]], 5, 7]), [1])
    check('missing maximum', solve([[[1, 5, None, 0, 3]], 5, 7]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 5, 7]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 5, 7]), [])
    check('disjoint bounds', solve([[[1, 1, 4, 0, 3], [2, 8, 10, 0, 3]], 5, 7]), [])
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:
Row-group pruning excludes a minimum equal to the range upper bound.

Choose row groups that may satisfy an inclusive equality/range scan. Metadata [id,min,max,null_count,row_count] describes known integer values; unknown min/max cannot prove exclusion. Null-only and empty groups cannot satisfy a non-null range. Return candidate IDs without claiming every candidate contains a match.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        groups,low,high=d
        out=[]
        for ident,minimum,maximum,nulls,count in groups:
            if count==0: continue
            if False: continue
            if minimum is not None and minimum>high: continue
            if maximum is not None and maximum<low: continue
            out.append(ident)
        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('inclusive low', solve([[[1, -1, 1, 0, 3]], 1, 3]), [1])
    check('inclusive high', solve([[[1, 3, 5, 0, 3]], 1, 3]), [1])
    check('missing minimum', solve([[[1, None, 3, 0, 3]], 1, 3]), [1])
    check('missing maximum', solve([[[1, 1, None, 0, 3]], 1, 3]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 1, 3]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 1, 3]), [])
    check('disjoint bounds', solve([[[1, -3, 0, 0, 3], [2, 4, 6, 0, 3]], 1, 3]), [])
elif N == 2:
    check('inclusive low', solve([[[1, 0, 2, 0, 3]], 2, 4]), [1])
    check('inclusive high', solve([[[1, 4, 6, 0, 3]], 2, 4]), [1])
    check('missing minimum', solve([[[1, None, 4, 0, 3]], 2, 4]), [1])
    check('missing maximum', solve([[[1, 2, None, 0, 3]], 2, 4]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 2, 4]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 2, 4]), [])
    check('disjoint bounds', solve([[[1, -2, 1, 0, 3], [2, 5, 7, 0, 3]], 2, 4]), [])
elif N == 3:
    check('inclusive low', solve([[[1, 1, 3, 0, 3]], 3, 5]), [1])
    check('inclusive high', solve([[[1, 5, 7, 0, 3]], 3, 5]), [1])
    check('missing minimum', solve([[[1, None, 5, 0, 3]], 3, 5]), [1])
    check('missing maximum', solve([[[1, 3, None, 0, 3]], 3, 5]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 3, 5]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 3, 5]), [])
    check('disjoint bounds', solve([[[1, -1, 2, 0, 3], [2, 6, 8, 0, 3]], 3, 5]), [])
elif N == 4:
    check('inclusive low', solve([[[1, 2, 4, 0, 3]], 4, 6]), [1])
    check('inclusive high', solve([[[1, 6, 8, 0, 3]], 4, 6]), [1])
    check('missing minimum', solve([[[1, None, 6, 0, 3]], 4, 6]), [1])
    check('missing maximum', solve([[[1, 4, None, 0, 3]], 4, 6]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 4, 6]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 4, 6]), [])
    check('disjoint bounds', solve([[[1, 0, 3, 0, 3], [2, 7, 9, 0, 3]], 4, 6]), [])
elif N == 5:
    check('inclusive low', solve([[[1, 3, 5, 0, 3]], 5, 7]), [1])
    check('inclusive high', solve([[[1, 7, 9, 0, 3]], 5, 7]), [1])
    check('missing minimum', solve([[[1, None, 7, 0, 3]], 5, 7]), [1])
    check('missing maximum', solve([[[1, 5, None, 0, 3]], 5, 7]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 5, 7]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 5, 7]), [])
    check('disjoint bounds', solve([[[1, 1, 4, 0, 3], [2, 8, 10, 0, 3]], 5, 7]), [])
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:
        groups,low,high=d
        out=[]
        for ident,minimum,maximum,nulls,count in groups:
            if count==0: continue
            if nulls>count: continue
            if minimum is not None and minimum>high: continue
            if maximum is not None and maximum<low: continue
            out.append(ident)
        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('inclusive low', solve([[[1, -1, 1, 0, 3]], 1, 3]), [1])
    check('inclusive high', solve([[[1, 3, 5, 0, 3]], 1, 3]), [1])
    check('missing minimum', solve([[[1, None, 3, 0, 3]], 1, 3]), [1])
    check('missing maximum', solve([[[1, 1, None, 0, 3]], 1, 3]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 1, 3]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 1, 3]), [])
    check('disjoint bounds', solve([[[1, -3, 0, 0, 3], [2, 4, 6, 0, 3]], 1, 3]), [])
elif N == 2:
    check('inclusive low', solve([[[1, 0, 2, 0, 3]], 2, 4]), [1])
    check('inclusive high', solve([[[1, 4, 6, 0, 3]], 2, 4]), [1])
    check('missing minimum', solve([[[1, None, 4, 0, 3]], 2, 4]), [1])
    check('missing maximum', solve([[[1, 2, None, 0, 3]], 2, 4]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 2, 4]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 2, 4]), [])
    check('disjoint bounds', solve([[[1, -2, 1, 0, 3], [2, 5, 7, 0, 3]], 2, 4]), [])
elif N == 3:
    check('inclusive low', solve([[[1, 1, 3, 0, 3]], 3, 5]), [1])
    check('inclusive high', solve([[[1, 5, 7, 0, 3]], 3, 5]), [1])
    check('missing minimum', solve([[[1, None, 5, 0, 3]], 3, 5]), [1])
    check('missing maximum', solve([[[1, 3, None, 0, 3]], 3, 5]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 3, 5]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 3, 5]), [])
    check('disjoint bounds', solve([[[1, -1, 2, 0, 3], [2, 6, 8, 0, 3]], 3, 5]), [])
elif N == 4:
    check('inclusive low', solve([[[1, 2, 4, 0, 3]], 4, 6]), [1])
    check('inclusive high', solve([[[1, 6, 8, 0, 3]], 4, 6]), [1])
    check('missing minimum', solve([[[1, None, 6, 0, 3]], 4, 6]), [1])
    check('missing maximum', solve([[[1, 4, None, 0, 3]], 4, 6]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 4, 6]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 4, 6]), [])
    check('disjoint bounds', solve([[[1, 0, 3, 0, 3], [2, 7, 9, 0, 3]], 4, 6]), [])
elif N == 5:
    check('inclusive low', solve([[[1, 3, 5, 0, 3]], 5, 7]), [1])
    check('inclusive high', solve([[[1, 7, 9, 0, 3]], 5, 7]), [1])
    check('missing minimum', solve([[[1, None, 7, 0, 3]], 5, 7]), [1])
    check('missing maximum', solve([[[1, 5, None, 0, 3]], 5, 7]), [1])
    check('null only', solve([[[1, None, None, 3, 3]], 5, 7]), [])
    check('empty group', solve([[[1, None, None, 0, 0]], 5, 7]), [])
    check('disjoint bounds', solve([[[1, 1, 4, 0, 3], [2, 8, 10, 0, 3]], 5, 7]), [])
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:
Row-group pruning admits null-only groups to a non-null scan.

Choose row groups that may satisfy an inclusive equality/range scan. Metadata [id,min,max,null_count,row_count] describes known integer values; unknown min/max cannot prove exclusion. Null-only and empty groups cannot satisfy a non-null range. Return candidate IDs without claiming every candidate contains a match.

split: open-access