Artificial life · Rust · Bit-exact

Evolution, bit for bit.

A real-time artificial-life laboratory in memory-safe Rust. Every organism carries its own heritable neural network and chemistry, and they feed, signal, move, split and die through one shared energy field. Watch, pause, inspect, branch and replay them: the same world, to the last bit, every time.

Tick
2,400
Sim time
+0.0 s
Alive
262,144
View
whole
Rendered by flife, not drawn10,954 founders · 320² field · colour = founder lineage
  • 9,988

    parameters per brain

    The default network, 104 → 64 → 32 → 36. No two organisms share one.

  • 104 → 36

    senses to decisions

    Field energy, 32 chemical channels and their gradients in; reproduction, emission and spending out.

  • Bit for bit

    CPU = Metal

    Controllers, field, sensing and uptake on the Mac's GPU reach the CPU reference's world exactly.

  • ≈10/s

    ticks, 100k organisms

    The Desktop ecology world on 16 workers of an M5 Ultra. Measured, not a passed gate.

Provenance

What you are watching.

Not an illustration: flife render drew each frame from the committed world at its tick. The world is deterministic: the same commands reach the same digests, below, on any machine.
The world
Preset
presets/confluent-world.toml
Model
field-ecology-v1-contact
Seed
42
Founders
10,954 on a 320 × 320 field
Tick length
1/32 s of simulated time
Evolved first
2,400 ticks (75 simulated seconds)
Alive in the film
262,144 – 262,144
The film
Ticks
2,400 → 5,600, a frame every 8
Frames
401 at 30 fps, 1080 × 1080
Colour
founder lineage: a stable categorical colour per lineage
Field
not drawn, sphere look
Camera
10 keys, chosen from the run
First digest
3f279f51662ba456db526d2828b3faf19f93a7bd160deeb6f8e5f7f86f5134ed
Last digest
7fa0cc68e168a7277016aabd5a68b3322d4b074bdd2d99ede61228e48d3c9fc7
How this world was chosen

The film's world is not the baseline model. It runs field-ecology-v1-contact, a registered variant with one added rule: every organism is a body, here 0.25 world units across, and after each tick overlapping bodies push apart while bodies within 1.5 diameters pull together by the square of how alike their inherited chemistry is. The rule moves organisms, never energy. It was added because the reference screenshots' organisms look like packed spheres, which organisms that are points cannot be. Measured, the bodies stack two or three deep rather than pack: the pull, summed over every neighbour, outweighs the push.

Its numbers were chosen by searches outside the simulation, in several stages, against 14 statistics of the reference screenshots that inspired the project. The last stage changed the scale, not the rules. The field is four times finer, so a field cell holds a few organisms rather than about ten, nearer the references' one. Food is plentiful, so the population sits at its ceiling of 262,144, as the references' counters show theirs do at a million. Children land up to 2.5 world units from their parent, so colonies fill the 80-unit torus instead of leaving most of it black. Of every world the searches scored, this is the closest to the references, 0.74 on the statistics' scale against 1.27 for the previous film's world, and it was chosen by eye, coloured by lineage. The film shows the chosen world itself, from the tick where it was scored.

Nothing the search measured feeds back into a run. The organisms have no aesthetic fitness: they feed, emit, split and die by energy alone. The seed is the Desktop preset's 42, not a pick. On three seeds the search never saw, the world scores 0.81 to 1.57, against 2.55 to 2.80 for the previous film's world on the same seeds.

Emission, chosen by the neural networks, makes the structure, and contact shapes it at the scale of bodies. Organisms return about half of what they eat to the field, in a chemical composition their networks choose and kin choose alike, so each lineage paints its surroundings with its own chemistry. Adhesion then sorts lineages by that chemistry, as real tissues sort by adhesion, into domains of labyrinths, foam and packed spheres. With every controller's decisions zeroed, nothing is emitted and the bodies settle into a uniform mottled haze, with no domains, labyrinths or foam. With every newborn's genome drawn fresh instead of inherited, the population falls from its ceiling to about 1,200.

The camera is chosen from the run, not by hand. The same ticks are first rendered small; each shot then eases into the region where the organisms changed most during it, and the film opens and closes on the whole torus. The camera changes no result: the preview and the film end on the same digest.

The search, every sample's score and the held-out seeds.

