Skip to content

Latest commit

 

History

History
376 lines (254 loc) · 135 KB

ToDo.md

File metadata and controls

376 lines (254 loc) · 135 KB

vega-webgpu roadmap

Tracking the gap to a production-grade, canvas-matching WebGPU renderer.

Open work comes first, grouped by what it blocks. Everything already landed is kept below, grouped by theme, because most of it records a decision and the measurement behind it rather than just a change.

The goal for 2.0.0 was narrow: every mark and mark property vega can express is drawn, the output matches the canvas renderer, and no spec is slower than it. It shipped on 2026-10-04. Anything that would be an improvement on canvas rather than parity with it was left for later.

How a difference is measured

WEBGPU_FIDELITY=1 npx playwright test fidelity ranks every spec and fixture by three numbers, which say different things. diff is the share of pixels that moved, max is how wrong the worst block of two scene pixels is, and mean is the average error over inked pixels. A soft antialiasing difference is a high diff and a low max, a misplaced mark is the reverse, and a systematic one shows in the mean. The per-spec gate in render.spec.ts uses diff plus a densest-32px-tile measure, since a whole-image percentage is diluted by however much of a chart is empty.

Currently 184 cases, 35 of them matching canvas to within 2 levels everywhere.

by max channel error   0-2: 37   2-8: 17   8-32: 87   32-128: 43   over 128: 2
by mean channel error  0-1: 102   1-2: 28   2-4: 31   4-8: 18    over 8: 7

Read together those two say where the work is. Systematically we are close, 130 of 186 averaging under two levels over their inked pixels. Only two are over 128 and both are skipped with a reason, clip-path-round at 179 and gradient-diagonal at 177. text-variants was a third at 180.5 and reads 1.0 now that a stroked glyph is given room for its miter, and line-curve-caps a fourth at 212 and reads 27.8 now that a curve draws its round cap.

What is left is local, and it is not one cause. Past the two skips the worst are label at 113, which is vega translating to each item and back and is an upstream report below, contour-map at 99, symbol-shapes at 74 and playfair at 71, then the map and choropleth family at 60 to 69, which is the polygon seam model. Each is a few pixels in one place: contour-map differs on 0.023% of its frame and its interiors read 0.94 over 174k flat pixels.

Skipped in the render suite

Two fixtures are recorded and shown but not gated. A skip is the alternative to raising a budget past what a measure reports, which would write a defect down as if it were a tolerance. Each carries the release it is queued for in skippedScenes in test/render/scenes.ts, and that milestone reaches the gallery as a badge on the row and a banner over the case, and the test report as an annotation. The pngs are recorded either way, so the difference each one names is on screen beside the cases that pass.

fixture queued for what is wrong
clip-path-erase 2.1.0 an erasing compositing operator inside a clip path erases the box of the path rather than the path
gradient-diagonal upstream canvas draws a diagonal ramp as a pattern at the group origin and leaves marks blank. We are the correct side of this one

gradient-diagonal is not ours: matching canvas there would mean deliberately not drawing marks, so it wants the upstream report below rather than a fix here.

Eight more specs skip on a run, and none of them is a defect. They are the diagnostics that only run when asked: six under WEBGPU_BENCH, one under WEBGPU_FIDELITY and one under WEBGPU_DIAGNOSE. A ninth is the half pixel baseline case in textdrift.spec.ts, which has nothing to reproduce at an even pixel ratio and so skips at dpr 2 only. A full run reports 10 skipped at dpr 1 and 11 at dpr 2, and two of those are the table above.

Open: outside the code

2.0.0 shipped without these. None of them is code in this repository.

  • Report the path reading to vega, upstream. path/render.js reflects the running control point for S and T whatever command came before, where the spec reflects only after a curve of the same kind and otherwise takes the current point. Its own t gets this right and T does not, so the two forms of one command disagree. An arc with a zero radius is also dropped rather than drawn as a line to its end. None of it is hard to fix and all of it changes what existing charts draw, so it wants a report before a patch. We match the current behaviour deliberately, which is what path-commands holds.
  • Report the canvas matrix drift to vega, upstream. markItemPath.draw and path.draw translate to an item and back by the negated offset, so every item leaves a little of itself in the rasterizer's matrix while the matrix vega can read stays exact. Over a few thousand items it reaches 1e-4 to 3e-4 of a pixel, enough to move any text sitting on an exact half pixel baseline by a whole row, which is what label shows. save and restore around the item is exact and is a two line change. Measured and reproduced in the landed label entry above.
  • Report the non axis aligned gradient to vega, upstream. util/canvas/gradient.js sends a linear gradient whose endpoints are not axis aligned, on bounds that are not square, down a second path: it renders the ramp into an offscreen image the size of the item and returns createPattern(image, 'no-repeat'), which is vega #2365. A no-repeat pattern anchors at the origin of the space the fill happens in, nothing calls setTransform to move it onto the item, and drawPath fills after the item translate has been undone, so it lands at the enclosing group's origin. A mark further from that origin than its own bounds are wide is filled with nothing at all. Reproduced and measured in gradient-diagonal, three non-square diagonal rects of which canvas draws one partly and leaves two blank, which this renderer does not match on purpose. The fix upstream is a pattern transform, or a gradient with the ramp transformed into bounds space. The mark playground uses an axis aligned gradient, so it exercises the path specs actually take.
  • Report the broken image to vega, upstream. marks/image.js draws when img.complete || img.toDataURL, and a url that failed to load leaves an image that is complete and carries no pixels. drawImage throws InvalidStateError on one, so a single bad url costs the canvas renderer the whole frame rather than the one mark. Reproduced on a 404, an undecodable data url and an empty url: renderAsync rejects and nothing is drawn, the background included. A width test on the image alongside the complete test is the fix, which is what this renderer does now.
  • Revive #21.
  • Branch protection on main, the one GitHub setting left. typecheck, lint, build and the render tests run in Actions on every push and PR (ci.yml), uploading the report and the raw images as artifacts. pages.yml builds the site and uploads it with a gallery of the whole corpus as that commit draws it, beside the nine runs before it, recorded fresh rather than committed and each png stored once. Its record step does not gate the deploy: the pngs and the manifest are written before the assertions, so the gallery ships showing where the renderer stands, which is what it is for, and ci.yml is the workflow that gates. The Pages source is set to GitHub Actions. What is left is branch protection, so a merge waits on the checks. release.yml pushes the hosted build straight to main with the Actions token, which a rule requiring the checks would refuse, so that push needs a way around it first.

Open: 2.1.0 and later

  • Tell people about npm. vega-webgpu is on npm since 2.0.2, and release.yml publishes every release through trusted publishing, an rc under next. The README and the project page still only show the hosted script tag.
  • PR to widen vega-typings Renderers union to include 'webgpu', which matters once the package is on npm.
  • Every pipeline owns its own bind group layout, which has cost four bugs. createRenderPipeline passes layout: 'auto', so two pipelines built from the same shader and the same uniform block still get layouts that are not interchangeable, and a bind group made from one is rejected on the other. WebGPU throws out the whole command buffer for that, so the symptom is a black frame rather than one wrong mark. It has turned up on the line mark, on the symbol mark's circles, on a group border held back to after its children, and on the curve spans, each time as a cache that kept a bind group across a change of blend. Every one was found by accident. An explicit GPUPipelineLayout shared by the marks that share a uniform block would make a bind group interchangeable between them and retire the whole class, rather than leaving it to be caught a fifth time.

Carried over from 2.0.0. The edge residuals wait on analytic coverage for triangulated fills, the gate wants a perceptual metric for its last blind spot, and the diagonal ramp is for vega to fix.

  • A ramp that is not axis aligned is a pattern in vega, placed at the group origin. util/canvas/gradient.js builds a canvas gradient only when the ramp is horizontal, vertical or the bounds are square, and renders anything else into an image handed to createPattern(image, 'no-repeat'), which is vega #2365. drawPath fills after the item translate has been undone, so the pattern lands at the enclosing group's origin rather than at the mark, and a mark further out than its own bounds are wide is filled with nothing at all. The new gradient-diagonal fixture is three non-square diagonal rects, of which canvas draws one partly and leaves two blank, with a square box and a horizontal ramp as controls: it reads 23.057% of pixels, a 100% worst tile and a signed mean of 76.52, and is skipped with that measurement. Matching it means deliberately not drawing marks, so it is a decision rather than a fix, and it wants reporting upstream first. A symbol reads differently again, drawn everywhere with a ramp that advances with x, and this did not pin down why.

  • Analytic coverage for triangulated fills, re-scoped. MSAA expresses quarter steps, so an axis-aligned path edge landing exactly on a pixel boundary reads 0.25 or 0.75 where canvas fills the pixel. That is still true and still the reason a triangulated edge differs at all. What this entry used to claim is not: it said the item was the largest single parity gap and that almost all of the 32 to 128 band was this one cause, citing arc-shapes at 109 and path-shapes at 61. Those were single-pixel worst-channel numbers from the measure the suite replaced, because one antialiased edge pixel landing the other side of a rounding boundary reads 255 on a render that is otherwise exact. Measured again on the block the suite gates on, the three fixtures this names read arc-shapes 29.8, area-shapes 21.3 and path-shapes 18.0, all inside the default of 70, and none of them appears in the worst fifteen of the corpus. The band is instead a mix of the polygon seam model, curve construction and the canvas matrix drift, each tracked on its own. So this is worth doing for exactness rather than because it dominates anything, and the honest ranking puts it behind the path clip, which is the worst case in the corpus and a vega form drawn wrong rather than an antialiasing difference. The approach when it is taken is signed-area accumulation per contour edge into a coverage target, then one composite, which is also what per-item compositing would want.

  • The cross-check gate tolerates a pixel being 39 levels off. diffPngs runs pixelmatch at threshold: 0.15, which for a neutral shift is 39 of 255 before a pixel counts as different at all (measured: 39 passes, 40 fails, and 60 on a single channel). A mean channel budget now covers that blind spot from 10 upward, proved by darkening a render 30 levels and watching six specs report 0.000% differing pixels and a 0.0% worst tile while the mean gate fires. Tightening the threshold does not close the rest, which was measured over all 134 pairs against a synthetic 15 level colour error: at 0.15 and 0.1 the error is still invisible on some specs (0.00% of pixels), and at 0.05 and 0.02 it shows on most but the legitimate differences climb to 12.4% and 16.2% with 27 and 64 specs over 1%, and no single threshold separates the two populations. The reason is structural. A differing-pixel count is a fraction of the whole canvas, so it mixes how wrong a render is with how much ink it has: a sparse spec drawn entirely wrong scores under a dense spec drawn correctly. The mean is the ink-normalized measure, and the same error reads 12.4 to 15 on every one of the 132 non-exception pairs regardless of density. That band is closed now, by the sign. A coverage difference pushes pixels both ways and a systematic error does not, so the mean signed channel error over inked pixels separates them where the unsigned one cannot: 102 of the 145 cases sit under 0.5 of a level on it, and what is over is two known populations, the polygon seam model on the maps and choropleths and sparse specs whose inked pixels are nearly all edge. It holds a default budget of 2 with fifteen listed exceptions. gate.spec.ts is the proof rather than an argument: stocks-index, which is text and a thin line and so the case every other measure is weakest on, drawn four levels darker reads 0.000% of pixels differing, worst channel 4 and mean 2.91, all three inside their budgets, while the signed mean reads 2.86 and fires. The gallery shows it beside the others. That band is now covered where there is interior to measure it on. Chromium masks edges with a Sobel filter before diffing, and the same idea here (the mean over inked pixels whose 3x3 neighbourhood is flat in both renders) collapses the legitimate differences to a worst of 1.55, so it holds a budget of 3 and catches a 5 level error where the mean needs about 12. It does not apply everywhere: text and thin lines have no flat interior at all, and 30 of 134 cases cannot fill the 1000 pixel sample, so those keep the mean alone at roughly a 12 level floor. Closing that last group needs a real perceptual metric, FLIP or SSIM as a second check. A second thing the threshold does, which reads as a much stronger claim than it is: a case reporting 0.000% differing pixels is not a case that matches, it is one where nothing passed the threshold. Counted over the corpus, 71 cases print 0.000% and not one of them has zero differing pixels. isocontour-airports reads 0.000% with 25.04% of its frame a level or more apart, map-area-compare 22.88%, regression 21.37%, and their worst channels run to 52. Every one of them has ink on both sides, so none is the empty comparison that would also read zero. The raw count is recorded as touched now and the gallery shows it beside the gated one, so the zero cannot be read alone.

    Each of the other five measures has a case of the same shape in gate.spec.ts now, so the claim that six measures each answer a question the others cannot is executable rather than written down. One render, one injected error, the measure it belongs to firing and the rest inside the same defaults the suite gates on: an inked pixel moved 16 levels either way reads mean 15.65 against bias 0.38 and 0.000% of pixels, a 6 pixel blot at 255 levels reads block 255 against 0.025% of pixels and a 3.5% tile, a 22 pixel blot at 45 levels reads a 47.3% tile against block 45.0 and 0.481% of pixels, interiors moved 5 levels either way read flat 5.00 over 13904 px against mean 3.36, and 32 rows moved 2 pixels sideways read 1.107% of pixels against bias 0.00 and flat 0.00 over 29904 px. Two of them say something about the measures themselves. The densest tile cannot separate from the pixel count on a fixture, because 35% of a 32 pixel square is 358 pixels and that is already 0.24% of a 680x216 frame against a 0.2% budget, so it earns its place on the larger frames only. And the pixel count is alone on a displaced mark only because a spec is not held to the block measure, which reads 185 on the same case. A sixth hole was open under all of them: every measure is a comparison, so two renders that both draw nothing agree on all six, and each comparison now asserts the pair drew on at least 0.5% of the frame, against a corpus minimum of 1.60% on rule-degenerate.

  • What is left in blend-marks is not the blend (worst channel 53, over the whole fixture). The arc and path get their edge coverage from MSAA quarter steps, and are off by the same amount with no blend set, so they belong to the edge-coverage item rather than here. The line that held this at 141 is fixed.

  • stocks-index holds worst channel 106, and it is a cusp rather than the text. Re-measured: 106, not the 180 this said, and the worst pixel is at 603,153, which is the bottom of a sharp V in one of the lines and nowhere near the label band this used to blame. Canvas has the stroke colour at full alpha and we have 138 of 255. The line is linear, so it takes the segment shader and a real join. Where two segments double back on each other the bevel limit collapses to nothing, so each is cut at the vertex and the pixel there keeps half of one segment's falloff, where canvas fills it from the union of two rectangles that overlap. Neither the bisector nor a coverage mask can answer it: the two contributions cover different halves of the pixel, so compositing them gives three quarters and taking the larger gives a half, where the union is the whole. It wants true area coverage, which is the item above, and it is one pixel per cusp. driving holds the same thing on a curve.

