FAILURE MAP
← Case archive

FA-51276 / Raster clipping / Open access

Overlap count clip regions: parity threshold · case 01

Odd clipping rejects triple coverage.

Verified by executionVariant 1 · 12 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Odd clipping rejects triple coverage.

VERIFIED REPAIR

Apply the documented state transition at parity threshold. Sources contribute unique sample sets to an overlap-count clip. Replacing a source first removes its old contribution. Removing an unknown source is inert. Coverage may select union, exactly-one, at-least-two or odd count. Moving a source translates its retained original sample set before clipping to the target, allowing previously exterior samples to enter. Draw emits selected finite samples.

Unsuccessful approach: Accepting all nonzero counts includes even overlap.

Case contract

Sources contribute unique sample sets to an overlap-count clip. Replacing a source first removes its old contribution. Removing an unknown source is inert. Coverage may select union, exactly-one, at-least-two or odd count. Moving a source translates its retained original sample set before clipping to the target, allowing previously exterior samples to enter. Draw emits selected finite samples.

Why this case matters

Raster clip state can leak coverage across draws even when every individual region is valid.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    sources={}
    counts={x:0 for x in full}
    mode='union'
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op in ('put','move','remove'):
            key=cmd[1]
            old=sources.get(key,set())
            for x in old & full: counts[x]-=1
            if op=='put': new=set(cmd[2])
            elif op=='move': new={x+cmd[2] for x in old}
            else: new=set()
            if op=='remove': sources.pop(key,None)
            else: sources[key]=new
            for x in new & full: counts[x]+=1
        elif op=='mode': mode=cmd[1]
        elif op=='draw':
            if mode=='union': selected=[x for x in full if counts[x]>0]
            elif mode=='single': selected=[x for x in full if counts[x]==1]
            elif mode=='overlap': selected=[x for x in full if counts[x]>=2]
            else: selected=[x for x in full if counts[x]==1]
            out.append(sorted(selected))
    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([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 4), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 4), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 4), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 4), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 4), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 4), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 4), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 4), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 4), [[0, 1, 2, 3]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 4), [[0, 1]])
if N == 2:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 5), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 5), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 5), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 5), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 5), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 5), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 5), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 5), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 5), [[0, 1, 2, 3, 4]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 5), [[0, 1]])
if N == 3:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 6), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 6), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 6), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 6), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 6), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 6), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 6), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 6), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 6), [[0, 1, 2, 3, 4, 5]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 6), [[0, 1]])
if N == 4:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 7), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 7), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 7), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 7), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 7), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 7), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 7), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 7), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 7), [[0, 1, 2, 3, 4, 5, 6]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 7), [[0, 1]])
if N == 5:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 8), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 8), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 8), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 8), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 8), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 8), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 8), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 8), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 8), [[0, 1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 8), [[0, 1]])
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)
Boundary fixtureActualExpectedOutcome
explicit sequence 0[[2]][[2]]Passed
explicit sequence 1[[0]][[0]]Passed
explicit sequence 2[[1]][[1]]Passed
explicit sequence 3[[1]][[1]]Passed
explicit sequence 4[[0]][[0]]Passed
explicit sequence 5[[0]][[0]]Passed
explicit sequence 6[[0]][[0]]Passed
explicit sequence 7[[]][[]]Passed
explicit sequence 8[[0], []][[0], [0]]Failed
explicit sequence 9[[]][[]]Passed
explicit sequence 10[[0, 1, 2, 3]][[0, 1, 2, 3]]Passed
explicit sequence 11[[0, 1]][[0, 1]]Passed

SHA-256 / ca9f86cc8ab7d8737327ec50983f6919b0e9725988b0e05f5e1c901d14c516f2

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    sources={}
    counts={x:0 for x in full}
    mode='union'
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op in ('put','move','remove'):
            key=cmd[1]
            old=sources.get(key,set())
            for x in old & full: counts[x]-=1
            if op=='put': new=set(cmd[2])
            elif op=='move': new={x+cmd[2] for x in old}
            else: new=set()
            if op=='remove': sources.pop(key,None)
            else: sources[key]=new
            for x in new & full: counts[x]+=1
        elif op=='mode': mode=cmd[1]
        elif op=='draw':
            if mode=='union': selected=[x for x in full if counts[x]>0]
            elif mode=='single': selected=[x for x in full if counts[x]==1]
            elif mode=='overlap': selected=[x for x in full if counts[x]>=2]
            else: selected=[x for x in full if counts[x]>0]
            out.append(sorted(selected))
    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([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 4), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 4), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 4), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 4), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 4), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 4), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 4), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 4), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 4), [[0, 1, 2, 3]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 4), [[0, 1]])
if N == 2:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 5), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 5), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 5), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 5), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 5), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 5), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 5), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 5), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 5), [[0, 1, 2, 3, 4]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 5), [[0, 1]])
if N == 3:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 6), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 6), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 6), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 6), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 6), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 6), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 6), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 6), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 6), [[0, 1, 2, 3, 4, 5]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 6), [[0, 1]])
if N == 4:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 7), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 7), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 7), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 7), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 7), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 7), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 7), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 7), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 7), [[0, 1, 2, 3, 4, 5, 6]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 7), [[0, 1]])
if N == 5:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 8), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 8), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 8), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 8), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 8), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 8), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 8), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 8), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 8), [[0, 1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 8), [[0, 1]])
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)
Boundary fixtureActualExpectedOutcome
explicit sequence 0[[2]][[2]]Passed
explicit sequence 1[[0]][[0]]Passed
explicit sequence 2[[1]][[1]]Passed
explicit sequence 3[[1]][[1]]Passed
explicit sequence 4[[0]][[0]]Passed
explicit sequence 5[[0]][[0]]Passed
explicit sequence 6[[0]][[0]]Passed
explicit sequence 7[[]][[]]Passed
explicit sequence 8[[0], [0]][[0], [0]]Passed
explicit sequence 9[[0]][[]]Failed
explicit sequence 10[[0, 1, 2, 3]][[0, 1, 2, 3]]Passed
explicit sequence 11[[0, 1]][[0, 1]]Passed

