A recompositional notebook

Hypersparks

Up to two million motes climb a tower built from the faces of a four-dimensional polytope. Below, the swarm is taken apart scale by scale and put back together. Every figure runs the same engine with different settings, and every code block is source that engine executes.

In [0]the whole · 10⁴ to 10⁶ motes

The whole

Move across the figure to stir it. Press and drag to turn the polytope through four dimensions. Keys 1, 2 and 3 pick the polytope, and C calls for calm. Leave it alone and the swarm settles to about twelve thousand motes, which costs your machine very little.

Attention buys more. Each movement raises an attention value toward one, and it decays with a half-life of a second and a half. Particle count follows it geometrically up to a little over two million. So do the noise octaves each mote is pushed through and the fog layers behind them. A governor watches the interval between frames and lowers the ceiling when the page starts dropping them. The readout in the corner shows where your machine's ceiling sits right now.

In [1]1 flag · 5 points

One flag

A polytope has faces of every dimension: vertices, edges, polygons, cells, and the polytope itself. A flag is one chain of them, each face inside the next. Take the centre of every face on the chain and call the points b0 to b4. Those five points span a four-dimensional simplex, and everything else in this notebook is built from copies of it.

The table lists the five centres of the selected flag. It is read from the same array the GPU samples. Each mote lives in one flag. At level j it scatters over the simplex spanned by b0 to bj, then drifts onto bj and starts level j+1. Move the slider to stop the climb early.


  

The climb of one mote through a flag. The weights w are exponential draws normalised to sum to one, which is a uniform point of the simplex.

In [2]120 to 384 flags

All the flags

Every flag gives one simplex and together they fit without gaps. This is the barycentric subdivision of the polytope's boundary, a three-sphere. The wires are the chains b0 to b4 of the flags, and more of them are drawn as you pay attention.

The face counts below are not typed in. They count distinct centres at each depth in the flags the GPU reads, and they are checked against the known counts. The alternating sum is zero, the Euler characteristic of a three-sphere. In the language of cellular chains these counts are the ranks of the chain groups C0 to C3, and a mote rising a level moves in the direction a coboundary operator reaches, from a face toward the larger faces around it. Nothing here computes a cohomology group. The picture is a way of sitting with one.


  

  

  

In [3]5 levels · 6 rotation planes

The tower

The levels are filtered. Level 0 holds the vertices, each level adds the faces of the next dimension, and level 4 fills the whole polytope. Each level gets its own place in space. Height grows with the level, the polytope shrinks a little, and its four-dimensional rotation picks up a twist proportional to the level. Then perspective drops four dimensions to three, and the screen drops three to two. That is a chain of two projections, and the second is the one your eye undoes.

Two cautions. A filtration by skeletons is real topology, but it is not a Postnikov tower, which removes homotopy groups from the bottom. I draw skeletons because they can be drawn. Higher homotopies are an aspiration in this notebook, and the twist is a drawing choice.


In [4]attention to frame time

The throttle

The positions above are exact. What makes it a swarm is a displacement added on top: a few octaves of sine waves evaluated at each mote's own place, so neighbours move together, plus a swirl around your pointer. The number of octaves is the part attention controls, along with the particle count.

The governor is deliberately simple. It tracks a smoothed frame interval and the smallest interval it has seen, which is your display's refresh. If frames run well past that, the ceiling drops by a tenth. If they run close to it, the ceiling creeps back up. The slider pins a minimum attention so you can find your machine's limit without waving at it. The trace shows the last fifteen seconds of the hero figure and this one, whichever drew last.


In [5]every control at once

Put back together

The whole again, with the settings the earlier cells used one at a time. Cut the levels to see the vertex dust. Take the flag count down to one and you are back in the first figure. Raise the queer term and the symmetry loosens, so the polytope leans and ripples instead of holding its form.

Outwhat this is

What this is, and what it is not

Provenance
project
hypersparks
repo_path
~/hypersparks
git_remote
none yet
git_branch
main
git_commit
see provenance.json and git log in the repo
generated_at
2026-11-15
generator
Claude Code, a single file with WebGL2 and no dependencies
session_source
Claude Code background job
session_locator
~/.claude/jobs/90d05155