Reproducible experiments for a narrative-nonfiction paper on the handful of algorithms that ran the world — and what is replacing them. Every figure in the paper is generated by code in this repo, from public data or explicit synthetic models, with fixed seeds. No figure is borrowed; nothing is hand-drawn.
Companion repo to the paper "The Last Legible Machines: Six Algorithms That Ran the World, and the One That Ate Them" (in preparation; DOI to follow). The repo keeps its neutral name for stability.
python -m pip install -r requirements.txt
python run_all.py # runs the 8 self-contained experiments, writes figures/Each experiment also runs on its own, e.g. python experiments/e1_flybook/run.py.
Outputs: a PNG in figures/ and a metrics.json next to each run.py.
| # | Name | What it shows | Data | Live keys? |
|---|---|---|---|---|
| E1 | Fly-book duel | Two Amazon repricing bots (Eisen's exact multipliers) spiral a book to $23.7M; phase diagram of when coupled optimizers explode | none (deterministic) | no |
| E2 | Supercolony automaton | Founder-bottleneck → one borderless "us"; cue diversity → permanent war borders (the ant→platform-monoculture bridge, runnable) | synthetic | no |
| E3 | Succession study (flagship) | How much of the classical top-10 web survives into LLM answer-engine citations, 2026 | live search + answer APIs | yes (demo mode offline) |
| E4 | Red Queen in a bottle | Spam evasion vs filter retraining as a measured arms-race curve; the cost of winning is false positives | UCI SMS Spam Collection (bundled) | no (classical); LLM variant optional |
| E5 | Anternet replication | Harvester-ant foraging regulator vs TCP AIMD: one feedback law, two substrates | synthetic | no |
| E6 | Flash-crash in a bottle | Volume-keyed selling into thinning depth craters a toy market; a stop-logic pause arrests it | synthetic | no |
| E7 | Auction bench | Second-price learns truth-telling, first-price learns to shade to (N−1)/N; revenue equivalence — why the 2019 switch wasn't a revenue grab | synthetic | no |
| E8 | Gale–Shapley bench | Deferred acceptance yields provably zero blocking pairs; greedy accumulates thousands | synthetic | no |
- E1: growth factor 1.2684/cycle → ~51 cycles from $106 to the observed $23,698,655.93.
- E2: at cue-diversity D=2, a mean of 1.0 surviving supercolony and 0 border; at D=64, ~24 colonies and ~1,600 cells of active border.
- E3 (LIVE, 2026-08-22): ChatGPT answered 80% of 50 queries without consulting the web at all (Gemini: 62%). When the web was consulted, only 37% (ChatGPT) / 29% (Gemini) of cited domains came from the classical top-10; the survivors sat at mean classical rank 2.6–3.3. Consultation by query type: informational 5%, ambiguous 5%, YMYL 25%, factual 30%, local 40%, commercial 75%.
- E4: static filter decays from 100% to ~87% catch over 8 rounds; a retraining filter holds ~100% — but its false-positive rate sits at ~17% (the arms race isn't free).
- E6: crash floor 87.5 without a pause vs 94.0 with a 6-step stop-logic pause.
- E7: learned shading → 1.00 (second-price) vs 0.79 (first-price; theory 0.80); revenue 0.667 vs 0.656 (theory 0.667).
- E8: greedy matching at n=800 → ~27,000 blocking pairs; Gale–Shapley → exactly 0 at every size.
- Every experiment fixes a seed (mostly
20260822) and is deterministic. - One command per figure;
run_all.pyregenerates everything in ~15s. - Each
run.pywrites ametrics.json— the numbers the paper cites. - Toy models are labelled as illustrations, not causal claims, in both the
docstring and the figure/metrics (see E6's
limitationfield).
These need API access and stay reproducible only up to provider drift, so they run in a clearly-watermarked demo/offline mode by default.
- E3: the classical baseline ships as a dated snapshot
(
baseline_2026-08-22.json), so no search key is needed to reproduce the comparison — only an answer-engine key. Copyexperiments/e3_succession/providers.example.pytoproviders.py(gitignored), setGEMINI_API_KEY/OPENAI_API_KEY/PERPLEXITY_API_KEY, thenpython experiments/e3_succession/run.py --live. The runner also accepts an optionalanswer_citations_detailed(engine, q)provider returning{"cited": [urls], "retrieved": bool, "model": str, "searches": [...]}, which lets it distinguish "never consulted the web" from "searched but cited nothing" — both are measurements, not failures. The 2026-08-22 live run (results.json) used ChatGPT + Gemini. Demo mode (no keys) produces a synthetic figure watermarked "do not cite". - E4 LLM variant (
run_llm.py): optional, gated behind an ethics flag.
- E4 uses the public UCI SMS Spam Collection (bundled in
data/, 5,574 messages). It reports aggregate metrics only, uses mechanical perturbations already documented in the spam literature, synthesizes no novel spam, targets no live filter, and emits no reusable evasion payloads. The LLM variant is held to the same rule and is off by default. - Toy financial/ecological models (E2, E5, E6, E7) are qualitative illustrations of published mechanisms, not calibrated predictors.
MIT — see LICENSE.
If you use this code, cite the repository (a paper DOI will be added on publication). Data: Almeida, Gómez Hidalgo & Yamakami, UCI SMS Spam Collection.