Worth doing, not worth holding a release for. The performance entries are allocation churn or repeated work rather than anything that shows as a slow frame today.

  • Picking a spec while the last one was still drawing threw on the test page. Cannot read properties of null (reading 'background'), and the page was left half set up. Every control there starts a load and a load awaits twice, so a second click ran the first one's tail against the second one's state: disposeAll clears the view at the top of a load, and the next statement that reads it is past an await. The window is the second load's own fetch, so it needs the first to be inside runAsync when it opens, which is why it shows at a gap of 20 to 50 ms and not at 5 or 90. Each run now checks it is still the current one after every await and gives up if it is not, finalizing anything it had already built. demomode.spec.ts picks a heavy spec and then a light one at five gaps, and fails on the null without the checks.
  • The side by side benchmark can be run one renderer at a time, and reports a cost for each. It showed one figure for the pair and the slower renderer set it, so the faster one had nothing to show: on the benchmark at forty thousand symbols both read 9 renders a second. Two views on one page take turns on one thread and vega's timers all fire in one animation frame, so the pair advances in lockstep, and no way of driving them changes that while a vega View cannot run off the main thread. A run control holds one view still instead, by swapping its run and runAsync for no-ops and putting them back, and the other then shows its own speed: on a real adapter the webgpu view goes from 9 to 60 renders a second with the canvas one held, where the canvas view stays at 9 with the webgpu one held. Each renderer is also counted and timed on its own now, one line each, so the cost stands beside the rate: 1.6 ms of cpu against 35. Worth knowing for anyone reading numbers off this: the render suite forces the SwiftShader software adapter, where the same measurement inverts and reads 9 for canvas against 2 for webgpu. WEBGPU_HARDWARE=1 is what puts it on the real one. demomode.spec.ts holds the mechanism rather than the ratio for that reason.
  • Viewport clipping. movies-sort is 212x47678 logical pixels, so it draws at 0.17x to fit the GPU texture cap and every mark is built each frame whether or not it is on screen. Draw only what is visible: keep the canvas the size of the viewport, clip to it, and scroll the scene inside it, while the page behaves as though it were one tall canvas. Optional and off by default, since it changes what a screenshot of the view contains.
  • movies-sort takes about 3.4 s to draw its 95k-px-tall canvas, and every mark is rebuilt each frame whether or not it is on screen. Fixed by the viewport clipping item rather than on its own.
  • A canvas larger than the texture limit draws softer, never sharp. WebGPU caps every texture, the swapchain included, at maxTextureDimension2D, which the device requests at the adapter's own value (16384 on this machine, 8192 on SwiftShader). A view whose device pixels exceed that drops its pixel ratio to fit and draws softer, with one warning, which covers browser zoom on a large view. The ratio goes below 1 where it has to: movies-sort is 212x47678 logical pixels and draws at 0.34x here and 0.17x on SwiftShader. Tiled rendering is the general answer, viewport clipping the cheaper one.
  • The earthquakes globe is 80% our own cpu, nearly all of it d3-geo. A frame is 23.4 ms, of which renderAsync is 18.7 and vega's dataflow 4.7, with the gpu idle at 0.00. Within ours the shape mark is 18.25 ms: about 5.7 ms building a 114 KB path string, 2.3 ms parsing it back, the rest fill triangulation. Feeding d3-geo a PathSink removes the string and the parse, the way lineSpans did for curves, but geometryForPath caches by path string so a sink needs another key.
  • Area marks with a curve still tessellate. The same treatment needs a fill rather than a stroke, so it wants the span's own geometry rather than a ribbon: horizon, stacked-area and playfair are the specs waiting on it.
  • The GPU curve instances are rebuilt every frame. basis and bezier both re-run d3's generator and repack the span array on every render, where every other geometry producer memoizes. A static chart re-rendered on hover or pan pays for control points that did not change.
  • Reuse buffers rather than recreating them. A frame's buffers are released once the frame after theirs has been submitted, which fixed the leak, but they are still created per draw. Reuse was tried and reverted: a pool keyed by size and usage is easy to get wrong, and one that hands a uniform buffer to a vertex slot fails 76 specs. Worth revisiting with the whole usage in the key and the renderer-swap test watching.
  • Per-draw bind groups remain. The buffers are shared but each draw still builds its own bind group. Cache those against the same key.
  • One draw state on the context. A uniform buffer keyed by its values and a memoized bindGroup(pipeline) would replace BufferManager's setters and the three bind groups marks still hold by hand. The bounded caches and the clip in the dispatcher it needs have landed.
  • The mask and composite pipelines through markPipeline. The clip mask, coverage mask, mask composite and blend composite pipelines are built outside it, so a sample count change still has to clear _markCache to reach them.
  • Rules through segments and circles through the symbol distance functions. One shader fewer each, and pixels move, so each wants its own run against the suite.
  • Per-item buffer churn in text/rect gradient paths: a uniform buffer, bind group and vertex buffer are allocated per item per frame and never explicitly released, leaning entirely on GC. Pool or batch them (ties into the retained-geometry work under Performance).
  • markClip allocated a scissor rect per mark per frame. It is gone: the renderer narrows the clip only for a mark that carries one of its own.
  • Downscaled images resample differently. The texture had one level, so an icon drawn at a quarter of its size read four of the sixteen texels under each pixel and dropped the rest. Canvas does not: measured against its own drawImage at a quarter, the average of all sixteen lands within a level of what it draws (187,155,116 at alpha 97 against 186,156,117 at 113 on the edge pixel it was checked on) where a bilinear read of the same four comes back empty there. So a chain, each level drawn from the original rather than halved from the one above it, since halving compounds the filter and comes out softer than canvas at every level past the first. The chain alone measured worse, 0.179% of pixels and mean 5.41 to 0.343% and 6.46, and the reason is in the spec: two of its four marks scale width and height by different amounts, and one level for both axes blurs the shallower one by the difference. With maxAnisotropy the whole spec moves together, 0.179% to 0.160% of pixels, mean 5.41 to 3.64, worst channel 114 to 89 and the flat mean 0.97 to 0.93, and at dpr 2 it holds 0.024%, 1.49 and 72. The pixelated sampler is clamped to the first level instead, since a 2D context with smoothing off is nearest at any scale.
  • The other blend modes need the destination inside the shader, and they have it. Once the layer and the backdrop copy existed for the two items above, a mode is one entry in a table: overlay, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, hue, saturation, color and luminosity, the separable ones as an expression and the four that are not through the spec's own SetLum and SetSat. blendKey no longer drops any of them. The fixture that pinned the gap is now blend-readback, all eleven over a two-tone backdrop, and it reads 0.000% of pixels, a mean of 0.04 and a worst channel of 1 where it read 10.862%, 42.02 and 187 as a control. Its four budget exceptions are gone with it.
  • Per-item compositing would reproduce canvas's polygon seams, if it is ever wanted. Canvas composites each shape separately, so on a shared edge the background survives a * (1 - a), up to a quarter of the pixel. One multisampled pass cannot do that: the samples of a pixel are partitioned between the two polygons and the resolve averages them into full coverage, which is the geometrically correct answer and the reason one pass can draw a whole mark. Reproducing it without a pass per item wants a second multisampled attachment holding the item index per sample, and a resolve that groups a pixel's samples by owner and composites the groups in draw order with count / sampleCount as each one's coverage. That is canvas's model at quarter-step granularity, in one geometry pass plus a full-screen resolve. It breaks down for translucent marks, where a sample has no single owner, so it would need the current path as a fallback. Costed, not started, and named in the README as work for a release after 2.0.0 rather than something that will not happen.
  • The bundle is 153.0 KB minified, 45.7 KB gzipped, and two thirds of it is ours. Measured off the minified sourcemap: our marks 35.2 KB, our shaders 22 KB after the wgsl minifier, our util 19.2, tess2 26.8, d3-shape 7.1, d3-color 7.1, everything else under 2 each. tess2 has to stay, since earcut cannot take the self-intersecting contours a projected map produces. The three svg path packages are gone, since vega parses a path itself and we have to read it the way it does. d3-color is only used to parse a css colour string, which ctx.fillStyle = s; ctx.fillStyle does exactly and in the same way canvas will, so a memoized canvas parse would drop 7.1 KB and remove a way for our colours to disagree with canvas. Worth doing, not started, and it touches a hot path so it wants the render suite watching.
  • Symbol bounds, upstream. vega measures a symbol's box by replaying its path for every item on every frame, which is most of a frame on symbol-heavy specs. Measuring the design once instead is exact for every shape when unrotated and 9x faster on the bound pass at 800k symbols. A patch sits on a local branch of a fork, not proposed.

Open: cosmetic, or a dev task only

Nothing here changes what a user sees, or it is one pixel in one spec.

  • powerPreference warning on Windows (cosmetic, crbug.com/369219127).

  • A dash along a curve lands a little off where canvas puts it. path-transforms-dashed and group-variants hold a pixel-count budget over the fixture default for it: 0.195% and 0.230% of pixels at dpr 1 against the 0.2% default, and 0.333% for the first at dpr 2 on CI. The same paths undashed are inside the default, so it is where the pattern falls along the curve rather than the curve itself.

  • driving holds worst channel 101, at one pixel: the cusp where its cardinal curve doubles back, which canvas joins and the GPU curve spans butt against each other.

  • Highest mean channel error, meaning a systematic rather than local difference. Current: line-curves 13.1, rule-diagonals 12.6, map-fit 10.4, map-fit-stroked 10.1, choropleth-stroked 8.5, regression 7.2, layout-wrap 6.8, choropleth 6.3, dot-plot 6.1, barley 5.9. These are the cases where every inked pixel is somewhat wrong rather than a few being very wrong. rule-diagonals is known to be canvas rather than us, and the two map and two choropleth entries are the polygon-seam model, so a high mean against canvas is not on its own proof of our error.

  • Parameter coverage: exercise multiple settings per feature (curve types, symbol shapes, line dashes, autosize modes) so regressions in a single parameter are caught. Three of the four are covered, and audited against the values rather than by eye. Every value of blend, strokeCap and strokeJoin vega's schema allows is drawn by a fixture, and scene.spec.ts holds that against the same generator releases/vega-enums.js comes out of, so a vega release that adds one fails rather than going unnoticed. line-interpolate draws all 23 entries of vega's curve lookup on one set of points, the open and closed forms, three bundle betas, both cardinal and catmull-rom tensions and monotone each way round included, and reads 0.146% of pixels, worst block 61.8, mean 4.85 and a flat mean of 0.00 over 10227 px: every curve interior is exactly canvas's colour and the whole difference is the edge, spread evenly over the 20 curved cells at 5 to 8 mean each while the three step forms are exact. Every built-in symbol shape and three custom paths were already covered, and six fixtures carry dashes. What is left is autosize, which is a View property rather than a mark one, and the corpus exercises none, pad, fit and fit-x of it.

  • The image mark had no fixture, and now has two. image-variants is every property that decides where an image lands, drawn at the source's own size so nothing in it is a resampling difference: the default corner, align and baseline each way, a width or a height alone with the other derived, both letterbox branches of aspect, opacity, three urls in one draw, smooth off at 1:1, multiply over a rect and a half pixel origin. It reads 0.000% of pixels, worst block 1.0 and a flat mean of 0.01 over 37890 px. image-resample is the scales: halved, quartered, 0.7 which lands between two mip levels, stretched differently on each axis, a letterbox that rescales, and doubled with smoothing on and off, at 0.002%, worst block 26.0 and mean 0.36. Neither needed a budget.

    Writing them found one bug. A url that fails to load leaves an image that is complete and carries no pixels, drawImage throws on one, and the image mark drew it anyway: one bad url took the whole frame with it, logged as [vega-webgpu] Render failed: InvalidStateError and nothing on screen. The mark skips an image with no pixels in it now. The canvas renderer throws the same way on the same input and loses its frame too, so there is nothing to compare against and scenes-hostile/image-broken holds it instead: a 404, an undecodable data url and an empty url beside one image that loads, which paints 8.56% of the frame where it painted 0.00% before.

  • Shader variants are already a dictionary lookup. Pipelines live in ctx._shaderCache and res.sdfPipelines, compiled on first use and fetched by key after, so per-mark specialisation would not move the numbers: CPU mark drawing is 3.4 ms of a 13 ms frame and shader setup is none of it. Worth revisiting only if a profile shows pipeline switching itself costing.

  • The rest of a 300k frame is vega, not the renderer. At three hundred thousand points the whole loop is 82 ms, of which renderAsync is 7.1 and the gpu 0.4. The remaining 75 ms is vega's dataflow recomputing every x and y from a signal, which is the same work whichever renderer is attached. Worth saying out loud whenever this renderer is compared against canvas, since canvas pays it too.

Landed

Landed: feature completeness

