FA-51831 / Raster clipping / Open access
Circle span scissor: float root rounding · case 01
The doubled half-width is rounded instead of floored, admitting pixel centers just outside the disc.
ROOT CAUSE
The doubled half-width is rounded instead of floored, admitting pixel centers just outside the disc.
VERIFIED REPAIR
Restore the specified clipping decision at float root rounding. Each command is [cx,cy,r,scissor] for a filled disc centred on the integer pixel-corner point (cx,cy). Pixel (x,y) is covered when its center (x+1/2,y+1/2) lies within the closed disc. Rows of the half-open scissor [left,top,right,bottom) intersected with [0,size) are scanned in order, computing exact integer span bounds with half-pixel doubled coordinates and an integer square root, then clipping to scissor columns. Non-empty spans are [row,start,end).
Unsuccessful approach: Rewriting the rounding with an offset still rounds up.
Case contract
Each command is [cx,cy,r,scissor] for a filled disc centred on the integer pixel-corner point (cx,cy). Pixel (x,y) is covered when its center (x+1/2,y+1/2) lies within the closed disc. Rows of the half-open scissor [left,top,right,bottom) intersected with [0,size) are scanned in order, computing exact integer span bounds with half-pixel doubled coordinates and an integer square root, then clipping to scissor columns. Non-empty spans are [row,start,end).
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
from math import isqrt
N = 1
observations = []
def solve(commands, size):
out=[]
for cx,cy,r,clip in commands:
l,t,rr,b=max(clip[0],0),max(clip[1],0),min(clip[2],size),min(clip[3],size)
spans=[]
for y in range(t,b):
m=4*r*r-(2*y+1-2*cy)**2
if m<0: continue
k=round(m**0.5)
xa=-((1+k-2*cx)//2)
xb=(2*cx-1+k)//2+1
xa,xb=max(xa,l),min(xb,rr)
if xa<xb: spans.append([y,xa,xb])
out.append(spans)
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([[3, 3, 2, [0, 0, 6, 6]]], 6), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 6, 6]]], 6), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 6, 6]]], 6), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[3, 3, 3, [1, 1, 6, 5]]], 6), [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 6, 6]]], 6), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[6, 3, 2, [0, 0, 6, 6]]], 6), [[[1, 5, 6], [2, 4, 6], [3, 4, 6], [4, 5, 6]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 6, 4]]], 6), [[[0, 2, 6], [1, 2, 6], [2, 2, 6], [3, 2, 6]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 6, 6]]], 6), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 6, 6]]], 6), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 6, 6]]], 6), [[[0, 0, 6], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 0, 6]]])
if N == 2:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 7, 7]]], 7), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 7, 7]]], 7), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 7, 7]]], 7), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[3, 3, 3, [1, 1, 7, 6]]], 7), [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6], [5, 1, 5]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 7, 7]]], 7), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[7, 3, 2, [0, 0, 7, 7]]], 7), [[[1, 6, 7], [2, 5, 7], [3, 5, 7], [4, 6, 7]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 7, 4]]], 7), [[[0, 2, 7], [1, 2, 7], [2, 2, 7], [3, 2, 7]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 7, 7]]], 7), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 7, 7]]], 7), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 7, 7]]], 7), [[[0, 0, 7], [1, 0, 7], [2, 0, 7], [3, 0, 7], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
if N == 3:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 8, 8]]], 8), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 8, 8]]], 8), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 8, 8]]], 8), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[4, 4, 4, [1, 1, 8, 7]]], 8), [[[1, 1, 7], [2, 1, 8], [3, 1, 8], [4, 1, 8], [5, 1, 8], [6, 1, 7]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 8, 8]]], 8), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[8, 3, 2, [0, 0, 8, 8]]], 8), [[[1, 7, 8], [2, 6, 8], [3, 6, 8], [4, 7, 8]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 8, 4]]], 8), [[[0, 2, 8], [1, 2, 8], [2, 2, 8], [3, 2, 8]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 8, 8]]], 8), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 8, 8]]], 8), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 8, 8]]], 8), [[[0, 0, 8], [1, 0, 8], [2, 0, 8], [3, 0, 8], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
if N == 4:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 9, 9]]], 9), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 9, 9]]], 9), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 9, 9]]], 9), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[4, 4, 4, [1, 1, 9, 8]]], 9), [[[1, 1, 7], [2, 1, 8], [3, 1, 8], [4, 1, 8], [5, 1, 8], [6, 1, 7], [7, 2, 6]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 9, 9]]], 9), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[9, 3, 2, [0, 0, 9, 9]]], 9), [[[1, 8, 9], [2, 7, 9], [3, 7, 9], [4, 8, 9]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 9, 4]]], 9), [[[0, 2, 8], [1, 2, 8], [2, 2, 8], [3, 2, 8]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 9, 9]]], 9), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 9, 9]]], 9), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 9, 9]]], 9), [[[0, 0, 8], [1, 0, 8], [2, 0, 8], [3, 0, 8], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
if N == 5:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 10, 10]]], 10), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 10, 10]]], 10), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 10, 10]]], 10), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[5, 5, 5, [1, 1, 10, 9]]], 10), [[[1, 1, 9], [2, 1, 9], [3, 1, 10], [4, 1, 10], [5, 1, 10], [6, 1, 10], [7, 1, 9], [8, 1, 9]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 10, 10]]], 10), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[10, 3, 2, [0, 0, 10, 10]]], 10), [[[1, 9, 10], [2, 8, 10], [3, 8, 10], [4, 9, 10]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 10, 4]]], 10), [[[0, 2, 8], [1, 2, 8], [2, 2, 8], [3, 2, 8]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 10, 10]]], 10), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 10, 10]]], 10), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 10, 10]]], 10), [[[0, 0, 8], [1, 0, 8], [2, 0, 8], [3, 0, 8], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
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 | [[[1, 1, 5], [2, 1, 5], [3, 1, 5], [4, 1, 5]]] | [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]] | Failed |
| explicit case 1 | [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]] | [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]] | Passed |
| explicit case 2 | [[[1, 1, 3], [2, 1, 3]]] | [[[1, 1, 3], [2, 1, 3]]] | Passed |
| explicit case 3 | [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6]]] | [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6]]] | Passed |
| explicit case 4 | [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]] | [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]] | Passed |
| explicit case 5 | [[[1, 4, 6], [2, 4, 6], [3, 4, 6], [4, 4, 6]]] | [[[1, 5, 6], [2, 4, 6], [3, 4, 6], [4, 5, 6]]] | Failed |
| explicit case 6 | [[[0, 2, 6], [1, 2, 6], [2, 2, 6], [3, 2, 6]]] | [[[0, 2, 6], [1, 2, 6], [2, 2, 6], [3, 2, 6]]] | Passed |
| explicit case 7 | [[[1, 0, 3], [2, 0, 3], [3, 0, 3], [4, 0, 3]]] | [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]] | Failed |
| explicit case 8 | [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5]]] | [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5]]] | Passed |
| explicit case 9 | [[[0, 0, 6], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 0, 6]]] | [[[0, 0, 6], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 0, 6]]] | Passed |
SHA-256 / a8065419088f2c146829f04cbf27c95a0ec1d69a932e7ff51db4d5170e72be49
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from math import isqrt
N = 1
observations = []
def solve(commands, size):
out=[]
for cx,cy,r,clip in commands:
l,t,rr,b=max(clip[0],0),max(clip[1],0),min(clip[2],size),min(clip[3],size)
spans=[]
for y in range(t,b):
m=4*r*r-(2*y+1-2*cy)**2
if m<0: continue
k=int(m**0.5+0.5)
xa=-((1+k-2*cx)//2)
xb=(2*cx-1+k)//2+1
xa,xb=max(xa,l),min(xb,rr)
if xa<xb: spans.append([y,xa,xb])
out.append(spans)
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([[3, 3, 2, [0, 0, 6, 6]]], 6), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 6, 6]]], 6), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 6, 6]]], 6), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[3, 3, 3, [1, 1, 6, 5]]], 6), [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 6, 6]]], 6), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[6, 3, 2, [0, 0, 6, 6]]], 6), [[[1, 5, 6], [2, 4, 6], [3, 4, 6], [4, 5, 6]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 6, 4]]], 6), [[[0, 2, 6], [1, 2, 6], [2, 2, 6], [3, 2, 6]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 6, 6]]], 6), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 6, 6]]], 6), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 6, 6]]], 6), [[[0, 0, 6], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 0, 6]]])
if N == 2:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 7, 7]]], 7), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 7, 7]]], 7), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 7, 7]]], 7), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[3, 3, 3, [1, 1, 7, 6]]], 7), [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6], [5, 1, 5]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 7, 7]]], 7), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[7, 3, 2, [0, 0, 7, 7]]], 7), [[[1, 6, 7], [2, 5, 7], [3, 5, 7], [4, 6, 7]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 7, 4]]], 7), [[[0, 2, 7], [1, 2, 7], [2, 2, 7], [3, 2, 7]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 7, 7]]], 7), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 7, 7]]], 7), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 7, 7]]], 7), [[[0, 0, 7], [1, 0, 7], [2, 0, 7], [3, 0, 7], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
if N == 3:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 8, 8]]], 8), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 8, 8]]], 8), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 8, 8]]], 8), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[4, 4, 4, [1, 1, 8, 7]]], 8), [[[1, 1, 7], [2, 1, 8], [3, 1, 8], [4, 1, 8], [5, 1, 8], [6, 1, 7]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 8, 8]]], 8), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[8, 3, 2, [0, 0, 8, 8]]], 8), [[[1, 7, 8], [2, 6, 8], [3, 6, 8], [4, 7, 8]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 8, 4]]], 8), [[[0, 2, 8], [1, 2, 8], [2, 2, 8], [3, 2, 8]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 8, 8]]], 8), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 8, 8]]], 8), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 8, 8]]], 8), [[[0, 0, 8], [1, 0, 8], [2, 0, 8], [3, 0, 8], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
if N == 4:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 9, 9]]], 9), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 9, 9]]], 9), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 9, 9]]], 9), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[4, 4, 4, [1, 1, 9, 8]]], 9), [[[1, 1, 7], [2, 1, 8], [3, 1, 8], [4, 1, 8], [5, 1, 8], [6, 1, 7], [7, 2, 6]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 9, 9]]], 9), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[9, 3, 2, [0, 0, 9, 9]]], 9), [[[1, 8, 9], [2, 7, 9], [3, 7, 9], [4, 8, 9]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 9, 4]]], 9), [[[0, 2, 8], [1, 2, 8], [2, 2, 8], [3, 2, 8]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 9, 9]]], 9), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 9, 9]]], 9), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 9, 9]]], 9), [[[0, 0, 8], [1, 0, 8], [2, 0, 8], [3, 0, 8], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
if N == 5:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 10, 10]]], 10), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 10, 10]]], 10), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 10, 10]]], 10), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[5, 5, 5, [1, 1, 10, 9]]], 10), [[[1, 1, 9], [2, 1, 9], [3, 1, 10], [4, 1, 10], [5, 1, 10], [6, 1, 10], [7, 1, 9], [8, 1, 9]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 10, 10]]], 10), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[10, 3, 2, [0, 0, 10, 10]]], 10), [[[1, 9, 10], [2, 8, 10], [3, 8, 10], [4, 9, 10]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 10, 4]]], 10), [[[0, 2, 8], [1, 2, 8], [2, 2, 8], [3, 2, 8]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 10, 10]]], 10), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 10, 10]]], 10), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 10, 10]]], 10), [[[0, 0, 8], [1, 0, 8], [2, 0, 8], [3, 0, 8], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
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 | [[[1, 1, 5], [2, 1, 5], [3, 1, 5], [4, 1, 5]]] | [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]] | Failed |
| explicit case 1 | [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]] | [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]] | Passed |
| explicit case 2 | [[[1, 1, 3], [2, 1, 3]]] | [[[1, 1, 3], [2, 1, 3]]] | Passed |
| explicit case 3 | [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6]]] | [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6]]] | Passed |
| explicit case 4 | [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]] | [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]] | Passed |
| explicit case 5 | [[[1, 4, 6], [2, 4, 6], [3, 4, 6], [4, 4, 6]]] | [[[1, 5, 6], [2, 4, 6], [3, 4, 6], [4, 5, 6]]] | Failed |
| explicit case 6 | [[[0, 2, 6], [1, 2, 6], [2, 2, 6], [3, 2, 6]]] | [[[0, 2, 6], [1, 2, 6], [2, 2, 6], [3, 2, 6]]] | Passed |
| explicit case 7 | [[[1, 0, 3], [2, 0, 3], [3, 0, 3], [4, 0, 3]]] | [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]] | Failed |
| explicit case 8 | [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5]]] | [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5]]] | Passed |
| explicit case 9 | [[[0, 0, 6], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 0, 6]]] | [[[0, 0, 6], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 0, 6]]] | Passed |
SHA-256 / cb0a545544b87f2c4ee0a05bc491b9bc7aef00bd5fdff1cb037b7b8454b33e68
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from math import isqrt
N = 1
observations = []
def solve(commands, size):
out=[]
for cx,cy,r,clip in commands:
l,t,rr,b=max(clip[0],0),max(clip[1],0),min(clip[2],size),min(clip[3],size)
spans=[]
for y in range(t,b):
m=4*r*r-(2*y+1-2*cy)**2
if m<0: continue
k=isqrt(m)
xa=-((1+k-2*cx)//2)
xb=(2*cx-1+k)//2+1
xa,xb=max(xa,l),min(xb,rr)
if xa<xb: spans.append([y,xa,xb])
out.append(spans)
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([[3, 3, 2, [0, 0, 6, 6]]], 6), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 6, 6]]], 6), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 6, 6]]], 6), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[3, 3, 3, [1, 1, 6, 5]]], 6), [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 6, 6]]], 6), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[6, 3, 2, [0, 0, 6, 6]]], 6), [[[1, 5, 6], [2, 4, 6], [3, 4, 6], [4, 5, 6]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 6, 4]]], 6), [[[0, 2, 6], [1, 2, 6], [2, 2, 6], [3, 2, 6]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 6, 6]]], 6), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 6, 6]]], 6), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 6, 6]]], 6), [[[0, 0, 6], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 0, 6]]])
if N == 2:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 7, 7]]], 7), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 7, 7]]], 7), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 7, 7]]], 7), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[3, 3, 3, [1, 1, 7, 6]]], 7), [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6], [5, 1, 5]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 7, 7]]], 7), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[7, 3, 2, [0, 0, 7, 7]]], 7), [[[1, 6, 7], [2, 5, 7], [3, 5, 7], [4, 6, 7]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 7, 4]]], 7), [[[0, 2, 7], [1, 2, 7], [2, 2, 7], [3, 2, 7]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 7, 7]]], 7), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 7, 7]]], 7), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 7, 7]]], 7), [[[0, 0, 7], [1, 0, 7], [2, 0, 7], [3, 0, 7], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
if N == 3:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 8, 8]]], 8), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 8, 8]]], 8), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 8, 8]]], 8), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[4, 4, 4, [1, 1, 8, 7]]], 8), [[[1, 1, 7], [2, 1, 8], [3, 1, 8], [4, 1, 8], [5, 1, 8], [6, 1, 7]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 8, 8]]], 8), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[8, 3, 2, [0, 0, 8, 8]]], 8), [[[1, 7, 8], [2, 6, 8], [3, 6, 8], [4, 7, 8]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 8, 4]]], 8), [[[0, 2, 8], [1, 2, 8], [2, 2, 8], [3, 2, 8]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 8, 8]]], 8), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 8, 8]]], 8), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 8, 8]]], 8), [[[0, 0, 8], [1, 0, 8], [2, 0, 8], [3, 0, 8], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
if N == 4:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 9, 9]]], 9), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 9, 9]]], 9), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 9, 9]]], 9), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[4, 4, 4, [1, 1, 9, 8]]], 9), [[[1, 1, 7], [2, 1, 8], [3, 1, 8], [4, 1, 8], [5, 1, 8], [6, 1, 7], [7, 2, 6]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 9, 9]]], 9), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[9, 3, 2, [0, 0, 9, 9]]], 9), [[[1, 8, 9], [2, 7, 9], [3, 7, 9], [4, 8, 9]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 9, 4]]], 9), [[[0, 2, 8], [1, 2, 8], [2, 2, 8], [3, 2, 8]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 9, 9]]], 9), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 9, 9]]], 9), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 9, 9]]], 9), [[[0, 0, 8], [1, 0, 8], [2, 0, 8], [3, 0, 8], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
if N == 5:
check('explicit case 0', solve([[3, 3, 2, [0, 0, 10, 10]]], 10), [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]])
check('explicit case 1', solve([[3, 3, 3, [0, 0, 10, 10]]], 10), [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]])
check('explicit case 2', solve([[2, 2, 1, [0, 0, 10, 10]]], 10), [[[1, 1, 3], [2, 1, 3]]])
check('explicit case 3', solve([[5, 5, 5, [1, 1, 10, 9]]], 10), [[[1, 1, 9], [2, 1, 9], [3, 1, 10], [4, 1, 10], [5, 1, 10], [6, 1, 10], [7, 1, 9], [8, 1, 9]]])
check('explicit case 4', solve([[0, 0, 3, [0, 0, 10, 10]]], 10), [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]])
check('explicit case 5', solve([[10, 3, 2, [0, 0, 10, 10]]], 10), [[[1, 9, 10], [2, 8, 10], [3, 8, 10], [4, 9, 10]]])
check('explicit case 6', solve([[4, 2, 4, [2, 0, 10, 4]]], 10), [[[0, 2, 8], [1, 2, 8], [2, 2, 8], [3, 2, 8]]])
check('explicit case 7', solve([[1, 3, 2, [0, 0, 10, 10]]], 10), [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]])
check('explicit case 8', solve([[2, 4, 3, [0, 0, 10, 10]]], 10), [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5], [6, 0, 4]]])
check('explicit case 9', solve([[3, 2, 5, [0, 0, 10, 10]]], 10), [[[0, 0, 8], [1, 0, 8], [2, 0, 8], [3, 0, 8], [4, 0, 7], [5, 0, 7], [6, 1, 5]]])
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 | [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]] | [[[1, 2, 4], [2, 1, 5], [3, 1, 5], [4, 2, 4]]] | Passed |
| explicit case 1 | [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]] | [[[0, 1, 5], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 1, 5]]] | Passed |
| explicit case 2 | [[[1, 1, 3], [2, 1, 3]]] | [[[1, 1, 3], [2, 1, 3]]] | Passed |
| explicit case 3 | [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6]]] | [[[1, 1, 6], [2, 1, 6], [3, 1, 6], [4, 1, 6]]] | Passed |
| explicit case 4 | [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]] | [[[0, 0, 3], [1, 0, 3], [2, 0, 2]]] | Passed |
| explicit case 5 | [[[1, 5, 6], [2, 4, 6], [3, 4, 6], [4, 5, 6]]] | [[[1, 5, 6], [2, 4, 6], [3, 4, 6], [4, 5, 6]]] | Passed |
| explicit case 6 | [[[0, 2, 6], [1, 2, 6], [2, 2, 6], [3, 2, 6]]] | [[[0, 2, 6], [1, 2, 6], [2, 2, 6], [3, 2, 6]]] | Passed |
| explicit case 7 | [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]] | [[[1, 0, 2], [2, 0, 3], [3, 0, 3], [4, 0, 2]]] | Passed |
| explicit case 8 | [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5]]] | [[[1, 0, 4], [2, 0, 5], [3, 0, 5], [4, 0, 5], [5, 0, 5]]] | Passed |
| explicit case 9 | [[[0, 0, 6], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 0, 6]]] | [[[0, 0, 6], [1, 0, 6], [2, 0, 6], [3, 0, 6], [4, 0, 6], [5, 0, 6]]] | Passed |
SHA-256 / c548acc932506688c4fae5fdb9262f2a9392099598ab72612c7ca12b67705445
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.994297+00:00.
Case digest / e91f740fec64a22ecdc893217ebae757ec7fecc2da72aeff563c98da0a67a2e0