create({ tileable }), sampleMany, sampleGradA few thousand starlings running the usual three boid rules — separation, alignment,
cohesion — with one addition: the ambient wind they steer into is not hand-authored, it is
field.sampleMany() on a helix-noise field, sampled at each bird's own position and at the
current field time. Nobody keyframed the wheeling. Drag to orbit, scroll to zoom.
Why this field and not any smooth noise. A flow field you assemble from three scalar noise
channels has sources and sinks in it. Agents advected by such a field are pumped out of the sources
and piled into the sinks, so an evenly seeded population thins in some places and jams in others —
the density artifact that makes hand-rolled wind look wrong no matter how you tune the octaves. A
helix-noise field is u = ∇×A, so ∇·u = 0 exactly and the flow is
volume-preserving: an evenly seeded population stays evenly seeded, forever, by Liouville's theorem.
That is a measurable claim, so the page measures it.
The receipt. Two clouds of 4,096 passive tracers are seeded at exactly the same
uniform-random positions in the period box and then simply advected — no boid rules, nothing but the
flow. One rides the helix field. The other rides a gradient field u = ∇φ built on
the same integer-lattice wavenumbers, the same k^-1.4 amplitude law, the same eddy-churn
rates and normalised to the same RMS speed — the only difference is that its modes are parallel
to k instead of transverse to it, which makes it exactly curl-free and maximally compressible.
Both clouds are binned into a 6³ grid and the readout prints σ/μ of the bin counts for each, live,
always, whichever field the flock is using. The dotted line on the chart is 1/√μ = 0.230, the
spread a uniform random scatter has by counting statistics alone: that is the floor, not zero.
Measured over three minutes, the divergence-free cloud never leaves ±17% of that floor, its fullest
bin never holds more than 36 tracers and no bin is ever empty. The gradient cloud leaves the floor
within two seconds and settles at σ/μ ≈ 5–8, with 20–45% of its tracers in one bin of 216 and
roughly 160 of the other bins empty. Underneath, rms ∇·u prints the mechanism: the
trace of sampleGrad for the helix field against the closed-form divergence of the
gradient field, 1e-16 against 1.4. Both fields are normalised to unit RMS speed and the
readout prints both, so you can check the comparison is not won on amplitude — they track within
~15%, and the compressible one runs slightly slower, which makes the contrast conservative.
What this is not, and what is faked. No pressure solve, no collision, no viscosity — the field is kinematic, an exact closed-form divergence-free velocity field, not a fluid simulation, and the birds are points with no body. Three things in the flock are authored rather than emergent, and all three are on sliders. Cohesion is a clumping force, put there on purpose. Roost is a weak pull toward the flock's own centre of mass beyond 3.2 units: local cohesion only sees 2.6 units, so a flock that spreads past that horizon can never re-gather. Drag roost to 0 and the cloud loosens within seconds and thins out over the torus from there. The roost also pulls 1.6× harder vertically than horizontally, which is what makes the cloud a wide slab rather than a ball — a shape choice, not something the flow field did. And the MAXN = 24 neighbour cap keeps the boid loop bounded in the dense core, which costs a little accuracy exactly where the flock is thickest. None of the three touches the tracers, which is the whole reason the receipt lives on them. One more thing worth knowing: the flock steers toward the local wind rather than being advected by it, so it feels the difference between the two fields more weakly than the tracers do — flip the steering button and the amber knots form long before the flock visibly reacts.