Each of these was a vega property that was parsed and then ignored, so a spec using it rendered differently with nothing said.

  • A round strokeCap on a curved line is drawn. The curve shaders cover the stroke across its width and stop at the end points, so a basis, cardinal, monotone, catmull-rom or natural line ended flat. Routing a capped curve to the tessellated path caps it and moves the curve itself further from canvas, measured as 80 differing pixels going to 145, so the cap is drawn where the curve is instead: each end of each run gets a two point stub along the end tangent, through the segment shader, with a butt at the end point and a round cap at the far end. The butt is what keeps it to the half beyond the curve, since a whole disc would sit over the curve body as well and composite twice there under any mode that reads the frame back. The writers report their own runs rather than the stubs being read back out of the instance rows: a basis span carries four B-spline control points and starts at (P0 + 4*P1 + P2) / 6 rather than at P0, so the rows cannot say where a run ends, and reading them that way put a disc at every span boundary. A cubic can also repeat its endpoint as a control point, so the tangent falls back through the other two rather than leaving that end uncapped. line-curve-caps goes from 0.279% of pixels and a worst block of 212 to 0.020% and 27.8, inside every budget, and is gated rather than skipped.

  • strokeCap square no longer drops strokeDash. strokeAsSegments sent a square capped mark to the extruded ribbon, on the grounds that only extrude-polyline draws a square cap. That stopped being true when writeSegments learned to grow a run by half a stroke at each outer end, which is the same shape, and rule, shape and line have relied on it since. arc, area, path and trail still took the old branch, and the branch is the only place the dash is applied, so the pattern was computed and thrown away. The gate is gone, so all four walk their outline whatever the cap, and two more call sites that read caps and join off strokeEnds while leaving square behind are fixed with it: shape dropped the cap on a solid stroke and kept it on a gradient one, and the line mark's own segment writer dropped it, which is why lineRoute forced a square capped line onto the tessellated path. It forces only a curve there now, since the curve shaders draw no cap at all. The new square-dashes fixture is the four marks dashed under a square cap with a line as the control, and reads worst channel 212 against canvas before the fix and 122 after, all of it one row at a dash end where the phase around a ring differs.

  • A gradient filled symbol blends its stroke. The fill took gradientPipelineFor(blendKey(item.blend)) and the stroke a fixed solidPipeline built with normal blend, so a symbol with a ramp and a blend drew a ring that ignored it. solidPipelineFor is the same blendPipelines helper the fill uses. The new blend-symbol-gradient fixture reads worst channel 194 with the stroke pinned to normal and 90 with it routed, the residual being a three pixel band inside the stroke of a tessellated ring.

  • A gradient stroke reaches every mark that strokes, and rule draws its stroke caps. symbol, rect, group, line and rule stroke through a shader of their own, a distance function or an analytic box, and neither can express a ramp, so each takes the outline walk a dash already takes. rule had no cap either: a round one is the segment shader's own end, and a square one is a butt end on a segment half a stroke longer at each end, which is the same shape. Measured on the playground against canvas, with the property on and against the mark plain: symbol 0.012% of pixels to 0.065%, rect 0.000% to 0.000%, group 0.000% to 0.000%, line 0.046% to 0.090%, rule 0.002% to 0.004%, and rule's cap 0.014%. Two things had to be right in the group: a ramp is per item so its border cannot join the batched one, and the border is held back until after the backgrounds, which is the order canvas paints them in. Enqueuing it early left the group's own fill over the inner half of its own border, four pixels of a four pixel stroke. The support table the playground drives has no no left in it, and gradient-strokes grew a symbol, rect, rule and line to hold it.

  • A round join drew one disc and butted the next segment into it, which doubles under a blend. The join encoding had a free slot, a bisector with no cut length, and a round join is exactly that: each segment keeps its own side of the bisector and rounds off at the end point, so the two halves of the disc are drawn once each. Before, the arriving segment drew the whole disc and the leaving one butted into it, which overlaps its body for half a stroke. Invisible under an opaque stroke and not under multiply, which multiplies the overlap twice. On the playground a line with strokeCap and blend together went from 0.413% of pixels to 0.107%, against 0.104% for the cap alone and 0.093% for the blend alone, and the new line-join-blend fixture reads 0.000% at both pixel ratios where it read 0.117% before. buttRound is gone with it.

  • A cached symbol buffer was being made in the frame pool, so every frame after the third submitted a destroyed one. [Buffer "Symbol Geometry Buffer"] used in submit while destroyed, on any scene holding a symbol shape with no distance function, which is cross, stroke and a custom path. The pool destroys a buffer two frames after the one that made it, and the shape cache went on handing out the same one. Nothing in the suite saw it, because WebGPU reports a misuse through onuncapturederror and carries on drawing, and nothing was listening: the pixels were right. gpuerrors.spec.ts listens now and redraws seven fixtures six times each, which reproduces it at seven errors without the fix and none with it.

  • A line mark held a bind group across a change of blend, which loses the whole frame. The segment draw cached its uniform bind group on the buffer alone, so a scene with one blended line and one unblended one set a group built from the normal pipeline's layout on the blended pipeline. That invalidates the command buffer, and with it every mark of the frame: dash-caps came out entirely blank, background included. Nothing said so, because the message goes to onuncapturederror. The cache is keyed by pipeline as well now. blendKey also warned that normal needs a destination read, since only source-over and nothing were treated as the default and vega writes both.

  • Two facing round caps across a dash gap are cut at the midpoint rather than overlapped. A round cap reaches half the stroke past the end of its run, so on any dash whose gap is under the stroke width the two runs either side overlap. Canvas fills the union of the bands once and we drew a band each, which composites the overlap twice: nothing under an opaque stroke, a dark bar at every gap under a blend. With equal radii each arc is the outer one on its own side, so cutting both at the midpoint traces the union exactly. The encoding had a free slot for it, a round end with a positive cut, and the cut is hard rather than a ramp for the same reason the bisector is: two ramps facing each other across one plane both report a half and compose to three quarters, which is a pale seam at every joint. On the playground a line with strokeDash, strokeCap and blend went from 0.779% of pixels to 0.262%, all five properties at once from 0.735% to 0.202%, and a rule from 0.275% to 0.044%. Merging the runs instead is exact only for a square cap, where the two caps fill the gap between them, and dashPolyline does that: two round caps cross short of the stroke edge and leave a notch either side that a merged run paints over, which measured worse than the overlap. The cut follows the line between the two ends rather than either direction, so it holds around a corner as readily as along a straight run, which is where a dash gap most often lands: at strokeDashOffset 22 on a big corner the two caps met across the turn and left a dark lens in the middle of it. It applies only past the end point, since carried into the band it slices a wedge off the side canvas draws, with a hard edge where canvas has an antialiased one. It shares the miter's encoding and is told apart by its length, which is always under half the stroke where a miter's is never under it. Two unit mistakes on the way, both caught at dpr 2 and invisible at dpr 1: the vertex stage measures in item units and the fragment in device pixels, since the vertex stage scales the cut across with everything else, and scaling it again in the fragment cut away most of the stroke. The new dash-corner fixture is one big corner dashed four ways and reads 0.018% of pixels against 0.531% with the cut off. On the playground a line with strokeDash, strokeCap and blend is 0.204% where it was 0.913%, all five properties at once 0.144%, and the blend now adds almost nothing over the dash alone at 0.135%. Past the end point the plane is the whole answer, since out there both shapes are only their caps. Inside the band the test is instead whether the cap it faces covers the pixel outright: around a sharp corner that cap reaches across the turn into this run's body, and cutting the band on the plane instead would slice a wedge off the side canvas draws. Without either, both drew it, which reads as a dark bisector through every corner. On the playground a dashed, capped, blended line goes from 9 pixels over 60 levels out to 1, its 0.913% of pixels to 0.173%, and dash-corner from 0.531% with the cut off to 0.008%.

  • A square cap is drawn on a dash. capEnd gave a square cap a butt end, so every dash run of a square-capped stroke was half a stroke short at each end. The writer lengthens the run instead, which is the same shape, and rule stops doing its own version of it. The dash-caps fixture holds a round, a square and a butt dash, blended and not, with a gap under the stroke width and one over it.

  • strokeDash reaches every mark that strokes. line, rule, group, rect, symbol, path, area, shape, arc and trail all walk their outline and dash it through the segment shader, since a dash cannot come out of an extruded ribbon or a shader that draws a whole ring. strokeOutline and dashPatternOf in marks/util.ts are the one implementation. Two things were wrong and neither was the phase the earlier note claimed. The dash was enqueued before the fill, so an opaque fill covered the inner half of every run: on path-dashes that was 400 of the 416 differing pixels, and fixing the order alone took it from 0.887% to 0.009% and mean 4.32 to 0.15. What was left was the seam of a closed contour, where the run that reaches the start point and the one that leaves it met as two flat ends and left the corner unpainted at worst channel 182. dashPolyline now joins those two runs when the input is a loop, so the seam is a vertex like any other. path-dashes holds 0.000% of pixels and worst channel 45 at the default budgets. The playground measures every mark against canvas with a dash on: group 0.000%, rect 0.083%, area 0.113%, shape 0.119%, line 0.135%, symbol 0.185%, path 0.193%, trail 0.530%, arc 0.734%, and rule 0.011%.

  • A dashed group border follows the corner radius. dashedBorderInstances walked the box as four straight sides, so a group with both cornerRadius and strokeDash got a dashed sharp rectangle. The outline now comes from vega's own pathRectangle generator, so the curve, where it starts and which way it runs are the ones canvas dashes along. The new group-corner-dash fixture holds 0.010% of pixels, mean 0.44 and worst channel 87. The residual is not the flattening: the contour is half a pixel shorter than the curve around the whole border, and cutting the corners finer to close that moved the dashes further from canvas rather than nearer (0.010% to 0.065%, 87 to 175), which says canvas is not measuring the curve either. Measured again over four cases at three settings, with the arc conversion fixed underneath it, and the coarse contour wins every one of them: at DASH_FLATNESS 1, 2 and 4, gradient-strokes reads 0.031%, 0.034% and 0.047% of pixels, group-corner-dash 0.010%, 0.031% and 0.033%, mark-dashes 0.032%, 0.038% and 0.043%, and the playground dashed arc 0.535%, 0.623% and 0.636%. So a dash is walked along a contour cut at 1 whatever the pixel ratio, and the fill is drawn on one cut at four times the ratio.

  • rect and arc draw strokeDash too, so every mark that strokes does. A rect stroke is analytic in the fragment shader and an arc is a triangulated ring, so neither can express a pattern: both take the outline walk the rest use, rect through dashedBorderInstances and arc through dashedOutline on its own contours. Measured on the playground against canvas, rect goes 2.616% of pixels to 0.083% and arc 2.739% to 0.734%, the latter under its own 0.816% with no dash at all. A dashed rect edge is pixel for pixel canvas's, and the three wedges of mark-dashes differ by 232, 248 and 226 pixels with the solid one in the middle, so what is left on an arc is its ribbon edge and not the dash.

  • A stroked trail is the widest of the triangulated marks, and the cause is compositing rather than geometry. vega writes one closed contour per trail segment and consecutive contours overlap, so two antialiased stroke fringes land on the same pixel and we composited both where canvas fills the union of the bands once. At the worst pixel canvas read 209, 111, 111 and we read 131, 79, 81, which is more stroke and not less. Not the flattening, which the first note assumed: at CURVE_FLATNESS 4, 8 and 16 the fixture read 0.174%, 0.184% and 0.181% of pixels, and dropping the simplification took the plain trail fixture to 5.984% since tess2 refuses the unsimplified contours.

    The stroke is drawn as one shape now. The bands go into a single sampled r8unorm mask under a max blend, where the largest coverage a pixel receives is the union of them, and a quad over the box the instances reach paints the colour through it in one composite with the item's own blend. The frame's render pass breaks either side of the mask pass and resumes with a load, so the MSAA resolve stays on the last of them. A gradient stroke still goes band by band, since a ramp cannot be read back out of a coverage mask.

    The new trail-overlap fixture is a wide ribbon stroked translucently and again under multiply, and it reads 0.046% of pixels where it read 3.645%, with the worst tile 0.6% against 25.8% and the signed mean 0.27 against 3.54. trail-stroked goes 0.172% to 0.048%, and 0.049% to 0.019% at dpr 2. What is left is where two contour strokes cross at an acute angle: the mask keeps the larger of the two coverages and the union is larger still, so the tip of each crossing is one pixel light. Summing them instead, or screening them, puts the double composite back (3.580% against 3.645% for no mask at all), because the bands mostly overlap along their length rather than crossing. One measurement went on the pass split: a render pass carrying a timestampWrites with neither index set is rejected, which invalidated the whole command buffer and drew a black frame. gpuerrors.spec.ts named it in one run.

  • A blend over a translucent source is inexact. The new blend-alpha fixture puts all four modes at four source alphas over a two-tone opaque backdrop, and it says which: multiply and screen are exact at every alpha (worst channel 1), since their factors expand to the formula canvas uses. min and max have no term to interpolate with, so darken and lighten read 44 and 38 levels out at half alpha. The first note blamed multiply for 3.0% of pixels, which the fixture does not support.

    Those two are evaluated in a shader instead. The mark draws unblended into a layer of its own, the frame is copied out beneath it, and a composite evaluates as*(1-ab)*Cs + as*ab*B(Cb,Cs) + (1-as)*ab*Cb over the two and replaces the pixel. blend-alpha goes from a mean of 4.55 and a worst channel of 44 to 0.08 and 2.

  • Text gradients shared a cache slot. The glyph raster bakes the fill, because it is drawn through vega's own canvas text mark, and textCacheKey joined item.fill straight in. Every object stringifies the same way, so one string drawn with three different gradients shared a raster and the last two wore the first one's colours. A paint that is an object is now serialized. The text-gradients fixture is three identical labels differing only in their gradient, and it measures 6.671% of pixels and mean 72.59 without the fix against 0.000% and mean 0.34 with it.

  • A blend mode needs an opaque backdrop. The same formula carries as*(1-ab)*Cs, the part of the source landing where the backdrop does not reach, and factors that reach the destination cannot carry that as well: a multiply over nothing came out black where canvas draws the source plainly. The layer above answers it, and when to pay for it is exact rather than guessed: source over leaves the alpha at one, so a frame cleared opaque is opaque wherever anything draws and multiply and screen can stay on the blend state there. A frame with no background takes the layer for every mode.

    What it costs, measured on the real adapter at 1600x1200 with a full height bar per draw: a frame of 1, 8 and 32 of them takes 9.03, 9.53 and 11.15 ms against 8.60, 8.95 and 9.25 for the same marks under multiply, so a layered draw is about 0.06 ms. The suite's own software adapter says 21 ms for the same draw, which is what rasterizing three full frame passes on the cpu costs and not what anything else sees. Worth writing down: the first reading said 717 ms for 32 of them and was entirely an artefact of the runner.

    The routing is central. markPipeline is the only place a mark pipeline is built, so a mode that needs the backdrop is built unblended there and the mode it was asked for is recorded against the pipeline. The queue reads that back and lifts the draw into a layer run, folding it in straight after, which also means each draw meets the frame on its own the way canvas composites a fill and then a stroke. No mark needed changing for it.

    The new blend-transparent fixture is all four modes over a half transparent backdrop and over none at all, on rect, symbol, line and arc, and and with the layer disabled it reads 15.791% of pixels, a mean of 32.70 and a worst channel of 159 against 0.000%, 0.10 and 40 with it. Three bugs came out of writing it. d3 gives a fully transparent colour NaN channels whatever was written, and those reached the clear value as they were, so a spec with a transparent background failed the frame outright. The symbol mark held one uniform bind group across a change of pipeline, so a mark whose items carry different blends set a bind group from the wrong layout and lost the frame. And a symbol shape with no distance function drew through a pipeline carrying no blend at all, so cross, wedge and a custom path never blended.

  • blend reaches every mark. group, image and text built their pipeline without one, so they always composited normal while the other nine honoured it. Each now takes a pipelineFor(blend) the way rect and area do. The catch was that a pipeline built with a default layout owns its own bind group layout, so a bind group made from the normal pipeline is invalid on a blend variant and the frame is dropped whole: every group and its backdrop vanished, with the reason only in a device warning. Every bind group now comes from the pipeline its draw uses, and the image texture cache is keyed by blend as well as by sampler. blend-marks-more covers group and text against canvas at 0.000%; image follows the same shape but has no fixture of its own.

  • strokeJoin and strokeMiterLimit are honoured, and the default is a miter. They were not even declared on StrokeStyle, so every interior joint of a segment line was rounded where canvas miters, and a sharp peak came out blunt and short. Both segments at a vertex now carry the same outward bisector and each keeps its own side of it, so their union is the joined outline: the miter reaches its apex on its own, since the bisector leaves the stroke exactly there, and a corner past the limit is cut back to the line canvas bevels along, which is perpendicular to the bisector at halfWidth * cos. One bisector rather than a join primitive per vertex, so there is no overlap between the two segments to composite twice. src/util/join.ts computes it, writeSegments carries each join to both sides of its vertex, and geometryForItem passes the same two properties to extrude-polyline for the triangulated marks. The new stroke-joins fixture walks narrowing apex angles as miter, round, bevel and a limit of 2, and holds 0.000% of pixels at the default budgets. Two details cost a measurement each. A round join is one disc, drawn by the segment arriving at the vertex, and letting both draw it composited the same disc twice and darkened its rim (line-shapes 67 to 78). And a pixel whose centre lands exactly on the bisector, which every axis aligned corner has, was painted by both, so the tie goes to one of them by the sign each segment already disagrees on (group-stroke 51 to 102 without it).

  • A curve is flattened four times as finely, which every consumer wants but a dash. svg-path-contours was run at its default, so a contour sat visibly inside its own curve, and once the strokes stopped being extruded ribbons that became the leading term rather than a detail under the MSAA quantization. The fixtures: arc-shapes 0.211% of pixels to 0.058% and its worst tile 2.9% to 0.7%, gradient-strokes 0.161% to 0.054%, path-shapes 0.034% to 0.005%, area-shapes max 74 to 57, trail max 81 to 61. The specs follow: horizon to 0.000% and max 59 to 45, area max 127 to 93, choropleth-stroked 153 to 145, map-bind 169 to 163, and the mean drops on every map. At dpr 2 it is larger still, and three fixtures left the dpr budget table: gradient-strokes, arc-shapes and trail hold their own budget there now. Two things bound it. A dash is measured along the polyline rather than drawn on it, so canvas is not walking the curve either and a closer contour walks the dashes further off: those take DASH_FLATNESS and stay coarse, worth 0.037% against 0.055% on mark-dashes and 0.010% against 0.034% on a dashed rounded border. The flatness itself follows the device grid, which took the corner fix below before it was safe.

  • A gradient stroke can be dashed. Only the extruded ribbon could sample a ramp, and a ribbon carries no dash, so a stroke that asked for both drew solid and the dash was dropped without a word. The segment shader has a gradient entry now, reading the ramp from the fragment world position the way the fill shader does, and every mark that outlines routes a gradient stroke through it: arc, area, trail, path and shape. Measured on the playground with both on, against each mark with neither: arc 0.424% of pixels to 0.451%, area 0.029% to 0.117%, path 0.110% to 0.112%, shape 0.056% to 0.126%, trail 0.167% to 0.452%, so the combination is at or under what the mark costs plain. shape keeps its held outline buffer for a solid stroke and only a gradient one pays for a draw of its own, since a ramp is per item and cannot share a bind group. gradient-strokes grew a dashed gradient arc and path to hold it.

  • A round stroke cap reaches path, area, shape, arc and trail. It rode in with the item above: those marks stroke through the segment shader now, and a JoinEnd in src/util/join.ts already carried the cap. extrude-polyline has no round cap at all and drew butt silently. Measured with one on, path 0.121% of pixels, area 0.122% and shape 0.126%, each inside its own budget. What is left is narrower than the item was: a line whose curve the GPU evaluates goes through the curve shader, which has no cap of any kind, and a rule draws its own rect, so both still butt.

  • A group background paints over an earlier sibling's children, the way vega draws it. Every background went into one instanced draw before any group was visited, so a later group's fill landed under what an earlier one had already drawn outside its own box. The backgrounds interleave with the visit when any group's box reaches into another's bounds, and keep the single draw when none does, which is what a row of panels looks like. The bounds rather than the box is the point: a panel's axis labels reach outside it and the next panel's fill covers them. The new group-overlap fixture is a pair that overlaps and a pair that does not, and holds 0.000% of pixels and worst channel 1. Forced back onto the batched path it measures 0.889% of pixels, a 46.9% worst tile and worst channel 196, so the fixture is testing the thing. Nothing in the corpus takes the interleaved path, which is the same as saying no spec here overlaps its panels, so the batch is intact everywhere it was.

  • Routing lines through extrude-polyline for miter parity was the wrong fix. It was tried and measured worse, not better: blend-marks went 0.024% to 0.912% and worst channel 141 to 161, because that path overlaps at a joint too and takes its edge coverage from MSAA. The bisector cut above gets the miter with neither cost.

