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

N = 1
observations = []
def solve(commands, size):
    out=[]
    for clips,culls,clip_mask,cull_mask,discard in commands:
        if discard or not clips: out.append('discarded'); continue
        reject=False
        partial=False
        for plane in range(size):
            if clip_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in clips]
                if all(x<0 for x in values): reject=True
                if any(x<0 for x in values): partial=True
            if cull_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else -1 for v in culls]
                if values and all(x<0 for x in values): reject=True
        out.append('discarded' if reject else 'clipped' if partial else 'accepted')
    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([[[[1], [1]], [[1], [1]], 1, 0, True]], 4), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 4), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 4), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 4), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 4), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 4), ['accepted'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 4), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 4), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 4), ['accepted'])
if N == 2:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 5), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 5), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 5), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 5), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 5), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 5), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 5), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 5), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 5), ['accepted'])
if N == 3:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 6), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 6), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 6), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 6), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 6), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 6), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 6), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 6), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 6), ['accepted'])
if N == 4:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 7), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 7), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 7), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 7), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 7), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 7), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 7), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 7), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 7), ['accepted'])
if N == 5:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 8), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 8), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 8), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 8), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 8), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 8), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 8), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 8), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 8), ['accepted'])
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):
    out=[]
    for clips,culls,clip_mask,cull_mask,discard in commands:
        if discard or not clips: out.append('discarded'); continue
        reject=False
        partial=False
        for plane in range(size):
            if clip_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in clips]
                if all(x<0 for x in values): reject=True
                if any(x<0 for x in values): partial=True
            if cull_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else (v[-1] if v else 0) for v in culls]
                if values and all(x<0 for x in values): reject=True
        out.append('discarded' if reject else 'clipped' if partial else 'accepted')
    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([[[[1], [1]], [[1], [1]], 1, 0, True]], 4), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 4), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 4), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 4), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 4), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 4), ['accepted'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 4), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 4), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 4), ['accepted'])
if N == 2:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 5), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 5), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 5), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 5), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 5), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 5), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 5), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 5), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 5), ['accepted'])
if N == 3:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 6), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 6), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 6), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 6), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 6), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 6), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 6), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 6), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 6), ['accepted'])
if N == 4:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 7), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 7), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 7), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 7), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 7), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 7), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 7), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 7), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 7), ['accepted'])
if N == 5:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 8), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 8), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 8), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 8), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 8), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 8), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 8), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 8), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 8), ['accepted'])
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:
Missing cull distances create false full-primitive rejection.

Each primitive carries per-vertex clip-distance and cull-distance arrays, active bitmasks and a raster-discard flag. A primitive is rejected if every vertex is negative on any one enabled clip or cull plane. Surviving primitives need clipping if any enabled clip distance is negative; cull distances never cause partial clipping. Missing components default to zero and disabled plane bits are ignored. Empty primitives and raster-discarded primitives emit discarded. Only low size plane slots exist.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    out=[]
    for clips,culls,clip_mask,cull_mask,discard in commands:
        if discard or not clips: out.append('discarded'); continue
        reject=False
        partial=False
        for plane in range(size):
            if clip_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in clips]
                if all(x<0 for x in values): reject=True
                if any(x<0 for x in values): partial=True
            if clip_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in culls]
                if values and all(x<0 for x in values): reject=True
        out.append('discarded' if reject else 'clipped' if partial else 'accepted')
    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([[[[1], [1]], [[1], [1]], 1, 0, True]], 4), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 4), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 4), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 4), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 4), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 4), ['accepted'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 4), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 4), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 4), ['accepted'])
if N == 2:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 5), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 5), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 5), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 5), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 5), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 5), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 5), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 5), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 5), ['accepted'])
if N == 3:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 6), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 6), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 6), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 6), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 6), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 6), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 6), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 6), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 6), ['accepted'])
if N == 4:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 7), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 7), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 7), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 7), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 7), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 7), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 7), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 7), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 7), ['accepted'])
if N == 5:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 8), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 8), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 8), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 8), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 8), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 8), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 8), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 8), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 8), ['accepted'])
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):
    out=[]
    for clips,culls,clip_mask,cull_mask,discard in commands:
        if discard or not clips: out.append('discarded'); continue
        reject=False
        partial=False
        for plane in range(size):
            if clip_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in clips]
                if all(x<0 for x in values): reject=True
                if any(x<0 for x in values): partial=True
            if (clip_mask|cull_mask) & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in culls]
                if values and all(x<0 for x in values): reject=True
        out.append('discarded' if reject else 'clipped' if partial else 'accepted')
    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([[[[1], [1]], [[1], [1]], 1, 0, True]], 4), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 4), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 4), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 4), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 4), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 4), ['accepted'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 4), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 4), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 4), ['accepted'])
