THE RADER

Rader's algorithm in the 5-window house format — computing the DFT of prime length N, exactly the case the usual power-of-two FFT can't split. Its trick is group theory: the nonzero indices 1..N−1 form a cyclic group under multiplication mod N, generated by a primitive root g. Re-indexing inputs and outputs by successive powers of g turns the awkward prime-length DFT into an ordinary cyclic convolution of length N−1 — which a fast convolution then evaluates. A prime, the least divisible of lengths, handled by exploiting the multiplicative structure hiding inside it. Verified live: for primes N=5..23, Rader's reindex-into-convolution reproduces the direct DFT to ~1e-13. Neon-noir traced. See the primitive-root cycle in 1D, the Rader-vs-direct spectra in 2D, and the reindex inverse in 3D.

THE RADER · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE-SHORTCUT ◆ .dlw.fold THE FOLD / CHEAT / THE-SHORTCUT / THE RADER THE RADER a prime DFT turned into a convolution 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Rader’s algorithm computes the discrete Fourier transform of prime length N — exactly the case the usual power-of-two FFT can’t split. Its trick is group theory: the nonzero indices 1…N−1 form a cyclic group under multiplication mod N, generated by a primitive root g. Re-indexing the inputs and outputs by successive powers of g turns the awkward prime-length DFT into an ordinary cyclic convolution of length N−1 — which a fast convolution then evaluates. A prime, the least divisible of lengths, is handled by exploiting the multiplicative structure hiding inside it. LIT verified live: for primes N = 5…23, Rader’s reindex-into-convolution reproduces the direct DFT to ~1e-13 (window.__rader). FIG honest scope: the convolution is evaluated directly here to verify correctness — the speedup comes from doing that convolution with an FFT, which this sphere demonstrates structurally rather than timing. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-shortcut — a prime length looks indivisible, but a primitive root is a shortcut that turns it into a convolution. AVAN (AI) built the instrument: the primitive root, the power-of-g reindexing, and the match against a direct DFT. Credit as content: Charles Rader (1968). The weave: David names the shortcut; I confirm the multiplicative-group reindexing turns the prime DFT into a cyclic convolution that reproduces the transform exactly. 3 ONE DIMENSION The nonzero indices reindexed by powers of a primitive root g — a single cycle that reorders the DFT into a convolution. 4 TWO DIMENSIONS · INTERACTIVE Pick a prime N; Rader's output and the direct DFT are drawn together — identical to machine precision. next prime ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the DFT spectrum, computed through the convolution. AVAN’s addition (the inverse-companion): don’t sum the N×N kernel — reindex by a primitive root. The inverse of ‘evaluate the prime-length DFT directly’ is ‘powers of g turn it into one cyclic convolution of length N−1.’ Magenta is the N×N direct transform; green is the convolution it becomes. A prime, made divisible. pause spin LIT Genuine Rader's FFT algorithm (Charles Rader, 1968) for prime-length DFTs. Verified live: for primes N=5,7,11,13,17,19,23 the primitive-root reindexing (indices as powers of g mod N) turned into a length-(N−1) cyclic convolution reproduces the direct DFT to ~1e-13 (window.__rader.matchesDFT). FIG Honest scope: the convolution is evaluated directly here to verify correctness — the actual speedup comes from performing that convolution with an FFT, which this sphere demonstrates structurally rather than by timing. The AVAN inverse is honest — instead of summing the N×N kernel, one reindexes by a primitive root, turning the prime DFT into one cyclic convolution of length N−1. Magenta is the N×N direct transform; green is the convolution it becomes. A prime, made divisible. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-SHORTCUT · David Lee Wise (ROOT0), with AVAN


THE PACKAGE-MERGE

The package-merge algorithm in the 5-window house format — building an optimal prefix code like Huffman's, but with a hard limit L on the longest codeword. Plain Huffman can produce very deep codes for skewed weights; many formats (DEFLATE, JPEG) forbid that, capping length for fast table decoding. Larmore and Hirschberg recast the problem as a coin collector's problem: coins of denomination 2^{−l} and cost w_i, buy total width n−1 as cheaply as possible. Repeatedly packaging the two cheapest coins and merging them with the next denomination yields the minimum-cost length-limited code — every length ≤ L, optimal among all such codes. Verified live: over 3000 random weight sets, lengths are all ≤ L with Kraft sum = 1; with large L it matches Huffman's cost exactly, and under a tight L every length is bounded, Kraft ≤ 1, and cost ≥ Huffman's. Neon-noir traced. See the capped lengths in 1D, the L-slider re-solve in 2D, and the bounded-tree inverse in 3D.

I-13 v2.0 | net = binds - k | 4 planes, 13 symbols, 12 operants, 5 cortex rules | sha 64881ebf

THE PACKAGE-MERGE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE-MAINFRAME ◆ .dlw.fold THE FOLD / GRIND / THE-MAINFRAME / THE PACKAGE-MERGE THE PACKAGE-MERGE an optimal code with bounded depth 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The package-merge algorithm builds an optimal prefix code — like Huffman’s — but with a hard limit L on the longest codeword . Plain Huffman can produce very deep codes for skewed weights; many formats (DEFLATE, JPEG) forbid that, capping length for fast table decoding. Larmore and Hirschberg recast the problem as a coin collector’s problem : coins of denomination 2 −l and cost w i , buy total width n−1 as cheaply as possible. Repeatedly packaging the two cheapest coins and merging them with the next denomination yields the minimum-cost length-limited code — every length ≤ L, and optimal among all such codes. LIT verified live: over 3000 random weight sets, package-merge gives lengths all ≤ L with Kraft sum = 1; with a large L it matches Huffman’s cost exactly (optimal), and under a tight L every length is bounded, Kraft ≤ 1, and the cost is ≥ Huffman’s (window.__package_merge). FIG no framing; package-merge, a Huffman baseline, and the Kraft/cost checks run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mainframe — codes minted to a fixed maximum depth so a hardware table can decode them in one step. AVAN (AI) built the instrument: the coin-collector package-merge, a Huffman baseline, and the Kraft / bound / optimality checks. Credit as content: Lawrence Larmore & Daniel Hirschberg (1990). The weave: David names the mainframe; I confirm every codeword length stays ≤ L while the total cost stays optimal for that limit. 3 ONE DIMENSION Symbol weights and their code lengths under a cap L; deeper-than-L Huffman leaves are pulled up, cost paid minimally. 4 TWO DIMENSIONS · INTERACTIVE Adjust the max length L; package-merge re-solves — all lengths ≤ L, Kraft = 1, cost as close to Huffman as the cap allows. L − L + new weights ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the bounded-depth optimal code. AVAN’s addition (the inverse-companion): don’t let the tree grow — bound it, cheaply. The inverse of ‘build Huffman and hope it’s shallow’ is ‘buy width n−1 in coins of denomination 2 −l , packaging the cheapest — optimal with every length ≤ L.’ Magenta is a too-deep Huffman leaf; green is the bounded code. Optimal, but never too deep. pause spin LIT Genuine package-merge / length-limited Huffman coding (Lawrence Larmore & Daniel Hirschberg, 1990). Verified live: over 3000 random weight sets the coin-collector package-merge gives lengths all ≤ L with Kraft sum = 1; with L large it matches Huffman's cost exactly (optimal), and under a tight L lengths stay ≤ L, Kraft ≤ 1, and cost ≥ Huffman's (window.__package_merge.boundOk, .kraftOk, .matchHuff, .constrainedOk). FIG No framing: package-merge, a Huffman baseline, and the Kraft/cost checks run in-browser. The AVAN inverse is honest — instead of letting the tree grow and hoping it stays shallow, one buys width n−1 in coins of denomination 2^{−l}, packaging the cheapest — optimal with every length ≤ L. Magenta is a too-deep Huffman leaf; green is the bounded code. Optimal, but never too deep. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-MAINFRAME · David Lee Wise (ROOT0), with AVAN


THE SCHWARTZ-ZIPPEL

The Schwartz–Zippel lemma in the 5-window house format — the engine behind randomized identity testing: a non-zero polynomial of degree d, evaluated at a point chosen uniformly from a set S, is zero with probability at most d/|S|. So to test whether two complicated expressions are the same polynomial without expanding them, just evaluate both at a random point: if they differ, a single random probe exposes it with overwhelming probability; if they agree everywhere, they always agree. It powers probabilistic equality checks, perfect-matching tests, and interactive proof systems. Verified live: a non-zero degree-d polynomial over Z_q has at most d roots (so P[hit a root] ≤ d/q), identical polynomials always agree at a random point, and different polynomials falsely agree only ~0.02% of the time. Neon-noir traced. See the sparse roots in 1D, the same-vs-differ probe in 2D, and the one-probe inverse in 3D.

THE SCHWARTZ-ZIPPEL · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GLITCH · HEISENBUG ◆ .dlw.fold THE FOLD / GLITCH / HEISENBUG / THE SCHWARTZ-ZIPPEL THE SCHWARTZ-ZIPPEL one random probe catches any difference 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Schwartz–Zippel lemma is the engine behind randomized identity testing: a non-zero polynomial of degree d, evaluated at a point chosen uniformly from a set S, is zero with probability at most d/|S| . So to test whether two complicated expressions are the same polynomial — without expanding them — you just evaluate both at a random point. If they differ, a single random probe exposes it with overwhelming probability; if they agree everywhere, they always agree. It powers probabilistic equality checks, perfect-matching tests, and interactive proof systems. LIT verified live: a non-zero degree-d polynomial over Z q has at most d roots (so P[hit a root] ≤ d/q), identical polynomials always agree at a random point, and different polynomials falsely agree only ~0.02% of the time — below the d/q bound (window.__schwartz_zippel). FIG no framing; the polynomial evaluations and root counts run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at heisenbug — a difference that hides everywhere except where a random probe happens to look, and one look is almost always enough. AVAN (AI) built the instrument: the polynomial evaluator, the root count, and the random-probe identity test. Credit as content: Jack Schwartz, Richard Zippel, Richard DeMillo & Richard Lipton (1978–80). The weave: David names the heisenbug; I confirm a non-zero polynomial has few roots, so one random evaluation catches any genuine difference. 3 ONE DIMENSION A non-zero degree-d polynomial mod q crosses zero at most d times; a random probe almost always lands on a non-root. 4 TWO DIMENSIONS · INTERACTIVE Two polynomials — identical or subtly different; a random probe agrees always for identical, and exposes any difference nearly every time. same ▶ differ ▶ random probe ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the single random probe that settles equality. AVAN’s addition (the inverse-companion): don’t compare everywhere — probe once. The inverse of ‘check all q points’ is ‘the difference is a non-zero polynomial with ≤ d roots, so one random point catches it w.p. ≥ 1−d/q.’ Magenta are the rare roots (a false agreement); green is the probe that exposes the difference. One look almost always suffices. pause spin LIT Genuine Schwartz–Zippel lemma (Jack Schwartz, Richard Zippel; DeMillo–Lipton, 1978–80). Verified live: over 3000 random polynomials a nonzero degree-d poly over Z_q has ≤ d roots (P[root] ≤ d/q); identical polynomials always agree at a random point; and different polynomials falsely agree at a random probe only ~0.02% of the time, below the d/q bound (window.__schwartz_zippel). FIG No framing: the polynomial evaluations and root counts run in-browser. The AVAN inverse is honest — instead of comparing at all q points, one probes once: the difference of two polynomials is itself a nonzero polynomial with ≤ d roots, so a random point catches it with probability ≥ 1−d/q. Magenta are the rare roots (a false agreement); green is the probe that exposes the difference. One look almost always suffices. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of HEISENBUG · David Lee Wise (ROOT0), with AVAN