Landed: matching canvas

  • Stroked text is drawn whole. A label is rasterized into an atlas cell sized from vega's own text bound, and that bound is the fill glyph box: textMetrics reports an advance and a height and neither knows about a stroke. The cell gave one pixel of clearance for antialiasing, so a stroke was cut off at every edge. Half the width is not the reach either, which is what the first fix assumed and why it left a worst block of 87.8: a glyph corner under a miter join carries out to miterLimit * width / 2, the bound canvas itself clamps to and the one geometryForItem already pads by. text-variants goes from 0.161% of pixels and a worst block of 180.5 to 0.000% and 1.0, and is gated rather than skipped. The other five text fixtures are unmoved.

  • A clip that is a path is cut to the path. vega parses clip: {path} and clip: {sphere} into a generator that draws the clip path, and canvas clips to the path itself where a mark here was held to a scissor rect, which can only state the box. The path is drawn into a coverage target of its own and every mark shader reads it, since every fragment entry already calls clipCoverage. Three things had to be right. The mask cannot share the stroke mask, which is one texture each pass clears, because a clip has to survive while every mark inside it draws and two clipped groups in a frame would overwrite each other, so the targets are pooled by index and reset per frame. It is drawn before the mark rather than inside it, because getMarkResources writes the flag that says a mask is bound and every mark calls that before it reaches its own clip. And it is multisampled and resolved rather than single sampled: coverage of a filled path comes from rasterization rather than from a distance function, so a single sampled mask cut with a hard edge and read 0.305% of pixels where canvas antialiases the clip. clip-path-round goes from 14.004% of pixels, a 98.4% worst tile, mean 42.46 and a worst block of 179 to 0.006%, 0.2%, 0.38 and 22.3, and is gated rather than skipped. A clip inside a clip is the intersection of the two for free, since the mask pass applies whatever clip is already in force.

  • A clip narrows the one it is inside rather than replacing it. context.clip() intersects with whatever is already clipped, and both markClip and the group visit returned the new box outright, so a clipped group inside a clipped one was drawn wherever the inner one reached. A mark-level clip was worse still: it took the box of the mark's own group whatever it was inside, and at the top level that group carries no width, which clipped the mark away entirely. The rounded corners follow the innermost clip that sets a radius, so a plain clip inside a rounded one still has its corners cut, and only two rounded clips in one chain lose the outer one. The new group-clip-nested fixture holds three cases, two clipped groups, a mark-level clip in an unclipped group inside a clipped one, and a plain clip inside a rounded one, and goes from 19.863% of pixels, a 100% worst tile, mean 58.52 and a worst block of 231 to 0.000%, 0.0%, 0.43 and 19.5. clip-path-box goes 28.810% and 179 to 0.000% and 0.3.

  • A gradient spans the item's bounds, which is what canvas fills one from. rect and group mapped a ramp over their own box in uv space, and vega's boundStroke grows an item's bounds by a whole stroke width on each side, so a stroked rect stretched its fill by that much and every inked pixel sat a level or two along the ramp. rect-gradient-border goes from mean 2.96, bias 2.42 and flat 2.70 to 0.79, 0.21 and 0.50, which retires the last bias override in the suite. The radial form takes the bounds with it, where it took the raw box before.

  • A ramp no longer moves with the group offset. gradientBounds added the accumulated group translation to an item's bounds, and both the bounds and the triangulated geometry are already in the enclosing group's coordinates: the translation reaches the shader through the offset uniform instead. A gradient inside a translated group was therefore sampled a group offset away, which for anything smaller than the offset is one flat end of the ramp. Nothing in the corpus caught it because every gradient fixture sat at the root, where the offset is zero. The new gradient-in-group fixture is a gradient fill on symbol, path, arc and rect and a gradient stroke on symbol and rect, inside a group at (140, 80), and goes from 3.660% of pixels, an 87.5% worst tile, mean 13.86 and a worst block of 151.5 to 0.007%, 0.2%, 0.33 and 15.0.

  • Two overlapping items of one mark meet the backdrop one at a time. A mode the frame state cannot express is drawn into a layer and composited against a copy of the frame, and the copy is read once per draw, so every item of an instanced or batched mark blended with what was there before any of them. canvas composites item by item, which is what rect already closed its run for. symbol and rule close their instanced run now, arc, path and shape close their vertex batch, and a shape's stroke leaves the held outline buffer for a draw of its own, since that buffer is drawn after every fill where canvas strokes each item before it fills the next. The new blend-overlap fixture is two overlapping items on each of the six marks, darken over white and lighten over a dark band, and goes from 5.939% of pixels, a 77.6% worst tile, mean 18.97 and a worst block of 223 to 0.018%, 0.7%, 0.15 and 27.8. text is the same shape and reads it off the label run: blend-text-overlap goes from 3.462%, 34.5%, 14.06 and 223 to 0.000%, 0.0%, 0.05 and 0.8. A mark whose blend is left to the frame state is unchanged, since instances within one draw already composite in order.

  • A shape's held outline follows a dash, a cap and a join. The mark keeps its outline buffer between frames and rewrites it only when something it is drawn from changed, and what decided that was the fill geometry's own inputs. None of strokeDash, strokeDashOffset, strokeCap, strokeJoin or strokeMiterLimit moves a vertex of the fill, so toggling one redrew the outline the mark had before, and a cap or a join does not change the segment count the hold falls back on either. shapecache.spec.ts sets a dash on every county of map-fit-stroked and then a round cap, and the frame is unchanged over 3607 items without the fix and changed with it.

  • An svg path is read by vega's own path renderer now, so a path mark reads the same commands canvas does. We parsed with parse-svg-path, abs-svg-path and normalize-svg-path, which read the spec, and vega does not. A new path-commands fixture puts one path mark per command and per trap in a grid, and it found five divergences at once, all of them ours to lose: an S that is the first curve reflects vega's running control point, which is still (0, 0) there, where the spec uses the current point, and the same after an arc, since vega's arc leaves that point untouched. T does the same, while its own relative form t checks what came before it. And an arc with a zero radius is dropped entirely where the spec draws a line to its end. Per cell, in differing pixels: S first 677 to 34, T first 808 to 21, S after arc 570 to 49, T after arc 225 to 138, zero radius arc 677 to 80, which puts every one of the 24 cells in the same band as the ones that already matched. Reading the commands through pathParse and pathRender and collecting them into contours is also three dependencies fewer, and a lineTo arrives as one rather than as a cubic on its own ends. It cost one rung. tess2 refuses an exact outline more readily than the same shape carrying redundant points, and the more exact contours took the second ribbon of trail off the frame at dpr 2, where the flatness is twice what it is at dpr 1: every existing fallback threw and the mark was dropped, for 5.912% of pixels and a 74.4% worst tile. A coarser curve is a shape tess2 takes, so the last try before giving up now halves the flatness until it does. trail at dpr 2 reads 0.011% and worst channel 72.

  • An arc wider than 240 degrees lost everything past it. normalize-svg-path turns an svg A command into cubics and splits one longer than 120 degrees by recursing, but the caller only ever lifts a single curve out of the flat result it gets back: a three part arc arrived as one segment carrying two curves, and the reader takes the first six numbers of a segment, so the third curve was dropped without a word. A 343 degree wedge came out as a 240 degree one. Nothing in the corpus caught it, because the only arc over 240 degrees in it is a full circle, and d3-shape emits that as two 180 degree arcs. An endAngle of exactly two pi therefore took a different path through d3 than one just under it, which is what made this look like a mark drawn alone behaving differently from the same mark among others. We convert an arc to cubics ourselves now, by the endpoint to centre conversion in the SVG implementation notes, splitting at 90 degrees rather than 120: the worst chord sits about 2.7e-4 of a radius off against 2.3e-3, and the old cubics also bulged outside the true arc by 0.014 px at radius 42. The new arc-sweeps fixture holds eight wedges and donuts either side of 240 degrees and goes from 8.734% of pixels, a 54% worst tile and worst channel 204 to 0.052%, 0.5% and 67. Across the corpus arc-shapes goes 0.058% to 0.037%, gradient-strokes 0.037% to 0.031% and mark-dashes 0.036% to 0.032%, and on the playground a solid arc goes 0.451% to 0.156% and a dashed one 0.748% to 0.535%.

  • A straight run is no longer flattened, so the flatness follows the pixel ratio. normalize-svg-path rewrites every lineTo as a cubic whose control points sit on its own ends, and svg-path-contours then subdivided that like any other curve. None of the points it produced landed on the corner, so at a fine setting a step line's corner at (256.5, 65) came back as (256.5, 64.93) and the join built there lost its tip: line-shapes at dpr 2 went from worst channel 71 to 134 while its pixel count did not move. Walking the normalized path directly and emitting a straight run as its own two points keeps every corner exact at any flatness, which is what lets the flatness track the device grid: a chord error bounded in path units sits twice as far from its curve on a grid twice as fine. At dpr 2 gradient-strokes goes 112 to 101 and choropleth 0.442% of pixels to 0.363%, and the whole suite passes at both ratios. It is 40 lines against the three packages svg-path-contours already wrapped, so the dependency count is unchanged. The catch took finding, and it was tess2. An exact outline is more likely to be one it refuses than the same shape carrying redundant points along its straight runs, and a four contour county went missing off the choropleth that way: the worst tile at dpr 2 went 4.8% to 47.6%, with a landmass drawn displaced. Logging the path it refused and running the builders against each other on that one path is what found it. Exact, it throws at 19/9/18/137 points. The flattener's own shape, simplified, is 19/9/18/143 and gives 188 triangles. Those six points are the whole difference, so that shape is the last thing tried before giving up. The two combinations tried before it, the exact contour unsimplified and the subdivided one unsimplified, both throw as well, which is why the first attempt at this looked unfixable.

  • A dash run whose far leg is a stub loses a wedge at the corner. Both segments at a vertex are cut against the bisector and each is meant to cover what the other gives up, which needs the other one to reach past the vertex. Working out how far settles it: the deepest point either has to reach is where the neighbour's own rectangle starts, at halfWidth * sin of the turn, so never more than half a stroke and nothing at all on a gentle bend or a sharp spike. A dash cut landing nearer than that leaves a stub that cannot, and the sliver it fails to cover lies inside the neighbour's own rectangle, which canvas fills and neither of ours did: the stroke came out cut off along the inside of the corner. Each end now carries how far its neighbour runs before it stops, and past that the cut gives way, which is exact rather than a tolerance: the neighbour's axis comes back out of the bisector, since the two keep equal angles to it, and the exemption holds only inside the segment's own rectangle, so the two sides stay disjoint and nothing is drawn twice. A large stand-in where the neighbour's far end is another join leaves those as they were. dash-corner goes 0.008% of pixels and worst channel 121 to 0.003% and 82, mark-dashes 115 to 103, and on the playground the difference at the corners of a dashed blended line is antialiasing fringe rather than a missing wedge. Rounding the corner off instead was tried first and is wrong: below the miter limit a spike's apex reaches many stroke widths past the vertex, and a disc of the stroke's own width deletes it, which stroke-joins reads as worst channel 179 against its own 41. The stride carries the kind separately as planned, which retires the magnitude test that told a miter from a cap meeting, and it cost one measurement to find why: the kind is matched exactly and an interpolated varying does not survive barycentric rounding, so a miter read 2.9999998 on scattered fragments and quietly became a butt end. The join fields are @interpolate(flat), which is what they always were per instance.

  • A sharp corner on an outline drawn through the segment shader loses a pixel. A square symbol with a thick outline left a one pixel diagonal hole at the corner, running along the bisector: at the worst pixel canvas had the stroke colour and we had the page behind it. It was the bisector tie, and the window given to it was the wrong shape rather than the wrong width. The two segments read the same distance with opposite signs, and one rejected past zero while the other rejected under 1e-4, so a pixel between the two was rejected by both. An exact zero was never the case to worry about: a fused multiply-add rounds the two products of the dot differently, so a pixel centre landing on the bisector reads about 6e-8 rather than 0, which falls inside the window. Both are bit-for-bit opposite, since negating a product and a sum is exact and the vertex, the bisector and the offset all reach the two segments as the same floats, so which side of zero it falls decides it with no window at all: one rejects above zero and the other at or below it. gradient-strokes goes 0.025% of pixels and worst channel 155 to 0.023% and 128, and its worst pixel is now a curve edge rather than a corner. The corner block matches canvas ink for ink.

  • A triangulated mark strokes through the segment shader, not an extruded ribbon. path, area, arc and trail walked their own contours only for a dash before, and now do it for every stroke, which is what shape already did for a country border. A ribbon takes its edge coverage from MSAA, which reaches quarter steps, and it overlaps itself at every joint, so a translucent stroke double blends there. Segments are analytic across the stroke and cut against a shared bisector at each vertex, so they do neither. Measured on the playground against canvas, the same marks each way: path 0.559% of pixels to 0.112%, area 0.397% to 0.117%, arc 0.810% to 0.383% and trail 1.376% to 0.471%. arc-diagram, whose arcs are path marks at strokeOpacity: 0.2 and which held this item, goes worst channel 158 to 51 and mean 4.43 to 3.65, and airports 55 to 54 and mean 0.58 to 0.43. The fixtures follow: path-shapes 0.054% to 0.034% and max 85 to 69, area-shapes 0.041% to 0.015%, arc-shapes 0.344% to 0.211% and max 127 to 116. A square cap is the one exception and keeps the ribbon, since only extrude-polyline draws one, and so does a gradient stroke, which the segment shader cannot sample a ramp for.

  • The suite passes at RENDER_DPR=2. Eight fixtures failed there, all of them on the worst channel rather than the pixel count, because the budgets were calibrated at dpr 1 and there was no second set. Two of the eight, line-dashes and path-shapes, pass outright now that a triangulated mark strokes through the segment shader. The rest take a dpr-aware budget, and that is a raised budget rather than a fix, so it rests on the flat-region measure saying the renders are right: at dpr 2 every one of them reports a flat mean of 0.00 or 0.50 over 1.7k to 154k pixels, which is the mark interiors matching exactly, and 0.006% to 0.45% of pixels differing at all. The whole difference is edge coverage, which belongs to the analytic coverage item. The run also turned up a test that proved nothing there: the zoom check hardcoded a target ratio of 2, so at dpr 2 it zoomed to where it already was and passed on a no-op. It zooms to a ratio the run is not on now.

  • scatter-plot-contours is inside every budget. It measures 0.000% of pixels past the gate's threshold, a 0.0% worst tile, worst channel 45 and mean 0.50, inside every default budget. The note that its contour lines were drawn very differently was written before the curve and line work and no longer describes it, so it is closed on the measurement rather than on a change made for it.

  • map-fit's densest tile is the polygon seam model, not a defect of its own. It was the worst tile in the corpus at 22.2% of a 32px square at 544,288 and had never been looked at. That square is Florida, and map-fit is the unstroked county mesh, so at 700x400 a county is a few pixels across and almost every pixel there is somebody's boundary. The difference is alpha: canvas leaves 14,912 pixels of the frame partly transparent against our 4,236, with the colours within 12 levels, which is canvas filling each county separately and keeping a share of the background on every shared edge. The flat-region measure agrees, reporting 0.00 over 13,757 pixels, so every interior matches exactly. It is the model written up under the choropleth item, and map-fit-stroked is the variant that asks for a real border instead.

  • A label a pixel low at a half pixel phase is canvas drifting away from its own transform. label was the worst case in the corpus at worst channel 226 and a 10.2% tile, and every hot tile in it held a label whose device baseline has a fraction of exactly .5. Canvas put The Godfather on rows 14 to 19 and we put the same six ink counts on 15 to 20, so the rasterization was identical and only the row differed. Chrome rounds a text baseline to a whole device pixel, and at exactly .5 it rounds up. The renderer intercepts as fillText("The Godfather", 800, 9.5) with getTransform() reporting exactly (1, 0, 0, 1, 18, 11), so the baseline is exactly 20.5 and the glyph belongs on 15. Issuing that same call on a fresh canvas of the same size, with the same font, alignment and transform, does put it on 15. The renderer leaves 14. The matrix the rasterizer holds is not the matrix getTransform() reports. markItemPath.draw in vega-scenegraph translates to each item and then translates back by the negated offset, and the label spec draws 2260 symbols that way: 9043 translate calls with fractional arguments that cancel on paper and do not cancel in the matrix. Recording every transform call the renderer makes and replaying the list on a blank canvas reproduces the row exactly, 14 where the same call after a plain setTransform gives 15, while the reported matrix reads f = 11 either way. Sweeping an offset into the baseline on that replay puts the drift between 1e-4 and 3e-4 of a pixel, which is nothing except across a tie. Wrapping each pair as save, translate, restore instead removes it and the replay gives 15. Proved at the whole spec: re-setting the transform to the numbers getTransform() itself reports, immediately before each of the 146 fillText calls, takes label from 0.110% of pixels, a 10.2% tile, mean 4.11 and worst channel 226 to 0.003%, 0.4%, 3.12 and 52. That is the entire gap, and label stops being the worst case in the corpus. A bare save and restore around the call changes nothing, since Chrome only re-applies the matrix when the save actually changed it. So our placement is the one a canvas without the drift gives, which is also what text-baseline-phase already said: it sweeps sixteen sub-pixel phases including exactly .5 across three baselines and matches at worst channel 1. Nothing to change here, and the residual 226 in label stays until vega stops translating back. Reproduced behind canvasTextDrift, off by default. The drift is computable from the scene rather than measurable: walking it the way the canvas renderer draws it, and accumulating the same float32 translation, gives 10.999725341796875 where the reported matrix says 11, which is the number the recorded ops give and what puts The Godfather on row 14. Three things had to be right before it was safe to use. The drift decides which whole pixel the label lands on and nothing else, since it is far under the phase grid and folding it into the phase instead re-rasterizes labels it cannot move, which flips a hinted stem: every axis label in scatter-brush-panzoom went to worst channel 255 that way. The matrix is float32 and the point is not, so taking the baseline to float32 too reads 146.49999999999994 as exactly 146.5 and moves nine specs worth of labels canvas leaves alone. And a clipped mark is drawn inside save and restore, so whatever its items leave in the matrix is popped again with the clip, which is why the same scatter spec has no drift at its axis while label does. Measured against canvas over all 111 specs with the option on: one better, none worse. label goes from 0.110% of pixels to 0.027%, and its worst channel stays at 226, since what is left is the horizontal sub-pixel bucket rather than the row. There is nothing to reproduce at an even pixel ratio: a baseline half way between two device pixels at ratio 1 is on a whole one at ratio 2, and label already matches on 0.000% there. textdrift.spec.ts holds both halves, that the option closes label and that it leaves bar alone.

  • Rotated text shifts when a draw stops rasterizing rotations, and the two paths cannot be made to agree. A rotated label normally has its rotation baked into the atlas cell with the quad axis aligned. When an atlas upload passes UPLOAD_BUDGET_MS the renderer drops to rasterizing the label upright and turning the quad, which a label that only moves does not have to be re-rasterized for, and wordcloud at 200% zoom showed labels jumping as hover triggered the switch. The note here used to say the two should land a glyph on the same pixels. They cannot: the browser hints a glyph along its baseline, so asking it for a rotated glyph and asking it for an upright one gives two different rasterizations rather than one resampled into the other. At 90 and 270 degrees the upright glyph carries 12% more ink. Measured four ways to rule out the alternatives, and all four read the same: a nearest sampler against a linear one, and the sub-pixel phase quantized against not. The baked path is the one that matters and it is exact, 0.024 of a pixel from canvas across ten angles, so the open question is not how to align the fallback but whether to switch at all, which is a latency decision rather than a fidelity one. The new exactRotatedText option pins the cheaper path on so it can be reached on purpose rather than only under load, text-rotated gates the baked path at ten angles against canvas at 0.000% of pixels and a worst block of 1.0, and rotatedtext.spec.ts holds the baked path to a fifth of a pixel and the fallback to not drifting past the 1.09 it reads today. The fallback reads 0.35 at dpr 2 against 1.09 at dpr 1, which is the hinting explanation again: a finer grid hints closer to the outline, so the two rasterizations converge.

  • A curve cut the corner off a tight turn. driving is a cardinal line, which goes to the GPU curve shader as Bezier spans, and each span was drawn as a fixed eight straight quads. A hairpin turns further inside one quad than a straight quad can follow, so its point came out blunt where canvas closes it: worst channel 255, the largest single error in the corpus. The count is now taken per span from its control polygon, which grows both with length and with how far the span swings, at one quad per two device pixels and capped at 32. Quads past what a span needs collapse and are culled, so a gentle curve costs what it did before. driving drops to 101 worst channel, and what is left there is text antialiasing rather than the line.

  • A transparent stroke ate a ring off its own fill. fillStrokeShare gave the stroke band to the stroke alone, so where the stroke was translucent the fill under it was lost rather than showing through. Canvas fills the whole shape and strokes on top. A vega legend swatch is stroke: transparent with a width of 1.5, which came out 8px across where canvas draws 10, seen on layout-splom. The helper now composites the stroke over the fill and each caller passes the coverage at its nominal edge. An opaque stroke covers the fill under it either way, so the fixtures that were already exact did not move: symbol-circles and symbol-shapes are unchanged, layout-splom goes 0.081% to 0.056% and gapminder mean 2.47 to 1.78.

  • A blended or translucent line no longer composites its own joint twice. The dark blob on the blend-marks chevron was a line at blend: multiply bending at 165,160: segments were one capsule each, and an interior joint was the round end of one sitting on the butt start of the next, so the overlap was composited twice where canvas strokes the polyline once. The bisector cut leaves the two segments disjoint, so there is no overlap to composite at all. blend-marks goes 0.024% to 0.005% of pixels, worst channel 141 to 53 and mean 0.28 to 0.18.

  • The blend-unsupported fixture read as a bug rather than a control. The name said the renderer cannot blend, when it supports several modes, and the picture is 12 unlabelled swatches. It is now blend-needs-readback, which is what actually separates the two fixtures, and each of the three blend fixtures names its modes in draw order and says whether it is expected to match. The gallery shows that description above the numbers. The names are not drawn into the picture on purpose: blend holds a worst channel budget of 5 and text is where the renderer differs most, so labelling the pixels would cost the fixture the precision it exists for.

