◀ THE FOLD0ROOT.AI // WORLD II · CO-OP · SHARED MEMORY◆ .dlw.fold
THE FOLD / CO-OP / SHARED MEMORY / THE CURVE THAT FILLS THE PLANE

THE CURVE THAT FILLS THE PLANE

one line threads every cell — and keeps neighbors near
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The Hilbert curve. A single continuous path that visits every cell of an N×N grid exactly once — and, unlike a scanline, points that are close on the 1D path stay close in 2D, with no long jumps. That makes it a locality-preserving way to flatten 2D (or 3D) data into one dimension, which is why databases, image textures, and spatial indexes store memory in Hilbert order for far better cache behaviour.

LIT verified: the index↔(x,y) map is a perfect bijection over the grid (every cell once, round-trips), and consecutive indices are always grid-adjacent (Manhattan distance exactly 1). FIG ‘fills the plane’ is the picture; the bijection and unit-step adjacency are exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) brought the thread — the corpus is full of self-similarity and memory layout (the fractal kernels, the cache work, the byte-addressing) and the idea that how you order data is as much a design as the data itself. AVAN (AI) built this instrument: the curve engine, the locality demo, and the lifted 3D ribbon.

The weave: David names the plane-filling thread and its seat at SHARED MEMORY (locality is a cache virtue); I make the 1D order a strip in 1D, the curve and its locality live in 2D, and the ribbon climbing in 3D against the naive scanline. The sphere is the seam.
3 ONE DIMENSION
The bare 1D order: a line of N² cells, coloured by position from start (dark) to end (bright). This single strip, folded by the Hilbert rule, becomes the whole square in the next window — same colours, same cells, rearranged.
4 TWO DIMENSIONS · INTERACTIVE
The curve, coloured by index. Slide a window of the 1D range and watch it light a compact blob in 2D — that’s locality. Flip to row-major and the same range smears into a thin stripe: the bounding box explodes.
order 5
window
5 THREE DIMENSIONS + AVAN’S INVERSE
The path lifted so height = position on the walk, turning. Green is the Hilbert curve: because each step is one cell, it climbs as a smooth, self-hugging ribbon that never leaps.
AVAN’s addition (the inverse-companion): the magenta ribbon is the naive row-major scanline over the same cells. It climbs the same total height but snaps all the way back at the end of every row — long jumps that trash a cache. Locality’s inverse is the scanline; the two ribbons over one grid show exactly what Hilbert order buys.
LIT A genuine Hilbert curve (bit-manipulation d2xy / xy2d). Verified live: the index↔(x,y) map is a perfect bijection over the grid (round-trips), and consecutive indices are always grid-adjacent (Manhattan distance exactly 1). The locality win — a 1D window maps to a far tighter 2D bounding box than row-major — is measured live (verifiable: window.__hilbert.bijection && adjacencyManhattan1 && localityWin).

FIG 'Fills the plane' is the picture; the bijection, the unit-step adjacency, and the locality advantage are exact. It really is used to lay out memory and spatial indexes for better cache behaviour.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of SHARED MEMORY · David Lee Wise (ROOT0), with AVAN