FA-51741 / Raster clipping / Open access
Clipped bresenham prestep: right bound inclusive · case 01
The walk includes the column equal to the half-open scissor right edge.
ROOT CAUSE
The walk includes the column equal to the half-open scissor right edge.
THE FAILURE
The walk includes the column equal to the half-open scissor right edge.
Unsuccessful approach: Subtracting after the minimum drops the last pixel of lines that end inside the scissor.
Case contract
Each command is [x0,y0,x1,y1,scissor] for an x-major integer line with x0<=x1 and |y1-y0|<=x1-x0 (a zero-length line is a single point). The reference pixel in column x is y0+floor((2*(y1-y0)*(x-x0)+dx)/(2*dx)), ties rounding up. Clipping to the half-open scissor [left,top,right,bottom) intersected with [0,size) must emit exactly the reference pixels inside it, in x order. The walk starts at the first visible column with an exact pre-stepped error term and may stop once y has left the scissor in the direction of travel.
Why this case matters
Raster clipping decides which pixels a primitive may touch; a single wrong clip decision writes outside the target or scissor, or silently drops visible coverage.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(commands, size):
out=[]
for x0,y0,x1,y1,clip in commands:
l,t,r,b=max(clip[0],0),max(clip[1],0),min(clip[2],size),min(clip[3],size)
dx,dy=x1-x0,y1-y0
pixels=[]
if dx==0:
if l<=x0<r and t<=y0<b: pixels=[[x0,y0]]
else:
xs=max(x0,l)
xe=min(x1,r)
if xs<=xe:
num=2*dy*(xs-x0)+dx
y=y0+num//(2*dx)
err=num%(2*dx)
for x in range(xs,xe+1):
if y>=b and dy>=0 or y<t and dy<=0: break
if t<=y<b: pixels.append([x,y])
err+=2*dy
while err>=2*dx:
err-=2*dx
y+=1
while err<0:
err+=2*dx
y-=1
out.append(pixels)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('explicit case 0', solve([[0, 0, 5, 2, [0, 0, 6, 6]]], 6), [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 2], [5, 2]]])
check('explicit case 1', solve([[-3, 0, 5, 3, [0, 0, 6, 6]]], 6), [[[0, 1], [1, 2], [2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 2', solve([[0, 1, 4, 3, [2, 0, 6, 6]]], 6), [[[2, 2], [3, 3], [4, 3]]])
check('explicit case 3', solve([[0, 4, 5, 1, [2, 0, 6, 6]]], 6), [[[2, 3], [3, 2], [4, 2], [5, 1]]])
check('explicit case 4', solve([[1, 1, 9, 1, [0, 0, 6, 6]]], 6), [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]])
check('explicit case 5', solve([[0, 0, 3, 3, [0, 0, 2, 6]]], 6), [[[0, 0], [1, 1]]])
check('explicit case 6', solve([[2, 2, 5, 3, [0, 0, 6, 6]]], 6), [[[2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 7', solve([[2, 1, 6, 3, [1, 0, 6, 6]]], 6), [[[2, 1], [3, 2], [4, 2], [5, 3]]])
check('explicit case 8', solve([[3, 3, 3, 3, [0, 0, 2, 6]]], 6), [[]])
check('explicit case 9', solve([[3, 3, 3, 3, [0, 0, 6, 6]]], 6), [[[3, 3]]])
check('explicit case 10', solve([[0, 0, 4, 4, [0, 2, 6, 6]]], 6), [[[2, 2], [3, 3], [4, 4]]])
check('explicit case 11', solve([[0, 5, 5, 0, [0, 0, 6, 3]]], 6), [[[3, 2], [4, 1], [5, 0]]])
check('explicit case 12', solve([[0, 0, 6, 2, [0, 1, 6, 2]]], 6), [[[2, 1], [3, 1], [4, 1]]])
if N == 2:
check('explicit case 0', solve([[0, 0, 6, 2, [0, 0, 7, 7]]], 7), [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 1], [5, 2], [6, 2]]])
check('explicit case 1', solve([[-3, 0, 6, 3, [0, 0, 7, 7]]], 7), [[[0, 1], [1, 1], [2, 2], [3, 2], [4, 2], [5, 3], [6, 3]]])
check('explicit case 2', solve([[0, 1, 4, 3, [2, 0, 7, 7]]], 7), [[[2, 2], [3, 3], [4, 3]]])
check('explicit case 3', solve([[0, 4, 5, 1, [2, 0, 7, 7]]], 7), [[[2, 3], [3, 2], [4, 2], [5, 1]]])
check('explicit case 4', solve([[1, 1, 10, 1, [0, 0, 7, 7]]], 7), [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1]]])
check('explicit case 5', solve([[0, 0, 3, 3, [0, 0, 2, 7]]], 7), [[[0, 0], [1, 1]]])
check('explicit case 6', solve([[2, 2, 5, 3, [0, 0, 7, 7]]], 7), [[[2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 7', solve([[2, 1, 6, 3, [1, 0, 7, 7]]], 7), [[[2, 1], [3, 2], [4, 2], [5, 3], [6, 3]]])
check('explicit case 8', solve([[3, 3, 3, 3, [0, 0, 2, 7]]], 7), [[]])
check('explicit case 9', solve([[3, 3, 3, 3, [0, 0, 7, 7]]], 7), [[[3, 3]]])
check('explicit case 10', solve([[0, 0, 4, 4, [0, 2, 7, 7]]], 7), [[[2, 2], [3, 3], [4, 4]]])
check('explicit case 11', solve([[0, 5, 5, 0, [0, 0, 7, 3]]], 7), [[[3, 2], [4, 1], [5, 0]]])
check('explicit case 12', solve([[0, 0, 6, 2, [0, 1, 7, 2]]], 7), [[[2, 1], [3, 1], [4, 1]]])
if N == 3:
check('explicit case 0', solve([[0, 0, 7, 2, [0, 0, 8, 8]]], 8), [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 1], [5, 1], [6, 2], [7, 2]]])
check('explicit case 1', solve([[-3, 0, 7, 3, [0, 0, 8, 8]]], 8), [[[0, 1], [1, 1], [2, 2], [3, 2], [4, 2], [5, 2], [6, 3], [7, 3]]])
check('explicit case 2', solve([[0, 1, 4, 3, [2, 0, 8, 8]]], 8), [[[2, 2], [3, 3], [4, 3]]])
check('explicit case 3', solve([[0, 4, 5, 1, [2, 0, 8, 8]]], 8), [[[2, 3], [3, 2], [4, 2], [5, 1]]])
check('explicit case 4', solve([[1, 1, 11, 1, [0, 0, 8, 8]]], 8), [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1]]])
check('explicit case 5', solve([[0, 0, 3, 3, [0, 0, 2, 8]]], 8), [[[0, 0], [1, 1]]])
check('explicit case 6', solve([[2, 2, 5, 3, [0, 0, 8, 8]]], 8), [[[2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 7', solve([[2, 1, 6, 3, [1, 0, 8, 8]]], 8), [[[2, 1], [3, 2], [4, 2], [5, 3], [6, 3]]])
check('explicit case 8', solve([[3, 3, 3, 3, [0, 0, 2, 8]]], 8), [[]])
check('explicit case 9', solve([[3, 3, 3, 3, [0, 0, 8, 8]]], 8), [[[3, 3]]])
check('explicit case 10', solve([[0, 0, 4, 4, [0, 2, 8, 8]]], 8), [[[2, 2], [3, 3], [4, 4]]])
check('explicit case 11', solve([[0, 5, 5, 0, [0, 0, 8, 3]]], 8), [[[3, 2], [4, 1], [5, 0]]])
check('explicit case 12', solve([[0, 0, 6, 2, [0, 1, 8, 2]]], 8), [[[2, 1], [3, 1], [4, 1]]])
if N == 4:
check('explicit case 0', solve([[0, 0, 8, 2, [0, 0, 9, 9]]], 9), [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 1], [5, 1], [6, 2], [7, 2], [8, 2]]])
check('explicit case 1', solve([[-3, 0, 8, 3, [0, 0, 9, 9]]], 9), [[[0, 1], [1, 1], [2, 1], [3, 2], [4, 2], [5, 2], [6, 2], [7, 3], [8, 3]]])
check('explicit case 2', solve([[0, 1, 4, 3, [2, 0, 9, 9]]], 9), [[[2, 2], [3, 3], [4, 3]]])
check('explicit case 3', solve([[0, 4, 5, 1, [2, 0, 9, 9]]], 9), [[[2, 3], [3, 2], [4, 2], [5, 1]]])
check('explicit case 4', solve([[1, 1, 12, 1, [0, 0, 9, 9]]], 9), [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1]]])
check('explicit case 5', solve([[0, 0, 3, 3, [0, 0, 2, 9]]], 9), [[[0, 0], [1, 1]]])
check('explicit case 6', solve([[2, 2, 5, 3, [0, 0, 9, 9]]], 9), [[[2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 7', solve([[2, 1, 6, 3, [1, 0, 9, 9]]], 9), [[[2, 1], [3, 2], [4, 2], [5, 3], [6, 3]]])
check('explicit case 8', solve([[3, 3, 3, 3, [0, 0, 2, 9]]], 9), [[]])
check('explicit case 9', solve([[3, 3, 3, 3, [0, 0, 9, 9]]], 9), [[[3, 3]]])
check('explicit case 10', solve([[0, 0, 4, 4, [0, 2, 9, 9]]], 9), [[[2, 2], [3, 3], [4, 4]]])
check('explicit case 11', solve([[0, 5, 5, 0, [0, 0, 9, 3]]], 9), [[[3, 2], [4, 1], [5, 0]]])
check('explicit case 12', solve([[0, 0, 6, 2, [0, 1, 9, 2]]], 9), [[[2, 1], [3, 1], [4, 1]]])
if N == 5:
check('explicit case 0', solve([[0, 0, 9, 2, [0, 0, 10, 10]]], 10), [[[0, 0], [1, 0], [2, 0], [3, 1], [4, 1], [5, 1], [6, 1], [7, 2], [8, 2], [9, 2]]])
check('explicit case 1', solve([[-3, 0, 9, 3, [0, 0, 10, 10]]], 10), [[[0, 1], [1, 1], [2, 1], [3, 2], [4, 2], [5, 2], [6, 2], [7, 3], [8, 3], [9, 3]]])
check('explicit case 2', solve([[0, 1, 4, 3, [2, 0, 10, 10]]], 10), [[[2, 2], [3, 3], [4, 3]]])
check('explicit case 3', solve([[0, 4, 5, 1, [2, 0, 10, 10]]], 10), [[[2, 3], [3, 2], [4, 2], [5, 1]]])
check('explicit case 4', solve([[1, 1, 13, 1, [0, 0, 10, 10]]], 10), [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [9, 1]]])
check('explicit case 5', solve([[0, 0, 3, 3, [0, 0, 2, 10]]], 10), [[[0, 0], [1, 1]]])
check('explicit case 6', solve([[2, 2, 5, 3, [0, 0, 10, 10]]], 10), [[[2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 7', solve([[2, 1, 6, 3, [1, 0, 10, 10]]], 10), [[[2, 1], [3, 2], [4, 2], [5, 3], [6, 3]]])
check('explicit case 8', solve([[3, 3, 3, 3, [0, 0, 2, 10]]], 10), [[]])
check('explicit case 9', solve([[3, 3, 3, 3, [0, 0, 10, 10]]], 10), [[[3, 3]]])
check('explicit case 10', solve([[0, 0, 4, 4, [0, 2, 10, 10]]], 10), [[[2, 2], [3, 3], [4, 4]]])
check('explicit case 11', solve([[0, 5, 5, 0, [0, 0, 10, 3]]], 10), [[[3, 2], [4, 1], [5, 0]]])
check('explicit case 12', solve([[0, 0, 6, 2, [0, 1, 10, 2]]], 10), [[[2, 1], [3, 1], [4, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit case 0 | [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 2], [5, 2]]] | [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 2], [5, 2]]] | Passed |
| explicit case 1 | [[[0, 1], [1, 2], [2, 2], [3, 2], [4, 3], [5, 3]]] | [[[0, 1], [1, 2], [2, 2], [3, 2], [4, 3], [5, 3]]] | Passed |
| explicit case 2 | [[[2, 2], [3, 3], [4, 3]]] | [[[2, 2], [3, 3], [4, 3]]] | Passed |
| explicit case 3 | [[[2, 3], [3, 2], [4, 2], [5, 1]]] | [[[2, 3], [3, 2], [4, 2], [5, 1]]] | Passed |
| explicit case 4 | [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1]]] | [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]] | Failed |
| explicit case 5 | [[[0, 0], [1, 1], [2, 2]]] | [[[0, 0], [1, 1]]] | Failed |
| explicit case 6 | [[[2, 2], [3, 2], [4, 3], [5, 3]]] | [[[2, 2], [3, 2], [4, 3], [5, 3]]] | Passed |
| explicit case 7 | [[[2, 1], [3, 2], [4, 2], [5, 3], [6, 3]]] | [[[2, 1], [3, 2], [4, 2], [5, 3]]] | Failed |
| explicit case 8 | [[]] | [[]] | Passed |
| explicit case 9 | [[[3, 3]]] | [[[3, 3]]] | Passed |
| explicit case 10 | [[[2, 2], [3, 3], [4, 4]]] | [[[2, 2], [3, 3], [4, 4]]] | Passed |
| explicit case 11 | [[[3, 2], [4, 1], [5, 0]]] | [[[3, 2], [4, 1], [5, 0]]] | Passed |
| explicit case 12 | [[[2, 1], [3, 1], [4, 1]]] | [[[2, 1], [3, 1], [4, 1]]] | Passed |
SHA-256 / 60e26c815793e3e0cade1a361a3604f9514664a7c01333410ebd3afa94adb6c8
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(commands, size):
out=[]
for x0,y0,x1,y1,clip in commands:
l,t,r,b=max(clip[0],0),max(clip[1],0),min(clip[2],size),min(clip[3],size)
dx,dy=x1-x0,y1-y0
pixels=[]
if dx==0:
if l<=x0<r and t<=y0<b: pixels=[[x0,y0]]
else:
xs=max(x0,l)
xe=min(x1,r)-1
if xs<=xe:
num=2*dy*(xs-x0)+dx
y=y0+num//(2*dx)
err=num%(2*dx)
for x in range(xs,xe+1):
if y>=b and dy>=0 or y<t and dy<=0: break
if t<=y<b: pixels.append([x,y])
err+=2*dy
while err>=2*dx:
err-=2*dx
y+=1
while err<0:
err+=2*dx
y-=1
out.append(pixels)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('explicit case 0', solve([[0, 0, 5, 2, [0, 0, 6, 6]]], 6), [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 2], [5, 2]]])
check('explicit case 1', solve([[-3, 0, 5, 3, [0, 0, 6, 6]]], 6), [[[0, 1], [1, 2], [2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 2', solve([[0, 1, 4, 3, [2, 0, 6, 6]]], 6), [[[2, 2], [3, 3], [4, 3]]])
check('explicit case 3', solve([[0, 4, 5, 1, [2, 0, 6, 6]]], 6), [[[2, 3], [3, 2], [4, 2], [5, 1]]])
check('explicit case 4', solve([[1, 1, 9, 1, [0, 0, 6, 6]]], 6), [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]])
check('explicit case 5', solve([[0, 0, 3, 3, [0, 0, 2, 6]]], 6), [[[0, 0], [1, 1]]])
check('explicit case 6', solve([[2, 2, 5, 3, [0, 0, 6, 6]]], 6), [[[2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 7', solve([[2, 1, 6, 3, [1, 0, 6, 6]]], 6), [[[2, 1], [3, 2], [4, 2], [5, 3]]])
check('explicit case 8', solve([[3, 3, 3, 3, [0, 0, 2, 6]]], 6), [[]])
check('explicit case 9', solve([[3, 3, 3, 3, [0, 0, 6, 6]]], 6), [[[3, 3]]])
check('explicit case 10', solve([[0, 0, 4, 4, [0, 2, 6, 6]]], 6), [[[2, 2], [3, 3], [4, 4]]])
check('explicit case 11', solve([[0, 5, 5, 0, [0, 0, 6, 3]]], 6), [[[3, 2], [4, 1], [5, 0]]])
check('explicit case 12', solve([[0, 0, 6, 2, [0, 1, 6, 2]]], 6), [[[2, 1], [3, 1], [4, 1]]])
if N == 2:
check('explicit case 0', solve([[0, 0, 6, 2, [0, 0, 7, 7]]], 7), [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 1], [5, 2], [6, 2]]])
check('explicit case 1', solve([[-3, 0, 6, 3, [0, 0, 7, 7]]], 7), [[[0, 1], [1, 1], [2, 2], [3, 2], [4, 2], [5, 3], [6, 3]]])
check('explicit case 2', solve([[0, 1, 4, 3, [2, 0, 7, 7]]], 7), [[[2, 2], [3, 3], [4, 3]]])
check('explicit case 3', solve([[0, 4, 5, 1, [2, 0, 7, 7]]], 7), [[[2, 3], [3, 2], [4, 2], [5, 1]]])
check('explicit case 4', solve([[1, 1, 10, 1, [0, 0, 7, 7]]], 7), [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1]]])
check('explicit case 5', solve([[0, 0, 3, 3, [0, 0, 2, 7]]], 7), [[[0, 0], [1, 1]]])
check('explicit case 6', solve([[2, 2, 5, 3, [0, 0, 7, 7]]], 7), [[[2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 7', solve([[2, 1, 6, 3, [1, 0, 7, 7]]], 7), [[[2, 1], [3, 2], [4, 2], [5, 3], [6, 3]]])
check('explicit case 8', solve([[3, 3, 3, 3, [0, 0, 2, 7]]], 7), [[]])
check('explicit case 9', solve([[3, 3, 3, 3, [0, 0, 7, 7]]], 7), [[[3, 3]]])
check('explicit case 10', solve([[0, 0, 4, 4, [0, 2, 7, 7]]], 7), [[[2, 2], [3, 3], [4, 4]]])
check('explicit case 11', solve([[0, 5, 5, 0, [0, 0, 7, 3]]], 7), [[[3, 2], [4, 1], [5, 0]]])
check('explicit case 12', solve([[0, 0, 6, 2, [0, 1, 7, 2]]], 7), [[[2, 1], [3, 1], [4, 1]]])
if N == 3:
check('explicit case 0', solve([[0, 0, 7, 2, [0, 0, 8, 8]]], 8), [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 1], [5, 1], [6, 2], [7, 2]]])
check('explicit case 1', solve([[-3, 0, 7, 3, [0, 0, 8, 8]]], 8), [[[0, 1], [1, 1], [2, 2], [3, 2], [4, 2], [5, 2], [6, 3], [7, 3]]])
check('explicit case 2', solve([[0, 1, 4, 3, [2, 0, 8, 8]]], 8), [[[2, 2], [3, 3], [4, 3]]])
check('explicit case 3', solve([[0, 4, 5, 1, [2, 0, 8, 8]]], 8), [[[2, 3], [3, 2], [4, 2], [5, 1]]])
check('explicit case 4', solve([[1, 1, 11, 1, [0, 0, 8, 8]]], 8), [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1]]])
check('explicit case 5', solve([[0, 0, 3, 3, [0, 0, 2, 8]]], 8), [[[0, 0], [1, 1]]])
check('explicit case 6', solve([[2, 2, 5, 3, [0, 0, 8, 8]]], 8), [[[2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 7', solve([[2, 1, 6, 3, [1, 0, 8, 8]]], 8), [[[2, 1], [3, 2], [4, 2], [5, 3], [6, 3]]])
check('explicit case 8', solve([[3, 3, 3, 3, [0, 0, 2, 8]]], 8), [[]])
check('explicit case 9', solve([[3, 3, 3, 3, [0, 0, 8, 8]]], 8), [[[3, 3]]])
check('explicit case 10', solve([[0, 0, 4, 4, [0, 2, 8, 8]]], 8), [[[2, 2], [3, 3], [4, 4]]])
check('explicit case 11', solve([[0, 5, 5, 0, [0, 0, 8, 3]]], 8), [[[3, 2], [4, 1], [5, 0]]])
check('explicit case 12', solve([[0, 0, 6, 2, [0, 1, 8, 2]]], 8), [[[2, 1], [3, 1], [4, 1]]])
if N == 4:
check('explicit case 0', solve([[0, 0, 8, 2, [0, 0, 9, 9]]], 9), [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 1], [5, 1], [6, 2], [7, 2], [8, 2]]])
check('explicit case 1', solve([[-3, 0, 8, 3, [0, 0, 9, 9]]], 9), [[[0, 1], [1, 1], [2, 1], [3, 2], [4, 2], [5, 2], [6, 2], [7, 3], [8, 3]]])
check('explicit case 2', solve([[0, 1, 4, 3, [2, 0, 9, 9]]], 9), [[[2, 2], [3, 3], [4, 3]]])
check('explicit case 3', solve([[0, 4, 5, 1, [2, 0, 9, 9]]], 9), [[[2, 3], [3, 2], [4, 2], [5, 1]]])
check('explicit case 4', solve([[1, 1, 12, 1, [0, 0, 9, 9]]], 9), [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1]]])
check('explicit case 5', solve([[0, 0, 3, 3, [0, 0, 2, 9]]], 9), [[[0, 0], [1, 1]]])
check('explicit case 6', solve([[2, 2, 5, 3, [0, 0, 9, 9]]], 9), [[[2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 7', solve([[2, 1, 6, 3, [1, 0, 9, 9]]], 9), [[[2, 1], [3, 2], [4, 2], [5, 3], [6, 3]]])
check('explicit case 8', solve([[3, 3, 3, 3, [0, 0, 2, 9]]], 9), [[]])
check('explicit case 9', solve([[3, 3, 3, 3, [0, 0, 9, 9]]], 9), [[[3, 3]]])
check('explicit case 10', solve([[0, 0, 4, 4, [0, 2, 9, 9]]], 9), [[[2, 2], [3, 3], [4, 4]]])
check('explicit case 11', solve([[0, 5, 5, 0, [0, 0, 9, 3]]], 9), [[[3, 2], [4, 1], [5, 0]]])
check('explicit case 12', solve([[0, 0, 6, 2, [0, 1, 9, 2]]], 9), [[[2, 1], [3, 1], [4, 1]]])
if N == 5:
check('explicit case 0', solve([[0, 0, 9, 2, [0, 0, 10, 10]]], 10), [[[0, 0], [1, 0], [2, 0], [3, 1], [4, 1], [5, 1], [6, 1], [7, 2], [8, 2], [9, 2]]])
check('explicit case 1', solve([[-3, 0, 9, 3, [0, 0, 10, 10]]], 10), [[[0, 1], [1, 1], [2, 1], [3, 2], [4, 2], [5, 2], [6, 2], [7, 3], [8, 3], [9, 3]]])
check('explicit case 2', solve([[0, 1, 4, 3, [2, 0, 10, 10]]], 10), [[[2, 2], [3, 3], [4, 3]]])
check('explicit case 3', solve([[0, 4, 5, 1, [2, 0, 10, 10]]], 10), [[[2, 3], [3, 2], [4, 2], [5, 1]]])
check('explicit case 4', solve([[1, 1, 13, 1, [0, 0, 10, 10]]], 10), [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], [8, 1], [9, 1]]])
check('explicit case 5', solve([[0, 0, 3, 3, [0, 0, 2, 10]]], 10), [[[0, 0], [1, 1]]])
check('explicit case 6', solve([[2, 2, 5, 3, [0, 0, 10, 10]]], 10), [[[2, 2], [3, 2], [4, 3], [5, 3]]])
check('explicit case 7', solve([[2, 1, 6, 3, [1, 0, 10, 10]]], 10), [[[2, 1], [3, 2], [4, 2], [5, 3], [6, 3]]])
check('explicit case 8', solve([[3, 3, 3, 3, [0, 0, 2, 10]]], 10), [[]])
check('explicit case 9', solve([[3, 3, 3, 3, [0, 0, 10, 10]]], 10), [[[3, 3]]])
check('explicit case 10', solve([[0, 0, 4, 4, [0, 2, 10, 10]]], 10), [[[2, 2], [3, 3], [4, 4]]])
check('explicit case 11', solve([[0, 5, 5, 0, [0, 0, 10, 3]]], 10), [[[3, 2], [4, 1], [5, 0]]])
check('explicit case 12', solve([[0, 0, 6, 2, [0, 1, 10, 2]]], 10), [[[2, 1], [3, 1], [4, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit case 0 | [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 2]]] | [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 2], [5, 2]]] | Failed |
| explicit case 1 | [[[0, 1], [1, 2], [2, 2], [3, 2], [4, 3]]] | [[[0, 1], [1, 2], [2, 2], [3, 2], [4, 3], [5, 3]]] | Failed |
| explicit case 2 | [[[2, 2], [3, 3]]] | [[[2, 2], [3, 3], [4, 3]]] | Failed |
| explicit case 3 | [[[2, 3], [3, 2], [4, 2]]] | [[[2, 3], [3, 2], [4, 2], [5, 1]]] | Failed |
| explicit case 4 | [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]] | [[[1, 1], [2, 1], [3, 1], [4, 1], [5, 1]]] | Passed |
| explicit case 5 | [[[0, 0], [1, 1]]] | [[[0, 0], [1, 1]]] | Passed |
| explicit case 6 | [[[2, 2], [3, 2], [4, 3]]] | [[[2, 2], [3, 2], [4, 3], [5, 3]]] | Failed |
| explicit case 7 | [[[2, 1], [3, 2], [4, 2], [5, 3]]] | [[[2, 1], [3, 2], [4, 2], [5, 3]]] | Passed |
| explicit case 8 | [[]] | [[]] | Passed |
| explicit case 9 | [[[3, 3]]] | [[[3, 3]]] | Passed |
| explicit case 10 | [[[2, 2], [3, 3]]] | [[[2, 2], [3, 3], [4, 4]]] | Failed |
| explicit case 11 | [[[3, 2], [4, 1]]] | [[[3, 2], [4, 1], [5, 0]]] | Failed |
| explicit case 12 | [[[2, 1], [3, 1], [4, 1]]] | [[[2, 1], [3, 1], [4, 1]]] | Passed |
SHA-256 / 1e33d396e3c9a67f9e928b1bd5777ffd48c53c7d44855e0962ad55762bc5fd6b
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 13 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
Exact integer/rational arithmetic on small stipulated fixtures models the clipping decision only; no memory layout, GPU pipeline, graphics API or standards 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:22.071730+00:00.
Case digest / 7f14b5fd9cc6d1083b7c20ce98109c70b69de7712f466e9336713aa367fb33b7