Landed: rendering fidelity

  • A square cornered rect no longer fills under the outer half of its stroke. straightRectColor measured the fill against the stroke's outer box, so the fill reached half a stroke past the rect's own edge. An opaque stroke hid that everywhere but the antialiased edge, which came out darker, and a translucent one showed the fill through its outer half: a 4px stroke at half opacity read 35 there where canvas reads 127. The rounded path and the symbols measure against the true edge and were right. An audit of the budget overrides found it: bar-noaxis held a signed-mean budget of 5 for a bias of 4.05 that was put down to sparse edges and was this. It reads 0.04 now and its override is gone, playfair goes from 0.342% of pixels and a 7.2% worst tile to 0.006% and 1.3%, and the new rect-stroke-straddle fixture, translucent strokes on square cornered rects, bars a pixel apart and a group background, reads a worst block of 111 without the fix and 12.25 with it.

  • Every line the curve shaders do not draw is walked as segments. Step, open, closed and gapped lines took an extruded ribbon, which has no round join or cap and mitered every corner. They take the walk a dashed line takes now, which retires the tessellated line route. The new line-round-walked fixture read 179 on its worst block and reads 20.5. line-interpolate goes from 0.146% of pixels and a 2.3% worst tile to 0.058% and 1.1% with its mean from 4.85 to 4.16, line-curves from 0.025% and mean 13.09 to 0.017% and 11.62, and line-shapes and blend-curves from mean 4.31 and 0.26 to 4.06 and 0.23.

  • An upright label keeps its exact vertical phase. The phase was quantized to a 64 step grid in both axes to bound the glyph cache. The browser snaps a glyph to a whole pixel along its baseline, so a vertical grid buys nothing: every phase on one side of the snap rasterizes to the same glyph, and rounding onto the grid left the quad up to 1/128 of a pixel off a whole device pixel, which resamples the whole label. Horizontal keeps the grid, since there the browser really does place sub-pixel. Two specs left the worst max-error band, 13 cases over 128 to 11.

  • A group border can draw over its children. strokeForeground moves the border to after the group's own contents, which is where vega puts it, and a dashed one goes with it. strokeOffset was already honoured. The group-stroke fixture holds both against canvas along with the half pixel nudge a hairline gets: four of its six cells are within one level, and the two that are not are the round-against-miter join and canvas's own coverage at a hairline corner, 8 pixels each at worst channel 51.

  • An interior vertex of a dashed run gets its join. Two butt ends meeting at an angle leave the outside of the corner unpainted, so a dashed group border whose dash ran through a corner was missing it: worst channel 204 against canvas at the two corners of the group-stroke fixture that fall mid-dash. writeSegments now applies caps to a run's outer ends only and rounds every interior vertex, which is what the shape mark's contours already did. 204 to 51, the remainder being that canvas miters where this rounds.

  • Rect edge antialiasing is analytic now, which fixes seams generally. Canvas computes edge coverage analytically (measured: exactly 100 - phase*100 across sub-pixel phases), so two abutting rects produce complementary coverage and it shows only a faint line. Our MSAA coverage was quantized to whole samples, did not complement, and left an obvious white seam (heatmap rows, axis bands). The rect quad is now grown by one device pixel and the fragment shader computes box coverage from the true edges, so MSAA contributes no edge coverage and we reproduce the canvas model. Geometry is untouched, so deliberate sub-pixel gaps survive: the rect-subpixel fixture covers eight abutting phases plus gaps of 0.2 to 1.0 px in both axes and matches canvas at 0.000%. heatmap 0.26% to 0.01%. Rejected alternatives: growing rects to overlap, and snapping edges to device pixels, both of which close or widen gaps that are meant to be there.

  • Text blur fixed, rotation and sub-pixel placement. Each glyph is rasterized into its axis-aligned bounding box (rotation baked in) at its real sub-pixel phase, then drawn as a plain quad on a whole device pixel, so it maps 1:1 to device pixels (crisp, no resampling) and lands exactly where canvas draws it instead of snapped up to half a pixel away. The cache is keyed by dpr, angle and quantized phase (64 steps/px). Rotated radial labels (arc-diagram) ~3.7% to 0.8%. Dense small labels (barley) ~3.2% to 1.0%. Follow-up: SDF/atlas text to close the last text-dense fringe.

  • Rect fill inset fixed. Rect marks carrying a strokeWidth but no stroke (common: stroke set on hover only) reserved a transparent stroke band and rendered ~strokeWidth/2 px too small on every edge. Canvas ignores strokeWidth when there is no stroke, so we now do too (nested-plot 4.7% to 0.8%).

  • Transparent background matches canvas. initialize forced a white background, so every frame was fully opaque while canvas leaves the background transparent and only fills when one is set (44% of an orthographic map). A missing background now clears to zero alpha. This also exposed that captureFrame returned premultiplied alpha while toDataURL returns straight, which made anything translucent compare wrong; the readback un-premultiplies.

  • Rules antialias analytically. 4x MSAA can only express quarter-pixel coverage, so a 1px rule quantized to five levels (51/102/153/204/255) where canvas computes the real fraction. The rule quad grows by one device pixel and the fragment shader computes box coverage from the true edges, the same model as rect. At tenth-pixel offsets the worst channel goes from 31 off canvas to 1. Guarded by the rule-subpixel fixture and a max-channel-delta budget, since the differing-pixel count cannot see a change this small.

  • Segments antialias analytically, so a diagonal is smooth rather than stepped. src/shaders/sline.ts relied on 4x MSAA, which can only express quarter steps, and a slanted 1 px stroke came out beaded where canvas draws a gradient. The quad grows by a device pixel and the fragment takes coverage across the stroke times coverage along it, the separable box model rect and rule use. This is every dash, dashed rect border, diagonal rule and linear line segment.

    parallel-coords 0.424% to 0.002%, the rule-angles fixture 0.088% to 0.000% and its worst channel 67 to 48, regression 0.114% to 0.023%, density 0.131% to 0.061%, stocks-index 0.099% to 0.051%. Twelve specs improved and one moved by 0.002%.

    The new rule-diagonals fixture scores both renderers against exact geometric pixel coverage rather than against each other, at five angles and three widths: 14.7 levels off on average before, 3.1 after, where canvas is 15.8. The remaining error is the box model itself, which is exact only for an axis-aligned edge and tops out near 11 levels at 45 degrees. A width-corrected ramp measured three times worse, so it stays.

  • Symbol outlines were missing a corner. extrude-polyline builds no join at the seam when it is told a polyline is closed, so the outer miter at every closed contour's first vertex was simply absent: a stroked square came out with three corners. Rings are reopened at the midpoint of their first segment, which puts every real vertex in the interior and lands the two butt caps on a straight run. symbol-shapes worst channel 153 to 76, and square, cross, diamond and stroke now match canvas ink exactly. This covered all closed stroked paths, so geographic outlines and path marks got it too.

  • Self-intersecting paths fill nonzero, the way canvas does. A custom star symbol came out hollow in the middle where canvas fills it solid, 182 levels off at the centre pixel. triangulate-contours asks tess2 for even-odd and never exposed the option, but it forwards the whole option object, so the winding rule is simply passed through. symbol-custom worst channel 182 to 76, and no spec moved, so map and area holes were already wound for nonzero.

  • Symbol shapes with a closed form are drawn analytically. src/shaders/symbolSdf.ts builds the source with the shapeDistance body substituted per shape and compiled on first use, so each variant stays branchless. square, diamond and all five triangles are one instanced quad each, with no triangulation and no MSAA-quantized coverage. Worst channel against canvas: square 51 to 12, triangle-up 48/76 to 10/19, triangle 53 to 3, diamond 8 to 1. The symbol-analytic fixture holds them at a budget of 25 where the triangulated versions were 76.

    The stroke edge has to grow the shape's own extents rather than offset its distance, since canvas joins with a miter and offsetting a distance rounds every corner. cross is excluded for that reason: it is a union of two boxes, and eroding a union is not the union of the erosions, which puts its reflex corners in the wrong place (26 triangulated against 51 as an SDF).

  • Circle edges take fill and stroke as disjoint shares of the pixel, the model rect and symbolSdf already used. The shader mixed fill towards the stroke colour across a 1.5 px smoothstep instead, which reads a strokeless symbol's transparent black as a colour: it darkened every edge pixel and squared its alpha, so a half covered edge came out at an eighth of the ink canvas gives. Circles are in most specs, so this was the largest systematic error in the suite. 35 specs improved and 7 moved by under 0.08%: contour-scatter 2.48% to 1.42%, dot-plot 0.80% to 0.50%, regression 0.38% to 0.11%, and legends-ordinal, autosize-fit, layout-hconcat and layout-vconcat to 0.000%. Mean channel error: regression 21.0 to 7.7, panzoom 14.1 to 5.4, splom-outer 14.0 to 7.2, label 11.0 to 5.3.

    What is left is canvas's error, not ours. Scored against exact geometric pixel coverage rather than against canvas, the symbol-circles fixture's stroked circles are 2 to 3 levels off on average (worst 16) where canvas is 7 to 14 (worst 90). Canvas inks far less than the true area where an arc runs nearly tangent to a pixel row, which is its curve flattening, so the fixture's 72 worst channel is canvas moving away from the truth and matching it would mean reproducing a rasterizer artifact.

  • choropleth's missing county borders are deliberate. Canvas fills each polygon separately, so a shared edge keeps about a quarter of the background as a pale seam. One multisampled pass covers that edge completely: measured 11,152 seam pixels in canvas against 900 in ours. Matching it needs each polygon to composite with its own fractional coverage, which means the fill fragment knowing its distance to the polygon outline, and a triangulation only knows its own edges, which have to stay hard. Not reproduced, written up in the README, and choropleth-stroked and map-fit-stroked ask for the border instead, scoring better than the originals (0.681% against 0.783%, 0.365% against 0.436%).

  • map-point-radius stray "flying line". A contour shaped A to B to A (geographic slivers clipped by the horizon) turns by almost 180 degrees, and extrude-polyline puts the miter there either at NaN or thousands of pixels away, smearing one triangle across the canvas. Stroke vertices are now dropped unless they sit within the miter allowance of their own contour. 143 stray pixels to 0.

  • tree-radial-bundle fixed. Its curved links are line marks with interpolate, which were drawn as straight polylines. Routing them through the shared path tessellation took it from 10.2% to 0.27%.

  • Every mark has a fixture now. arc, area, group, line and path each got one that walks their own parameters rather than whatever a spec happens to use, which is what found the three gaps below. Worst channel against canvas: group 15, line 67, area 79, arc 127, path 174.

  • Path marks apply their own transform. angle, scaleX and scaleY were read by nobody, so a rotated path drew axis aligned and a scaled one drew at its natural size. The path coordinates scale before the stroke is extruded, which is what keeps the stroke width uniform the way canvas does, then the whole thing rotates about the item origin. path-shapes mean channel error 32.5 to 5.8, and no spec moved, since none of them rotates a path.

  • Line marks draw their stroke caps. A square cap goes through the tessellated path, which extrudes it. A round cap could not: extrude-polyline has no round cap at all, so it silently drew butt. Rounds are discs at the two ends now, reusing the analytic circle the round joins already draw. line-shapes worst channel 179 to 67.

