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

N = 1
observations = []
def solve(d):
    try:
        rows,budget=d
        batches=[]; current=[]; used=0
        for ident,size in rows:
            if current and used+size>budget:
                batches.append(current); current=[]; used=0
            current.append(ident); used+=1
            if size>budget:
                batches.append(current); current=[]; used=0
        if current: batches.append(current)
        return batches
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])
    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])
    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])
    check('single partial', solve([[[1, 1]], 3]), [[1]])
    check('no rows', solve([[], 3]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])
elif N == 2:
    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])
    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])
    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])
    check('single partial', solve([[[1, 2]], 6]), [[1]])
    check('no rows', solve([[], 6]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])
elif N == 3:
    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])
    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])
    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])
    check('single partial', solve([[[1, 3]], 9]), [[1]])
    check('no rows', solve([[], 9]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])
elif N == 4:
    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])
    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])
    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])
    check('single partial', solve([[[1, 4]], 12]), [[1]])
    check('no rows', solve([[], 12]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])
elif N == 5:
    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])
    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])
    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])
    check('single partial', solve([[[1, 5]], 15]), [[1]])
    check('no rows', solve([[], 15]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        rows,budget=d
        batches=[]; current=[]; used=0
        for ident,size in rows:
            if current and used+size>budget:
                batches.append(current); current=[]; used=0
            current.append(ident); used=size
            if size>budget:
                batches.append(current); current=[]; used=0
        if current: batches.append(current)
        return batches
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])
    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])
    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])
    check('single partial', solve([[[1, 1]], 3]), [[1]])
    check('no rows', solve([[], 3]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])
elif N == 2:
    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])
    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])
    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])
    check('single partial', solve([[[1, 2]], 6]), [[1]])
    check('no rows', solve([[], 6]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])
elif N == 3:
    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])
    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])
    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])
    check('single partial', solve([[[1, 3]], 9]), [[1]])
    check('no rows', solve([[], 9]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])
elif N == 4:
    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])
    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])
    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])
    check('single partial', solve([[[1, 4]], 12]), [[1]])
    check('no rows', solve([[], 12]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])
elif N == 5:
    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])
    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])
    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])
    check('single partial', solve([[[1, 5]], 15]), [[1]])
    check('no rows', solve([[], 15]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Batch packing accounts one byte per row regardless of row size.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        rows,budget=d
        batches=[]; current=[]; used=0
        for ident,size in rows:
            if current and used+size>budget:
                batches.append(current); current=[]
            current.append(ident); used+=size
            if size>budget:
                batches.append(current); current=[]; used=0
        if current: batches.append(current)
        return batches
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])
    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])
    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])
    check('single partial', solve([[[1, 1]], 3]), [[1]])
    check('no rows', solve([[], 3]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])
elif N == 2:
    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])
    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])
    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])
    check('single partial', solve([[[1, 2]], 6]), [[1]])
    check('no rows', solve([[], 6]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])
elif N == 3:
    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])
    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])
    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])
    check('single partial', solve([[[1, 3]], 9]), [[1]])
    check('no rows', solve([[], 9]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])
elif N == 4:
    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])
    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])
    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])
    check('single partial', solve([[[1, 4]], 12]), [[1]])
    check('no rows', solve([[], 12]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])
elif N == 5:
    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])
    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])
    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])
    check('single partial', solve([[[1, 5]], 15]), [[1]])
    check('no rows', solve([[], 15]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

prompt:
Batch packing retains byte occupancy after flushing rows.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        rows,budget=d
        batches=[]; current=[]; used=0
        for ident,size in rows:
            if current and used+size>budget:
                batches.append(current); current=[]; used=0
            current.append(ident); used+=size
            if used>=budget:
                batches.append(current); current=[]; used=0
        if current: batches.append(current)
        return batches
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])
    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])
    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])
    check('single partial', solve([[[1, 1]], 3]), [[1]])
    check('no rows', solve([[], 3]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])
elif N == 2:
    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])
    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])
    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])
    check('single partial', solve([[[1, 2]], 6]), [[1]])
    check('no rows', solve([[], 6]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])
elif N == 3:
    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])
    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])
    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])
    check('single partial', solve([[[1, 3]], 9]), [[1]])
    check('no rows', solve([[], 9]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])
elif N == 4:
    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])
    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])
    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])
    check('single partial', solve([[[1, 4]], 12]), [[1]])
    check('no rows', solve([[], 12]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])
