Data & layoutAttribution garden
Marketing attribution you can watch.
What it costs a frame
- 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.
| Machine | GPU ms | CPU ms | CPU p95 |
|---|---|---|---|
| RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool | 3.30 | 0.79 | 1.23 |
| apple · Apple A19 Proin a browser tab · 16 November 2026 | 10.1 | 1.82 | 2.04 |
| Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026 | 1.83 | 0.97 | 1.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
- Showing a team why last-click reports undersell the channels that introduce customers
- A what-if for a budget cut: sales and revenue lost, and spend saved per sale lost
- Comparing attribution models side by side over the same journeys
- Replaying any event log of paths and outcomes (support tickets, onboarding steps, a sales funnel) as particles that can be scrubbed
- Teaching Markov removal effects with a chain you can solve by hand in the tests
Pitfalls, in brief
- Scrubbing is exact only because nothing is carried between frames: every bee, grain and fruit is computed from its journey and the clock.
- The bee paths exist twice, in garden-plan.ts (beeAt, grainAt) and in the WGSL (beeAt): change one, change the other.
- 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.
- Short gaps make fast flights: two touches an hour apart get a flight a fraction of a day long.
- The Markov chain is solved exactly (a (channels + 1)-square linear system).
8 more in brief
- 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.
- 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.
- 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.
- 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.
- Pipelines take about 3 s to build on a cold shader cache (longer on a busy GPU).
- 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.
- 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.
- 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.
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.


