FAILURE MAP
← Case archive

FA-51549 / Raster clipping / Member archive

Cohen sutherland pixel window: top edge parameter origin · case 04

The top-edge intersection measures the parameter from the far endpoint while interpolating from the near endpoint.

Member previewVariant 4 · 3 implementations · 16 checks per implementation

Case contract

Each command is a segment [x0,y0,x1,y1] whose endpoints are integers or exact decimal/rational strings in pixel-center coordinates. The window is the closed square [0,size-1]x[0,size-1] of pixel centers. Outcodes use strict outside tests (left 1, right 2, below 4, above 8). Both codes zero accepts; a shared bit rejects; otherwise the outside endpoint (endpoint 0 first) is moved to the highest set edge in above, below, right, left order and its code is recomputed from the new point; a clip against an edge parallel to the segment is treated as a rejection. At most five iterations are allowed; an unresolved or rejected segment returns None. Accepted endpoints round half-up to integer pixels.

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 2[[0, 0, 0, 0]][[0, 0, 8, 8]]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 ↗