SHA-256 / 15c63e44babc14af2fcf575015500a22894f5fe250f7164874b934d7c4b4972a

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(commands, size):
    full=set(range(size))
    sources={}
    counts={x:0 for x in full}
    mode='union'
    out=[]
    for cmd in commands:
        op=cmd[0]
        if op in ('put','move','remove'):
            key=cmd[1]
            old=sources.get(key,set())
            for x in old & full: counts[x]-=1
            if op=='put': new=set(cmd[2])
            elif op=='move': new={x+cmd[2] for x in old}
            else: new=set()
            if op=='remove': sources.pop(key,None)
            else: sources[key]=new
            for x in new & full: counts[x]+=1
        elif op=='mode': mode=cmd[1]
        elif op=='draw':
            if mode=='union': selected=[x for x in full if counts[x]>0]
            elif mode=='single': selected=[x for x in full if counts[x]==1]
            elif mode=='overlap': selected=[x for x in full if counts[x]>=2]
            else: selected=[x for x in full if counts[x]%2==1]
            out.append(sorted(selected))
    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([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 4), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 4), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 4), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 4), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 4), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 4), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 4), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 4), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 4), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 4), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 4), [[0, 1, 2, 3]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 4), [[0, 1]])
if N == 2:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 5), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 5), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 5), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 5), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 5), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 5), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 5), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 5), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 5), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 5), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 5), [[0, 1, 2, 3, 4]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 5), [[0, 1]])
if N == 3:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 6), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 6), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 6), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 6), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 6), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 6), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 6), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 6), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 6), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 6), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 6), [[0, 1, 2, 3, 4, 5]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 6), [[0, 1]])
if N == 4:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 7), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 7), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 7), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 7), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 7), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 7), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 7), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 7), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 7), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 7), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 7), [[0, 1, 2, 3, 4, 5, 6]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 7), [[0, 1]])
if N == 5:
    check('explicit sequence 0', solve([['put', 'a', [0, 1]], ['put', 'a', [2]], ['draw']], 8), [[2]])
    check('explicit sequence 1', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['draw']], 8), [[0]])
    check('explicit sequence 2', solve([['put', 'a', [-1]], ['move', 'a', 2], ['draw']], 8), [[1]])
    check('explicit sequence 3', solve([['put', 'a', [2]], ['move', 'a', -1], ['draw']], 8), [[1]])
    check('explicit sequence 4', solve([['put', 'a', [0]], ['put', 'b', [0]], ['remove', 'a'], ['remove', 'a'], ['draw']], 8), [[0]])
    check('explicit sequence 5', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'overlap'], ['draw']], 8), [[0]])
    check('explicit sequence 6', solve([['put', 'a', [0]], ['mode', 'single'], ['draw']], 8), [[0]])
    check('explicit sequence 7', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'single'], ['draw']], 8), [[]])
    check('explicit sequence 8', solve([['put', 'a', [0]], ['put', 'b', [0]], ['put', 'c', [0]], ['mode', 'overlap'], ['draw'], ['mode', 'odd'], ['draw']], 8), [[0], [0]])
    check('explicit sequence 9', solve([['put', 'a', [0]], ['put', 'b', [0]], ['mode', 'odd'], ['draw']], 8), [[]])
    check('explicit sequence 10', solve([['put', 'a', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]], ['draw']], 8), [[0, 1, 2, 3, 4, 5, 6, 7]])
    check('explicit sequence 11', solve([['put', 'a', [0, 1]], ['put', 'b', [1]], ['draw']], 8), [[0, 1]])
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)
Boundary fixtureActualExpectedOutcome
explicit sequence 0[[2]][[2]]Passed
explicit sequence 1[[0]][[0]]Passed
explicit sequence 2[[1]][[1]]Passed
explicit sequence 3[[1]][[1]]Passed
explicit sequence 4[[0]][[0]]Passed
explicit sequence 5[[0]][[0]]Passed
explicit sequence 6[[0]][[0]]Passed
explicit sequence 7[[]][[]]Passed
explicit sequence 8[[0], [0]][[0], [0]]Passed
explicit sequence 9[[]][[]]Passed
explicit sequence 10[[0, 1, 2, 3]][[0, 1, 2, 3]]Passed
explicit sequence 11[[0, 1]][[0, 1]]Passed

SHA-256 / 92cd39876125319016ab1054ea66cb3024b34a80a5a57b6bbfe89e20ddba9742

Verification & scope

Finite one-dimensional integer sample sets model coverage state only; no geometric intersection, memory layout, GPU or graphics-standard conformance is claimed. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:45:17.390306+00:00.

Case digest / 04a45d8cb32d0c58024424370d152acfb91600a3995779facb38c35f773f4d6a