The start-up self-test checks the GPU binning apart: if it comes back wrong only the
binning stays on the CPU (gpu_binning_off says why), instead of the whole GPU stage
switching off; the tests require it to work wherever the GPU stage runs (lavapipe in CI).
On Direct3D 12 the binning passes cost more per stage tile than the CPU binning (onion
+-5 at 1080p in tiles: 9.7 -> 14.4 ms, measured twice), so Auto keeps the CPU's there
and on backends not yet measured; ANICRAFT_GPU_BINNING=gpu still forces it.
A hairline segment went into every tile within 2 px of it; 1.25 px is enough (a pixel
centre within its reach is within 1 px of a point of it, plus rounding). The room for
its pieces is its padded box's tiles, row by row only for long segments. Onion outlines
against tinted, GPU stage, best of three: 1080p tiles 10.2 vs 9.5 ms, 4K tiles 15.1 vs
15.4 ms, one texture 7.2 vs 7.1 ms.
Mapping the GPU-binned index at creation zeroed and copied its whole room for entries on
the CPU; the headers and op headers now go through the queue and the rest starts zeroed
on the GPU. 50k shapes at 4K, direct: 50 -> 24 ms (CPU-binned: 121 ms).
Auto bins on the GPU from 32,768 edges: forcing it on every 512 px stage tile made the
1,000-shape 4K stage 1.9x slower and the 10k-shape one 1.3x (per-tile pass set-up); with
the threshold the tiled stage never loses (10k at 4K 10.5 -> 10.0 ms, 50k 63.6 -> 38.4 ms).
A hairline segment whose box is out of reach of a pixel is skipped before the distance
(same coverage). gpu_bench compares CPU and Auto binning and checks budgets (--check).
The CPU lays out the fills' points, each fill's tile range, each tile row's fills in
drawing order and room for every tile the fills' bounds cover, with an upper bound of the
pieces, so every buffer is sized up front and nothing is read back. bin.wgsl splits the
edges (one invocation per row of tiles of each fill, so no atomics), scan.wgsl places the
pieces, and a pass per tile keeps the fills with pieces or a backdrop there, in order: the
same lists as the CPU binning, which stays the reference and the way for fills in masks
and groups. Binning::Auto bins on the GPU from 4,096 edges; ANICRAFT_GPU_BINNING overrides.
Tests: the GPU's lists against the CPU's, entry by entry and pixel by pixel (stress
frames, outlines, the analytic scenes), and GPU-binned frames against the oracle, on
Vulkan and Direct3D 12.
Crossings computed apart from the splitting could disagree with it by a rounding near a
tile corner and count one crossing twice (the backdrop and a step): 543 pixels off by up
to 133/255 on a stress frame. The steps now come from consecutive pieces of a tile row in
different columns, so the backdrop and the steps always describe the same pieces. A test
on stress frames at awkward scales catches it. Also drops leftover timing prints.
Outline mode (an outlined layer, onion skin's outlines) draws hairlines straight from
the flattened path: coverage 1 - the distance to the nearest segment, one edge per
segment where a stroked hairline was four plus a disc at every bend. Exact for axis-
aligned lines, no darkening at overlaps and joins. The GPU stage computes the same.
The binning's per-row float backdrops become one integer per tile plus a piece on the
tile's left edge wherever the outline crosses it (Vello's backdrops and y-edges), which
lets the GPU compute the same lists without float atomics. Parity unchanged.
Hit testing keeps main's pick_index, picking in the symbol open in place. Onion skin and
Edit Multiple Frames switch off while a symbol is open in place; the multi-frame listing
evaluates the open timeline. A double-click on a Library symbol opens it for editing, as in
Animate. Raw point edits keep a stroke's StrokeStyle (tested).