elif N == 5:
    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])
    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])
    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])
    check('single partial', solve([[[1, 5]], 15]), [[1]])
    check('no rows', solve([[], 15]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        rows,budget=d
        batches=[]; current=[]; used=0
        for ident,size in rows:
            if current and used+size>budget:
                batches.append(current); current=[]; used=0
            current.append(ident); used+=size
            if size>=budget:
                batches.append(current); current=[]; used=0
        if current: batches.append(current)
        return batches
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])
    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])
    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])
    check('single partial', solve([[[1, 1]], 3]), [[1]])
    check('no rows', solve([[], 3]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])
elif N == 2:
    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])
    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])
    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])
    check('single partial', solve([[[1, 2]], 6]), [[1]])
    check('no rows', solve([[], 6]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])
elif N == 3:
    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])
    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])
    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])
    check('single partial', solve([[[1, 3]], 9]), [[1]])
    check('no rows', solve([[], 9]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])
elif N == 4:
    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])
    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])
    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])
    check('single partial', solve([[[1, 4]], 12]), [[1]])
    check('no rows', solve([[], 12]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])
elif N == 5:
    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])
    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])
    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])
    check('single partial', solve([[[1, 5]], 15]), [[1]])
    check('no rows', solve([[], 15]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A full batch is flushed before following zero-byte rows can fit.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        rows,budget=d
        batches=[]; current=[]; used=0
        for ident,size in rows:
            if current and used+size>budget:
                batches.append(current); current=[]; used=0
            current.append(ident); used+=size
            if size>budget:
                batches.append(current); current=[]; used=0
        if current and used>=budget: batches.append(current)
        return batches
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])
    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])
    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])
    check('single partial', solve([[[1, 1]], 3]), [[1]])
    check('no rows', solve([[], 3]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])
elif N == 2:
    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])
    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])
    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])
    check('single partial', solve([[[1, 2]], 6]), [[1]])
    check('no rows', solve([[], 6]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])
elif N == 3:
    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])
    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])
    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])
    check('single partial', solve([[[1, 3]], 9]), [[1]])
    check('no rows', solve([[], 9]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])
elif N == 4:
    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])
    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])
    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])
    check('single partial', solve([[[1, 4]], 12]), [[1]])
    check('no rows', solve([[], 12]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])
elif N == 5:
    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])
    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])
    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])
    check('single partial', solve([[[1, 5]], 15]), [[1]])
    check('no rows', solve([[], 15]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        rows,budget=d
        batches=[]; current=[]; used=0
        for ident,size in rows:
            if current and used+size>budget:
                batches.append(current); current=[]; used=0
            current.append(ident); used+=size
            if size>budget:
                batches.append(current); current=[]; used=0
        if current and len(current)>1: batches.append(current)
        return batches
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])
    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])
    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])
    check('single partial', solve([[[1, 1]], 3]), [[1]])
    check('no rows', solve([[], 3]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])
elif N == 2:
    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])
    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])
    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])
    check('single partial', solve([[[1, 2]], 6]), [[1]])
    check('no rows', solve([[], 6]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])
elif N == 3:
    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])
    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])
    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])
    check('single partial', solve([[[1, 3]], 9]), [[1]])
    check('no rows', solve([[], 9]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])
elif N == 4:
    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])
    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])
    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])
    check('single partial', solve([[[1, 4]], 12]), [[1]])
    check('no rows', solve([[], 12]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])
elif N == 5:
    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])
    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])
    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])
    check('single partial', solve([[[1, 5]], 15]), [[1]])
    check('no rows', solve([[], 15]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Batch packing drops the final partially filled batch.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        rows,budget=d
        batches=[]; current=[]; used=0
        for ident,size in rows:
            if current and used+size>budget:
                batches.append(current); current=[]; used=0
            current.append(ident); used+=size
            if size>budget:
                batches.append(current); current=[]; used=0
        batches.append(current)
        return batches
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])
    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])
    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])
    check('single partial', solve([[[1, 1]], 3]), [[1]])
    check('no rows', solve([[], 3]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])
elif N == 2:
    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])
    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])
    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])
    check('single partial', solve([[[1, 2]], 6]), [[1]])
    check('no rows', solve([[], 6]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])
elif N == 3:
    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])
    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])
    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])
    check('single partial', solve([[[1, 3]], 9]), [[1]])
    check('no rows', solve([[], 9]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])
