FA-51733 / Raster clipping / Member archive
Clipped bresenham prestep: midpoint bias missing · case 03
The error term omits the half-pixel bias, so reference rows are floored instead of rounded.
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 fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit case 0 | [[[0, 0], [1, 0], [2, 0], [3, 0], [4, 1], [5, 1], [6, 1], [7, 2]]] | [[[0, 0], [1, 0], [2, 1], [3, 1], [4, 1], [5, 1], [6, 2], [7, 2]]] | 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 ↗