FAILURE MAP
← Case archive

FA-51738 / Raster clipping / Member archive

Clipped bresenham prestep: negative prestep truncation · case 03

Pre-stepping a descending line truncates toward zero while the error keeps a floored remainder, desynchronising row and error.

Member previewVariant 3 · 3 implementations · 13 checks per implementation

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.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
explicit case 3[[[2, 4], [3, 3], [4, 3], [5, 2]]][[[2, 3], [3, 2], [4, 2], [5, 1]]]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