Landed: features

  • The compositing operators are drawn too, not just the blend modes. vega's blend goes straight to globalCompositeOperation, which takes the Porter Duff operators in the same property, and those were warned about and drawn normally. What separates them from a blend mode is small once the composite evaluates the formula: a blend keeps source over's coverage weights and changes B(Cb, Cs), an operator keeps B at the source and changes the weights, so the table carries fa and fb beside blend. destination-over, the four in and out pairs, both atops, xor, lighter and copy. Five of them do something to the frame where the source is absent, so those skip the discard and run on every pixel of the clip, which is what canvas does with them. The new blend-operators fixture is one clipped group each, since otherwise the erasing ones wipe the ones beside them, and it reads 0.000% of pixels and worst channel 1 where it reads 21.521% and 196 with the table entries taken out. Every value canvas accepts now draws.

  • Line dashes. strokeDash/strokeDashOffset are split into drawn runs on the cpu and emitted as segments, covering straight and curved lines. Group and rect borders dash the same way, since the analytic rect stroke cannot express a pattern. Fixture line-dashes, 0.000% against canvas.

  • Symbol geometry is already cached per (shape, size, strokeWidth) with least-recently-used eviction, and instanced: 0.02 to 0.22 ms a frame in the benchmark. Only gradient-filled symbols bypass it.

  • Symbol shapes: all shapes (square, cross, diamond, triangle-*, arrow, wedge, stroke, custom SVG) plus angle rotation now render. Circles keep the analytic shader. Other shapes are triangulated once per (shape, size) and instanced. symbol-shapes 6.8% to 0.03%, symbol-angle 14.3% to 0.001%.

  • Gradient on symbols: gradient-filled symbols (e.g. a legend swatch) now render via the gradient pipeline (triangulated, per item). The gradient spec's radial-gradient circle went 4.6% to 0.007%.

  • Trail marks are implemented, so all twelve of vega's mark types now render. A trail is one filled ribbon whose width follows each point's size, sharing the area shader.

    The shared trail path generator took its width from item.width || item.height, where vega's own accessor is item.size || 1. That drew every trail as a one pixel line rather than a ribbon, and it was only visible because the fixture was compared against canvas. Covered by the trail fixture at 0.016%.

  • Blend modes, for the four WebGPU can express. vega's blend is canvas's globalCompositeOperation, and WebGPU blends with fixed function state rather than a programmable one, so multiply, screen, darken and lighten fall out of its factors and operations. All four reproduce canvas exactly, worst channel 1, in the blend fixture.

    A pipeline is built per blend mode and cached, and a run of rects starts a new draw when the mode changes. The rect shader discards fragments with no coverage: the quad is grown a pixel past the rect, and under a min or max blend those empty fragments would still darken the destination, which is what put a fringe around a darken rect.

  • Every mark honours blend, not just rect. rect, rule, area and symbol reproduce canvas closely (worst channel 1, 1, 1 and 31), and arc, path and line blend correctly and keep the edge error they have without a blend. Covered by the blend-marks fixture.

    Every shader now discards a fragment with no coverage. Marks grow their geometry past the shape so an analytic edge is not clipped, and those empty fragments would otherwise still reach the blend state: under a multiply they brighten the destination and under a min they darken it. That alone took rule from 65 to 1.

  • An antialiased edge under a blend weights its own colour now. Canvas applies a blend as dst * (1 - a) + a * f(src, dst), so the source has to be weighted by its own alpha somewhere, and WebGPU's factors cannot do that and reach the destination at the same time. Every shader is built per blend mode and the fragment entry point applies the weighting, which makes multiply and screen exact at every alpha rather than only at 1. Symbol under multiply went from 88 worst channel to 31, and blend-marks from 0.184% to 0.074%.

    min and max have no term to interpolate with, so darken and lighten stay exact only at alpha 0 and 1. Weighting towards the operation's identity (white for min, black for max) at least leaves an antialiased edge alone, where an unweighted colour applies the full blend to a fragment that barely covers the pixel.

