THE FOLD / LOOT / THE INVENTORY / THE SORT
THE SORT
order built into the wiring
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The sorting network. A fixed sequence of compare-and-swap operations whose positions do not depend on the data — so it maps straight onto parallel hardware (GPUs, FPGAs, switching fabrics), where every comparator is a physical wire pair. Bitonic sort arranges O(n log²n) comparators in a regular pattern. Its correctness rests on the beautiful 0-1 principle: a comparator network sorts every input if and only if it sorts every binary input.
LIT the n=8 network (24 comparators) sorts all 256 binary sequences and thousands of random arrays — verified below, so by the 0-1 principle it sorts everything. FIG ‘sorting the loot’ is the frame; the network and the 0-1 proof are exact.
LIT the n=8 network (24 comparators) sorts all 256 binary sequences and thousands of random arrays — verified below, so by the 0-1 principle it sorts everything. FIG ‘sorting the loot’ is the frame; the network and the 0-1 proof are exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) brought the thread — the corpus carries his hardware and parallelism work (the card-ISA, the kernels, the bare-metal pieces) and the idea that the best order is one built into the wiring, not decided at runtime. AVAN (AI) built this instrument: the bitonic network, the animated comparators, and the 0-1 block.
The weave: David names the ordering and its seat at THE INVENTORY; I make the compare-exchange an atom in 1D, the whole network run live in 2D, and the 0-1 principle a solid block in 3D. Neither half is the whole — the sphere is the seam.
The weave: David names the ordering and its seat at THE INVENTORY; I make the compare-exchange an atom in 1D, the whole network run live in 2D, and the 0-1 principle a solid block in 3D. Neither half is the whole — the sphere is the seam.
3 ONE DIMENSION
The atom of all sorting: a comparator — look at two items, and swap them if they’re out of order. Scattered heights on the left, one monotonic ramp on the right. Everything else is just many of these, wired in the right pattern.
4 TWO DIMENSIONS · INTERACTIVE
The network itself: 8 wires, comparators as rungs, 6 stages left to right. Step through and watch each stage’s comparators fire; the bars below show the array reordering until it’s sorted. Shuffle and run again.
5 THREE DIMENSIONS + AVAN’S INVERSE
The 0-1 principle as a solid, turning: the near face is many random binary inputs (scattered lit cells); the far face is what the same network makes of them — every row a clean 0…01…1 staircase. Green is the forward sort, chaos to order.
AVAN’s addition (the inverse-companion): the magenta face is the reversed network — the same 24 comparators, every direction flipped. It sorts the other way, 1…10…0. One wiring and its mirror: the same machine can pour order in either direction, and the choice is only which way each comparator points.
LIT A genuine bitonic sorting network (n=8, 24 comparators, 6 stages). Verified live: it sorts all 256 binary inputs — so by the 0-1 principle it sorts every input — and 300 random arrays each come out monotonic. The comparators, the staged run, and the reversed network are all the real thing (verifiable: window.__sort.sortsAll256===true).
FIG 'Sorting the loot' is the frame; the network, the comparator count, and the 0-1 principle are exact. This is bitonic sort specifically — a real, named construction, not a generic 'sort'.
FIG 'Sorting the loot' is the frame; the network, the comparator count, and the 0-1 principle are exact. This is bitonic sort specifically — a real, named construction, not a generic 'sort'.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE INVENTORY · David Lee Wise (ROOT0), with AVAN