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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=set(cmd[2]) & full
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear()
        elif op=='disable': enabled=False
        elif op=='enable': enabled=True
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]!=revision:
                cache[active]=(revision,set(defs.get(active,set())))
            out.append(sorted(cache[active][1] if enabled else full))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=set(cmd[2]) & full
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear(); cache.pop(None,None)
        elif op=='disable': enabled=False
        elif op=='enable': enabled=True
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]!=revision:
                cache[active]=(revision,set(defs.get(active,set())))
            out.append(sorted(cache[active][1] if enabled else full))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
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:
Clearing all masks retains valid-looking cache entries.

Cache entries store copied coverage and source revisions. Draw recomputes after mask edits. Disable returns full coverage without overwriting cached mask. Rebinding to another name cannot reuse the old name; clearing definitions removes stale entries. Missing definitions clip empty.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=set(cmd[2]) & full
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear(); cache.clear()
        elif op=='disable': enabled=False
        elif op=='enable': enabled=True
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]!=revision:
                cache[active]=(revision,set(defs.get(active,set())))
            out.append(sorted(cache[active][1]))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=set(cmd[2]) & full
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear(); cache.clear()
        elif op=='disable': enabled=False
        elif op=='enable': enabled=True
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]!=revision:
                cache[active]=(revision,set(defs.get(active,set())))
            out.append(sorted(cache[active][1] if enabled else set()))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
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:
Drawing with clipping disabled still uses cached coverage.

Cache entries store copied coverage and source revisions. Draw recomputes after mask edits. Disable returns full coverage without overwriting cached mask. Rebinding to another name cannot reuse the old name; clearing definitions removes stale entries. Missing definitions clip empty.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=set(cmd[2]) & full
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear(); cache.clear()
        elif op=='disable': enabled=False
        elif op=='enable': enabled=False
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]!=revision:
                cache[active]=(revision,set(defs.get(active,set())))
            out.append(sorted(cache[active][1] if enabled else full))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=set(cmd[2]) & full
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear(); cache.clear()
        elif op=='disable': enabled=False
        elif op=='enable': enabled=True; defs[active]=set(full); revs[active]=revs.get(active,0)+1
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]!=revision:
                cache[active]=(revision,set(defs.get(active,set())))
            out.append(sorted(cache[active][1] if enabled else full))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
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:
Re-enabling leaves the cache bypass active.

Cache entries store copied coverage and source revisions. Draw recomputes after mask edits. Disable returns full coverage without overwriting cached mask. Rebinding to another name cannot reuse the old name; clearing definitions removes stale entries. Missing definitions clip empty.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=set(cmd[2]) & full
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear(); cache.clear()
        elif op=='disable': enabled=False
        elif op=='enable': enabled=True
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]!=revision:
                cache[active]=(revision,set(defs.get(active,full)))
            out.append(sorted(cache[active][1] if enabled else full))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=set(cmd[2]) & full
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear(); cache.clear()
        elif op=='disable': enabled=False
        elif op=='enable': enabled=True
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]!=revision:
                cache[active]=(revision,set(defs.get(active,full if active is not None else set())))
            out.append(sorted(cache[active][1] if enabled else full))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A cache miss for an undefined mask populates full coverage.

Cache entries store copied coverage and source revisions. Draw recomputes after mask edits. Disable returns full coverage without overwriting cached mask. Rebinding to another name cannot reuse the old name; clearing definitions removes stale entries. Missing definitions clip empty.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=set(cmd[2]) & full
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear(); cache.clear()
        elif op=='disable': enabled=False
        elif op=='enable': enabled=True
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]>revision:
                cache[active]=(revision,set(defs.get(active,set())))
            out.append(sorted(cache[active][1] if enabled else full))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=set(cmd[2]) & full
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear(); cache.clear()
        elif op=='disable': enabled=False
        elif op=='enable': enabled=True
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]+1<revision:
                cache[active]=(revision,set(defs.get(active,set())))
            out.append(sorted(cache[active][1] if enabled else full))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
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:
Cache invalidation compares revisions in the wrong direction.

Cache entries store copied coverage and source revisions. Draw recomputes after mask edits. Disable returns full coverage without overwriting cached mask. Rebinding to another name cannot reuse the old name; clearing definitions removes stale entries. Missing definitions clip empty.

split: open-access


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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=defs.get(cmd[1],set()) | (set(cmd[2]) & full)
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear(); cache.clear()
        elif op=='disable': enabled=False
        elif op=='enable': enabled=True
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]!=revision:
                cache[active]=(revision,set(defs.get(active,set())))
            out.append(sorted(cache[active][1] if enabled else full))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    defs={}
    revs={}
    cache={}
    active=None
    enabled=True
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op=='set':
            defs[cmd[1]]=(defs.get(cmd[1],full) & set(cmd[2])) & full
            revs[cmd[1]]=revs.get(cmd[1],0)+1
        elif op=='bind': active=cmd[1]
        elif op=='drop':
            defs.pop(cmd[1],None)
            cache.pop(cmd[1],None)
        elif op=='invalidate': cache.pop(cmd[1],None)
        elif op=='clear': defs.clear(); cache.clear()
        elif op=='disable': enabled=False
        elif op=='enable': enabled=True
        elif op=='draw':
            revision=revs.get(active,0)
            if active not in cache or cache[active][0]!=revision:
                cache[active]=(revision,set(defs.get(active,set())))
            out.append(sorted(cache[active][1] if enabled else full))
    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([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 4), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 4), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 4), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 4), [[0], [0, 1, 2, 3], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 4), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 4), [[0], []])
if N == 2:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 5), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 5), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 5), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 5), [[0], [0, 1, 2, 3, 4], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 5), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 5), [[0], []])
if N == 3:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 6), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 6), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 6), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 6), [[0], [0, 1, 2, 3, 4, 5], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 6), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 6), [[0], []])
if N == 4:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 7), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 7), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 7), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 7), [[0], [0, 1, 2, 3, 4, 5, 6], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 7), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 7), [[0], []])
if N == 5:
    check('explicit sequence 0', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['set', 'a', [1]], ['draw']], 8), [[0], [1]])
    check('explicit sequence 1', solve([['set', 'a', [0]], ['set', 'b', [2]], ['bind', 'b'], ['draw']], 8), [[2]])
    check('explicit sequence 2', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
    check('explicit sequence 3', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['clear'], ['draw']], 8), [[0], []])
    check('explicit sequence 4', solve([['set', 'a', [0]], ['bind', 'a'], ['draw'], ['disable'], ['draw'], ['enable'], ['draw']], 8), [[0], [0, 1, 2, 3, 4, 5, 6, 7], [0]])
    check('explicit sequence 5', solve([['bind', 'missing'], ['draw']], 8), [[]])
    check('explicit sequence 6', solve([['set', 'a', [0, 99]], ['bind', 'a'], ['draw'], ['invalidate', 'a'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 7', solve([['set', 'a', []], ['bind', 'a'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['set', 'a', [0]], ['set', 'b', [1]], ['bind', 'a'], ['draw'], ['drop', 'a'], ['draw']], 8), [[0], []])
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:
Replacing a mask definition merges coverage into the previous definition.

Cache entries store copied coverage and source revisions. Draw recomputes after mask edits. Disable returns full coverage without overwriting cached mask. Rebinding to another name cannot reuse the old name; clearing definitions removes stale entries. Missing definitions clip empty.

split: open-access