Landed: performance

  • Geometry is cached per item instead of rebuilt every frame. cacheShapes existed but defaulted off and only covered shape marks. It is on by default now, bounded to 4096 entries with least-recently-used eviction, and the same helper backs path as well. A colour-only change rewrites colours over the cached positions instead of triangulating again. choropleth re-render 67.2 ms to 12.8 ms, which is faster than canvas at 47 ms.

  • Measured on real hardware, and the software rasterizer was most of it. WEBGPU_HARDWARE=1 runs the benchmark on the machine's own adapter and drops the forced Vulkan flags, so the browser picks its own backend. Frame cost against SwiftShader: contour-map 40.5 ms to 4.8, choropleth 13.3 to 7.0, airports 8.9 to 4.1, tree-radial-bundle 41.9 to 26.7. choropleth beats canvas by 6.8x (7.0 against 47). Nothing here argues for moving tessellation into a compute shader: on hardware the GPU side is already small, and under SwiftShader it would be adding to the part that is slow.

  • basis and bundle curves are evaluated on the GPU. tree-radial-bundle is 764 faceted line marks, so every frame built 764 SVG path strings, parsed them, flattened them, extruded a stroke mesh and issued 764 draws. src/shaders/curve.ts takes the control points as instances and evaluates the uniform cubic B-spline in the vertex shader, one instance per span, with the joints offset along the analytic tangent so neighbouring quads share an edge exactly. Overlapping them would double-blend, and this spec draws at strokeOpacity 0.2.

    On hardware: line 9.4 ms to 1.1, group 21.8 to 4.8, the spec 27.0 ms to 11.7. The batch only merges draws whose bind groups are the same object, so holding one is what took it from 22.6 to 11.7; rebuilding it per curve silently defeated the merge.

  • Attributed the rest of a frame. _draw, _submit and _reinit are reported alongside the per-mark timings. tree-radial-bundle spends 3.4 ms in mark drawing and 0.15 ms encoding, so the balance is GPU. It is not vertex bound: 4, 8 and 16 sub-segments per span all cost the same, only fidelity changes. Every spec also carries a ~4 ms floor, which is the benchmark awaiting onSubmittedWorkDone and draining the GPU each frame, something real rendering does not do. Treat the totals as upper bounds.

  • Measured what a first frame costs, and prebuilding does not fix it. First frame against steady state on hardware: tree-radial-bundle 196 ms against 16, choropleth 75 against 7, scatter-plot 40 against 6. That is pipeline setup, and it is worth knowing it is there.

    Creating the pipelines is not the cost. Building every mark's pipelines takes 0.2 ms for all eleven, because the browser defers the real compilation until a pipeline is first used in a draw. Pre-creating them therefore cannot remove it: warming every mark made the first frame 40 to 56 ms worse (symbol-shapes 7.7 to 64.3, scatter-plot 47.8 to 88.4), since it compiles pipelines the spec never draws, and warming only the marks the scene contains measured neutral (scatter-plot 52.3 either way). The warm API was removed rather than shipped as a no-op.

    createRenderPipelineAsync is the untried candidate: it is specified to resolve only once a pipeline is usable without further delay, so it should move the compile off the first frame. It needs the render path to await pipelines, which is why it was not tried here.

  • Pipelines are cached by descriptor in ctx._pipelineCache, keyed by shader, entry point, sample count and vertex layout, so marks that share a shader and layout share one pipeline and a _markCache reset no longer rebuilds them.

  • Every cubic curve a line draws is evaluated on the GPU. cardinal, catmull-rom, monotone and natural all come out of d3 as cubic Beziers, so the curve shader gained a bezier variant beside its basis one and the mark collects the control points from the same generator canvas draws through, with no path string and no flattening in between. linear and the step family stay on the tessellated path, which is what gives their corners a join.

    Flattening was not just soft, it invented geometry: where driving's cardinal curve doubles back, the flattened polyline turned a smooth reversal into a corner and extrude-polyline mitered it into a spike two pixels above the marker, which canvas does not draw. driving 0.300% to 0.146% and its mean channel error 6.4 to 4.8, line-curves mean 13.1 to 11.7, falkensee 0.102% to 0.080%. Collecting from the generator rather than parsing its path string also made it cheaper than the tessellation it replaced: driving 0.60 ms to 0.58 on the main thread.

  • Uniform buffers are reused across draws. Every draw call minted a uniform buffer and a bind group, and a spec with hundreds of small line marks paid for hundreds of both per frame. They are keyed by resolution and offset now. Note that outright sharing one buffer is wrong: the render queue defers every draw to the end of the frame, so one buffer rewritten per group hands every draw the last group's offset, which is what line-curves and regression caught.

  • The shader sources actually share their common wgsl now. Building them in TypeScript is only worth it if the shared parts are shared, and they had been copied: the blend prelude plus fragment entry pair in every file, the fill and stroke pixel share in three, box coverage in two, the zero-length-safe segment direction in three, and the subdivision count in both the shader and the mark, where they had to agree or the curve loses spans. One definition each.

    Area, Path and Shape all named the same builder and Group named rect's, so the same wgsl compiled three and two times and the marks built a pipeline each for layouts that were character identical. On a first frame: choropleth 6 shader modules and 8 pipelines to 5 and 6, arc-diagram 8 and 9 to 7 and 8, bar 5 and 7 to 4 and 5, and choropleth's first frame 135.9 ms to 114.

  • The line mark has one curve draw and one route. drawBezier was drawBasis with the names swapped, and five predicates read points[0] to answer one question, three of them partitioning the interpolate enum separately. lineRoute says where a mark draws and CURVE_OF is the single table of which cubic each interpolation is. Both curve pipelines had also been built up front, so a scene of linear lines paid to compile shaders it never drew. 133 lines out of line.ts, every spec pixel identical.

  • The line mark batches its segments now, and renderBatch is gone. The flag was broken three ways: true meant one draw per mark and false meant accumulate, so the name was inverted; the accumulate path used a second segment shader that never got the analytic coverage SLine did; and neither mode batched anything, because the per-mark round join draw flushed the batch every time. Measured: parallel-coords issued 888 draws a frame in both modes.

    The join disc is gone. A segment end can be round, which is both a round stroke cap and the round join at an interior vertex, so the segment shader draws the whole polyline. Only the earlier segment of a joint rounds its end, since rounding both would blend the same disc twice. That leaves one segment path, so the flag has nothing to select between and the duplicate shader is deleted along with the dead simpleLine.

    parallel-coords 888 draws a frame to 105, and 3.95 ms to 2.34 on the main thread. Fidelity improved with it: regression 0.023% to 0.006% and its worst channel 73 to 60, stocks-index 0.043% to 0.033%. Diagonal rules hold at 3.1 levels off exact pixel coverage where canvas is 15.9.

  • A NaN coordinate lands at the origin, the way vega reads it. vega's own accessors are item.x || 0, which folds NaN and null to zero. Ours were destructuring defaults and ?? 0, which only fold undefined, so a NaN reached the vertex buffer and the rasterizer dropped the triangle: the mark vanished where canvas draws it. The earthquakes-globe legend is a real case, since vega gives its symbols NaN x and y and positions each entry by its enclosing group, so webgpu drew no legend symbols at all. The nan-placement fixture pins it at 231 worst channel to 1.

  • The render lock releases at submit rather than at the next animation frame. It coalesced correctly, since only the most recent pending render survives, but _frame waited for requestAnimationFrame before releasing, so a render arriving inside that window was deferred a whole frame. The rAF only existed to close a debugLog timing. Deferred render latency, mean and worst: tree-radial-bundle 13.58 and 19.60 ms to 12.47 and 14.30, bar 1.45 and 2.90 to 0.92 and 1.10, scatter-plot 2.28 and 4.00 to 1.74 and 2.10.

    What is left on tree-radial-bundle is its own 12 ms frame cost. test/render/latency.spec.ts measures this under WEBGPU_BENCH.

  • Analytic coverage works in device pixels everywhere now. rect's straight path, rule and sline converted to device pixels, but the analytic circle, the symbol distance fields, the rounded rect edge and the curve stroke all measured coverage in logical pixels. At dpr 1 those are the same number, which is why nothing caught it: the whole suite ran at deviceScaleFactor: 1. At dpr 2 the antialiasing came out twice as soft as canvas's.

    RENDER_DPR sets the suite's device pixel ratio. At dpr 2 twelve of twenty one fixtures failed before and seven after, and dpr 1 is untouched, all 116 cross-checked cases byte identical.

  • arrow and wedge are drawn analytically. vega draws a wedge as an isosceles triangle and an arrow as a shaft box under a head triangle, so both fit the existing distance functions. Two bugs came out of it: sdTriangleInflated scaled about the centroid, which moves every edge by the same distance only for an equilateral triangle, and the geometry quad assumed a miter reaches about the stroke half width where a wedge tip carries it seven times as far, clipping the tip three pixels short. It scales about the incentre now and each shape substitutes its own reach and miter. symbol-shapes 0.049% to 0.032%.

  • A frame no longer drains the GPU before the next one starts. renderAsync awaited onSubmittedWorkDone() and vega awaits renderAsync on every frame, so the cpu could never run ahead of the gpu: no overlap, no pipelining. Its own doc comment said it resolved when the frame was submitted, which is what it does now. A caller that wants the pixels reads them back through captureFrame, which is ordered behind the frame in the same queue, and idle() is there for anyone who genuinely wants to wait. All 116 cross-checked cases byte identical.

  • Frame rate is measured honestly now, on both paths. The live counter in test/fps.js was a bare requestAnimationFrame loop that never observed a render, so it reported how often the browser could service rAF: canvas draws synchronously and blocks it, webgpu submits and returns, so at a million symbols it read 2 against 30 without either being frames drawn. It counts renders now, by wrapping the renderer's own entry point, and shows cpu and gpu time beside the rate.

    The gpu number comes from timestamp queries written around the render pass, read back a frame or more later so they never stall the frame being drawn. renderer.gpuFrameTime exposes it and the benchmark reports it per spec.

    What it says is worth knowing: gpu time is 0.00 to 0.10 ms against 0.5 to 8 ms of cpu on every spec in the benchmark. The renderer is entirely cpu bound, which is also why replacing the analytic circle's 32-gon with a quad, sixteen times fewer vertices, measured as a wash.

  • The analytic circle draws on a quad rather than a 32-gon. The fragment shader computes the circle from its own distance, so approximating one in geometry only cost vertices: 96 per symbol against 6, which is 28.8 million a frame at three hundred thousand points. Gpu time at 300k goes 2.62 ms to 0.40.

    Measured at twenty and fifty thousand this looked like a wash, because the gpu was idle there at 0.3 ms. It also reads as a fidelity regression against canvas, eleven specs moving by up to 0.19%, and it is the opposite: scored against exact pixel coverage the quad is closer on every measure, 0.6 levels off against 0.8 for a fill and 2.3 against 2.7 for a stroke, where canvas is 1.5 and 10.4.

  • Symbol colours are written straight into the instance buffer. Color.from2 allocates a fresh rgba array on every call and the attribute loops called it twice per item, so a 300k frame minted 600k arrays. renderAsync at 300k goes 13.6 ms to 7.1.

  • Analytic coverage was wrong for anything thinner than a pixel. clamp(half - d + 0.5) is the coverage of a band only when the band is at least a pixel wide. A 0.2 px country border came back as 0.6 covered, three times the ink, which is why geographic outlines looked heavy and broken. Taking the difference of the two edges instead, clamp(hi - p + 0.5) - clamp(lo - p + 0.5), is right at every width. Rules at one to three pixels are unmoved, still 3.1 levels off exact coverage against canvas's 15.9.

  • A shape mark's outline draws as segments rather than a triangulated ribbon. extrude-polyline built a mesh per contour and MSAA gave its edge quarter step coverage, which a sub pixel border cannot survive. The contours are already flattened, so they go straight to the segment shader. map-point-radius 1.384% to 0.825%, map-bind 0.660% to 0.345%, contour-map 0.058% to 0.008%.

    It is not yet a cpu win. The shape mark still spends 17.5 ms a frame on the globe, and taking the stroke out of the triangulation did not move it, so where that goes wants another look.

  • Shader sources are built in TypeScript, one variant per use. The .wgsl files could not be specialized, so a blend mode meant either branching per pixel or a file per combination. src/shaders/ is TypeScript now and shaderModule() composes a source and compiles it on first use, keyed by name, sub-variant and blend mode. Building on demand rather than up front matters: a chart uses a handful of these, and compiling every blend mode of every shader would put the cost of shaders nobody draws into the first frame. Measured: first frame unchanged, symbol-shapes 117.3 ms against 116.8 and choropleth 133.0 against 135.9, both within the run to run spread. 120 of 121 specs pixel-identical.

    This also removed rollup-plugin-string, collapsed the three byte-identical area/path/shape shaders into one builder, and moved the projection and gradient blocks each into a single shared snippet.

  • A gradient stroke samples the ramp. The earthquakes-globe sphere strokes with a linear gradient and used to come out flat teal against canvas's blue ramp. A gradient stroke keeps the triangulated ribbon and goes through the gradient pipeline, since the segment shader cannot sample per fragment, and shape, arc, area, path and trail all take that route. symbol, rect, rule and line still draw a gradient stroke as a flat colour.

