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*size+denominator-1)//denominator)) 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*size/denominator))) 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:
Upward coverage rounding selects an extra sample below the next rank threshold.

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


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*size)//denominator)) if alpha_enabled else size
        ordering=sorted(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)

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=[]
    full=set(range(size))
    for numerator,denominator,rank,rotation,geometry,enabled,shader,alpha_enabled in commands:
        count=max(0,min(size,(numerator*size)//denominator)) if alpha_enabled else size
        ordering=list(reversed([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:
Sorting rank IDs destroys the supplied alpha coverage permutation.

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


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*size)//denominator)) if alpha_enabled else size
        ordering=[x for x in rank if x in full]
        selected={ordering[-1-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,(numerator*size)//denominator)) if alpha_enabled else size
        ordering=[x for x in rank if x in full]
        selected={ordering[i] for i in range(max(0,len(ordering)-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:
Alpha covers the last ranks instead of the first ranks.

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


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*size)//denominator)) 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,(numerator*size)//denominator)) 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+abs(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:
The coverage dither rotation moves selected sample IDs in the opposite direction.

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