if N == 2:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 5), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 5), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 5), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 5), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 5), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 5), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 5), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 5), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 5), ['accepted'])
if N == 3:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 6), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 6), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 6), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 6), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 6), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 6), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 6), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 6), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 6), ['accepted'])
if N == 4:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 7), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 7), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 7), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 7), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 7), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 7), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 7), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 7), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 7), ['accepted'])
if N == 5:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 8), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 8), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 8), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 8), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 8), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 8), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 8), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 8), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 8), ['accepted'])
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:
Cull plane activation incorrectly reuses the clip-distance enable mask.

Each primitive carries per-vertex clip-distance and cull-distance arrays, active bitmasks and a raster-discard flag. A primitive is rejected if every vertex is negative on any one enabled clip or cull plane. Surviving primitives need clipping if any enabled clip distance is negative; cull distances never cause partial clipping. Missing components default to zero and disabled plane bits are ignored. Empty primitives and raster-discarded primitives emit discarded. Only low size plane slots exist.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    out=[]
    for clips,culls,clip_mask,cull_mask,discard in commands:
        if discard or not clips: out.append('discarded'); continue
        reject=False
        partial=False
        for plane in range(size):
            if cull_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in clips]
                if all(x<0 for x in values): reject=True
                if any(x<0 for x in values): partial=True
            if cull_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in culls]
                if values and all(x<0 for x in values): reject=True
        out.append('discarded' if reject else 'clipped' if partial else 'accepted')
    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([[[[1], [1]], [[1], [1]], 1, 0, True]], 4), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 4), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 4), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 4), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 4), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 4), ['accepted'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 4), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 4), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 4), ['accepted'])
if N == 2:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 5), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 5), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 5), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 5), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 5), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 5), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 5), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 5), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 5), ['accepted'])
if N == 3:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 6), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 6), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 6), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 6), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 6), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 6), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 6), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 6), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 6), ['accepted'])
if N == 4:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 7), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 7), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 7), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 7), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 7), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 7), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 7), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 7), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 7), ['accepted'])
if N == 5:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 8), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 8), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 8), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 8), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 8), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 8), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 8), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 8), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 8), ['accepted'])
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):
    out=[]
    for clips,culls,clip_mask,cull_mask,discard in commands:
        if discard or not clips: out.append('discarded'); continue
        reject=False
        partial=False
        for plane in range(size):
            if (clip_mask|cull_mask) & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in clips]
                if all(x<0 for x in values): reject=True
                if any(x<0 for x in values): partial=True
            if cull_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in culls]
                if values and all(x<0 for x in values): reject=True
        out.append('discarded' if reject else 'clipped' if partial else 'accepted')
    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([[[[1], [1]], [[1], [1]], 1, 0, True]], 4), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 4), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 4), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 4), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 4), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 4), ['accepted'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 4), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 4), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 4), ['accepted'])
if N == 2:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 5), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 5), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 5), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 5), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 5), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 5), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 5), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 5), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 5), ['accepted'])
if N == 3:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 6), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 6), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 6), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 6), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 6), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 6), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 6), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 6), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 6), ['accepted'])
if N == 4:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 7), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 7), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 7), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 7), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 7), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 7), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 7), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 7), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 7), ['accepted'])
if N == 5:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 8), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 8), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 8), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 8), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 8), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 8), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 8), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 8), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 8), ['accepted'])
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:
Clip-plane activation incorrectly depends on cull-distance enables.

Each primitive carries per-vertex clip-distance and cull-distance arrays, active bitmasks and a raster-discard flag. A primitive is rejected if every vertex is negative on any one enabled clip or cull plane. Surviving primitives need clipping if any enabled clip distance is negative; cull distances never cause partial clipping. Missing components default to zero and disabled plane bits are ignored. Empty primitives and raster-discarded primitives emit discarded. Only low size plane slots exist.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    out=[]
    for clips,culls,clip_mask,cull_mask,discard in commands:
        if discard or not clips: out.append('discarded'); continue
        reject=False
        partial=False
        for plane in range(size):
            if clip_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in clips]
                if all(x<0 for x in values): reject=True
                if any(x<0 for x in values): partial=True
            if cull_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in culls]
                if values and all(x<0 for x in values): reject=True
        out.append('clipped' if partial else 'discarded' if reject else 'accepted')
    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([[[[1], [1]], [[1], [1]], 1, 0, True]], 4), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 4), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 4), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 4), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 4), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 4), ['accepted'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 4), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 4), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 4), ['accepted'])