elif N == 4:
    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])
    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])
    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])
    check('single partial', solve([[[1, 4]], 12]), [[1]])
    check('no rows', solve([[], 12]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])
elif N == 5:
    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])
    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])
    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])
    check('single partial', solve([[[1, 5]], 15]), [[1]])
    check('no rows', solve([[], 15]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        rows,budget=d
        batches=[]; current=[]; used=0
        for ident,size in rows:
            if current and used+size>budget:
                batches.append(current); current=[]; used=0
            current.append(ident); used+=size
            if size>budget:
                batches.append(current); current=[]; used=0
        if not current: batches.append(current)
        return batches
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])
    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])
    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])
    check('single partial', solve([[[1, 1]], 3]), [[1]])
    check('no rows', solve([[], 3]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])
elif N == 2:
    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])
    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])
    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])
    check('single partial', solve([[[1, 2]], 6]), [[1]])
    check('no rows', solve([[], 6]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])
elif N == 3:
    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])
    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])
    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])
    check('single partial', solve([[[1, 3]], 9]), [[1]])
    check('no rows', solve([[], 9]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])
elif N == 4:
    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])
    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])
    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])
    check('single partial', solve([[[1, 4]], 12]), [[1]])
    check('no rows', solve([[], 12]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])
elif N == 5:
    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])
    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])
    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])
    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])
    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])
    check('single partial', solve([[[1, 5]], 15]), [[1]])
    check('no rows', solve([[], 15]), [])
    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Batch packing creates an empty terminal batch.

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

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row
            for segment in ".".join(path).split("."):
                if not isinstance(value,dict): value=None; break
                if segment not in value: value=None; break
                value=value[segment]
            out.append(value)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row
            for segment in path[0].split(".") if path else []:
                if not isinstance(value,dict): value=None; break
                if segment not in value: value=None; break
                value=value[segment]
            out.append(value)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A structural path splits literal dots inside field names.

Resolve an explicit sequence of field path segments against each row dictionary. Dots inside a segment are literal characters; empty path returns the whole row. A missing segment, non-dictionary intermediate, or null intermediate yields None; falsy leaf values remain present.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row
            for segment in path:
                if not isinstance(value,dict): value=None; break
                if segment not in value: value=None; break
                value=row.get(segment)
            out.append(value)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row
            for segment in path:
                if not isinstance(value,dict): value=None; break
                if segment not in value: value=None; break
                value=row.get(segment,value[segment])
            out.append(value)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
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:
Nested path resolution restarts from the root for each segment.

Resolve an explicit sequence of field path segments against each row dictionary. Dots inside a segment are literal characters; empty path returns the whole row. A missing segment, non-dictionary intermediate, or null intermediate yields None; falsy leaf values remain present.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row
            for segment in path:
                if not isinstance(value,dict): value=None; break
                if segment not in value: break
                value=value[segment]
            out.append(value)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row
            for segment in path:
                if not isinstance(value,dict): value=None; break
                if segment not in value: value={}; break
                value=value[segment]
            out.append(value)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
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:
Nested field resolution reuses the current object when a field is absent.

Resolve an explicit sequence of field path segments against each row dictionary. Dots inside a segment are literal characters; empty path returns the whole row. A missing segment, non-dictionary intermediate, or null intermediate yields None; falsy leaf values remain present.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row
            for segment in path:
                if not isinstance(value,dict): break
                if segment not in value: value=None; break
                value=value[segment]
            out.append(value)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row
            for segment in path:
                if not isinstance(value,dict): value=0; break
                if segment not in value: value=None; break
                value=value[segment]
            out.append(value)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A non-record intermediate is returned as a successful nested path.

Resolve an explicit sequence of field path segments against each row dictionary. Dots inside a segment are literal characters; empty path returns the whole row. A missing segment, non-dictionary intermediate, or null intermediate yields None; falsy leaf values remain present.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row
            for segment in path:
                if not isinstance(value,dict): value=None; break
                if segment not in value: value=None; break
                value=value[segment]
            out.append(value or None)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row
            for segment in path:
                if not isinstance(value,dict): value=None; break
                if segment not in value: value=None; break
                value=value[segment]
            out.append(None if value==0 else value)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
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:
Nested path extraction converts valid falsy leaves to null.

