All articles

Scoring 131,072 universes

How Rule Safari finds the interesting Life-like rules without being told which ones are famous, and the twelve-generation trick that made it work.

Cellular automataRustSimulation

Conway’s Game of Life has two rules. A dead cell with exactly three live neighbors is born. A live cell with two or three live neighbors survives. Everything else dies or stays dead. From that, you get gliders, guns, and people building working computers out of it.

Here’s the part nobody tells you at first: Life is one rule among 262,144 of exactly the same shape. Change the numbers and you get a different universe. Go ahead.

Born with
Survives

Every switch is a rule. Flip one and the same random soup restarts under the new physics. B0 is greyed out on purpose: a rule where dead cells are born with zero neighbors makes empty space flash.

Most of what you find in there is dull. Rules freeze in two generations, die out, or boil into static. A few are alive the way Life is: small things travel across quiet space, and the debris ticks. Rule Safari is a program that goes looking for those few, without being told which rules are famous.

Eighteen switches

A Life-like rule is written B3/S23: born with 3, survives with 2 or 3. Each of the nine neighbor counts can be on or off for birth, and again for survival. That’s eighteen switches, so 2¹⁸ = 262,144 rules.

Half of them have B0 switched on, and those make empty space blink on and off every generation. Rule Safari leaves them out. That leaves 131,072 universes to judge.

The hunt

Judging a rule means running it. You drop a random soup in, watch, and measure. Doing that properly for all 131,072 would be slow, so the hunt goes in two rounds: a cheap screen for everyone, then a close look at the best.

  1. 262,144

    Life-like rules · every way to choose the birth and survival counts: 2¹⁸

  2. 131,072

    screened · B0 rules left out, since empty space would flash. 2 soups of 40×40 for 160 generations, plus 2 seeds dropped into empty space

  3. 1,540

    studied closely · the best 1,500 plus every named rule: 2 soups of 128×128 for 600 generations, and 32 nurseries

  4. 48

    plates in the field guide · picked from the top of the ranking, skipping near-twins of rules already shown

Caught along the way: 34 kinds of spaceship in 27 rules, 13,134 oscillators, 39,241 still lifes.

The whole hunt took 93 seconds on a 16-core laptop. Every random number comes from a stream keyed by seed, rule and soup, so a hunt is reproducible no matter how the threads are scheduled.

The close look is where the zoo gets counted. The live cells are split into separate objects, and each object is replayed alone on an empty grid. If it comes back to its own shape within 16 generations, it’s catalogued: a still life, an oscillator, or, if it came back somewhere else, a spaceship with a speed like c/4 diagonal.

The score is 55% liveliness and 45% zoo. Spaceships count most, oscillators beyond period 2 count more than flickers.

The first score was wrong

The first version of the liveliness score loved the wrong rules. Specifically, big still blobs whose edges flicker forever.

It’s an easy mistake to make. Those blobs never settle, so they look busy. And their large uniform regions compress beautifully, so they look structured. Busy and structured is what Life looks like. It’s also what a pot on a low simmer looks like.

The fix is one number.

Twelve generations

Compare each soup with itself 12 generations earlier, and count what’s different.

Why twelve? Because 12 is a multiple of 1, 2, 3, 4, 6 and 12. An oscillator with any of those periods is back in exactly the same state after 12 generations, so it cancels out. A blinker flips back and forth all day and contributes nothing. What survives the comparison is change that goes somewhere: spaceships, growing debris, or noise.

Here’s that comparison running live. Blue is a cell that’s different from 12 generations ago. Grey is a live cell that’s exactly where it was.

In Life, the blinkers and blocks go grey and the gliders stay lit. Switch to B578/S134568: it never settles, but almost everything is flickering in place, so almost nothing lights up. Seeds lights up everywhere, because it’s noise.

That fraction, the share of cells that changed in 12 generations, is the rule’s motion. Liveliness is a curve over it: zero when almost nothing moves, full marks across a wide middle band, and fading again when the whole board churns.

full marks: things travel← frozen or flickeringnoise →100.01%0.1%1%10%100%cells changed vs 12 generations earlier (log scale)Conway's Life · 5.2%HighLife · 3.9%Day & Night · 1.4%Seeds · 33.4%Life without death · 0%

The curve from rule-safari’s source. Motion is averaged over the last eight 12-generation comparisons of each soup. Liveliness is then multiplied by how long the soups stay unsettled, and discounted for crowded soups, because interesting things happen against a quiet background.

Life lands at 5.2%, comfortably on the plateau. Seeds churns a third of the board every twelve generations, which is noise. Life without death never loses a cell, so the soup fills in and stops changing. It scores zero.

