CRITICALITY is a live Abelian sandpile rendered in canvas 2D. Grains rain onto a 129×129 grid; any cell holding four topples, shedding one grain to each neighbour, which can topple in turn. Its single job: let a viewer drop one grain too many and watch a self-similar avalanche repaint the field — while, left alone, the pile drives itself to the critical state and settles into its identity fractal.
Four colours only. The bright gold is reserved for full cells, marks and rules; body text runs on a lighter ink so nothing small sits under 4.5:1 on the slate.
No libraries. Pure canvas 2D and typed arrays — the simulation is small and hot, so a shader or physics engine would only get in the way. The field is drawn into a 129×129 ImageData (one pixel per cell) and scaled up with smoothing off, which keeps each grain a crisp block for the cost of one drawImage.
The signature — toppling. Cell states live in an Int16Array. A grain lands and, if a cell reaches four, it joins an unstable list. Each frame runs parallel Abelian sweeps under a 7 ms time budget: every unstable cell sheds 4×⌊grains/4⌋, its neighbours inherit the load via a delta buffer marked per-generation so no cell is touched twice, and the newly overloaded cells form the next sweep. Because toppling is Abelian the order never changes the result — so the sweep can fire a whole ring at once, which is exactly what draws the expanding avalanche. Toppling cells are flashed in a heat buffer that decays each frame, painting the red cascade front. Grains crossing the boundary fall into a sink, and that loss is what lets the pile balance itself. Grains are only dripped when the field is fully settled — the slow-drive / fast-relax separation of timescales that makes the avalanche sizes fall on a power law.
The identity fractal. Press Identity fractal and the field is set to 6 − stabilize(6), then relaxed live: the avalanche settles into the sandpile group's identity element — the stable configuration that adds to nothing — an intricate self-similar fractal computed honestly, not drawn.
--ink-3 from #78746B to #8C887D to clear the 4.5:1 floor (the recurring W2 failure).#463C2A → #927236 → #E0B23C); the fractal's shells now read distinctly instead of the mid-tones muddying together. Legend swatches matched to the exact render values.0.84 → 0.82) so the avalanche front feels sharper without losing the wake.scrollWidth≤375).document.hidden with the drip clock reset on resume. Removed the one unused ornament (a dead .stat.wide rule). Final copy read.