Resolve an explicit sequence of field path segments against each row dictionary. Dots inside a segment are literal characters; empty path returns the whole row. A missing segment, non-dictionary intermediate, or null intermediate yields None; falsy leaf values remain present.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row if path else None
            for segment in path:
                if not isinstance(value,dict): value=None; break
                if segment not in value: value=None; break
                value=value[segment]
            out.append(value)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    try:
        rows,path=d
        out=[]
        for row in rows:
            value=row if path else {}
            for segment in path:
                if not isinstance(value,dict): value=None; break
                if segment not in value: value=None; break
                value=value[segment]
            out.append(value)
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('literal dotted field', solve([[{'a.b': 1, 'a': {'b': 2}}], ['a.b']]), [1])
    check('nested homonym', solve([[{'a': {'b': 1}, 'b': 2}], ['a', 'b']]), [1])
    check('missing segment', solve([[{'a': {'b': 1}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 1}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 1}], []]), [{'a': 1}])
    check('multiple rows', solve([[{'a': 1}, {'a': 2}], ['a']]), [1, 2])
elif N == 2:
    check('literal dotted field', solve([[{'a.b': 2, 'a': {'b': 3}}], ['a.b']]), [2])
    check('nested homonym', solve([[{'a': {'b': 2}, 'b': 3}], ['a', 'b']]), [2])
    check('missing segment', solve([[{'a': {'b': 2}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 2}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 2}], []]), [{'a': 2}])
    check('multiple rows', solve([[{'a': 2}, {'a': 3}], ['a']]), [2, 3])
elif N == 3:
    check('literal dotted field', solve([[{'a.b': 3, 'a': {'b': 4}}], ['a.b']]), [3])
    check('nested homonym', solve([[{'a': {'b': 3}, 'b': 4}], ['a', 'b']]), [3])
    check('missing segment', solve([[{'a': {'b': 3}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 3}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 3}], []]), [{'a': 3}])
    check('multiple rows', solve([[{'a': 3}, {'a': 4}], ['a']]), [3, 4])
elif N == 4:
    check('literal dotted field', solve([[{'a.b': 4, 'a': {'b': 5}}], ['a.b']]), [4])
    check('nested homonym', solve([[{'a': {'b': 4}, 'b': 5}], ['a', 'b']]), [4])
    check('missing segment', solve([[{'a': {'b': 4}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 4}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 4}], []]), [{'a': 4}])
    check('multiple rows', solve([[{'a': 4}, {'a': 5}], ['a']]), [4, 5])
elif N == 5:
    check('literal dotted field', solve([[{'a.b': 5, 'a': {'b': 6}}], ['a.b']]), [5])
    check('nested homonym', solve([[{'a': {'b': 5}, 'b': 6}], ['a', 'b']]), [5])
    check('missing segment', solve([[{'a': {'b': 5}}], ['a', 'z']]), [None])
    check('scalar intermediate', solve([[{'a': 5}], ['a', 'b']]), [None])
    check('zero leaf', solve([[{'a': 0}], ['a']]), [0])
    check('empty path', solve([[{'a': 5}], []]), [{'a': 5}])
    check('multiple rows', solve([[{'a': 5}, {'a': 6}], ['a']]), [5, 6])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
An empty nested path returns null rather than the source row.

Resolve an explicit sequence of field path segments against each row dictionary. Dots inside a segment are literal characters; empty path returns the whole row. A missing segment, non-dictionary intermediate, or null intermediate yields None; falsy leaf values remain present.

split: open-access


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

N = 1
observations = []
def solve(d):
    try:
        fragments,projection=d
        out=[]
        for partition,rows in fragments:
            for row in rows:
                merged=dict(row)
                merged={**partition,**row}
                out.append([merged.get(name) for name in projection])
        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('partition overrides', solve([[[{'p': 'new'}, [{'p': 'old', 'v': 1}]]], ['v', 'p']]), [[1, 'new']])
    check('multiple fragments', solve([[[{'p': 'a'}, [{'v': 1}]], [{'p': 'b'}, [{'v': 2}]]], ['p', 'v']]), [['a', 1], ['b', 2]])
    check('empty fragment', solve([[[{'p': 'a'}, []]], ['p']]), [])
    check('missing projected', solve([[[{}, [{'v': 1}]]], ['v', 'x']]), [[1, None]])
    check('duplicate rows', solve([[[{}, [{'v': 1}, {'v': 1}]]], ['v']]), [[1], [1]])
    check('duplicate projection', solve([[[{}, [{'v': 1}]]], ['v', 'v']]), [[1, 1]])
    check('no fragments', solve([[], ['v']]), [])