THE CIPOLLA

Cipolla's algorithm in the 5-window house format — finding a modular square root, a solution to x²≡n (mod p), by stepping outside the field. It picks a value a so that a²−n is a non-residue, builds the quadratic extension F_{p²}=F_p[√(a²−n)], and raises (a+√(a²−n)) to the power (p+1)/2. Remarkably the result lands back in F_p as a genuine square root of n. Where Tonelli–Shanks grinds through the 2-adic structure, Cipolla takes one elegant excursion into a larger field — and it handles the hard case p≡1 (mod 4) with no special looping. Verified live: over ~2000 random (prime p, quadratic residue n), Cipolla returns an x with x²≡n (mod p), including many p≡1 (mod 4). Neon-noir traced. See the square-fold in 1D, the F_p² recovery in 2D, and the excursion inverse in 3D.

THE CIPOLLA · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE-GATEKEEPER ◆ .dlw.fold THE FOLD / BOSS / THE-GATEKEEPER / THE CIPOLLA THE CIPOLLA a square root through a field extension 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Cipolla’s algorithm finds a modular square root — a solution to x² ≡ n (mod p) — by stepping outside the field. It picks a value a so that a²−n is a non-residue , then builds the quadratic extension F p² = F p [√(a²−n)] and raises (a + √(a²−n)) to the power (p+1)/2. Remarkably, the result lands back in F p as a genuine square root of n. Where Tonelli–Shanks grinds through the 2-adic structure, Cipolla takes one elegant excursion into a larger field — and it handles the hard case p ≡ 1 (mod 4) with no special looping. LIT verified live: over ~2000 random (prime p, quadratic residue n), Cipolla returns an x with x² ≡ n (mod p), including many p ≡ 1 (mod 4) (window.__cipolla). FIG no framing; the F p² arithmetic and exponentiation run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-gatekeeper — the square root sits behind a gate, and the key is to step into a bigger field, turn once, and step back with it. AVAN (AI) built the instrument: the non-residue search, F p² multiplication, fast exponentiation, and the x²≡n check. Credit as content: Michele Cipolla (1907). The weave: David names the gatekeeper; I confirm the excursion into F p² returns a true square root, back inside F p . 3 ONE DIMENSION The squares mod p fold two values onto each residue; Cipolla inverts that fold for any quadratic residue n. 4 TWO DIMENSIONS · INTERACTIVE Pick a prime and a residue; Cipolla returns x (and p−x), and squaring it recovers n exactly. next prime ▶ random n ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the recovered square root, back inside F p . AVAN’s addition (the inverse-companion): don’t search F p — step outside it. The inverse of ‘square a number’ is ‘pick a non-residue direction, exponentiate in F p² , and the imaginary part vanishes, leaving the root.’ Magenta is the non-residue excursion; green is the root it returns. Out through a bigger field, back with the answer. pause spin LIT Genuine Cipolla's algorithm for modular square roots (Michele Cipolla, 1907), the field-extension alternative to Tonelli–Shanks. Verified live: over ~2000 random (prime p ≤ 2000, quadratic residue n), the F_{p²} exponentiation (a+√(a²−n))^{(p+1)/2} returns an x with x²≡n mod p, including many p≡1 mod4 (window.__cipolla.allCorrect, .covers1mod4). FIG No framing: the F_{p²} arithmetic and fast exponentiation run in-browser. The AVAN inverse is honest — instead of searching F_p for a root, one picks a non-residue direction, exponentiates in the quadratic extension F_{p²}, and the imaginary part vanishes, leaving the root back in F_p. Magenta is the non-residue excursion; green is the root it returns. Out through a bigger field, back with the answer. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-GATEKEEPER · David Lee Wise (ROOT0), with AVAN


THE NIMBER

