Feature Library

Attribution garden

3.30 GPU · 0.79 CPU ms
A still of the Attribution garden demo
Still
The live demo starts when it’s in view.Pick a model · drag the month strip to scrub · cut a budget · point at a fruit or a bed · follow one customer

Marketing attribution you can watch.

What it costs a frame

3.30 ms
0.79 ms
GPU
3.30 ms
CPU, median
0.79 ms
CPU, 95th pct
1.23 ms
Draw calls
0
Weight
Heavy

Measured 14 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged GPU 1.73–3.36, CPU 0.55–0.79 ms). What ran: Measured replaying the month at 3× from day 8 with 12,000 journeys: one compute dispatch evaluates every bee’s closed-form path, then about 90,000 pollen grains, the fruit and the beds are drawn as instanced quads; timed by its own timestamp queries. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool3.300.791.23
apple · Apple A19 Proin a browser tab · 16 November 202610.11.822.04
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20261.830.971.55

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
WebGPUNeeds WebGPU: current Chrome and Edge, Safari 26+, Firefox 141+ on Windows.
Your browser
Checking…Looking for WebGPU
Depends on
NothingNo other packages

What it’s for

  1. Showing a team why last-click reports undersell the channels that introduce customers
  2. A what-if for a budget cut: sales and revenue lost, and spend saved per sale lost
  3. Comparing attribution models side by side over the same journeys
  4. Replaying any event log of paths and outcomes (support tickets, onboarding steps, a sales funnel) as particles that can be scrubbed
  5. Teaching Markov removal effects with a chain you can solve by hand in the tests

Pitfalls, in brief

  1. Scrubbing is exact only because nothing is carried between frames: every bee, grain and fruit is computed from its journey and the clock.
  2. The bee paths exist twice, in garden-plan.ts (beeAt, grainAt) and in the WGSL (beeAt): change one, change the other.
  3. A sale’s fruit is set when its bee arrives, which can be a little after the sale (the last flight lasts at least TIMING.toFruit): count the wall’s sales by arrival (salesBy) or the readout and the wall disagree for a moment.
  4. Short gaps make fast flights: two touches an hour apart get a flight a fraction of a day long.
  5. The Markov chain is solved exactly (a (channels + 1)-square linear system).
8 more in brief
  1. Removal effects are shares of all sales, so they sum to more than 1: the data-driven model normalises them per path, over the channels on it.
  2. applyCuts plays a cut as whole channels dropped from journeys by a fixed draw, then loses just enough of the sales that lost a touch to match the chain.
  3. The fruit read the credit of every model from storage and mix two of them in the vertex shader: a model change is one uniform, not a re-upload.
  4. Grains on a bee are drawn where the compute pass put the bee this frame: the grain pass must come after the compute pass in the same submit, or they trail a frame behind and shimmer when scrubbing.
  5. Pipelines take about 3 s to build on a cold shader cache (longer on a busy GPU).
  6. Without WebGPU the Canvas 2D garden walks every journey on the CPU each painted frame (about 3–6 ms for 12,000): fine while playing, but paint only on change.
  7. A lost device (a driver reset, a sleeping laptop) sets lost and calls onLost, and draw() returns false from then on: show the Canvas 2D twin again and say so, as the demo does.
  8. draw() returns false while the last frame is still on the GPU: keep the frame dirty and draw again next frame, or a scrub step is lost.
13 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Fully custom code.

Mark Jarzynski & Marc Olano, Hash Functions for GPU Rendering (JCGT, 2020): The PCG hash under every grain, bee and bloom, bit for bit the same in WGSL and TypeScript; also the sample month’s random numbers.

Austin Appleby, MurmurHash3 (public domain): The fmix32 finaliser constants in hash01(), which draws who loses a touch under a cut.

Ken Perlin, Improving Noise (SIGGRAPH 2002): The quintic fade in the meadow’s gradient noise.

Eva Anderl, Ingo Becker, Florian von Wangenheim & Jan H. Schumann, Mapping the customer journey: lessons learned from graph-based online attribution modeling (IJRM, 2016): The Markov-chain attribution and its removal effect, as the data-driven model.

attributionmarketingmarkov chainremoval effectlast clickfirst clicktime decaybudgetwhat-ifcustomer journeysstatelessscrubbableclosed forminstancingcomputeraw webgpuwgslcanvas 2d fallbackdraw on demandtimestamp queriesseededno dependencies

Near it in the frame