elif N == 2:
    check('partition overrides', solve([[[{'p': 'new'}, [{'p': 'old', 'v': 2}]]], ['v', 'p']]), [[2, 'new']])
    check('multiple fragments', solve([[[{'p': 'a'}, [{'v': 2}]], [{'p': 'b'}, [{'v': 3}]]], ['p', 'v']]), [['a', 2], ['b', 3]])
    check('empty fragment', solve([[[{'p': 'a'}, []]], ['p']]), [])
    check('missing projected', solve([[[{}, [{'v': 2}]]], ['v', 'x']]), [[2, None]])
    check('duplicate rows', solve([[[{}, [{'v': 2}, {'v': 2}]]], ['v']]), [[2], [2]])
    check('duplicate projection', solve([[[{}, [{'v': 2}]]], ['v', 'v']]), [[2, 2]])
    check('no fragments', solve([[], ['v']]), [])
elif N == 3:
    check('partition overrides', solve([[[{'p': 'new'}, [{'p': 'old', 'v': 3}]]], ['v', 'p']]), [[3, 'new']])
    check('multiple fragments', solve([[[{'p': 'a'}, [{'v': 3}]], [{'p': 'b'}, [{'v': 4}]]], ['p', 'v']]), [['a', 3], ['b', 4]])
    check('empty fragment', solve([[[{'p': 'a'}, []]], ['p']]), [])
    check('missing projected', solve([[[{}, [{'v': 3}]]], ['v', 'x']]), [[3, None]])
    check('duplicate rows', solve([[[{}, [{'v': 3}, {'v': 3}]]], ['v']]), [[3], [3]])
    check('duplicate projection', solve([[[{}, [{'v': 3}]]], ['v', 'v']]), [[3, 3]])
    check('no fragments', solve([[], ['v']]), [])
elif N == 4:
    check('partition overrides', solve([[[{'p': 'new'}, [{'p': 'old', 'v': 4}]]], ['v', 'p']]), [[4, 'new']])
    check('multiple fragments', solve([[[{'p': 'a'}, [{'v': 4}]], [{'p': 'b'}, [{'v': 5}]]], ['p', 'v']]), [['a', 4], ['b', 5]])
    check('empty fragment', solve([[[{'p': 'a'}, []]], ['p']]), [])
    check('missing projected', solve([[[{}, [{'v': 4}]]], ['v', 'x']]), [[4, None]])
    check('duplicate rows', solve([[[{}, [{'v': 4}, {'v': 4}]]], ['v']]), [[4], [4]])
    check('duplicate projection', solve([[[{}, [{'v': 4}]]], ['v', 'v']]), [[4, 4]])
    check('no fragments', solve([[], ['v']]), [])
elif N == 5:
    check('partition overrides', solve([[[{'p': 'new'}, [{'p': 'old', 'v': 5}]]], ['v', 'p']]), [[5, 'new']])
    check('multiple fragments', solve([[[{'p': 'a'}, [{'v': 5}]], [{'p': 'b'}, [{'v': 6}]]], ['p', 'v']]), [['a', 5], ['b', 6]])
    check('empty fragment', solve([[[{'p': 'a'}, []]], ['p']]), [])
    check('missing projected', solve([[[{}, [{'v': 5}]]], ['v', 'x']]), [[5, None]])
    check('duplicate rows', solve([[[{}, [{'v': 5}, {'v': 5}]]], ['v']]), [[5], [5]])
    check('duplicate projection', solve([[[{}, [{'v': 5}]]], ['v', 'v']]), [[5, 5]])
    check('no fragments', solve([[], ['v']]), [])
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:
        fragments,projection=d
        out=[]
        for partition,rows in fragments:
            for row in rows:
                merged=dict(row)
                merged.update({k:v for k,v in partition.items() if k not in merged})
                out.append([merged.get(name) for name in projection])
        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('partition overrides', solve([[[{'p': 'new'}, [{'p': 'old', 'v': 1}]]], ['v', 'p']]), [[1, 'new']])
    check('multiple fragments', solve([[[{'p': 'a'}, [{'v': 1}]], [{'p': 'b'}, [{'v': 2}]]], ['p', 'v']]), [['a', 1], ['b', 2]])
    check('empty fragment', solve([[[{'p': 'a'}, []]], ['p']]), [])
    check('missing projected', solve([[[{}, [{'v': 1}]]], ['v', 'x']]), [[1, None]])
    check('duplicate rows', solve([[[{}, [{'v': 1}, {'v': 1}]]], ['v']]), [[1], [1]])
    check('duplicate projection', solve([[[{}, [{'v': 1}]]], ['v', 'v']]), [[1, 1]])
    check('no fragments', solve([[], ['v']]), [])
