THE FOLD / GRIND / WARM CACHE / THE MOVE-TO-FRONT
THE MOVE-TO-FRONT
recency becomes rank — a cache and a compressor in one
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The move-to-front transform keeps a list of all symbols and, for each input symbol, outputs its current position in the list — then moves that symbol to the front. Recently-seen symbols cluster near the front, so locally-repetitive data becomes a stream of small numbers, which then compress well.
It is the classic middle stage of bzip2 (after Burrows–Wheeler, before entropy coding). And it is literally a cache-eviction policy: move-to-front is the least-recently-used list.
LIT verified live: encode then decode round-trips any input exactly, and on clustered (BWT-like) input the mean output code is far smaller than on uniform-random input (window.__movetofront). FIG no framing; exact reversible transform.
It is the classic middle stage of bzip2 (after Burrows–Wheeler, before entropy coding). And it is literally a cache-eviction policy: move-to-front is the least-recently-used list.
LIT verified live: encode then decode round-trips any input exactly, and on clustered (BWT-like) input the mean output code is far smaller than on uniform-random input (window.__movetofront). FIG no framing; exact reversible transform.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at warm-cache — the recently-used list that keeps hot items close. Move-to-front is the warm cache, written as a transform. AVAN (AI) built the instrument: the encode/decode with a live symbol list, the exact round-trip, the locality measurement.
Credit as content: Boris Ryabko (1980); Bentley, Sleator, Tarjan & Wei (1986), A Locally Adaptive Data Compression Scheme. The weave: David names the warm cache; I show the list bubbling recent symbols to the front, prove the transform inverts exactly, and measure repetition turning into small codes.
Credit as content: Boris Ryabko (1980); Bentley, Sleator, Tarjan & Wei (1986), A Locally Adaptive Data Compression Scheme. The weave: David names the warm cache; I show the list bubbling recent symbols to the front, prove the transform inverts exactly, and measure repetition turning into small codes.
3 ONE DIMENSION
The symbol list as input streams in: each symbol’s current index is emitted, then it jumps to the front, pushing everything it passed down one slot. A symbol seen twice in a row emits a 0 the second time.
4 TWO DIMENSIONS · INTERACTIVE
Feed clustered or random input; watch it encode to indices as the list shuffles, then decode back exactly. Compare the mean code for clustered vs random data — locality turns repetition into small numbers.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the symbol list as a stack, recently-used symbols bubbling to the top, their emitted codes small.
AVAN’s addition (the inverse-companion): the transform is perfectly reversible with the very same operation — the decoder reads a position, pulls that list entry, and moves it to front, so encoder and decoder walk in lockstep with identical list state, no side information needed. And it converts repetition into smallness: the inverse of ‘a symbol repeats’ is ‘its code falls to 0.’ That is why a cache and a compressor are the same object — recency made into rank: the warm cache’s hit is the compressor’s small number. Magenta is the raw symbols, high and flat in entropy; green is the move-to-front codes, low and skewed, ready to compress. Turn ‘seen recently’ into ‘numerically small,’ and you have both an eviction policy and a coder at once.
LIT Genuine move-to-front transform (Ryabko 1980; Bentley, Sleator, Tarjan & Wei 1986). Verified live: MTF encode then decode reproduces the input exactly across 300 random trials, and (using a mulberry32 generator) clustered BWT-like input produces a far smaller mean output code (~2.3) than uniform-random input (~7.4) — window.__movetofront.roundTrip && .localityHolds.
FIG No framing: the encode/decode with a live symbol list and the locality measurement run in-browser; the round-trip is exact. The AVAN inverse is honest — the transform is genuinely self-inverse in lockstep (decoder mirrors encoder's list ops with no side channel), and it genuinely equals an LRU cache policy (recency made into rank). Locality is measured with a proper RNG (mulberry32), not an LCG whose low bits would distort it.
FIG No framing: the encode/decode with a live symbol list and the locality measurement run in-browser; the round-trip is exact. The AVAN inverse is honest — the transform is genuinely self-inverse in lockstep (decoder mirrors encoder's list ops with no side channel), and it genuinely equals an LRU cache policy (recency made into rank). Locality is measured with a proper RNG (mulberry32), not an LCG whose low bits would distort it.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of WARM CACHE · David Lee Wise (ROOT0), with AVAN