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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not ((active | primitive) & bit): continue
            viewport=routes[view] if view<len(routes) else view
            if viewport is None: continue
            if viewport<0 or viewport>=len(scissors): continue
            viewport_clip=set(scissors[viewport]) if viewport in scissor_enabled else full
            visible=set(samples)&set(viewclips[view])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not (active & bit): continue
            viewport=routes[view] if view<len(routes) else view
            if viewport is None: continue
            if viewport<0 or viewport>=len(scissors): continue
            viewport_clip=set(scissors[viewport]) if viewport in scissor_enabled else full
            visible=set(samples)&set(viewclips[view])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A view renders when either global or primitive routing enables it instead of requiring both.

A draw provides per-view clip sets, active-view bits, primitive view bits, optional viewport routing, enabled viewport clips, and primitive sample coverage. A view renders only if both masks include it. Route entries select the viewport clip while preserving output view identity. A null viewport route suppresses that view; absent route defaults to matching view index. Disabled viewport scissor passes full extent.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not (active & bit and primitive & bit): continue
            viewport=view
            if viewport is None: continue
            if viewport<0 or viewport>=len(scissors): continue
            viewport_clip=set(scissors[viewport]) if viewport in scissor_enabled else full
            visible=set(samples)&set(viewclips[view])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not (active & bit and primitive & bit): continue
            viewport=routes[0] if routes else view
            if viewport is None: continue
            if viewport<0 or viewport>=len(scissors): continue
            viewport_clip=set(scissors[viewport]) if viewport in scissor_enabled else full
            visible=set(samples)&set(viewclips[view])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Each view uses its same-numbered viewport even when explicitly rerouted.

A draw provides per-view clip sets, active-view bits, primitive view bits, optional viewport routing, enabled viewport clips, and primitive sample coverage. A view renders only if both masks include it. Route entries select the viewport clip while preserving output view identity. A null viewport route suppresses that view; absent route defaults to matching view index. Disabled viewport scissor passes full extent.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not (active & bit and primitive & bit): continue
            viewport=routes[view] if view<len(routes) else view
            if viewport is None: viewport=view
            if viewport<0 or viewport>=len(scissors): continue
            viewport_clip=set(scissors[viewport]) if viewport in scissor_enabled else full
            visible=set(samples)&set(viewclips[view])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not (active & bit and primitive & bit): continue
            viewport=routes[view] if view<len(routes) else view
            if viewport is None: viewport=0
            if viewport<0 or viewport>=len(scissors): continue
            viewport_clip=set(scissors[viewport]) if viewport in scissor_enabled else full
            visible=set(samples)&set(viewclips[view])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
An explicit null route falls back to the view index rather than suppressing the view.

A draw provides per-view clip sets, active-view bits, primitive view bits, optional viewport routing, enabled viewport clips, and primitive sample coverage. A view renders only if both masks include it. Route entries select the viewport clip while preserving output view identity. A null viewport route suppresses that view; absent route defaults to matching view index. Disabled viewport scissor passes full extent.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not (active & bit and primitive & bit): continue
            viewport=routes[view] if view<len(routes) else view
            if viewport is None: continue
            if viewport>=len(scissors): continue
            viewport_clip=set(scissors[viewport]) if viewport in scissor_enabled else full
            visible=set(samples)&set(viewclips[view])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not (active & bit and primitive & bit): continue
            viewport=routes[view] if view<len(routes) else view
            if viewport is None: continue
            if viewport>=len(scissors): continue
            viewport=max(0,viewport)
            viewport_clip=set(scissors[viewport]) if viewport in scissor_enabled else full
            visible=set(samples)&set(viewclips[view])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Negative viewport IDs wrap around the Python list and obtain another viewport clip.

A draw provides per-view clip sets, active-view bits, primitive view bits, optional viewport routing, enabled viewport clips, and primitive sample coverage. A view renders only if both masks include it. Route entries select the viewport clip while preserving output view identity. A null viewport route suppresses that view; absent route defaults to matching view index. Disabled viewport scissor passes full extent.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not (active & bit and primitive & bit): continue
            viewport=routes[view] if view<len(routes) else view
            if viewport is None: continue
            if viewport<0 or viewport>=len(scissors): continue
            viewport_clip=set(scissors[viewport]) if view in scissor_enabled else full
            visible=set(samples)&set(viewclips[view])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not (active & bit and primitive & bit): continue
            viewport=routes[view] if view<len(routes) else view
            if viewport is None: continue
            if viewport<0 or viewport>=len(scissors): continue
            viewport_clip=set(scissors[viewport]) if scissor_enabled else full
            visible=set(samples)&set(viewclips[view])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Scissor enable state is looked up by output view instead of routed viewport.

