A joke, followed until it broke.

A hackathon toy turned a FASTA file into a PNG and noticed the PNG came out smaller. The idea underneath was real: an image codec's row filters are two-dimensional predictors, so the width you pick is a free parameter, and sweeping it detects tandem repeats. Following that all the way removed the codec from the answer.

68%
of annotated chr21 windows agree with TRF
the compressed version manages 4%
5%
indel rate the statistic survives
the compressed version dies by 0.5%
17×
faster than the version with a compressor in it
and it is the only one that can go in a proof

One

What the statistic is looking at

Write a sequence into an image row by row. A PNG can subtract each row from the row above before compressing — the Up filter. Choose a width equal to the period of a tandem repeat and every row becomes a near-copy of the row above, so the subtraction leaves almost nothing.

The same sequence laid out at two widths, with the row difference below each
Top: the same bytes at two widths. Bottom: each row minus the row above, black where they differ. At width 140 the rows are unrelated and 77% of bytes differ. At width 171 — the period — the monomers stack into vertical stripes and only 9% differ. That gap is the entire signal.
Read this before the next section

Notice what does not change. The raw stream deflates to 0.86 bits per base at one width and 0.86 at the other. Deflate finds this repeat from one dimension without any help from the layout. The 2-D arrangement changes the row difference, not the file size — and that turns out to be the whole story.

Two

The reversal

Three ways to measure the same sweep. png writes a real PNG at each width. up fixes the Up filter and deflates the residual. match throws the compressor away and counts positions where a byte equals the byte w earlier.

Sweep curves under three statistics across four planted arrays
One row per statistic, one column per planted array; the dashed line marks the true period. match and up agree closely (r = 0.78–0.92) and spike only at the period and its multiples. png correlates with neither (r = -0.26 to 0.02); its dips grow with width because a wider image has fewer rows, which has nothing to do with any repeat.
The finding

The compressor was never doing the work. It was the lens that found the statistic. The framing this project is named after turns out to be scaffolding — and taking it away made the method faster, twenty times more tolerant of indels, and the only version that works on a real genome.

Three

Where it works, and where it stops

Planted arrays, 400 kb per cell, substitutions only. The boundary is a horizontal line: every period from 5 bp to 5000 bp is found at 65% divergence and none at 80%. Period does not enter into it.

Phase diagram of detection over repeat period and divergence
36 of 72 cells; × marks a cell where the detector's first answer was not the planted period. Two independently mutated copies agree at 0.34 of positions at 65% divergence and 0.28 at 80%, against a chance baseline of 0.25 for four letters. So detection holds down to about a five-point excess over chance, and not below.

Indels, not substitutions, are the real limit

Detection under substitutions and indels for both statistics
Hollow markers: the detector's first answer was no longer the planted period. Both statistics compare a position to the position w earlier, so an indel should hurt both. It does not hurt them equally: match survives to 5% and fails by 10%, up fails by 0.5%. A compressed size is one number over a whole window, so out-of-phase stretches add entropy that swamps the in-phase ones; a match rate is a mean over positions, so the stretches still in phase keep contributing.

Four

Real genomes

45 windows of 200 kb across T2T-CHM13v2 chr21:5–14 Mb — the acrocentric short arm and the centromere — scored against UCSC's simpleRepeat (Tandem Repeats Finder) and censat, neither of which knows anything about this method.

statisticwindows calling a period agreement (25 annotated)agreement (period ≥ 20 bp)
match19/4517/25 (68%)6/11
png4/451/25 (4%)1/11
up0/450/25 (0%)0/11
Reported period against TRF annotation along chr21
Grey rings are TRF's dominant consensus size per window; green is what the sweep reported. Green sits on grey where they agree: 68 bp in the two windows censat labels bsat_21_7 (beta satellite), 171 bp in the mon_21_* windows (alpha-satellite monomer), and multiples of 170 in hor_21_3, the higher-order array. up appears only in the legend — it calls nothing at all.

A plant satellite, and a control that has to stay quiet