What it found

The hunt never sees rule names. It has no idea which rules people have spent fifty years on. It ranked them anyway.

score 01,540 rules studied75+
  1. 1B3/S238EightLife75.6screen #21
  2. 2B3/S23Conway's Life74.4screen #3
  3. 3B38/S238HoneyLife73.1screen #596
  4. 4B378/S238no name72.6screen #150
  5. 5B36/S238IronLife71.9screen #891
  6. 6B38/S23Pedestrian Life71.8screen #765
  7. 7B368/S238LowDeath71.8screen #1,011
  8. 8B467/S014567no name71.7screen #1,422
  9. 9B378/S23no name71.6screen #1,012
  10. 10B36/S23HighLife70.7screen #1,077
  11. 11B3/S014567no name70.6screen #779
  12. 12B37/S238no name69.7screen #395

The top twelve of seed 1. Named rules are in blue; names were matched against LifeWiki’s list after the hunt. The right column is each rule’s rank in the cheap first screen, before the close look.

Conway’s Life came second, just behind its close relative EightLife. Seven of the top ten already have names on LifeWiki. Humans got there first, by hand.

The right-hand column is worth a second look. Conway’s Life was already third after the cheap screen. HoneyLife came in at No. 596 and IronLife at No. 891, and the close look pulled them up to third and fifth. HighLife squeaked into the 1,500 finalists at No. 1,077 and finished tenth. The screen is a net, not a judge.

Down at the other end sit rules that are famous in their own right. Maze and Life without death rank near the bottom: from a random soup they lock up fast, and locking up is the one thing this hunt punishes hardest.

The zoo

Across all 1,540 studied rules, the census caught 34 kinds of spaceship in 27 rules, 13,134 oscillator species, and 39,241 still lifes. These are the record holders, running in the rules they were found in:

Conway's Life gliderB3/S23 · Conway's Life
c/4 diagonal, 5 cells, period 4 · seen 34×
Fastest spaceshipB2/S0 · Live Free or Die
c orthogonal, 4 cells, period 1 · seen 11×
Slowest spaceshipB367/S03468
c/8 diagonal, 9 cells, period 8 · seen 8×
Biggest spaceshipB347/S268
c/8 orthogonal, 13 cells, period 8 · seen 1×
Longest-period oscillatorB35/S347
period 16, 5 cells · seen 26×
Richest zooB2/S · Seeds
4 kinds of spaceship, 3 oscillators, 0 still lifes · seen 34×

Shapes straight from the hunt’s results file, replayed here in your browser. This site’s test suite replays each one and checks it comes back to its own shape, moved exactly as far as the census says. The 13-cell ship was seen exactly once.

The fastest ship moves at c, one cell per generation, which is the speed limit in these universes. It’s four cells, and it lives in Live Free or Die and a few other B2 rules. The slowest moves one cell diagonally every eight generations, in a rule nobody had a name for.

The field guide

The hunt writes one HTML file: the records, then 48 plates picked from the top of the ranking. Each plate runs a soup live. Picks skip near-twins of rules already shown, so the page isn’t 48 copies of the same texture.

The Rule Safari field guide: headline numbers, the record creatures, and the first live plates: EightLife, Conway's Life and B378/S238The Rule Safari field guide: headline numbers, the record creatures, and the first live plates: EightLife, Conway's Life and B378/S238

The field guide from the default hunt. It runs live at r-hatim.github.io/rule-safari, with nothing to install.

What it can’t see

Honest limits, straight from the README:

  • The census only sees small, fast creatures. At most 16×16 cells, 64 live cells, period 16. Day & Night is known to have spaceships, and none were caught.
  • The ranking depends on the soups. With --seed 2, Pedestrian Life comes first and Life third. Nine of the top twelve still carry Life’s B3/S23 core.
  • The score is a judgement call. It encodes one idea of “interesting”: lively, sparse, full of things that move. Weight it differently and you’ll find different gems.

That last one is the real lesson. The program didn’t discover that Life is interesting. It encoded a definition of interesting, and Life turns out to be close to the best example of that definition. Fifty years of humans agreed.

Rule Safari came out of my nightly builds, where an AI agent invents, builds and tests a new project every night. The code is on GitHub, MIT licensed. cargo run --release -- hunt --quick runs a 4,096-rule sample in a few seconds.

Written by hrih

A thought to add?

A good question, another perspective, or something this made you think about. There’s room for it here.

Loading the conversation…

Use a name or an alias. No email address needed.

Comments are reviewed before appearing. Your display name and message will be public once approved. Privacy