if N == 2:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 5), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 5), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 5), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 5), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 5), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 5), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 5), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 5), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 5), ['accepted'])
if N == 3:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 6), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 6), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 6), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 6), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 6), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 6), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 6), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 6), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 6), ['accepted'])
if N == 4:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 7), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 7), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 7), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 7), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 7), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 7), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 7), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 7), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 7), ['accepted'])
if N == 5:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 8), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 8), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 8), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 8), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 8), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 8), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 8), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 8), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 8), ['accepted'])
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):
    out=[]
    for clips,culls,clip_mask,cull_mask,discard in commands:
        if discard or not clips: out.append('discarded'); continue
        reject=False
        partial=False
        for plane in range(size):
            if clip_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in clips]
                if all(x<0 for x in values): reject=True
                if any(x<0 for x in values): partial=True
            if cull_mask & (1<<plane):
                values=[v[plane] if plane<len(v) else 0 for v in culls]
                if values and all(x<0 for x in values): reject=True
        out.append('discarded' if reject and not partial else 'clipped' if partial else 'accepted')
    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([[[[1], [1]], [[1], [1]], 1, 0, True]], 4), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 4), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 4), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 4), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 4), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 4), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 4), ['accepted'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 4), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 4), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 4), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 4), ['accepted'])
if N == 2:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 5), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 5), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 5), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 5), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 5), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 5), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 5), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 5), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 5), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 5), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 5), ['accepted'])
if N == 3:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 6), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 6), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 6), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 6), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 6), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 6), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 6), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 6), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 6), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 6), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 6), ['accepted'])
if N == 4:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 7), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 7), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 7), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 7), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 7), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 7), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 7), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 7), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 7), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 7), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 7), ['accepted'])
if N == 5:
    check('explicit sequence 0', solve([[[[1], [1]], [[1], [1]], 1, 0, True]], 8), ['discarded'])
    check('explicit sequence 1', solve([[[[-1], [1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 2', solve([[[[1], [-1]], [[0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 3', solve([[[[1], [1]], [[-3], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 4', solve([[[[1], [1]], [[-1], [1]], 0, 1, False]], 8), ['accepted'])
    check('explicit sequence 5', solve([[[[-1], [-1]], [[0], [0]], 2, 0, False]], 8), ['accepted'])
    check('explicit sequence 6', solve([[[[0], [0]], [[-1], [-1]], 0, 2, False]], 8), ['accepted'])
    check('explicit sequence 7', solve([[[[1], [1]], [[-1], [-1]], 0, 1, False]], 8), ['discarded'])
    check('explicit sequence 8', solve([[[[-1], [1]], [[-1], [-1]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 9', solve([[[[-1, 1], [1, 1]], [[-1], [-1]], 1, 1, False]], 8), ['discarded'])
    check('explicit sequence 10', solve([[[[1, 1, 1, 1, -1], [1, 1, 1, 1, -1]], [[0], [0]], 16, 0, False]], 8), ['discarded'])
    check('explicit sequence 11', solve([[[], [], 0, 0, False]], 8), ['discarded'])
    check('explicit sequence 12', solve([[[[0], [0]], [[0], [0]], 1, 1, False]], 8), ['accepted'])
    check('explicit sequence 13', solve([[[[-1], [-1], [1]], [[0], [0], [0]], 1, 0, False]], 8), ['clipped'])
    check('explicit sequence 14', solve([[[[-1], [1]], [[0], [0]], 0, 1, False]], 8), ['accepted'])
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:
Partial clipping overrides a rejection by another active plane.

Each primitive carries per-vertex clip-distance and cull-distance arrays, active bitmasks and a raster-discard flag. A primitive is rejected if every vertex is negative on any one enabled clip or cull plane. Surviving primitives need clipping if any enabled clip distance is negative; cull distances never cause partial clipping. Missing components default to zero and disabled plane bits are ignored. Empty primitives and raster-discarded primitives emit discarded. Only low size plane slots exist.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    out=[]
    full=set(range(size))
    for numerator,denominator,rank,rotation,geometry,enabled,shader,alpha_enabled in commands:
        count=max(0,min(size,(numerator//denominator)*size)) if alpha_enabled else size
        ordering=[x for x in rank if x in full]
        selected={ordering[i] for i in range(min(count,len(ordering)))}
        selected={(x+rotation)%size for x in selected}
        geometric=set(geometry)&full
        fixed=set(enabled)&full
        shader_mask=full if shader is None else set(shader)&full
        out.append(sorted(selected & geometric & fixed & shader_mask))
    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([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[0, 1]])
    check('explicit sequence 1', solve([[1, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[]])
    check('explicit sequence 2', solve([[2, 3, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[0, 1]])
    check('explicit sequence 3', solve([[1, 3, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[3]])
    check('explicit sequence 4', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[1, 2]])
    check('explicit sequence 5', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], -1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[0, 3]])
    check('explicit sequence 6', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, False]], 4), [[0, 1, 2, 3]])
    check('explicit sequence 7', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [], True]], 4), [[]])
    check('explicit sequence 8', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[]])
    check('explicit sequence 9', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0], [1], True]], 4), [[]])
    check('explicit sequence 10', solve([[3, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[0, 1, 2, 3]])
if N == 2:
    check('explicit sequence 0', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[0, 1]])
    check('explicit sequence 1', solve([[1, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[]])
    check('explicit sequence 2', solve([[2, 3, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[0, 1, 2]])
    check('explicit sequence 3', solve([[1, 3, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[4]])
    check('explicit sequence 4', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[1, 2]])
    check('explicit sequence 5', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], -1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[0, 4]])
    check('explicit sequence 6', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, False]], 5), [[0, 1, 2, 3, 4]])
    check('explicit sequence 7', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [], True]], 5), [[]])
    check('explicit sequence 8', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[]])
    check('explicit sequence 9', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0], [1], True]], 5), [[]])
    check('explicit sequence 10', solve([[3, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[0, 1, 2, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[0, 1, 2]])
    check('explicit sequence 1', solve([[1, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[]])
    check('explicit sequence 2', solve([[2, 3, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[0, 1, 2, 3]])
    check('explicit sequence 3', solve([[1, 3, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[4, 5]])
    check('explicit sequence 4', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[1, 2, 3]])
    check('explicit sequence 5', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], -1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[0, 1, 5]])
    check('explicit sequence 6', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, False]], 6), [[0, 1, 2, 3, 4, 5]])
    check('explicit sequence 7', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [], True]], 6), [[]])
    check('explicit sequence 8', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[]])
    check('explicit sequence 9', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0], [1], True]], 6), [[]])
    check('explicit sequence 10', solve([[3, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[0, 1, 2, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[0, 1, 2]])
    check('explicit sequence 1', solve([[1, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[0]])
    check('explicit sequence 2', solve([[2, 3, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[0, 1, 2, 3]])
    check('explicit sequence 3', solve([[1, 3, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[5, 6]])
    check('explicit sequence 4', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[1, 2, 3]])
    check('explicit sequence 5', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], -1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[0, 1, 6]])
    check('explicit sequence 6', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, False]], 7), [[0, 1, 2, 3, 4, 5, 6]])
    check('explicit sequence 7', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [], True]], 7), [[]])
    check('explicit sequence 8', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[]])
    check('explicit sequence 9', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0], [1], True]], 7), [[]])
    check('explicit sequence 10', solve([[3, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[0, 1, 2, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[0, 1, 2, 3]])
    check('explicit sequence 1', solve([[1, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[0]])
    check('explicit sequence 2', solve([[2, 3, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[0, 1, 2, 3, 4]])
    check('explicit sequence 3', solve([[1, 3, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[6, 7]])
    check('explicit sequence 4', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[1, 2, 3, 4]])
    check('explicit sequence 5', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], -1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[0, 1, 2, 7]])
    check('explicit sequence 6', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, False]], 8), [[0, 1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 7', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [], True]], 8), [[]])
    check('explicit sequence 8', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[]])
    check('explicit sequence 9', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0], [1], True]], 8), [[]])
    check('explicit sequence 10', solve([[3, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[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):
    out=[]
    full=set(range(size))
    for numerator,denominator,rank,rotation,geometry,enabled,shader,alpha_enabled in commands:
        count=max(0,min(size,round(numerator/denominator)*size)) if alpha_enabled else size
        ordering=[x for x in rank if x in full]
        selected={ordering[i] for i in range(min(count,len(ordering)))}
        selected={(x+rotation)%size for x in selected}
        geometric=set(geometry)&full
        fixed=set(enabled)&full
        shader_mask=full if shader is None else set(shader)&full
        out.append(sorted(selected & geometric & fixed & shader_mask))
    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([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[0, 1]])
    check('explicit sequence 1', solve([[1, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[]])
    check('explicit sequence 2', solve([[2, 3, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[0, 1]])
    check('explicit sequence 3', solve([[1, 3, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[3]])
    check('explicit sequence 4', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[1, 2]])
    check('explicit sequence 5', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], -1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[0, 3]])
    check('explicit sequence 6', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, False]], 4), [[0, 1, 2, 3]])
    check('explicit sequence 7', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [], True]], 4), [[]])
    check('explicit sequence 8', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[]])
    check('explicit sequence 9', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0], [1], True]], 4), [[]])
    check('explicit sequence 10', solve([[3, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 4), [[0, 1, 2, 3]])
if N == 2:
    check('explicit sequence 0', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[0, 1]])
    check('explicit sequence 1', solve([[1, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[]])
    check('explicit sequence 2', solve([[2, 3, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[0, 1, 2]])
    check('explicit sequence 3', solve([[1, 3, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[4]])
    check('explicit sequence 4', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[1, 2]])
    check('explicit sequence 5', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], -1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[0, 4]])
    check('explicit sequence 6', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, False]], 5), [[0, 1, 2, 3, 4]])
    check('explicit sequence 7', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [], True]], 5), [[]])
    check('explicit sequence 8', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[]])
    check('explicit sequence 9', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0], [1], True]], 5), [[]])
    check('explicit sequence 10', solve([[3, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 5), [[0, 1, 2, 3, 4]])
if N == 3:
    check('explicit sequence 0', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[0, 1, 2]])
    check('explicit sequence 1', solve([[1, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[]])
    check('explicit sequence 2', solve([[2, 3, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[0, 1, 2, 3]])
    check('explicit sequence 3', solve([[1, 3, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[4, 5]])
    check('explicit sequence 4', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[1, 2, 3]])
    check('explicit sequence 5', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], -1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[0, 1, 5]])
    check('explicit sequence 6', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, False]], 6), [[0, 1, 2, 3, 4, 5]])
    check('explicit sequence 7', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [], True]], 6), [[]])
    check('explicit sequence 8', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[]])
    check('explicit sequence 9', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0], [1], True]], 6), [[]])
    check('explicit sequence 10', solve([[3, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 6), [[0, 1, 2, 3, 4, 5]])
if N == 4:
    check('explicit sequence 0', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[0, 1, 2]])
    check('explicit sequence 1', solve([[1, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[0]])
    check('explicit sequence 2', solve([[2, 3, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[0, 1, 2, 3]])
    check('explicit sequence 3', solve([[1, 3, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[5, 6]])
    check('explicit sequence 4', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[1, 2, 3]])
    check('explicit sequence 5', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], -1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[0, 1, 6]])
    check('explicit sequence 6', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, False]], 7), [[0, 1, 2, 3, 4, 5, 6]])
    check('explicit sequence 7', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [], True]], 7), [[]])
    check('explicit sequence 8', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[]])
    check('explicit sequence 9', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0], [1], True]], 7), [[]])
    check('explicit sequence 10', solve([[3, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 7), [[0, 1, 2, 3, 4, 5, 6]])
if N == 5:
    check('explicit sequence 0', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[0, 1, 2, 3]])
    check('explicit sequence 1', solve([[1, 7, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[0]])
    check('explicit sequence 2', solve([[2, 3, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[0, 1, 2, 3, 4]])
    check('explicit sequence 3', solve([[1, 3, [9, 8, 7, 6, 5, 4, 3, 2, 1, 0], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[6, 7]])
    check('explicit sequence 4', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[1, 2, 3, 4]])
    check('explicit sequence 5', solve([[1, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], -1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[0, 1, 2, 7]])
    check('explicit sequence 6', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, False]], 8), [[0, 1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 7', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [], True]], 8), [[]])
    check('explicit sequence 8', solve([[0, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[]])
    check('explicit sequence 9', solve([[1, 1, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0], [1], True]], 8), [[]])
    check('explicit sequence 10', solve([[3, 2, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], None, True]], 8), [[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:
Integer division discards fractional alpha before converting it to sample coverage.

Each command supplies alpha numerator over denominator, a permutation ranking the physical samples, rotation, geometric sample mask, fixed enable mask and optional shader mask. Alpha selects floor(alpha*size) ranks, clamped to [0,size]; alpha-disabled commands select all ranks. Rotate selected physical sample IDs modulo size, then intersect masks. A missing shader mask passes all samples; an explicit empty mask passes none. Return sorted surviving sample IDs.

split: open-access