2/92
A. thaliana chr4 windows calling a period
both of them 178 bp — pAL1, the centromeric satellite
0/23
E. coli windows calling a period
the negative control; reporting nothing is the right answer
Period calls across Arabidopsis chr4 and E. coli
Green: the statistic. Blue: the unconfirmed adaptive-PNG version, shown for contrast. Unconfirmed, the statistic also calls period 3 in 10 of 23 E. coli windows. That is not a false positive — it is codon structure in a dense bacterial genome — and harmonic confirmation removes it, because 6 and 9 do not dip.

Five

What it is not

Most of what was learned here is negative, so it gets its own section rather than a footnote.

It is not a compressor

inputv0.1 (base64)v0.2gzip -9 xz -62-bit + xz
sample.fasta, 611 B0.452× 0.666×0.111× 0.183×0.183×
CHM13 chr21 5–14 Mb 0.214×0.253× 0.184×0.172×

The rewritten container beats gzip on the megabase inputs, but that is the two-bit packing, not the layout — the same packer into xz beats the PNG every time. And the 2-D layout never beat gzip on the same bytes, at any width, for any period tested.

Things that looked like results and were not

Six

The rest of what was built

A container that is a container

No base64, two-bit DNA packing with lossless side streams for headers, newlines, N runs and soft-masking case, length and SHA-256 in a tEXt chunk, strict decoding. 0.214× on chr21.

Details →

A portrait that still decodes

Payload in the low nibble of every channel, a GC-and-compressibility rendering in the high nibble, Hilbert-ordered so neighbouring pixels are neighbouring sequence. Costs 1.16–1.48× the plain container.

Details →

Provenance inside a figure

The git commit, the command line and the input checksums, hidden in a plot's low bits, so a figure carries its own provenance through the one channel that always survives — somebody pasting it into a slide.

Details →

A detector for both

40/40 containers flagged, 0/119 real figures falsely flagged. A manifest-sized LSB payload is invisible (AUC 0.41); a full cover is not (AUC 0.92).

Details →

A FASTA you can print

Reed–Solomon over GF(256) with interleaving and four finder squares. 73 of 108 photographed trials recovered; the boundary is roughly blur σ ≲ 0.3 × module pitch, and rotation is not a factor.

Details →

Proving a repeat without showing the genome

A match count is one equality per base, so unlike a compressed size it can be arithmetised. The relation, a Merkle commitment and a sampling audit are implemented and tested; the SNARK is written and unproven.

Details →
CHM13 chr21 5-14 Mb rendered as a Hilbert-ordered portrait
9.1 MB of chr21 in one 2048×2048 PNG that decodes byte-for-byte. Hue is GC content, brightness is local compressibility, and position on the curve is position in the file — so satellite arrays glow and unique sequence stays dark.

The claim the proof would make

I know a sequence S of n bases whose Merkle root is R,
such that at least k positions satisfy S[i] = S[i − w].

For a satellite array that is a statement about repeat structure. At w = 3 it is a statement about a trinucleotide expansion.

0.899
audited lower bound on the match rate
against a claim of 0.835
7.7%
of the sequence the audit discloses
which is exactly why the audit is not the real thing
39310k
circuit constraints
only 1799k of them are the statistic; the commitment is the cost
Not built

The SNARK. The circom circuit is written and its constraints counted, and it has not been compiled or proven — this machine has no circom. And a proof that some sequence with root R has k matches says nothing about where that sequence came from; the commitment has to be bound to a sequencer signature or a lab attestation. The cryptography is the easy half.

Seven

Play it

The same statistic as a puzzle. You get a sequence and a budget of probes; each probe lays the sequence out at a width you choose and tells you what it compressed to. Find the period. It runs on the browser's own CompressionStream, so a width that snaps in the game snaps in the Python.

Building it is what exposed the global-baseline bug above — every level was solvable with the answer “2”, and it took a second implementation to see it.

Eight

Method

Every number on this page is read out of results/ by site/build_site.py, which generates the page. None of it is typed by hand, so it cannot drift from the experiments. Colour tokens are contrast-checked at build time by site/palette.py, which refuses to build if a token that carries meaning falls below its WCAG floor.

Eleven experiments, each one file, each writing a TSV or JSON that these figures and numbers come from. 107 tests, including a suite that ports the puzzle's random number generator into Python so its levels cannot silently become unsolvable.