Make it yourself
# flife is `cargo run --release -p flife-cli --` in the repository
flife run presets/confluent-world.toml --ticks 2400 --run-dir RUN
flife render --run-dir RUN --ticks 3200 --every 8 --width 1080 --height 1080 --no-field --look sphere --color lineage --camera CAMERA --out frames
# CAMERA: lib/media.json's render.camera keys, as {"keys": [...]}

Rendered at revision 64ed5b88ffc8 with controllers on cpu (frankentorch population_affine_f32_into, 24 lanes); no result depends on the route. The first frame shows 262,144 organisms and the last 262,144; the render's end record names the last digest above. The PNG frames are flife's; this page's video encodes them with flife's own BT.709 colour chain at CRF 24 for the web, and its SHA-256 is b27888799b1d5e73f58daa57eb653633a2a4599c5c125ac55e6a427774c5a807.

The rules

Every organism, its own brain.

None of the shapes in the film is painted. They have to come out of an ecology with finite energy, genuine inheritance and a ledger that balances on every tick.

Every organism has its own weights.

Organisms with the same topology share a kernel and a memory layout, never a parameter.

Organisms meet only through the field.

No pairwise attraction tables, collision forces or global reward functions in the baseline. The film's world is a registered variant that adds one rule, bodies that push apart and stick to alike chemistry, and says so.

Signals cannot counterfeit food.

A cell holds spendable energy e and a 32-component chemical signature m with ‖m‖ ≤ e. Opposite signals can cancel each other's chemistry without creating or destroying energy.

Nothing is trained by gradient.

Weights start random and change only through inherited mutation.

The ledger always balances.

Energy in the organisms plus energy in the field changes only by injection, removal, dissipation and a declared numerical residual, every tick.

FieldEcologyV1

How the world works.

An original, explicit rule set: a periodic field of energy and chemistry, and organisms that can only touch each other through it.
World

A two-dimensional periodic torus. Organisms have continuous positions; the field is a regular grid.

Field

Each cell holds energy and a 32-component signed chemical moment. One positive five-point stencil diffuses both, conserving energy before declared decay.

Sources

Seeded Gaussian patches drift across the torus on smooth paths, each injecting a fixed power with a fixed chemical direction per simulated second.

Sensing

Energy, 32 composition values and their gradients at a heritable sensing scale, plus the organism's own energy, age, velocity and recent energy change: 104 inputs.

Brain

Dense tanh networks with a linear output layer. Offspring can move between catalog topologies of 1,164 to 29,316 parameters.

Decisions

36 outputs: a reproduction hazard, a child's energy share, an emission gate, a 32-dimensional emission direction and a spending rate. No motor output.

Uptake

A two-pass demand and grant step. A contended cell grants in whole quanta, so no cell is overdrawn and thread order never decides who eats.

Chemistry

A heritable affinity decides whether each granted packet feeds or poisons. Toxicity is clipped to the energy the organism actually holds.

Motion

Heritable responses to gradients give an acceleration; drag is integrated exactly, and movement costs energy in proportion to speed squared.

Emission

An organism can pay energy to deposit chemistry at an efficiency of at most one. Deposits are first sensed on the next tick, so no loop can amplify energy.

Reproduction

A split makes a mutated child. Identity, genome, slot and energy transfer commit together, or nothing happens.

Death

Zero energy after any stage is death, checked after every stage. Part of the residue returns to the field.

The ledger

𝓔ₙ₊₁ − 𝓔ₙ = injection − removal − dissipation + numerical residual

𝓔 is the energy in every organism plus the energy in every cell. Emission, absorption and a child's endowment only move it. No correction may add energy to make the equation balance.

Ten phases

One tick.

Each tick is prepared as a candidate against the committed world and published whole, or not at all. Cancelling before phase 10 discards it; the last committed world stays authoritative.
  1. 01Admit commands at their recorded tick boundary
  2. 02Transport the field and inject sources into one immutable observation field
  3. 03Build the sensing pyramid and spatial bins
  4. 04Sense and evaluate due controllers, all from the same epoch
  5. 05Resolve uptake demand into cell grants
  6. 06Settle useful gain, toxicity and maintenance
  7. 07Propose affordable motion, then emission, then reproduction
  8. 08Resolve capacity, construct births and collect deaths, in stable identity order
  9. 09Reduce deposits and recycling into the next field
  10. 10Validate the invariants and publish state, events and accounting together
Four claims