elif N == 2:
    check('partition overrides', solve([[[{'p': 'new'}, [{'p': 'old', 'v': 2}]]], ['v', 'p']]), [[2, 'new']])
    check('multiple fragments', solve([[[{'p': 'a'}, [{'v': 2}]], [{'p': 'b'}, [{'v': 3}]]], ['p', 'v']]), [['a', 2], ['b', 3]])
    check('empty fragment', solve([[[{'p': 'a'}, []]], ['p']]), [])
    check('missing projected', solve([[[{}, [{'v': 2}]]], ['v', 'x']]), [[2, None]])
    check('duplicate rows', solve([[[{}, [{'v': 2}, {'v': 2}]]], ['v']]), [[2], [2]])
    check('duplicate projection', solve([[[{}, [{'v': 2}]]], ['v', 'v']]), [[2, 2]])
    check('no fragments', solve([[], ['v']]), [])
elif N == 3:
    check('partition overrides', solve([[[{'p': 'new'}, [{'p': 'old', 'v': 3}]]], ['v', 'p']]), [[3, 'new']])
    check('multiple fragments', solve([[[{'p': 'a'}, [{'v': 3}]], [{'p': 'b'}, [{'v': 4}]]], ['p', 'v']]), [['a', 3], ['b', 4]])
    check('empty fragment', solve([[[{'p': 'a'}, []]], ['p']]), [])
    check('missing projected', solve([[[{}, [{'v': 3}]]], ['v', 'x']]), [[3, None]])
    check('duplicate rows', solve([[[{}, [{'v': 3}, {'v': 3}]]], ['v']]), [[3], [3]])
    check('duplicate projection', solve([[[{}, [{'v': 3}]]], ['v', 'v']]), [[3, 3]])
    check('no fragments', solve([[], ['v']]), [])
elif N == 4:
    check('partition overrides', solve([[[{'p': 'new'}, [{'p': 'old', 'v': 4}]]], ['v', 'p']]), [[4, 'new']])
    check('multiple fragments', solve([[[{'p': 'a'}, [{'v': 4}]], [{'p': 'b'}, [{'v': 5}]]], ['p', 'v']]), [['a', 4], ['b', 5]])
    check('empty fragment', solve([[[{'p': 'a'}, []]], ['p']]), [])
    check('missing projected', solve([[[{}, [{'v': 4}]]], ['v', 'x']]), [[4, None]])
    check('duplicate rows', solve([[[{}, [{'v': 4}, {'v': 4}]]], ['v']]), [[4], [4]])
    check('duplicate projection', solve([[[{}, [{'v': 4}]]], ['v', 'v']]), [[4, 4]])
    check('no fragments', solve([[], ['v']]), [])
elif N == 5:
    check('partition overrides', solve([[[{'p': 'new'}, [{'p': 'old', 'v': 5}]]], ['v', 'p']]), [[5, 'new']])
    check('multiple fragments', solve([[[{'p': 'a'}, [{'v': 5}]], [{'p': 'b'}, [{'v': 6}]]], ['p', 'v']]), [['a', 5], ['b', 6]])
    check('empty fragment', solve([[[{'p': 'a'}, []]], ['p']]), [])
    check('missing projected', solve([[[{}, [{'v': 5}]]], ['v', 'x']]), [[5, None]])
    check('duplicate rows', solve([[[{}, [{'v': 5}, {'v': 5}]]], ['v']]), [[5], [5]])
    check('duplicate projection', solve([[[{}, [{'v': 5}]]], ['v', 'v']]), [[5, 5]])
    check('no fragments', solve([[], ['v']]), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A stale physical column overwrites its partition value.

Read ordered file fragments [partition-values,physical-rows] under a projection of field names. Partition values override stale physical columns of the same name; unprojected fields disappear, missing fields become None, and physically empty fragments do not synthesize rows.

split: open-access