A draw provides per-view clip sets, active-view bits, primitive view bits, optional viewport routing, enabled viewport clips, and primitive sample coverage. A view renders only if both masks include it. Route entries select the viewport clip while preserving output view identity. A null viewport route suppresses that view; absent route defaults to matching view index. Disabled viewport scissor passes full extent.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not (active & bit and primitive & bit): continue
            viewport=routes[view] if view<len(routes) else view
            if viewport is None: continue
            if viewport<0 or viewport>=len(scissors): continue
            viewport_clip=set(scissors[viewport]) if viewport in scissor_enabled else full
            visible=set(samples)&set(viewclips[viewport % len(viewclips)])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    out=[]
    for viewclips,active,primitive,routes,scissors,scissor_enabled,samples in commands:
        rendered=[]
        for view in range(len(viewclips)):
            bit=1<<view
            if not (active & bit and primitive & bit): continue
            viewport=routes[view] if view<len(routes) else view
            if viewport is None: continue
            if viewport<0 or viewport>=len(scissors): continue
            viewport_clip=set(scissors[viewport]) if viewport in scissor_enabled else full
            visible=set(samples)&set(viewclips[0])&viewport_clip&full
            rendered.append([view,sorted(visible)])
        out.append(rendered)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 4), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 4), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 4), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 4), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 4), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 4), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 4), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 4), [[[0, [0, 1, 2, 3]]]])
if N == 2:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 5), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 5), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 5), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 5), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 5), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 5), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 5), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 5), [[[0, [0, 1, 2, 3, 4]]]])
if N == 3:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 6), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 6), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 6), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 6), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 6), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 6), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 6), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 6), [[[0, [0, 1, 2, 3, 4, 5]]]])
if N == 4:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 7), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 7), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 7), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 7), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 7), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 7), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 7), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 7), [[[0, [0, 1, 2, 3, 4, 5, 6]]]])
if N == 5:
    check('explicit sequence 0', solve([[[[0], [1], [2]], 7, 7, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[0, [0]], [1, [1]], [2, [2]]]])
    check('explicit sequence 1', solve([[[[0], [1]], 1, 2, [], [[0], [1]], [0, 1], [0, 1]]], 8), [[]])
    check('explicit sequence 2', solve([[[[0, 1], [1, 2]], 3, 3, [1, 0], [[0], [1]], [0, 1], [0, 1, 2]]], 8), [[[0, [1]], [1, []]]])
    check('explicit sequence 3', solve([[[[0]], 1, 1, [None], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 4', solve([[[[0]], 1, 1, [-1], [[0]], [0], [0]]], 8), [[]])
    check('explicit sequence 5', solve([[[[0, 1], [0, 1]], 3, 3, [1, 0], [[0], [1]], [0], [0, 1]]], 8), [[[0, [0, 1]], [1, [0]]]])
    check('explicit sequence 6', solve([[[[0]], 1, 1, [0], [[]], [], [0]]], 8), [[[0, [0]]]])
    check('explicit sequence 7', solve([[[[0], [1], [2]], 4, 4, [], [[0], [1], [2]], [0, 1, 2], [0, 1, 2]]], 8), [[[2, [2]]]])
    check('explicit sequence 8', solve([[[[0, 99]], 1, 1, [0], [[0, 99]], [0], [0, 99]]], 8), [[[0, [0]]]])
    check('explicit sequence 9', solve([[[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], 1, 1, [], [[]], [], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]], 8), [[[0, [0, 1, 2, 3, 4, 5, 6, 7]]]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Rerouting the viewport also reroutes the per-view clip, losing view-local coverage.

A draw provides per-view clip sets, active-view bits, primitive view bits, optional viewport routing, enabled viewport clips, and primitive sample coverage. A view renders only if both masks include it. Route entries select the viewport clip while preserving output view identity. A null viewport route suppresses that view; absent route defaults to matching view index. Disabled viewport scissor passes full extent.

split: open-access