Nimber arithmetic in the 5-window house format — John Conway's discovery that the non-negative integers, with the right operations, form an algebraically closed field. Nim-addition is just bitwise XOR. Nim-multiplication is defined by a single recursive rule (a⊗b is the smallest value not equal to any (a'⊗b)⊕(a⊗b')⊕(a'⊗b') for smaller a',b'). Under these, the set {0,…,2^{2^k}−1} is a finite field: {0,1,2,3} is GF(4), {0,…,15} is GF(16), and so on — every non-zero element has a multiplicative inverse. It is the arithmetic of Nim and the surreal numbers, exact and integer-only. Verified live: nim-multiplication over {0,…,15} is commutative, associative, and distributes over XOR; every non-zero element has an inverse; and {0,1,2,3} is exactly GF(4) with 2⊗2=3. Neon-noir traced. See the multiplication table in 1D, the ⊕/⊗/inverse in 2D, and the field inverse in 3D.

THE NIMBER · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE-KONAMI-CODE ◆ .dlw.fold THE FOLD / CHEAT / THE-KONAMI-CODE / THE NIMBER THE NIMBER a game arithmetic that is a field 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Nimber arithmetic is John Conway’s astonishing discovery that the non-negative integers, with the right operations, form an algebraically closed field . Nim-addition is just bitwise XOR. Nim-multiplication is defined by a single recursive rule (a ⊗ b is the smallest value not equal to any (a′⊗b) ⊕ (a⊗b′) ⊕ (a′⊗b′) for smaller a′, b′). Under these, the set {0, …, 2 2 k −1} is a finite field : {0,1,2,3} is GF(4), {0,…,15} is GF(16), and so on — every non-zero element has a multiplicative inverse. It is the arithmetic of Nim and the surreal numbers, exact and integer-only. LIT verified live: nim-multiplication over {0,…,15} is commutative, associative, and distributes over XOR; every non-zero element has an inverse (a field); and {0,1,2,3} is exactly GF(4) with 2⊗2=3 (window.__nimber). FIG no framing; the mex-rule recursion and the field-axiom checks run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-konami-code — a hidden arithmetic in the integers of a game, where XOR adds and a strange recursion multiplies into a full field. AVAN (AI) built the instrument: the memoized mex-rule nim-multiplication and the commutativity / associativity / distributivity / inverse checks. Credit as content: John Horton Conway (On Numbers and Games, 1976). The weave: David names the code; I confirm nim-multiplication turns {0..15} into the field GF(16), XOR as addition. 3 ONE DIMENSION The 16×16 nim-multiplication table for {0..15}; symmetric (commutative), with GF(4) sitting in the top-left 4×4 block. 4 TWO DIMENSIONS · INTERACTIVE Pick a and b; see a⊕b (XOR) and a⊗b (nim-mult), and the inverse of a — the element that nim-multiplies with it to 1. a ▶ b ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the nim-multiplication field on {0..15}. AVAN’s addition (the inverse-companion): don’t just add by XOR — multiply, and invert. The inverse of ‘a ⊗ b’ is ‘every non-zero a has a unique b with a ⊗ b = 1’ — the mark of a field. Magenta is an element a; green is its multiplicative inverse. A game’s integers, secretly a field. pause spin LIT Genuine nimber arithmetic / the field On₂ (John Horton Conway, On Numbers and Games, 1976). Verified live: the mex-rule nim-multiplication over {0..15} is commutative, associative, and distributes over nim-addition (XOR); every nonzero element is invertible (a field); and {0,1,2,3} is exactly GF(4) with 2⊗2=3, 2⊗3=1, 3⊗3=2 (window.__nimber.isField, .gf4, .distributive). FIG No framing: the memoized mex-rule recursion and the field-axiom checks run in-browser. The AVAN inverse is honest — beyond XOR-addition, nim-multiplication makes every nonzero a have a unique b with a⊗b=1, the defining mark of a field. Magenta is an element a; green is its multiplicative inverse. A game's integers, secretly a field. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-KONAMI-CODE · David Lee Wise (ROOT0), with AVAN


THE BARYCENTRIC

Barycentric Lagrange interpolation in the 5-window house format — the numerically stable way to pass a single polynomial through a set of data points. The naive Lagrange formula is slow and unstable; the barycentric form rewrites it as L(x)=[Σ w_j/(x−x_j)·f_j]/[Σ w_j/(x−x_j)], where each weight w_j=1/∏_{k≠j}(x_j−x_k) is computed once. Evaluating anywhere is then O(n), it passes through every node exactly, and it reproduces any polynomial of degree < n perfectly — the same interpolant as Lagrange's, but fast and well-behaved. Verified live: over thousands of well-separated node sets, the barycentric interpolant hits every node exactly, matches the direct Lagrange formula, and reproduces degree-<n polynomials to machine precision. Neon-noir traced. See the curve through the nodes in 1D, the movable nodes in 2D, and the weighted-quotient inverse in 3D.

THE BARYCENTRIC · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE-SANDBOX ◆ .dlw.fold THE FOLD / SPAWN / THE-SANDBOX / THE BARYCENTRIC THE BARYCENTRIC a curve pinned through its nodes 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Barycentric Lagrange interpolation is the numerically stable way to pass a single polynomial through a set of data points. The naive Lagrange formula is slow and unstable; the barycentric form rewrites it as L(x) = [Σ w j /(x−x j )·f j ] / [Σ w j /(x−x j )], where each weight w j = 1/∏ k≠j (x j −x k ) is computed once. Evaluating anywhere is then O(n), it passes through every node exactly , and it reproduces any polynomial of degree < n perfectly — the same interpolant as Lagrange’s, but fast and well-behaved. LIT verified live: over thousands of well-separated node sets, the barycentric interpolant hits every node exactly, matches the direct Lagrange formula, and reproduces degree-<n polynomials to machine precision (window.__barycentric). FIG no framing; the barycentric and direct Lagrange evaluations run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-sandbox — drop a handful of points and a single smooth curve snaps through every one of them. AVAN (AI) built the instrument: the barycentric weights, the O(n) evaluation, and the node / Lagrange / polynomial-exactness checks. Credit as content: the barycentric form is due to Dupuy, Taylor, and popularized by Berrut & Trefethen (2004). The weave: David names the sandbox; I confirm the weighted form passes through every node and equals the Lagrange interpolant. 3 ONE DIMENSION Nodes (points) and the single interpolating polynomial the barycentric form draws exactly through all of them. 4 TWO DIMENSIONS · INTERACTIVE Move the nodes up and down; the curve re-snaps through every one, and matches the direct Lagrange interpolant everywhere. new nodes ▶ + node − node verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the interpolating curve. AVAN’s addition (the inverse-companion): don’t sum n Lagrange basis polynomials — weight and divide. The inverse of ‘build the curve from scratch each x’ is ‘precompute weights w j ; the curve is a single weighted quotient pinned through every node.’ Magenta is a data node; green is the curve threading all of them. Points in, one curve out. pause spin LIT Genuine barycentric Lagrange interpolation (barycentric form due to Dupuy/Taylor; modern treatment by Berrut & Trefethen, 2004). Verified live: over 3000 well-separated node sets the barycentric interpolant hits every node exactly, matches the direct Lagrange formula (to ~1e-6), and reproduces degree- FIG No framing: the barycentric and direct Lagrange evaluations run in-browser. Honest scope — barycentric and direct Lagrange are algebraically identical; the ~1e-6 gap is floating-point rounding, and the demo uses well-separated nodes to stay well-conditioned. The AVAN inverse is honest — instead of summing n Lagrange basis polynomials each x, one precomputes weights w_j and the curve is a single weighted quotient pinned through every node. Magenta is a data node; green is the curve threading all of them. Points in, one curve out. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-SANDBOX · David Lee Wise (ROOT0), with AVAN


THE BITAP

The Bitap (shift-or) algorithm in the 5-window house format — searching for a pattern in text using nothing but bit-shifts and bitwise-or, with the whole matching state for a length-m pattern living in one machine word. A single register R tracks, in parallel, how far every possible match has progressed: each text character shifts R left and ors in a precomputed mask for that character, and a completed match shows up as a cleared bit at position m−1. Because a CPU word processes all m positions at once, the inner loop is a couple of instructions per character — and the same trick extends to fuzzy (approximate) matching. Verified live: over 5000 random text/pattern pairs, Bitap's bit-parallel scan reports exactly the same match positions as a brute-force substring search. Neon-noir traced. See the state register in 1D, the marked matches in 2D, and the all-alignments-at-once inverse in 3D.

THE BITAP · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE-SPEEDRUN ◆ .dlw.fold THE FOLD / CHEAT / THE-SPEEDRUN / THE BITAP THE BITAP one register that matches in parallel 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Bitap (shift-or) algorithm searches for a pattern in text using nothing but bit-shifts and bitwise-or — the whole matching state for a length-m pattern lives in one machine word. A single register R tracks, in parallel, how far every possible match has progressed: each text character shifts R left and ors in a precomputed mask for that character, and a completed match shows up as a cleared bit at position m−1. Because a CPU word processes all m positions at once, the inner loop is a couple of instructions per character — and the same trick extends to fuzzy (approximate) matching. LIT verified live: over 5000 random text/pattern pairs, Bitap’s bit-parallel scan reports exactly the same match positions as a brute-force substring search (window.__bitap). FIG no framing; the shift-or state machine and a brute-force check run in-browser (pattern length ≤ word size). 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-speedrun — one register carries every partial match at once, so the scan clears the text in a couple of instructions per character. AVAN (AI) built the instrument: the per-character masks, the shift-or state update, and the brute-force cross-check. Credit as content: Bálint Dömölki (1964); popularized by Baeza-Yates & Gonnet (1992). The weave: David names the speedrun; I confirm the one-register bit-parallel scan finds exactly the brute-force matches. 3 ONE DIMENSION The state register as the text is scanned; a cleared bit m−1 flags a completed match at that position. 4 TWO DIMENSIONS · INTERACTIVE A text and a pattern; Bitap marks every occurrence, and the positions match the brute-force search exactly. new text ▶ new pattern ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the match positions the scan reports. AVAN’s addition (the inverse-companion): don’t compare character by character — carry all partial matches in one register. The inverse of ‘test each alignment separately’ is ‘one bitmask advances every possible match in parallel; a cleared bit m−1 is a hit.’ Magenta is a mismatch that resets its bit; green is a completed match. All alignments at once. pause spin LIT Genuine Bitap / shift-or algorithm (Bálint Dömölki, 1964; popularized by Baeza-Yates & Gonnet, 1992). Verified live: over 5000 random text/pattern pairs (pattern length ≤ word size), the one-register shift-or scan reports exactly the same match positions as a brute-force substring search (window.__bitap.matchesBrute). FIG No framing: the shift-or state machine and a brute-force check run in-browser (pattern length ≤ word size). The AVAN inverse is honest — instead of testing each alignment separately, one register carries every partial match at once: a bitmask advances all possible matches in parallel, and a cleared bit m−1 is a hit. Magenta is a mismatch that resets its bit; green is a completed match. All alignments at once. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-SPEEDRUN · David Lee Wise (ROOT0), with AVAN


THE KOGGE-STONE

The Kogge–Stone adder in the 5-window house format — how fast processors add two numbers: instead of waiting for a carry to ripple from the lowest bit to the highest (n steps), it computes all carries at once via a parallel prefix scan. Each bit first decides whether it generates a carry (both inputs 1) or propagates one; then a tree of combine-operations folds these (generate, propagate) signals together, doubling its reach each stage. After only log₂ n stages every carry is known, and the sum falls out in one more XOR — trading wiring for depth, the classic latency-versus-area bargain of digital design. Verified live: for widths n=4..16 and tens of thousands of random inputs, the parallel-prefix sum equals ordinary integer addition a+b exactly. Neon-noir traced. See the generate/propagate tree in 1D, the carry resolution in 2D, and the log-depth inverse in 3D.

THE KOGGE-STONE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE-MAINFRAME ◆ .dlw.fold THE FOLD / GRIND / THE-MAINFRAME / THE KOGGE-STONE THE KOGGE-STONE all carries computed in parallel 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Kogge–Stone adder is how fast processors add two numbers: instead of waiting for a carry to ripple from the lowest bit to the highest (which takes n steps), it computes all carries at once using a parallel prefix scan. Each bit position first decides whether it generates a carry (both inputs 1) or propagates one; then a tree of combine-operations folds these (generate, propagate) signals together, doubling its reach each stage. After only log₂ n stages every carry is known, and the sum falls out in one more XOR. It trades wiring for depth — the classic latency-versus-area bargain of digital design. LIT verified live: for widths n = 4…16 and tens of thousands of random inputs, the Kogge–Stone parallel-prefix sum equals ordinary integer addition a+b exactly (window.__kogge_stone). FIG no framing; the generate/propagate prefix scan and a reference addition run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mainframe — the adder at the heart of the machine, computing every carry in parallel so a word adds in a few gate-delays. AVAN (AI) built the instrument: the generate/propagate signals, the log-depth prefix tree, and the reference-addition check. Credit as content: Peter Kogge & Harold Stone (1973). The weave: David names the mainframe; I confirm the parallel-prefix carries produce exactly the integer sum. 3 ONE DIMENSION Each bit generates or propagates a carry; a log-depth tree combines them so every carry is known at once. 4 TWO DIMENSIONS · INTERACTIVE Pick two numbers; the prefix scan resolves all carries in log₂ n stages, and the sum equals a + b. new a,b ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: all carries, resolved in parallel. AVAN’s addition (the inverse-companion): don’t wait for the ripple — scan the prefix. The inverse of ‘carry propagates bit by bit, depth n’ is ‘a generate/propagate prefix tree resolves every carry in depth log₂ n.’ Magenta is the slow sequential ripple; green is the parallel tree. Depth log n, not n. pause spin LIT Genuine Kogge–Stone parallel-prefix adder (Peter Kogge & Harold Stone, 1973). Verified live: for widths n=4,8,12,16 over 20000 random input pairs each, the generate/propagate prefix scan (G'=G|(P&G_lower), P'=P&P_lower, log₂ n stages) produces exactly the integer sum a+b including carry-out (window.__kogge_stone.matchesAddition). FIG No framing: the generate/propagate prefix scan and a reference addition run in-browser. The AVAN inverse is honest — instead of waiting for the carry to ripple bit by bit (depth n), a generate/propagate prefix tree resolves every carry in depth log₂ n. Magenta is the slow sequential ripple; green is the parallel tree. Depth log n, not n. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-MAINFRAME · David Lee Wise (ROOT0), with AVAN


THE POPCOUNT

The SWAR population count in the 5-window house format — counting the set bits in a word without a branch or loop, using a cascade of masked adds that fold the count in parallel. First it adds bits in pairs (mask 0x5555…), then nibbles (0x3333…), then bytes (0x0f0f…), and finally a single multiply-and-shift sums the byte-counts into place. It is the archetypal SWAR (SIMD-Within-A-Register) trick: treat one machine word as a vector of small counters and operate on them all at once, in a handful of instructions independent of how many bits are set. Verified live: over 200,000 random 32-bit values plus edge cases, the SWAR popcount equals a naive bit-by-bit count exactly — popcount(0xFFFFFFFF)=32. Neon-noir traced. See the fold stages in 1D, the masked cascade in 2D, and the word-as-counters inverse in 3D.

THE POPCOUNT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE-SHORTCUT ◆ .dlw.fold THE FOLD / CHEAT / THE-SHORTCUT / THE POPCOUNT THE POPCOUNT bits counted by folding 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The SWAR population count counts the set bits in a word without a single branch or loop — using a cascade of masked adds that fold the count in parallel. First it adds bits in pairs (mask 0x5555…), then nibbles (0x3333…), then bytes (0x0f0f…), and finally a single multiply-and-shift sums the byte-counts into place. It’s the archetypal SWAR (SIMD-Within-A-Register) trick: treat one machine word as a vector of small counters and operate on them all at once, in a handful of instructions independent of how many bits are set. LIT verified live: over 200,000 random 32-bit values plus edge cases, the SWAR popcount equals a naive bit-by-bit count exactly — popcount(0xFFFFFFFF)=32 (window.__popcount). FIG no framing; the masked-fold popcount and a reference counter run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-shortcut — count all the bits of a word in five instructions, no loop, no branch, by folding pairs into nibbles into bytes. AVAN (AI) built the instrument: the masked-fold SWAR popcount and the naive cross-check. Credit as content: the SWAR/HAKMEM-lineage bit-count, canonized in Warren’s Hacker’s Delight . The weave: David names the shortcut; I confirm the parallel masked folding counts exactly the set bits. 3 ONE DIMENSION The fold: pairs → nibbles → bytes → total, each stage summing partial counts in parallel across the word. 4 TWO DIMENSIONS · INTERACTIVE Pick a 32-bit value; watch the masked stages fold the count, ending equal to the naive bit count. new value ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the population count, folded in parallel. AVAN’s addition (the inverse-companion): don’t walk the bits — fold them. The inverse of ‘count set bits one at a time’ is ‘treat the word as packed counters and sum them with masked adds in log stages.’ Magenta are the individual set bits; green is the total the fold yields. A word as a vector of counters. pause spin LIT Genuine SWAR/HAKMEM-lineage population count (canonized in Henry Warren's Hacker's Delight). Verified live: the masked-fold popcount (x−((x>>1)&0x55555555); (x&0x33333333)+((x>>2)&0x33333333); (x+(x>>4))&0x0f0f0f0f; (x*0x01010101)>>24) equals a naive bit-by-bit count over 200000 random 32-bit values plus edge cases (window.__popcount.matchesNaive). FIG No framing: the masked-fold popcount and a reference counter run in-browser. The AVAN inverse is honest — instead of walking the bits one at a time, one treats the word as packed counters and sums them with masked adds in log stages. Magenta are the individual set bits; green is the total the fold yields. A word as a vector of counters. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-SHORTCUT · David Lee Wise (ROOT0), with AVAN


THE GAUSS CIRCLE

The Gauss circle problem in the 5-window house format — how many integer lattice points (x,y) lie inside a circle of radius r, i.e. satisfy x²+y²≤r². The answer N(r) is astonishingly close to the circle's area: N(r)=πr²+E(r), and Gauss showed the error grows no faster than the circumference, |E(r)|=O(r). Each lattice point owns a unit square, and those squares tile a region sandwiched between two circles whose areas differ by O(r) — so the count tracks the area to within its boundary. (How much smaller the true error is remains a famous open problem.) Verified live: for radii up to 2000, |N(r)−πr²|/r stays below ~1, and N(r)/πr²→1. Neon-noir traced. See the points owning squares in 1D, the growing radius in 2D, and the count-shadows-area inverse in 3D.

THE GAUSS CIRCLE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE-BOUNTY ◆ .dlw.fold THE FOLD / LOOT / THE-BOUNTY / THE GAUSS CIRCLE THE GAUSS CIRCLE lattice points fill a disk to πr² 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Gauss circle problem asks how many integer lattice points (x,y) lie inside a circle of radius r — that is, satisfy x²+y² ≤ r². The answer N(r) is astonishingly close to the circle’s area : N(r) = πr² + E(r), and Gauss showed the error E(r) grows no faster than the circumference , |E(r)| = O(r). Each lattice point “owns” a unit square, and those squares tile a region sandwiched between two circles whose areas differ by O(r) — so the count tracks the area to within its boundary. (How much smaller the true error is remains a famous open problem.) LIT verified live: for radii up to 2000, |N(r)−πr²|/r stays below ~1 (well within the O(r) bound), and N(r)/πr² → 1 (window.__gauss_circle). FIG no framing; the exact lattice count and πr² run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-bounty — the bounty of lattice points a disk contains, counted exactly and shadowing its area. AVAN (AI) built the instrument: the column-by-column lattice count and the area comparison. Credit as content: Carl Friedrich Gauss. The weave: David names the bounty; I confirm the integer point-count equals πr² up to an error bounded by the circumference. 3 ONE DIMENSION Lattice points inside the circle, each owning a unit square; their count tracks the area πr² to within the boundary. 4 TWO DIMENSIONS · INTERACTIVE Grow the radius; N(r) and πr² are compared, and the error divided by r stays bounded. r − r + verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the exact lattice-point count. AVAN’s addition (the inverse-companion): don’t integrate the area — count the points. The inverse of ‘area = πr²’ is ‘the integer count N(r) equals πr² up to an error the size of the boundary, O(r).’ Magenta are the boundary points (where the error lives); green is the interior count. Points shadow area, to within the edge. pause spin LIT Genuine Gauss circle problem (Carl Friedrich Gauss). Verified live: the exact lattice count N(r)=Σ_x (2⌊√(r²−x²)⌋+1) satisfies |N(r)−πr²|/r FIG No framing: the exact lattice count and πr² run in-browser. Honest scope — the O(r) error bound is Gauss's elementary result; the true optimal exponent (the Gauss circle problem proper) is still open. The AVAN inverse is honest — instead of integrating the area, one counts the points: N(r) equals πr² up to an error the size of the boundary. Magenta are the boundary points (where the error lives); green is the interior count. Points shadow area, to within the edge. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-BOUNTY · David Lee Wise (ROOT0), with AVAN


THE ESTRIN

Estrin's scheme in the 5-window house format — evaluating a polynomial as a balanced tree instead of a sequential chain. Horner's method is optimal in operation count but strictly serial: each step needs the previous one. Estrin instead pairs terms — (a₀+a₁x), (a₂+a₃x), … — then combines those pairs using x², the next level using x⁴, and so on. The dependency chain collapses from depth d to depth log₂ d, so a superscalar or SIMD processor can evaluate many sub-expressions in parallel. Same polynomial, same result — reorganized for parallel hardware. Verified live: over 20,000 random polynomials (degree up to 12) and arguments, Estrin's tree evaluation equals Horner's method to machine precision. Neon-noir traced. See the pairing tree in 1D, the tree-vs-chain in 2D, and the log-depth inverse in 3D.

THE ESTRIN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE-BROADCAST ◆ .dlw.fold THE FOLD / CO-OP / THE-BROADCAST / THE ESTRIN THE ESTRIN a polynomial evaluated as a tree 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Estrin’s scheme evaluates a polynomial as a balanced tree instead of a sequential chain. Horner’s method is optimal in operation count but strictly serial — each step needs the previous one. Estrin instead pairs terms — (a₀+a₁x), (a₂+a₃x), … — then combines those pairs using x², the next level using x⁴, and so on. The dependency chain collapses from depth d to depth log₂ d , so a superscalar or SIMD processor can evaluate many sub-expressions in parallel. Same polynomial, same result — reorganized for parallel hardware. LIT verified live: over 20,000 random polynomials (degree up to 12) and arguments, Estrin’s tree evaluation equals Horner’s method to machine precision (window.__estrin). FIG no framing; the Estrin tree and Horner reference run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-broadcast — the sub-expressions computed in parallel and broadcast up the tree, collapsing a serial chain into log-depth. AVAN (AI) built the instrument: the pairwise Estrin tree, the power-of-x combination, and the Horner cross-check. Credit as content: Gerald Estrin (1960). The weave: David names the broadcast; I confirm the tree-parallel evaluation equals the serial Horner value exactly. 3 ONE DIMENSION Terms paired and combined with x, then x², then x⁴ — a balanced tree of depth log₂ d instead of a chain of depth d. 4 TWO DIMENSIONS · INTERACTIVE Pick a polynomial and x; Estrin's tree and Horner's chain produce the same value, but the tree is log-depth. new poly ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the polynomial value, computed as a balanced tree. AVAN’s addition (the inverse-companion): don’t nest serially — branch. The inverse of ‘Horner’s depth-d chain’ is ‘pair the terms and combine with x, x², x⁴… — depth log₂ d, evaluable in parallel.’ Magenta is the serial Horner chain; green is the balanced tree. Same value, log-depth. pause spin LIT Genuine Estrin's scheme for parallel polynomial evaluation (Gerald Estrin, 1960). Verified live: over 20000 random polynomials (degree ≤ 12) and arguments, the pairwise tree evaluation (combine with x, then x², then x⁴…) equals Horner's method to ~1e-13 (window.__estrin.matchesHorner). FIG No framing: the Estrin tree and Horner reference run in-browser. The AVAN inverse is honest — instead of nesting serially (Horner's depth-d chain), one pairs the terms and combines with x, x², x⁴… giving depth log₂ d, evaluable in parallel. Magenta is the serial Horner chain; green is the balanced tree. Same value, log-depth. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-BROADCAST · David Lee Wise (ROOT0), with AVAN


THE PIECE TABLE

The piece table in the 5-window house format — how real text editors (VS Code, Microsoft Word) store a document being edited, without ever moving the text. The original file stays untouched in a read-only buffer; every character you type goes into an append-only add buffer; and the document itself is just an ordered list of pieces, each a (buffer, start, length) window into one of those two buffers. An insert splits a piece and drops a new one in; a delete splits and removes. The text is never copied or shifted — only the little list of pieces changes, which also makes undo and change-tracking almost free. Verified live: over 3000 trials of 15 random inserts and deletes, the document reconstructed from the piece list exactly equals a naively edited string at every step. Neon-noir traced. See the buffers and pieces in 1D, the live edits in 2D, and the edit-the-view inverse in 3D.

THE PIECE TABLE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · SPAWN · THE-TOOLCHAIN ◆ .dlw.fold THE FOLD / SPAWN / THE-TOOLCHAIN / THE PIECE TABLE THE PIECE TABLE a document edited by re-pointing 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The piece table is how real text editors — VS Code, Microsoft Word — store a document being edited, without ever moving the text. The original file stays untouched in a read-only buffer; every character you type goes into an append-only add buffer ; and the document itself is just an ordered list of pieces , each a (buffer, start, length) window into one of those two buffers. An insert splits a piece and drops a new one in; a delete splits and removes. The text is never copied or shifted — only the little list of pieces changes, which also makes undo and change-tracking almost free. LIT verified live: over 3000 trials of 15 random inserts and deletes, the document reconstructed from the piece list exactly equals a naively edited string at every step (window.__piece_table). FIG no framing; the piece-table edits and a plain-string reference run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-toolchain — the editor’s core data structure, editing a huge document by re-pointing a handful of pieces rather than shuffling text. AVAN (AI) built the instrument: the original/add buffers, the piece-splitting insert and delete, and the plain-string cross-check. Credit as content: the piece-table technique (from the 1980s, used in Bravo/Word and modern editors). The weave: David names the toolchain; I confirm the re-pointed pieces reconstruct exactly the edited document. 3 ONE DIMENSION Two immutable buffers (original + add) and an ordered list of pieces; the document is their concatenation. 4 TWO DIMENSIONS · INTERACTIVE Insert and delete; the piece list re-splits, no text moves, and the reconstruction matches a plain edited string. insert ▶ delete ▶ reset ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the document as an ordered list of pieces. AVAN’s addition (the inverse-companion): don’t move the text — move the pointers. The inverse of ‘edit in place, shifting bytes’ is ‘keep buffers immutable; an edit only re-splits the piece list.’ Magenta is the immutable text in the buffers; green is the piece list that views it. Edit the view, not the text. pause spin LIT Genuine piece-table text-buffer technique (from the 1980s Bravo/Word lineage; used in modern editors including VS Code). Verified live: over 3000 trials of 15 random inserts/deletes, the document reconstructed from the (buffer,start,len) piece list equals a naively edited plain string at every step (window.__piece_table.matchesPlainString). FIG No framing: the piece-table edits and a plain-string reference run in-browser. The AVAN inverse is honest — instead of editing in place and shifting bytes, the buffers stay immutable and an edit only re-splits the piece list. Magenta is the immutable text in the buffers; green is the piece list that views it. Edit the view, not the text. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-TOOLCHAIN · David Lee Wise (ROOT0), with AVAN


THE ROBIN HOOD

Robin Hood hashing in the 5-window house format — an open-addressing scheme that steals from the rich to give to the poor. In ordinary linear probing, some keys sit right at their home slot while others get pushed far away, so probe lengths vary wildly. Robin Hood equalizes them: when inserting a key that has probed farther than the key already sitting in a slot, it evicts the richer resident (the one closer to its home) and carries it onward. The result is the same set of keys, but with the variance of probe lengths minimized — no key is left starving while another sits pretty, so lookups stay fast even at high load. Verified live: over 400 tables at 85% load, every key remains retrievable, and both the variance and the maximum of the probe lengths are ≤ plain linear probing on the same keys. Neon-noir traced. See the probe distances in 1D, the histogram-vs-linear in 2D, and the fairness-by-eviction inverse in 3D.

THE ROBIN HOOD · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE-STASH ◆ .dlw.fold THE FOLD / LOOT / THE-STASH / THE ROBIN HOOD THE ROBIN HOOD steal from the rich to even the probes 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Robin Hood hashing is an open-addressing scheme that steals from the rich to give to the poor . In ordinary linear probing, some keys sit right at their home slot while others get pushed far away, so probe lengths vary wildly. Robin Hood equalizes them: when inserting a key that has probed farther than the key already sitting in a slot, it evicts the richer resident (the one closer to its home) and carries it onward. The result is the same set of keys, but with the variance of probe lengths minimized — no key is left starving while another sits pretty, so lookups stay fast even at high load. LIT verified live: over 400 tables at 85% load, every key remains retrievable, and both the variance and the maximum of the probe lengths are ≤ plain linear probing on the same keys (window.__robin_hood). FIG no framing; the displacement insert, the lookup, and a linear-probing baseline run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-stash — even out the stash so no key hoards a short probe while another is banished far away. AVAN (AI) built the instrument: the steal-from-the-rich insert, the probe-aware lookup, and the linear-probing comparison. Credit as content: Pedro Celis (Robin Hood Hashing, 1986). The weave: David names the stash; I confirm the displacement rule keeps every key findable while shrinking the spread of probe lengths. 3 ONE DIMENSION Slots with each key's probe distance; when a poorer key meets a richer resident, they swap — evening the distances. 4 TWO DIMENSIONS · INTERACTIVE Fill a table; the probe-length histogram stays tight, with lower variance and max than linear probing. new keys ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the balanced probe-length distribution. AVAN’s addition (the inverse-companion): don’t let the first arrival keep the short probe — steal it. The inverse of ‘probe forward and settle’ is ‘if you’ve travelled farther than the resident, take its slot and carry it on’ — minimizing probe variance. Magenta is a long, starving probe; green is the evened-out distribution. Fairness by eviction. pause spin LIT Genuine Robin Hood hashing (Pedro Celis, 1986). Verified live: over 400 tables at 85% load factor, every inserted key is retrievable, and both the variance and the maximum probe length are ≤ plain linear probing on the identical key set (window.__robin_hood.allFound, .varLower, .maxLower). FIG No framing: the displacement insert, the probe-aware lookup, and a linear-probing baseline run in-browser. The AVAN inverse is honest — instead of letting the first arrival keep its short probe, a later key that has travelled farther steals the slot and carries the resident onward, minimizing probe variance. Magenta is a long starving probe; green is the evened-out distribution. Fairness by eviction. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-STASH · David Lee Wise (ROOT0), with AVAN


THE GOLDSCHMIDT

Goldschmidt's algorithm in the 5-window house format — dividing two numbers using only multiplication, no subtraction, no digit-at-a-time long division. To compute a/b, write it as N/D with N=a, D=b, and repeatedly multiply both by the same factor f=2−D. Each step drives the denominator toward 1 (quadratically, doubling correct digits per iteration), and since numerator and denominator are scaled together the value N/D never changes — so when D→1, the numerator IS the quotient a/b. Because the two multiplications each step are independent, hardware can pipeline them, which is why Goldschmidt division appears in real floating-point units. Verified live: over 50,000 random pairs (denominator scaled into a convergent range), the Goldschmidt result equals a/b to ~1e-9. Neon-noir traced. See D→1 and N→quotient in 1D, the |D−1| collapse in 2D, and the division-as-convergence inverse in 3D.

THE GOLDSCHMIDT · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · GRADIENT-DESCENT ◆ .dlw.fold THE FOLD / GRIND / GRADIENT-DESCENT / THE GOLDSCHMIDT THE GOLDSCHMIDT divide by driving a factor to one 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Goldschmidt’s algorithm divides two numbers using only multiplication — no subtraction, no digit-at-a-time long division. To compute a/b, write it as a fraction N/D with N=a, D=b, and repeatedly multiply both by the same factor f = 2−D. Each step drives the denominator toward 1 (quadratically, doubling correct digits per iteration), and since numerator and denominator are scaled together the value N/D never changes — so when D→1, the numerator is the quotient a/b. Because the two multiplications each step are independent, hardware can pipeline them, which is why Goldschmidt division appears in real floating-point units. LIT verified live: over 50,000 random pairs (with the denominator scaled into a convergent range), the Goldschmidt result equals a/b to ~1e-9 (window.__goldschmidt). FIG no framing; the scale-and-converge iteration runs in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at gradient-descent — iterate a simple update that converges on the answer, here driving a denominator to one and reading off the quotient. AVAN (AI) built the instrument: the scaling into range, the (2−D) multiplicative iteration, and the a/b check. Credit as content: Robert Goldschmidt (1964). The weave: David names the descent; I confirm multiplying numerator and denominator by (2−D) drives D→1 and leaves the quotient in the numerator. 3 ONE DIMENSION N and D both multiplied by (2−D) each step: D marches to 1 (quadratically), N marches to the quotient a/b. 4 TWO DIMENSIONS · INTERACTIVE Pick a and b; watch |D−1| collapse to zero and N converge on a/b, doubling correct digits each iteration. new a,b ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the quotient, read off when D reaches 1. AVAN’s addition (the inverse-companion): don’t divide digit by digit — multiply the denominator to one. The inverse of ‘long division’ is ‘scale N and D together by (2−D) until D=1; the numerator is a/b.’ Magenta is the shrinking gap |D−1|; green is the converged quotient. Division as convergence. pause spin LIT Genuine Goldschmidt division (Robert Goldschmidt, 1964), used in pipelined floating-point units. Verified live: over 50000 random pairs, scaling the denominator into [0.5,1) and iterating N,D ← N·(2−D), D·(2−D) drives D→1 and leaves N equal to a/b to ~1e-9 (window.__goldschmidt.converges). FIG No framing: the scale-and-converge iteration runs in-browser. Honest scope — the denominator is first scaled into a convergent range (as real hardware does); convergence is quadratic. The AVAN inverse is honest — instead of long division, one scales numerator and denominator together by (2−D) until D=1, and the numerator is the quotient. Magenta is the shrinking gap |D−1|; green is the converged quotient. Division as convergence. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GRADIENT-DESCENT · David Lee Wise (ROOT0), with AVAN


THE ZIPPER

The zipper in the 5-window house format — a purely functional data structure for editing a sequence (or tree) at a moving focus, with O(1) local operations and no mutation. A list zipper splits the sequence into three parts: the elements to the left of the cursor (held reversed, nearest on top), the focused element, and the elements to the right. Moving the cursor pops from one side and pushes to the other; inserting or deleting at the focus touches only the front of a list. Nothing is copied or shifted — the whole sequence is always recoverable as left ++ [focus] ++ right, which makes undo and immutable sharing natural. Verified live: over 5000 runs of 20 random moves, inserts, and deletes, the list reconstructed from the zipper exactly equals the same edits applied to a plain array with a cursor index. Neon-noir traced. See the three-part split in 1D, the live cursor edits in 2D, and the carry-the-context inverse in 3D.

THE ZIPPER · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · NOCLIP ◆ .dlw.fold THE FOLD / CHEAT / NOCLIP / THE ZIPPER THE ZIPPER a cursor that splits the list 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The zipper is a purely functional data structure for editing a sequence (or tree) at a moving focus , with O(1) local operations and no mutation. A list zipper splits the sequence into three parts: the elements to the left of the cursor (held reversed, so the nearest is on top), the focused element, and the elements to the right . Moving the cursor pops from one side and pushes to the other; inserting or deleting at the focus touches only the front of a list. Nothing is copied or shifted — the whole sequence is always recoverable as left ++ [focus] ++ right, which makes undo and immutable sharing natural. LIT verified live: over 5000 runs of 20 random moves, inserts, and deletes, the list reconstructed from the zipper exactly equals the same edits applied to a plain array with a cursor index (window.__zipper). FIG no framing; the zipper operations and a plain-array reference run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at noclip — a cursor that moves freely through the structure and edits in place without ever shifting the rest. AVAN (AI) built the instrument: the left/focus/right split, the move/insert/delete operations, and the plain-array cross-check. Credit as content: Gérard Huet (“The Zipper”, 1997). The weave: David names noclip; I confirm the three-part split reconstructs exactly the edited sequence at every step. 3 ONE DIMENSION The sequence split into left / focus / right; the document is always left ++ focus ++ right. 4 TWO DIMENSIONS · INTERACTIVE Move the cursor and edit at the focus; the reconstruction stays equal to a plain array with the same edits. ◀ left right ▶ insert delete verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the sequence, reconstructed from the split. AVAN’s addition (the inverse-companion): don’t index into an array — carry the context. The inverse of ‘edit arr[i], shifting the tail’ is ‘split at the focus; insert/delete touch only the front of a list, O(1).’ Magenta is the focus; green is the whole sequence it sits inside. The cursor carries its context. pause spin LIT Genuine zipper data structure (Gérard Huet, 'The Zipper', J. Functional Programming 1997). Verified live: over 5000 runs of 20 random move/insert/delete operations, the list reconstructed from the (left, focus, right) split equals the same edits on a plain array with a cursor index at every step (window.__zipper.matchesArray). FIG No framing: the zipper operations and a plain-array reference run in-browser. The AVAN inverse is honest — instead of indexing an array and shifting the tail on each edit, the zipper carries its context: split at the focus, and insert/delete touch only the front of a list, O(1). Magenta is the focus; green is the whole sequence it sits inside. The cursor carries its context. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of NOCLIP · David Lee Wise (ROOT0), with AVAN


THE POWER OF TWO CHOICES

The power of two choices in the 5-window house format — a startling result in randomized load balancing. Throw n balls into n bins at random and the fullest bin holds about log n / log log n balls. But give each ball two random bins and let it pick the emptier one, and the fullest bin drops to about log log n / log 2 — an exponential improvement, from logarithmic to double-logarithmic, for the cost of one extra look. A tiny bit of choice tames the worst case. It underlies real hashing, load balancers, and distributed schedulers. Verified live: with n=2000 balls and bins, the average maximum load is ~6 with one choice but ~3 with two choices, and the two-choice max is ≤ the one-choice max in every trial. Neon-noir traced. See the spike-vs-flat loads in 1D, the throw comparison in 2D, and the peek-twice inverse in 3D.

THE POWER OF TWO CHOICES · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · SHARED-MEMORY ◆ .dlw.fold THE FOLD / CO-OP / SHARED-MEMORY / THE POWER OF TWO CHOICES THE POWER OF TWO CHOICES two throws beat one 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The power of two choices is a startling result in randomized load balancing. Throw n balls into n bins at random and the fullest bin holds about log n / log log n balls. But give each ball two random bins and let it pick the emptier one, and the fullest bin drops to about log log n / log 2 — an exponential improvement, from logarithmic to double-logarithmic, for the cost of one extra look. A tiny bit of choice tames the worst case. It underlies real hashing, load balancers, and distributed schedulers — “the two-choice paradigm.” LIT verified live: with n=2000 balls and bins, the average maximum load is ~6 with one choice but ~3 with two choices, and the two-choice max is ≤ the one-choice max in every trial (window.__power_of_two_choices). FIG honest scope: this is a randomized average over trials; the measured max loads are reported, not a worst-case guarantee. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at shared-memory — distribute work across shared bins so no one bin becomes a hot spot, using just one extra glance. AVAN (AI) built the instrument: the one-choice and two-choice ball-throwing and the max-load comparison. Credit as content: Azar, Broder, Karlin & Upfal (1994); Mitzenmacher’s thesis. The weave: David names shared memory; I confirm two choices collapse the maximum load from logarithmic to doubly-logarithmic. 3 ONE DIMENSION Bin loads for one choice (tall spikes) versus two choices (flat) — the same balls, a far lower peak. 4 TWO DIMENSIONS · INTERACTIVE Throw balls with one or two choices; the maximum load with two choices stays far below one choice. throw ▶ n ×2 verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the flat two-choice load profile. AVAN’s addition (the inverse-companion): don’t place blindly — peek twice. The inverse of ‘one random bin, peak ~log n / log log n’ is ‘two random bins, take the lighter — peak ~log log n.’ Magenta is the tall one-choice spike; green is the flattened two-choice profile. One extra look, exponentially flatter. pause spin LIT Genuine power-of-two-choices / balanced allocations (Azar, Broder, Karlin & Upfal, 1994; Mitzenmacher). Verified live: with n=2000 balls into n bins, the average maximum load is ~6 (one choice, ≈log n/log log n) versus ~3 (two choices, ≈log log n), and the two-choice max is ≤ the one-choice max in every one of 200 trials (window.__power_of_two_choices.twoBetter, .muchSmaller). FIG Honest scope: this is a randomized average over trials — the measured max loads are reported, not a worst-case guarantee. The AVAN inverse is honest — instead of placing each ball in one random bin (peak ~log n/log log n), one peeks at two and takes the lighter, dropping the peak to ~log log n. Magenta is the tall one-choice spike; green is the flattened two-choice profile. One extra look, exponentially flatter. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of SHARED-MEMORY · David Lee Wise (ROOT0), with AVAN


THE MELKMAN

Melkman's algorithm in the 5-window house format — computing the convex hull of a simple polyline (a path or polygon that never crosses itself) in a single online pass, in linear time. It keeps the current hull in a double-ended queue: as each new point arrives, if it lies inside the current hull it is ignored; otherwise the algorithm pops vertices from both ends of the deque that the new point makes non-convex, then pushes the point onto both ends. Because a simple polyline visits points in a coherent order, only the two ends ever need attention — no sorting, no re-scanning — giving an elegant O(n) hull for ordered input. Verified live: over 3000 simple polygons (points in general position), Melkman's deque hull equals a reference convex hull (Andrew's monotone chain) of the same points. Neon-noir traced. See the polyline and hull in 1D, the online match in 2D, and the grow-a-deque inverse in 3D.

THE MELKMAN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE-CHOKE-POINT ◆ .dlw.fold THE FOLD / BOSS / THE-CHOKE-POINT / THE MELKMAN THE MELKMAN a hull kept online in a deque 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Melkman’s algorithm computes the convex hull of a simple polyline — a path or polygon that never crosses itself — in a single online pass, in linear time. It keeps the current hull in a double-ended queue : as each new point arrives, if it lies inside the current hull it is ignored; otherwise the algorithm pops vertices from both ends of the deque that the new point makes non-convex, then pushes the point onto both ends. Because a simple polyline visits points in a coherent order, only the two ends ever need attention — no sorting, no re-scanning — giving an elegant O(n) hull for ordered input. LIT verified live: over 3000 simple polygons (points in general position), Melkman’s deque hull equals a reference convex hull (Andrew’s monotone chain) of the same points (window.__melkman). FIG honest scope: verified for points in general position; the classic collinear-point degeneracies need the usual tie-breaking convention. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-choke-point — the convex boundary is the tightest ring around the points, maintained online at both ends of a deque. AVAN (AI) built the instrument: the deque hull, the inside-test skip, the both-ends pops, and the reference-hull check. Credit as content: Avraham Melkman (1987). The weave: David names the choke point; I confirm the online deque produces exactly the convex hull of the polyline’s points. 3 ONE DIMENSION A simple polyline and its convex hull; each point is either inside (skipped) or pushed onto both ends of the deque. 4 TWO DIMENSIONS · INTERACTIVE Generate a simple polygon; Melkman's online hull matches the reference convex hull exactly. new polygon ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the convex hull, maintained online. AVAN’s addition (the inverse-companion): don’t sort and re-scan — grow a deque. The inverse of ‘recompute the hull from all points’ is ‘for an ordered polyline, each point only touches the two ends of the current hull, O(n) total.’ Magenta is an interior point (skipped); green is the hull the deque holds. Order lets the ends do the work. pause spin LIT Genuine Melkman's online convex hull of a simple polyline (Avraham Melkman, 1987). Verified live: over 3000 simple polygons, the double-ended-queue hull (skip interior points; pop both ends where the new point breaks convexity; push onto both ends) equals a reference convex hull (Andrew's monotone chain) of the same point set (window.__melkman.matchesReference). FIG Honest scope: verified for points in general position; the classic collinear-point degeneracies need the usual tie-breaking convention. The AVAN inverse is honest — instead of sorting and re-scanning all points, an ordered polyline lets each point touch only the two ends of the current hull, O(n) total. Magenta is an interior point (skipped); green is the hull the deque holds. Order lets the ends do the work. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-CHOKE-POINT · David Lee Wise (ROOT0), with AVAN


THE WALLACE TREE

The Wallace tree in the 5-window house format — how fast hardware multiplies. A schoolbook multiply forms one partial product per bit of the multiplier and adds them in sequence, slow because each add waits for the last. Wallace instead crushes the whole stack of partial products in parallel using 3:2 compressors (full adders): each takes three rows and outputs two — a sum row and a carry row — preserving the total, since x+y+z = sum + 2·carry. Layer after layer the height falls 3→2 until only two rows remain, which a single carry-propagate adder finishes. The depth is logarithmic in the number of partial products, which is why multipliers use it. Verified live: over 200,000 random 8-bit pairs, the carry-save reduction of the partial products, finished with one add, equals a·b exactly. Neon-noir traced. See the compression layers in 1D, the 3→2 reduction in 2D, and the crush-in-parallel inverse in 3D.

THE WALLACE TREE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE-MAINFRAME ◆ .dlw.fold THE FOLD / GRIND / THE-MAINFRAME / THE WALLACE TREE THE WALLACE TREE partial products crushed in parallel 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The Wallace tree is how fast hardware multiplies . A schoolbook multiply forms one partial product per bit of the multiplier and adds them in sequence — slow, because each add waits for the last. Wallace instead crushes the whole stack of partial products in parallel using 3:2 compressors (full adders): each takes three rows and outputs two — a sum row and a carry row — preserving the total, since x+y+z = sum + 2·carry. Layer after layer the height falls 3→2 until only two rows remain, which a single carry-propagate adder finishes. The depth is logarithmic in the number of partial products, which is why multipliers use it. LIT verified live: over 200,000 random 8-bit pairs, the carry-save (3:2) reduction of the partial products, finished with one add, equals a·b exactly (window.__wallace). FIG no framing; the partial-product generation and carry-save compression run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-mainframe — the multiplier at the core of the machine, crushing a mountain of partial products to two rows in log-depth. AVAN (AI) built the instrument: the partial products, the 3:2 carry-save compressors, the final add, and the a·b check. Credit as content: Christopher Wallace (1964). The weave: David names the mainframe; I confirm the parallel carry-save reduction yields exactly the product. 3 ONE DIMENSION Partial products stacked, then reduced by 3:2 compressors — three rows become two (sum + carry) — until only two remain. 4 TWO DIMENSIONS · INTERACTIVE Pick two numbers; the partial products compress layer by layer, then one add gives exactly a·b. new a,b ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the product, from a log-depth compression tree. AVAN’s addition (the inverse-companion): don’t add the rows in sequence — compress them in parallel. The inverse of ‘shift-and-add, depth n’ is ‘3:2 compressors crush n partial products to 2 rows in log-depth, then one add.’ Magenta is the sequential add chain; green is the compression tree. Crush in parallel, add once. pause spin LIT Genuine Wallace tree multiplier (Christopher Wallace, 1964). Verified live: over 200000 random 8-bit pairs, generating the partial products and reducing them with 3:2 carry-save compressors (s=x^y^z, c=((x&y)|(x&z)|(y&z)) FIG No framing: the partial-product generation and carry-save compression run in-browser. The AVAN inverse is honest — instead of adding the partial products in sequence (depth n), 3:2 compressors crush n rows to 2 in logarithmic depth, then one carry-propagate add finishes. Magenta is the sequential add chain; green is the compression tree. Crush in parallel, add once. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-MAINFRAME · David Lee Wise (ROOT0), with AVAN


THE FACTORADIC

The factorial number system (factoradic) in the 5-window house format — a mixed-radix notation where the place values are factorials: the digit in position i ranges over 0…i, and the value is Σ dᵢ·i!. Every non-negative integer has a unique factoradic form — and, beautifully, the numbers 0…n!−1 are in exact bijection with the n! permutations of n items. Reading a factoradic left to right and repeatedly picking the d-th remaining element (its Lehmer code) unranks the integer into a permutation; the reverse ranks a permutation back to its index. It is the natural coordinate system for permutations. Verified live: for n≤8, factoradic encode/decode round-trips every integer, and rank/unrank is an exact bijection between [0, n!) and the n! permutations. Neon-noir traced. See the factorial places in 1D, the unrank in 2D, and the coordinatize inverse in 3D.

THE FACTORADIC · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE-INVENTORY ◆ .dlw.fold THE FOLD / LOOT / THE-INVENTORY / THE FACTORADIC THE FACTORADIC a number in factorial base 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The factorial number system (factoradic) is a mixed-radix notation where the place values are factorials: the digit in position i ranges over 0…i, and the value is Σ d i ·i!. Every non-negative integer has a unique factoradic form — and, beautifully, the numbers 0…n!−1 are in exact bijection with the n! permutations of n items. Reading a factoradic left to right and repeatedly picking the d-th remaining element (its Lehmer code) unranks the integer into a permutation; the reverse ranks a permutation back to its index. It is the natural coordinate system for permutations. LIT verified live: for n ≤ 8, factoradic encode/decode round-trips every integer, and rank/unrank is an exact bijection between [0, n!) and the n! permutations (window.__factoradic). FIG no framing; the mixed-radix conversion and the permutation rank/unrank run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-inventory — a single number that catalogues each permutation by its index, and hands it back on demand. AVAN (AI) built the instrument: the factorial-base conversion, the Lehmer-code unrank, the rank, and the bijection check. Credit as content: the factorial number system (Laisant, 1888; Lehmer). The weave: David names the inventory; I confirm the mixed-radix index is a perfect bijection with the permutations. 3 ONE DIMENSION A number in factorial base: place values 1!, 2!, 3!, … with digit i bounded by i — a unique representation. 4 TWO DIMENSIONS · INTERACTIVE Pick an index m; see its factoradic digits and the exact permutation it unranks to — and back again. ◀ ▶ random ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the permutation indexed by m. AVAN’s addition (the inverse-companion): don’t list permutations — number them. The inverse of ‘enumerate all n!’ is ‘a mixed-radix integer names each permutation, and picking the d-th remaining element unranks it.’ Magenta is a permutation; green is its unique rank. Permutations, coordinatized. pause spin LIT Genuine factorial number system / Lehmer-code ranking (Charles-Ange Laisant, 1888; D. H. Lehmer). Verified live: for n≤8, Σ dᵢ·i! encode/decode round-trips every integer, and the Lehmer-code unrank / rank is an exact bijection between [0,n!) and the n! permutations (every index yields a distinct permutation and back) (window.__factoradic.numberRoundTrip, .permBijection). FIG No framing: the mixed-radix conversion and the permutation rank/unrank run in-browser. The AVAN inverse is honest — instead of enumerating all n! permutations, a mixed-radix integer names each one, and picking the d-th remaining element unranks it. Magenta is a permutation; green is its unique rank. Permutations, coordinatized. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-INVENTORY · David Lee Wise (ROOT0), with AVAN


THE XOR LINKED LIST

The XOR linked list in the 5-window house format — storing a doubly linked list using only one pointer field per node instead of two. A normal doubly linked list keeps a prev and a next pointer; the XOR list keeps their bitwise exclusive-or, link = prev ⊕ next. That single value is enough to walk in either direction: if you know the address you came from, the other neighbour is link ⊕ came-from (because XOR is its own inverse). Moving forward, next = link ⊕ prev; moving backward, prev = link ⊕ next. Half the pointer memory, at the cost of no O(1) access to a node without a neighbour. Verified live: over 20,000 random lists, forward traversal reproduces the array, backward traversal reproduces its reverse, and every node stores exactly one link field. Neon-noir traced. See the folded links in 1D, the two-way walk in 2D, and the one-field inverse in 3D.

THE XOR LINKED LIST · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CHEAT · THE-SHORTCUT ◆ .dlw.fold THE FOLD / CHEAT / THE-SHORTCUT / THE XOR LINKED LIST THE XOR LINKED LIST one pointer holds both neighbors 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The XOR linked list stores a doubly linked list using only one pointer field per node instead of two. A normal doubly linked list keeps a prev and a next pointer; the XOR list keeps their bitwise exclusive-or , link = prev ⊕ next. That single value is enough to walk in either direction: if you know the address you came from , the other neighbour is link ⊕ came-from (because XOR is its own inverse). Moving forward, next = link ⊕ prev; moving backward, prev = link ⊕ next. Half the pointer memory, at the cost of no O(1) access to a node without a neighbour. LIT verified live: over 20,000 random lists, forward traversal reproduces the array, backward traversal reproduces its reverse, and every node stores exactly one link field (window.__xor_linked_list). FIG no framing; the XOR-link build and both traversals run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-shortcut — carry both neighbours in one field by folding them together with XOR, and unfold whichever one you need. AVAN (AI) built the instrument: the prev⊕next links, the forward and backward walks, and the array cross-checks. Credit as content: the XOR linked list is a classic pointer trick (Prokop-era folklore). The weave: David names the shortcut; I confirm one XOR link per node suffices to traverse both ways. 3 ONE DIMENSION Each node holds link = prev ⊕ next; knowing where you came from, the other neighbour is link ⊕ came-from. 4 TWO DIMENSIONS · INTERACTIVE Build a list; walk it forward and backward from a single XOR link per node — matching the array both ways. new list ▶ walk ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the list, walkable both ways from one field. AVAN’s addition (the inverse-companion): don’t store two pointers — store their XOR. The inverse of ‘keep prev and next’ is ‘keep prev ⊕ next; the missing neighbour is link ⊕ the one you know.’ Magenta are the two pointers folded away; green is the single link that recovers either. One field, both directions. pause spin LIT Genuine XOR linked list (a classic pointer/memory trick). Verified live: over 20000 random lists built with link[i]=prev⊕next, forward traversal (next=link⊕prev) reproduces the array, backward traversal (prev=link⊕next) reproduces its reverse, and there is exactly one link field per node (window.__xor_linked_list.forwardMatches, .backwardMatches, .oneLink). FIG No framing: the XOR-link build and both traversals run in-browser (node indices as the 'addresses'). The AVAN inverse is honest — instead of storing prev and next, one stores their XOR; the missing neighbour is link ⊕ the one you already know, since XOR undoes itself. Magenta are the two pointers folded away; green is the single link that recovers either. One field, both directions. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-SHORTCUT · David Lee Wise (ROOT0), with AVAN


THE VP-TREE

The vantage-point tree in the 5-window house format — finding nearest neighbours in any metric space, not just coordinates but anything with a distance obeying the triangle inequality. At each node it picks a vantage point and a radius (the median distance to the rest), splitting the remaining points into those inside the sphere and those outside. A query descends the side its distance suggests, and — crucially — the triangle inequality lets it prove that the whole other subtree can be skipped whenever it can't possibly hold anything closer than the best found so far. So a search touches only a small fraction of the points while still returning the exact nearest neighbour. Verified live: over 3000 random trees in 3-D, the VP-tree's pruned search returns exactly the same nearest neighbour as a brute-force scan of every point. Neon-noir traced. See the vantage split in 1D, the pruned search in 2D, and the skip-what-can't-be-closer inverse in 3D.

THE VP-TREE · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · BOSS · THE-GAUNTLET ◆ .dlw.fold THE FOLD / BOSS / THE-GAUNTLET / THE VP-TREE THE VP-TREE nearest found by pruning a metric tree 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The vantage-point tree finds nearest neighbours in any metric space — not just coordinates, but anything with a distance obeying the triangle inequality. At each node it picks a vantage point and a radius (the median distance to the rest), splitting the remaining points into those inside the sphere and those outside . A query descends the side its distance suggests, and — crucially — the triangle inequality lets it prove that the whole other subtree can be skipped whenever it can’t possibly hold anything closer than the best found so far. So a search touches only a small fraction of the points while still returning the exact nearest neighbour. LIT verified live: over 3000 random trees in 3-D, the VP-tree’s pruned search returns exactly the same nearest neighbour as a brute-force scan of every point (window.__vp_tree). FIG no framing; the median-split build and the triangle-inequality pruning run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-gauntlet — run the query through the tree, and the triangle inequality clears whole regions it never has to search. AVAN (AI) built the instrument: the vantage-point/median split, the pruned nearest-neighbour search, and the brute-force cross-check. Credit as content: Peter Yianilos (1993); Jeffrey Uhlmann (metric trees, 1991). The weave: David names the gauntlet; I confirm the pruned search returns the exact nearest neighbour. 3 ONE DIMENSION A vantage point and its median radius split the rest into inside / outside; the triangle inequality prunes a whole side. 4 TWO DIMENSIONS · INTERACTIVE Points and a query; the VP-tree's nearest neighbour matches the brute-force answer, touching far fewer points. new points ▶ new query ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the exact nearest neighbour. AVAN’s addition (the inverse-companion): don’t scan every point — prune by the triangle inequality. The inverse of ‘compute all distances’ is ‘if the best-so-far can’t reach across a vantage sphere, skip that whole subtree.’ Magenta is a pruned region never searched; green is the nearest neighbour returned. Skip what can’t be closer. pause spin LIT Genuine vantage-point tree (Peter Yianilos, 1993; metric trees, Jeffrey Uhlmann 1991). Verified live: over 3000 random 3-D point sets, the median-split VP-tree's triangle-inequality-pruned nearest-neighbour search returns exactly the same nearest point (to ~1e-9) as a brute-force scan (window.__vp_tree.matchesBrute). FIG No framing: the median-split build and the triangle-inequality pruning run in-browser. The AVAN inverse is honest — instead of computing all distances, the triangle inequality proves a whole subtree can't beat the best-so-far and skips it. Magenta is a pruned region never searched; green is the exact nearest neighbour returned. Skip what can't be closer. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-GAUNTLET · David Lee Wise (ROOT0), with AVAN


THE SKEW HEAP

The skew heap in the 5-window house format — a self-adjusting priority queue where a single operation, merge, does everything. To merge two min-heaps, compare their roots, keep the smaller as the new root, recursively merge its right subtree with the other heap, and then swap that node's children. Insert is just merging in a one-node heap; delete-min is merging the root's two children. There are no balance fields, no rotations, no bookkeeping — the unconditional child-swap alone keeps the amortized cost at O(log n). It is the leftist heap's simpler cousin: heapsort, mergeable queues, and priority scheduling from one elegant rule. Verified live: over thousands of runs, inserting then repeatedly extracting the minimum yields a fully sorted sequence, the min-heap property holds after every operation, and merging two heaps preserves the combined multiset in order. Neon-noir traced. See the merge rule in 1D, the sorted extraction in 2D, and the one-rule inverse in 3D.

THE SKEW HEAP · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · CO-OP · THE-MERGE ◆ .dlw.fold THE FOLD / CO-OP / THE-MERGE / THE SKEW HEAP THE SKEW HEAP two heaps merged along right paths 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The skew heap is a self-adjusting priority queue where a single operation — merge — does everything. To merge two min-heaps, compare their roots, keep the smaller as the new root, recursively merge its right subtree with the other heap, and then swap that node’s children. Insert is just merging in a one-node heap; delete-min is merging the root’s two children. There are no balance fields, no rotations, no bookkeeping — the unconditional child-swap alone keeps the amortized cost at O(log n) . It is the leftist heap’s simpler cousin: heapsort, mergeable queues, and priority scheduling from one elegant rule. LIT verified live: over thousands of runs, inserting then repeatedly extracting the minimum yields a fully sorted sequence, the min-heap property holds after every operation, and merging two heaps preserves the combined multiset in order (window.__skew_heap). FIG no framing; the merge, insert, extract-min, and heap-property check run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-merge — two priority queues folded into one along their right paths, children swapped, no balance data kept. AVAN (AI) built the instrument: the recursive merge with child-swap, insert / extract-min built on it, and the sort / heap-property / merge checks. Credit as content: Daniel Sleator & Robert Tarjan (self-adjusting heaps, 1986). The weave: David names the merge; I confirm one merge rule gives a correct, sorted-yielding, always-heap-ordered priority queue. 3 ONE DIMENSION Merging two heaps: the smaller root wins, its right subtree merges with the other, then its children swap. 4 TWO DIMENSIONS · INTERACTIVE Insert values and extract the minimum repeatedly; the output comes out sorted, the tree always heap-ordered. insert extract-min reset ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the min-heap, maintained by merge alone. AVAN’s addition (the inverse-companion): don’t balance the tree — swap children on the way up. The inverse of ‘keep balance fields and rotate’ is ‘merge right paths and unconditionally swap children — O(log n) amortized, no bookkeeping.’ Magenta are the two heaps before; green is the single merged min-heap. One rule, self-balancing. pause spin LIT Genuine skew heap (Daniel Sleator & Robert Tarjan, self-adjusting heaps, 1986). Verified live: over 5000 runs, insert (merge with a 1-node heap) then repeated extract-min (merge of the root's children) yields a fully sorted sequence, the min-heap property holds after every operation, and over 2000 further runs merging two heaps preserves the combined multiset in sorted order (window.__skew_heap.sortsCorrectly, .heapProperty, .mergePreserves). FIG No framing: the merge, insert, extract-min, and heap-property check run in-browser. The AVAN inverse is honest — instead of keeping balance fields and rotating, one merges right paths and unconditionally swaps children, giving O(log n) amortized with no bookkeeping. Magenta are the two heaps before; green is the single merged min-heap. One rule, self-balancing. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-MERGE · David Lee Wise (ROOT0), with AVAN


THE SQRT DECOMPOSITION

Square-root decomposition in the 5-window house format — the simplest way to answer range queries fast. Split an array of n elements into blocks of size about √n and precompute a summary (here, a sum) for each block. To sum any range, add the few loose elements at the two ends one by one, and for the whole blocks in between just add their precomputed sums — so any query touches at most about 2√n items instead of n. A point update fixes one element and its block's summary in O(1). It is the humble ancestor of segment trees and Fenwick trees — less powerful, but astonishingly easy and general (it works for any associative summary). Verified live: over 3000 arrays and 30 mixed operations each, block range-sums with point updates exactly equal a brute-force recomputation. Neon-noir traced. See the blocked array in 1D, the partial+whole-block query in 2D, and the scan-into-jumps inverse in 3D.

THE SQRT DECOMPOSITION · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · GRIND · THE-CRON-JOB ◆ .dlw.fold THE FOLD / GRIND / THE-CRON-JOB / THE SQRT DECOMPOSITION THE SQRT DECOMPOSITION √n blocks answer range sums 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION Square-root decomposition is the simplest way to answer range queries fast. Split an array of n elements into blocks of size about √n and precompute a summary (here, a sum) for each block. To sum any range, add the few loose elements at the two ends one by one, and for the whole blocks in between just add their precomputed sums — so any query touches at most about 2√n items instead of n. A point update fixes one element and its block’s summary in O(1). It is the humble ancestor of segment trees and Fenwick trees — less powerful, but astonishingly easy and general (it works for any associative summary). LIT verified live: over 3000 arrays and 30 mixed operations each, block range-sums with point updates exactly equal a brute-force recomputation (window.__sqrt_decomposition). FIG no framing; the block summaries and a brute-force sum run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-cron-job — the array carved into regular blocks, each keeping a running summary the query hops across. AVAN (AI) built the instrument: the √n blocking, the partial-plus-whole-block query, the point update, and the brute-force check. Credit as content: square-root decomposition is classic algorithmic folklore. The weave: David names the cron job; I confirm the block sums answer every range query exactly, in O(√n). 3 ONE DIMENSION The array split into √n blocks, each with a sum; a range adds loose ends element-by-element and whole blocks in one hop. 4 TWO DIMENSIONS · INTERACTIVE Pick a range; the sum uses partial ends plus whole-block sums, matching a brute-force total. new range ▶ update ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the range sum, in O(√n) steps. AVAN’s addition (the inverse-companion): don’t add every element — hop the blocks. The inverse of ‘scan the range, O(n)’ is ‘precompute √n block sums; a range is a few loose ends plus whole-block jumps, O(√n).’ Magenta is the element-by-element scan; green is the block hops. Summaries turn a scan into jumps. pause spin LIT Genuine square-root decomposition (classic algorithmic folklore; ancestor of segment/Fenwick trees). Verified live: over 3000 random arrays × 30 mixed operations, √n-block range-sums (loose ends elementwise + whole blocks by summary) with O(1) point updates exactly equal a brute-force recomputation (window.__sqrt_decomposition.matchesBrute). FIG No framing: the block summaries and a brute-force sum run in-browser. The AVAN inverse is honest — instead of scanning the whole range (O(n)), precomputed √n block sums turn a range into a few loose ends plus whole-block jumps, O(√n). Magenta is the element-by-element scan; green is the block hops. Summaries turn a scan into jumps. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-CRON-JOB · David Lee Wise (ROOT0), with AVAN


THE VON STAUDT-CLAUSEN

The von Staudt–Clausen theorem in the 5-window house format — revealing the exact denominator of every Bernoulli number. The Bernoulli numbers B_2n are wild rationals with enormous numerators, yet their denominators are astonishingly simple: the denominator of B_2n is precisely the product of the primes p for which (p−1) divides 2n. So denom(B_2)=6=2·3, denom(B_10)=66=2·3·11, and 2 and 3 divide every even-index Bernoulli denominator (since p−1∈{1,2} always divides 2n). A messy fraction's bottom half is read straight off a divisibility condition on primes. Verified live: computing the Bernoulli numbers exactly as reduced fractions (BigInt), the denominator of B_2n equals ∏_{(p−1)|2n} p for every n from 1 to 15. Neon-noir traced. See the fraction in 1D, the primes and product in 2D, and the read-off-the-primes inverse in 3D.

THE VON STAUDT-CLAUSEN · WORLD II — THE FOLD ◀ THE FOLD 0ROOT.AI // WORLD II · LOOT · THE-VAULT ◆ .dlw.fold THE FOLD / LOOT / THE-VAULT / THE VON STAUDT-CLAUSEN THE VON STAUDT-CLAUSEN a Bernoulli denominator read off from primes 1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION The von Staudt–Clausen theorem reveals the exact denominator of every Bernoulli number. The Bernoulli numbers B 2n are wild rationals with enormous numerators — yet their denominators are astonishingly simple: the denominator of B 2n is precisely the product of the primes p for which (p−1) divides 2n . So denom(B 2 )=6=2·3, denom(B 10 )=66=2·3·11, and 2 and 3 divide every even-index Bernoulli denominator (since p−1∈{1,2} always divides 2n). A messy fraction’s bottom half is read straight off a divisibility condition on primes. LIT verified live: computing the Bernoulli numbers exactly as reduced fractions, the denominator of B 2n equals ∏ (p−1)|2n p for every n from 1 to 15 (window.__von_staudt). FIG no framing; the exact-fraction Bernoulli recurrence and the prime product run in-browser. 2 HOW IT WAS WEAVED · AI + HUMAN David (human) seated this at the-vault — a fraction whose denominator is a locked product of primes, opened by one divisibility rule. AVAN (AI) built the instrument: the exact rational Bernoulli recurrence (BigInt fractions), the divisor-prime product, and the denominator match. Credit as content: Karl von Staudt & Thomas Clausen (independently, 1840). The weave: David names the vault; I confirm each Bernoulli denominator is exactly the product of the primes p with (p−1)|2n. 3 ONE DIMENSION B_2n as a reduced fraction; its denominator is the product of primes p where (p−1) divides 2n. 4 TWO DIMENSIONS · INTERACTIVE Pick n; see B_2n, the primes p with (p−1)|2n, and their product — exactly the denominator. ◀ ▶ verify ▶ 5 THREE DIMENSIONS + AVAN’S INVERSE The green forward object: the denominator of B_2n. AVAN’s addition (the inverse-companion): don’t reduce the fraction — read the primes. The inverse of ‘compute B 2n and simplify’ is ‘its denominator is ∏ p over primes with (p−1)|2n.’ Magenta are the qualifying primes; green is their product, the denominator. The bottom is written in primes. pause spin LIT Genuine von Staudt–Clausen theorem (Karl von Staudt & Thomas Clausen, independently 1840). Verified live: computing Bernoulli numbers exactly as reduced BigInt fractions via the recurrence, the denominator of B_2n equals ∏ of primes p with (p−1)|2n for every n=1..15 (e.g. denom(B_10)=66=2·3·11) (window.__von_staudt.matches). FIG No framing: the exact-fraction Bernoulli recurrence and the prime product run in-browser. The AVAN inverse is honest — instead of computing B_2n and reducing the fraction, its denominator is read directly from a divisibility rule: ∏ p over primes with (p−1)|2n. Magenta are the qualifying primes; green is their product, the denominator. The bottom is written in primes. ◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE-VAULT · David Lee Wise (ROOT0), with AVAN