Kept apart.

A beautiful image establishes only the visual claim. A speed measured on named hardware is a separate kind of result, and evidence for none of the four.
Rules

The simulation obeys its own rules

Invariants INV-01–INV-15 and the energy ledger; the field, ledger and population checks run on every tick before it is published

Implementation

The code reproduces those rules

Hand-computed fixtures, a separate scalar oracle, and CPU/Metal parity bit for bit

Visual

The images have the intended character

Human review against the references, raw diagnostic views beside the aesthetic ones (G5)

Ecological

Populations show measurable evolutionary phenomena

Ablations, seed ensembles and held-out seeds, failed and extinct runs kept (G9)

Gates G0–G10

Honest status.

The foundations are built and tested; the visual, full-scale rate, endurance and export gates are not. The 400,000 organism world at 30 ticks a second is a target, not a result. The README keeps the full account.
  • G0 Built and tested

    The stack composes

    One lockset; every probe matches its oracle on macOS arm64 and Linux x86-64.

  • G1 Built and tested

    Hand fixtures and arithmetic

    Fixtures pinned bit for bit; world digests identical on both hosts.

  • G2 Built and tested

    A first world lives, renders and pauses

    The 4,096-organism preset breeds, mutates and dies, live in a native Metal window.

  • G3 Built and tested

    Checkpoint replay and crash recovery

    A run killed at any step of a checkpoint or command resumes to the uninterrupted world.

  • G4 Built and tested

    CPU and Metal parity

    Controllers, field, sensing and uptake on Metal, each bit for bit the CPU reference's.

  • G5 Not yet

    Visual review

    Needs a human review against the references. Not yet run.

  • G6 Partial

    30 fps with p95 input latency ≤ 100 ms

    Offscreen only: 30.00 fps at 1080p (p95 51.6 ms) and 29.79 at 4K (p95 59.9 ms). Not yet measured in a window.

  • G7 Not yet

    400,000 organisms at 30 ticks/s

    Not reached. The 100,000-organism Desktop world runs at about 10 ticks/s on an M5 Ultra.

  • G8 Not yet

    Eight-hour endurance

    Not run.

  • G9 Partial

    Research claims

    Five declared hypotheses tested with held-out seeds (below); the release's claims are not yet made.

  • G10 Not yet

    Export alignment

    Not run.

FL-048 · declared before running

What the experiments found.

Five hypotheses, each with its rule written down before the runs, discovery and held-out seeds kept apart, and failed runs kept. Two are not supported, and the rest are stated as narrowly as the data allow. The full record.

H1Persistent heterogeneous colonies

Met · a low bar

Every run that reached tick 8,192 kept clustered, spatially autocorrelated colonies: 32 of 32 and 16 of 16.

H2Controllers add behaviour beyond chemistry

Not supported

The chemistry-only ablation also stops emission, and removing emission alone has the same effects. The decisions' own effect is inconsistent.

H3Paid emission supports niche construction

Met narrowly

Emission evens the field (Gini lower on 6 of 8 seeds, held out 7 of 8) but leaves colonies' clustering unchanged: environment modification, not demonstrated niche construction.

H4Visual structures are functional

Rule met · not established

The declared rule was met on one measure, but post hoc that effect is mostly an emptied disk refilling. A functional boundary is not established.

H5Architecture variation affects ecology

Not supported

Final population and births reverse sign between the discovery and held-out seeds.

Laboratory mode

Run it yourself.

Every command prints versioned NDJSON. Start with what your machine can run, then the 4,096-organism reference world.

# What this machine and build can run, by running it

cargo run --release -p flife-cli -- capabilities

# 1,024 ticks of the 4,096-organism reference world, headless

cargo run --release -p flife-cli -- run presets/reference-small-world.toml --ticks 1024 --every 128 --metrics-every 128

# The same world as PNG frames and an MP4

cargo run --release -p flife-cli -- render presets/reference-small-world.toml --ticks 2560 --every 4 --width 1080 --height 1080 --out frames --video world.mp4

# Live in the native Studio (macOS)

cargo run --release -p flife-studio -- presets/reference-small-world.toml --width 960 --height 540

# A kept run, then a step past its newest durable tick

cargo run --release -p flife-cli -- run presets/reference-small-world.toml --ticks 512 --run-dir my-run && cargo run --release -p flife-cli -- step my-run --ticks 64