The stroker builds each run of segments as its own outline (inner edges cut where they
cross, through the bend's point where they can't) and unites the loops, so the
renderers' sum of signed areas is the stroke's true coverage: no pixel is darker where
pieces overlapped (it was up to about half a pixel at round joins, caps and the joints
of wide curves). The GPU stage draws the oracle's polygons, so it follows.
Fourteen corpus goldens change, all at stroke edges (lighter; the dark knots at
corners go). Measured, median of 80 renders, before -> after: 2,000 stroked shapes at
1080p 9.3 -> 9.0 ms; the demo 2.5 -> 2.6 ms; 300 self-crossing scribbles at 720p
5.9 -> 6.4 ms; edges handed to the rasterizers down 3 to 4 times.
The run without the gate only proves the detector works, but it had 300 ms to
see an overlap, and on CI's Linux runner (busy with the software GPU tests) its
threads sometimes had not run by then: it failed twice in a row on this branch.
It now goes on until it has seen one, for at most 30 s.
Without the gate the detector must see the race, but on a two-core runner the workers and the
detector may not overlap in one 300 ms run (it failed once on the Linux gate). The gated run
still has to hold in every run.
On the macOS and Windows runners a helper thread had not started its
submission when the test closed the gate 20 ms later. The tests now wait for
the state they are about (a channel, the gate's own counts) and keep only the
lower time bounds, which hold on any machine.
The stage renderer shares the window's device and submitted its work from the
render service's threads at any time. A window reconfigures its surface when
it opens and when it is resized, and wgpu fails that when another thread
submits meanwhile: 'Surface::configure: Failed to wait for GPU to come idle
before reconfiguring the Surface'. In 0.2.1 that error was a panic, so
AniCraft closed at start-up or on a resize (#264, #309, and with them the
'won't open' reports #421#412#313#286#285#268#164); since ADR 0092 it
is survived, at the cost of a skipped frame, an autosave and a status line
blaming the graphics driver.
A SubmitGate (crates/gpu) is open while the window's thread runs the app's
frame and closed otherwise, also around windows drawn inside the frame (Test
Movie, floating panels). Work waits for it (asking for a frame), at most
250 ms; the renderer's starting self-test goes through it too.
Measured on Windows 10, RTX 5090, Vulkan, --screenshot starts: the error in
3 of 20 starts before, 0 of 20 after; 2.81 s and 2.80 s per run.
Text keeps its filters next to its styled runs. In HTML export, static text in several colours
with filters is one item of pieces (pp), so the pieces share one filtered group as evaluate
draws them; the page's player draws such items piece by piece.
* The page's player draws text with filters in a filtered group of its own,
as evaluate does (fx/fm on static text and fields); typed text in an input
field is the browser's and is reported.
* XFL: a text field's <filters> come in on the text instead of being
reported as skipped.
* GPU parity on filtered text: max 1/255, mean 0.003-0.005 (RTX 5090, Vulkan).
A filter list entry carries an enabled switch (FilterEntry, flattened into the filter's
own object, so older files open unchanged); evaluate and the HTML export leave switched-off
filters out, so every renderer and export draws them as absent. New filter.* commands:
move, enable, remove, copy, paste, and presets (list, save, apply, rename, delete, export,
import) kept in the session like brushes. XFL import keeps disabled filters, switched off.
Classic tweens pair lists that include switched-off filters.
Paint::Linear and Paint::Radial gain optional spread (extend/reflect/repeat)
and linear_rgb; radial gradients gain a focal point and a matrix (any
ellipse). All default and are skipped when unset, so older files and plain
gradients are stored as before. The CPU oracle, the GPU stage (and its
emulator), SVG and HTML export, and SVG and XFL import handle them exactly;
Lottie reports what it can't show. Fill frames (Paint::frame/with_frame/
fitted) are the basis of the Gradient Transform tool.
The fine shader wrapped a repeating bitmap's taps with ((q % size) + size) % size.
naga (30.0.1) writes WGSL's integer % as GLSL's, which is undefined for
negative operands, and the bilinear tap left of or above the edge is -1. On
the GL backend (llvmpipe in the FreeBSD VM, which has no Vulkan driver) the
edge texels came out wrong: bitmap repeated max 79, filtered bitmap max 16, so
FreeBSD x86_64 has failed since bitmap fills landed (0dae205). Vulkan, DX12
and Metal define the remainder, so Linux CI passed.
wrap() takes the unsigned remainder of |i| instead, defined on every backend.
shaders_take_no_signed_remainder parses every shader with naga and fails on a
% whose left operand is a signed integer; it fails on fine.wgsl before this.
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.
Commands read and write files through engine::vfs: std::fs on the desktop, an in-memory
store in the browser that the web shell fills from the file picker and empties into
downloads (ADR 0036). file.open opens .fla bytes through it and gains unsaved?: true for
restored copies. Instant/SystemTime come from web-time; rayon's deferred drops run inline
on wasm; the GPU crate plans layers in turn where wgpu handles aren't Sync; video export
says why it can't run in a browser; system font discovery is native-only.
The shell's gpu-stage feature is on by default and Preferences > Stage >
Renderer defaults to Graphics card (GPU), with the CPU drawing whenever
there is no usable card, a tile is past the GPU's limits or anything
fails. The setting is stored under a new key: every earlier build wrote
the old one as Cpu without anyone choosing it. CI installs lavapipe so the
parity tests run on a software adapter.
Measured (release, RTX 5090): 4K filtered sample 3.9 ms on Vulkan and
4.2 ms on DX12 (CPU 31.5 ms); 200 bitmap fills 4.4 / 4.3 ms (CPU 37.2 ms).
Docs: ADR 0031, performance, roadmap, architecture, CHANGELOG.
FXC must unroll loops that index vector components and could not unroll
blend's and adjust's, so the GPU stage never started on a DX12 window.
Both are vector code now, with the same arithmetic order. The parity
suite passes on DX12 as on Vulkan. A software adapter (WARP, llvmpipe)
is refused for the stage, since the CPU oracle is faster;
GpuRenderer::software() opens one for tests. The self-test now compares
against the oracle (bitmap and filtered symbol included) and says where
it went wrong. The benchmark gains a filtered sample and 200 bitmaps.
The oracle now hands filtered groups to other renderers as layers
(prepare_scene: Scene::layers, Fill::layer) and resolves each filter into
the exact steps it runs (filters::resolve); apply runs those same steps.
The GPU stage samples bitmaps from textures uploaded once per image
(bilinear by hand, the oracle's colour effect and repeat rules) and draws
each filtered layer, runs its filters as compute passes and composites it
like any fill. Parity: bitmaps byte-identical, filters max 1/255.
The GPU stage shares eframe's wgpu device (egui_wgpu::RenderState) and
draws each stage tile into a storage texture the shell registers with
egui as it is. Fallbacks: a headless device with readback (window on
OpenGL), then the CPU oracle. Every call runs in thread-local error
scopes; nothing is installed on the window's device; a work bound per
dispatch guards the driver watchdog.
The engine stays GPU-free: Raster::Native carries an opaque image, cached
under its own 384 MB budget; only the shell downcasts it.
perf, gpu_bench on RTX 5090 (Vulkan), 32 threads:
4K, 1,000 shapes: CPU 16.2-19.6 ms, read-back 8.4, direct 2.1-2.4 ms
4K, 10k shapes: CPU 25.8-28.1 ms, read-back 23.2, stage tiles 10.2 ms
4K, masked 10k: CPU 74.8-80.0 ms, stage tiles 10.9 ms
Binning stays on the CPU (ADR 0029: not the bottleneck as stage tiles).
render::prepare_scene hands the oracle's prepared fills with their clips
(artwork, cleaned parents, bounds) and groups (chains, sanitized alpha,
blend) to the GPU. The binning emits per-tile streams with clip-level and
group open/close entries; fine.wgsl keeps a per-pixel group stack and clip
coverage and blends with the oracle's separable W3C formulas. Parity on
the RTX 5090: max 1/255, mean <= 0.0011/255 on every new scene.
Also a texture entry point (main_texture) and GpuRenderer::shared for the
window's device; render_texture draws without readback.
The stage draws the camera frame in the camera layer's colour; the Camera tool
(C) pans, turns (round handle) and zooms (wheel), one undo step per drag;
View > Preview Through Camera renders stage tiles through the camera; the
timeline header toggles the camera; Properties gets a Camera section and a
layer Depth row. GPU parity and the accessibility audit cover camera scenes.