Feature Library

A million futures as a river delta

2.12 GPU · 0.68 CPU ms
A still of the A million futures as a river delta demo
Still
The live demo starts when it’s in view.Point at the land to pour futures from there · drag the deadline · change the plan beside the map · Table: drag to turn · Tab to the map, then the arrows

A Monte Carlo burndown drawn as land and water.

What it costs a frame

2.12 ms
0.68 ms
GPU
2.12 ms
CPU, median
0.68 ms
CPU, 95th pct
0.95 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 2.04–3.25, CPU 0.68–0.81 ms). What ran: Measured with the plan changing every 2.5 s (a run of 1,048,576 futures, 32,768 a frame, with the field, coast and relief passes), a stream poured from a moving point, 1,100 drops and long hill shadows, flat chart, lit look. 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 tool2.120.680.95
apple · Apple A19 Proin a browser tab · 16 November 202610.22.763.30
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 202634.41.202.06

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. Release and delivery forecasts with honest odds
  2. What-if planning: people, scope and risk levers re-run live
  3. Reading any deadline’s odds without re-running a simulation
  4. Monte Carlo results that keep every path visible
  5. DOM text laid exactly on a GPU-drawn tilted plane
  6. Text that wraps a moving shape in a chart

Pitfalls, in brief

  1. The futures do not depend on the deadline: move it with setDeadline and read the odds again from the last arrivals (readArrivals).
  2. Odds come from launch bins (1,024 along the map: a fifth of a day at 30 weeks), counted on time when a bin’s centre is on or before the deadline.
  3. Arrivals are read back a frame or two late, and only one read per stream is out at a time; a read from before setPlan is dropped.
  4. Only the first two risks colour the water (four families: neither, one, the other, both); the other two are counted per combination but do not tint it.
  5. Up to four risks and four slow weeks: the WGSL draws for four risk slots whether used or not, so the CPU pads to four too.
10 more in brief
  1. The CPU replays future i exactly only in its random draws; its arithmetic is 64-bit and the GPU’s 32-bit, so a launch can land a bin apart.
  2. The table is flat on purpose: a CSS matrix3d is a plane, so DOM text lies exactly on the drawn land only while the land is drawn flat.
  3. CSS matrix3d divides by w as the shader does, but only where w is positive: keep every element of the table in front of the camera, or the browser draws it mirrored or not at all. toChart returns null behind the camera.
  4. The table element sits at left 0, top 0 of the same box as the canvas, with transform-origin 0 0; any offset or border between them shifts every word.
  5. shape-outside needs a float with a size: wrapAlongEdge measures the text, retraces the edge and measures again (up to four passes).
  6. Memory: two streams of a 1,024 × 512 field (8 MB of counts each), seven rgba16float textures of that size and 4.7 MB of sample paths: about 40 MB of GPU memory.
  7. While a run is counting, each frame costs a compute batch (32,768 futures, about a thousand atomics each) plus two blur passes over the field: measure with a plan change, not at rest.
  8. Timestamp queries need the timestamp-query feature; without it gpuMs() is null.
  9. On an integrated GPU pass tier: ‘low’ (DELTA_TIERS): the land at 0.7× the pixels, the relief baked at half size, four shadow steps, a shorter run (262,144) and the main run and a stream stepping in turns.
  10. A run holds at most futureCap(plan) futures: each adds its launch in days to a 32-bit sum, so the cap is 4,294,967,295 over the latest launch in days (the map’s end plus 1.5× the longest stall): 20,259,279 at 30 weeks with no stall, 19,173,961 with the demo’s 1.2-week hold. setFutures and the futures option clamp to it and warn in the console.
15 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 that seeds and draws every future, on the GPU and the CPU alike.

G. E. P. Box & Mervin Muller, A note on the generation of random normal deviates (1958): The weekly and per-future lognormal luck.

Ken Perlin, Improving noise (SIGGRAPH 2002): Gradient noise with the quintic fade, for the hills, the ripples and the paper.

F. Kenton Musgrave, ridged multifractal terrain (Texturing and Modeling: A Procedural Approach, 1994): The ridged hills, each octave weighted by the last.

Paul Heckbert, Fundamentals of texture mapping and image warping (1989): The projective (homogeneous 3×3) map between a plane and the screen, and its inverse.

W3C, CSS Shapes Module Level 1 (shape-outside): Text wrapping a polygon float: the field note along the river’s bank.

WAI-ARIA Authoring Practices Guide (W3C): The slider pattern for the deadline, switches for the plan, toggle buttons for the views, and a polite live region for the odds.

monte carloforecastburndownproject planningriskprobabilitycomputeatomicswebgpuraw webgpuhomographymatrix3dperspectiveshape-outsidetext wrapterrainflowcartographykeyboardreduced motioncanvas 2d fallbackno dependencies

Near it in the frame