Landed: robustness and bugs

  • A view with no size logged WebGPU validation errors on every frame. The vega editor starts on an empty spec, which is a 0x0 view, and the frame went ahead anyway: configuring the context, the MSAA and offscreen targets and the swapchain texture were all made at 0x0, and a texture cannot be empty, so Chrome logged each one and then the invalid pass and submit that followed. Canvas draws nothing there and logs nothing. A frame on a canvas with no area now ends before the device is touched, a capture waiting on it gets the empty frame, and drawing resumes once the view has a size. zerosize.spec.ts takes canvas and this renderer from 0x0 to 200x100 and back, offscreen and onto the canvas, and holds both to no console output. Before the fix it caught all three of the editor's messages, the empty texture, the 0x0 swapchain texture and the invalid submit, and moving the check below the device still left the one configure raises.

  • A blended line drawn last lost its blend. The open batch only joined the queue at submit, after the frame had decided it needed no off-frame pass, so the line drew straight into the frame. blend-line-last read 212 on the worst block.

  • Gradient stops at zero alpha faded from black. d3-color drops the channels of a colour with no alpha. Stops parse through canvas's own fillStyle now. gradient-alpha-stop read 226.5.

  • Text took its blend into the glyph atlas. vega's text mark sets the blend on the context it draws into, so source-atop and the other operators rasterized nothing. text-blend-atop read 152.

  • Every label in a text mark took the first label's blend. The labels went up in one draw with one pipeline. They close a run on a change of blend now, as the other marks do. text-blend-mixed read 160.

  • A group mark with clip: true was not clipped, and a clip inside a rounded group kept its corners. Each mark worked out its own clip, and the group mark had none, while the rest took the group's box without its radius. The renderer applies a mark's clip before it draws it now, the way vega's does, and through the same code as a clipping group item. group-mark-clip read 180 and clip-mark-rounded 169.

  • Stroked text with a miter limit of 0 was clipped. The cell read the limit with ?? where canvas treats 0 as 10. text-miter-zero read 208.8.

  • The playground and the demo page leaked a GPU device on every change. View.finalize stops at the view. On CI the playground spec stalled creating devices.

  • Smaller ones. Scaled paths keep their scale on the tessellation fallbacks, the path key carries the flatness so a pixel ratio change re-triangulates fills, the uniform cache is LRU and frees what it evicts, and the zoom listener holds its renderer weakly.

  • A group border held back to after its children lost the whole frame under a blend. The draw picked its pipeline by mode and then set the bind group built from the plain one, which is the third time that shape of bug has turned up: a bind group belongs to the layout it was made from, and the command buffer is thrown out whole. Nothing drew. The new blend-outlines fixture read 100% of pixels and a mean of 195.90 against it.

  • Five outline routes ignored blend entirely. A dashed group border, a held group border, a dashed diagonal rule, a gradient stroked line and a shape's outline all reached their draw through a pipeline fixed at normal, so the mode was read, passed along and then dropped. Each has the per mode builder the rest of the marks already had. The shape one shares one buffer across a whole mark for the sake of a stroked choropleth, so its runs are recorded as stretches of that buffer and drawn with a first instance offset rather than being split into buffers. blend-outlines covers the four that a scenegraph can express and goes to 0.000% of pixels and worst channel 42.

  • The fast path for a blend was dead, and nothing could see it. _opaqueBackdrop decides whether multiply and screen can be left to the blend state, and it was read once while building the context, before vega had set the background. It was false for the life of the renderer, so every blended mark paid for an MSAA resolve, a copy of the frame and two more render passes. Not one pixel moved, because the slow path is exact as well, which is why the whole corpus passed. It is read per frame now, and the backdrop state is part of the pipeline cache key, since a pipeline built for one backdrop is wrong for the other and the key had only the mode. blendpath.spec.ts asserts which of the two paths six fixtures take, and it fails against the old reading.

  • A trail's stroke ignored any blend the state could not express. The composite that paints a coverage mask into the frame built its pipeline straight from blendState, so a trail with darken was wrong the same way every mark was before the layer existed, and one with overlay drew unblended. It goes through the same buildBlend every mark pipeline does now, which lifts it into a layer and folds it in from there.

  • The mask and blend targets were built on every frame whatever drew. Four textures the size of the canvas, about 48 MB at 1600x1200 with four samples, created for a renderer that never masks or blends. The queue records whether anything drew off the frame and they are built only then.

  • A curved line ignored blend. Both routes that do not go through the segment shader, the GPU curve spans and the tessellated path a gap forces, built their pipeline with no mode at all, so a basis line under multiply composited normal. The span bind group was cached by curve kind alone as well, which is the same bug that lost a frame on the symbol mark. The new blend-curves fixture reads 0.003% of pixels and worst channel 53 where it read 5.530% and 161.

  • Unreachable code passed both checks. A return left above the rest of a function survived npm run lint and npm run typecheck, which is how a probe stayed in needsBackdrop through a green lint run. eslint's no-unreachable is off because the typescript preset defers to the compiler, and the compiler reports it as a suggestion rather than an error unless allowUnreachableCode is false. It is now, along with allowUnusedLabels.

  • A fully transparent colour reached the frame as NaN. d3 gives one NaN channels whatever was written, rgba(0,0,0,0) and transparent alike, and parse passed them through. A spec with a transparent background failed the frame outright, since a clear value has to be finite, and every mark with a transparent fill or stroke carried NaN into its vertex buffer where only the alpha discard hid it. The channels of a colour with no alpha are zero now.

  • The symbol mark held a uniform bind group across a change of pipeline. A bind group belongs to the layout it was made from, so a mark whose items carry different blends set one built for another pipeline and lost the whole command buffer. The same shape of bug as the line mark's, and it is keyed by pipeline now. Found by putting four blends on one symbol mark.

  • A symbol shape with no distance function never blended. square and the triangles have one and took a pipeline per mode. Everything else is triangulated and drew through the single shape pipeline, which carries none, so cross, wedge and a custom path composited normal whatever the item asked for. The run key already separated them by mode, which is what made it look right.

  • A line past six and a half thousand points threw the whole frame. The batch collected a mark's instances with push(...values), and spreading throws RangeError: Maximum call stack size exceeded past about a hundred and twenty five thousand values. At nineteen floats an instance that is a line of roughly six and a half thousand points, which a dense time series reaches, and the throw took the frame rather than the mark. The batch holds each mark's array and copies them into one Float32Array at the flush instead, which also drops the intermediate JS array the flush used to build. bigline.spec.ts draws twelve thousand points and reads the frame back, and it fails with that exact error against the spread.

  • Hostile input has a suite. test/render/scenes-hostile feeds the renderer what a mark should never see: NaN and Infinity coordinates, zero and negative extents, values a billion pixels outside the viewport, absent styling, and shapes with too few points. Nothing is compared against canvas, since canvas has its own opinions about nonsense. What is asserted is that the device survives, the renderer keeps it, and the frame is not smeared: one NaN vertex stretches its triangle across everything, which is the failure the geographic miter bug produced. All five cases pass, drawing 0.4% and 0.8% of the frame where they draw at all.

    Two of the five failures it found first were the fixtures, not the renderer: JSON has no literal for NaN or Infinity, so those travel as sentinels the harness revives, and vega's own path parser throws on a malformed path string before any renderer sees it.

  • Blank renders wherever there is no compositor. getCurrentTexture() destroys the GPU device on a headless runner, roughly 15 ms after it is handed out, and every later requestAdapter() returns null. configure() and an offscreen pass both survive, and no launch flag combination changes it (seven were tested). wgOptions.offscreen renders into a texture the renderer owns and never touches the swapchain. Bisected by test/render/webgpu-smoke-diagnose.spec.ts.

  • A destroyed device left the renderer dead. A loss with reason destroyed returned early without clearing _device, so the renderer kept using it and every later capture rejected in mapAsync. Every loss reason now drops the device and its pipelines, capped at three automatic recoveries, and a failed capture retries once on a fresh device.

  • Buffer uploads exhausted a constrained runner. mappedAtCreation allocates a JS ArrayBuffer per buffer and a frame makes one per mark, so even a 32-byte uniform buffer failed to create. Uploads go through queue.writeBuffer, which reuses the staging ring.

  • A frame's buffers were never freed. A mark makes one per draw and WebGPU frees none on its own, so jobs was making 856 a frame and holding every one, climbing into tens of gigabytes while hovering. They are released once the frame after theirs has been submitted, late enough for a capture or a loaded image to have submitted again. A quad built once in getResources is marked lasting, since it outlives the frame that made it.

  • Swapping renderers leaked a device. vega swaps by dropping the old renderer and building a new one, never telling the old one to let go, so its device and everything on it stayed alive for as long as the page did. Taking over an element now finalizes whoever held it, and four swaps leave one live device rather than four.

  • renderLock resolved renderAsync too early. A render arriving mid-frame was coalesced into _pendingRender, but _renderPromise still pointed at the already-settled in-flight frame, so renderAsync (and the test harness) resolved before the newest scene was drawn, screenshotting a stale canvas. Deferred renders now expose a stand-in promise that settles only once the flushed frame does.

  • A failed frame wedged the renderer. _render's catch cleared _isRendering but never flushed _pendingRender, so a queued render was silently dropped and its awaiter hung forever. All frame exits (completion, early return, failure) now drain through one _finishFrame path.

  • The oversized-canvas early return stranded pending work for the same reason. It now drains through _finishFrame too.

  • Dead dirty-bounds tracking. The dirty() override walked the group chain and unioned bounds into _dirty/_tempb on every item, but nothing ever read them, every frame redraws the whole scene. Removed, reinstate with partial redraw.

  • Swapchain reconfigure. ctx.configure() now runs once per device in _reinit, not per frame.

Landed: tests

  • CI draws its canvas reference on the CPU. The runner has no GPU, and a desktop rasterizes canvas on its GPU, which differs in antialiased coverage and in how a dash wraps a closed corner. The cases that differ carry runner budgets, and CPU_CANVAS=1 reproduces the runner's numbers locally. The presented-frame checks skip there, since the runner has no compositor.

  • CI runs both pixel ratios. Only dpr 1 ran there, though a finer grid moves every analytic edge onto different sample positions and eight fixtures carry a budget of their own for it, so a regression that showed only at dpr 2 was one somebody had to find by hand. The render job is a matrix over the two now, with the report and the images uploaded per ratio so they do not collide.

  • A spec can be measured under a renderer option, not just at its default. canvasTextDrift had one test of its own and the corpus only ever saw it off, so what it is worth was an argument rather than a number. A case is a spec plus a query now, and label-drift sits beside label in the gate and the gallery: 0.027% of pixels against 0.110%, with the worst channel and the signed mean unmoved at 226 and 2.91, which says the rest of that spec is the glyph fringe and not where the labels sit.

  • A frame that breaks its own render pass is tested on the attachment shapes nothing else runs. Every other spec renders multisampled and offscreen, so a single sampled frame and a presented canvas were both untouched by the mask and blend passes, and the backdrop copy reads whatever the frame resolved into, which for a presented canvas is the swapchain texture. splitpass.spec.ts draws three of those fixtures twice under each, watching onuncapturederror and checking ink came out, and it asserts the harness options actually reached the renderer rather than being ignored.

  • A second measure, for how concentrated a difference is. A whole-image percentage is diluted by however much of a chart matches, so a small region that is badly wrong reads like a faint haze. The densest 32px square is reported beside it with where to look, and across the corpus runs a median of 30x the whole-image figure and up to 633x. Gated at 35%, above the worst observed.

  • A fidelity report ranks every case by how far it is from canvas. WEBGPU_FIDELITY=1 npx playwright test fidelity renders all 118 specs and fixtures and ranks them by max and mean channel error, not just the share of pixels that moved. The two say different things: a soft antialiasing difference is a high pixel count with a low max, a misplaced or miscoloured mark is the reverse. This is what surfaced the image premultiplication bug, which the pixel count reported as 0.000%. 21 of 118 cases match canvas to within 2 levels everywhere.

  • Five of the six specs that were 255 off were the glyph phase grid. The earlier note said the phase quantization was not the cause. It was. At 8 steps per device pixel a label can land in a different one of skia's own subpixel buckets than canvas picked, and a whole stem pixel flips. 64 steps costs nothing measurable, since a static scene still has one phase per label and the glyph cache came out the same size (barley 37 entries either way, first frame 92.6 ms against 95.5, steady 10.9 against 10.3), and it only churns the cache faster while text is moving.

    38 specs improved and one moved by 0.06%. tree-radial-bundle 0.491% to 0.082%, tree-radial 0.468% to 0.077%, label 0.237% to 0.108%. scales-discretize, panzoom, heatmap, heatmap-image, legends-continuous, quantile-dot-plot, quantile-quantile-plot, arc, bar-time, calendar and gapminder all reach 0.000%. Worst channel: panzoom and scales-discretize 255 to under 25, font-size-steps 255 to 139, map-fit 255 to 176, choropleth 255 to 206.

  • Antialiased pixels are counted. Pixelmatch classifies an isolated high-contrast pixel as antialiasing, which is exactly what a one pixel marker shift looks like, and left it out of the count. That hid 22939 differing pixels against 21231 counted, and reported airports as 0.000% with 13 marks visibly out of place. includeAA: true, budgets remeasured against the whole difference.

  • Test integrity: a blank render fails the gate. Two blank images diff at 0%, which is how CI looked healthy while every spec rendered blank. The smoke test now captures a frame and fails unless at least 5% of it has any alpha, and reports the device state when it does not. Still wanted for the full suite: a non-arbitrary per-spec check, for example asserting the output is not a single uniform colour.

  • All specs are tested. The corpus is derived from test/specs-valid (all 117 specs) minus 9 documented exclusions (remote data, force layouts, wordcloud, stress demos, oversized movies-sort). New specs are picked up automatically. Gap-revealing specs (tree-radial-bundle ~12%, symbol-shapes ~7%) are tested with documented budgets that fail on regression.

  • Feature canaries. line-curves (basis/monotone plus a defined gap) stays a spec; the dash, sub-pixel rect, corner, rule-angle, symbol-shape and text-layout canaries are scenegraph fixtures under test/render/scenes, driven straight into the renderer the way vega tests vega-scenegraph.

  • Inspectable output: HTML report with each spec's webgpu/canvas/diff attached (always, passing specs included). RENDER_ARTIFACTS=1 also writes the raw per-spec PNGs to test/render/output/. CI uploads both the report (render-report) and the raw images (render-images) as downloadable artifacts.

  • The hosted gallery keeps the last ten runs. Each Pages deploy records the corpus and carries the runs before it over from the deployed site, storing each png once under its hash. Two CI runs drew all 609 pngs byte for byte the same, so ten runs of an unchanged renderer weigh what one does, about 22MB. ?run=<sha> picks a run, the gallery lists them, and the CI and Pages run summaries link the run of their commit. A run at a release tag stays past the ten, every full release for good and the newest rc until the next, and ?run=2.1.0 opens it from the release page and the GitHub release.

  • Canvas presentation is tested. Everything else renders offscreen, so local and CI agree and a runner with no compositor never has to acquire a swapchain, which costs it its device. That left getCurrentTexture() and the present itself exercised by nothing: the renderer could compute every frame correctly, show none of them, and the suite would stay green. applyTestOptions hardcoded offscreen = true with no way past it, so offscreen=0 is the way back and present.spec.ts takes it. It screenshots the canvas element rather than the backing store, since a WebGPU canvas cannot be read back after a present and the compositor's own answer is the point, then holds it against what captureFrame returns for the same spec: within 2 channel levels, at dpr 1 and dpr 2. It skips on CI, whose runner has no compositor for a present to reach, and otherwise only when the device is actually lost, naming the reason. Two sabotage passes hold it honest, and both fail it as they should: acquiring the swapchain and drawing to the offscreen texture anyway gives 'the canvas on screen is blank, so the renderer drew a frame and presented none of it', and dropping offscreen=0 from the url gives 'offscreen=0 reached the renderer'. The second of those was a real catch. The spec harness hands out its View and not its renderer, so the first version read window.renderer, got undefined, and passed that assertion on Boolean(undefined) without ever checking anything.