Skip to content
Manic Microbes

The idea

Equilibrium is the most boring thing in physics.

Put a sealed jar of warm water on a shelf and nothing happens to it. The chemistry finds its lowest state, the temperature evens out, and then it sits there for as long as you care to watch. Everything that could happen has happened.

Now shine a light on it.

One tap, and nothing else

Energy comes in one side and leaves the other as heat. The jar is no longer settling — it is being pushed, continuously, and it cannot reach equilibrium while the light is on.

That is the entire premise of this simulator, and it is very nearly the only thing I let you control. You set the light: how bright, from what direction, whether it cycles through a day, whether it fades to nothing over a million ticks. You set what is dissolved in the water at the start, and where the walls are. Then you stop.

Everything after that has to pay for itself out of the flow.

Matter is finite

There are nineteen chemicals in the water and a fixed amount of each. Diffusion and currents are computed as fluxes, so the quantity taken out of one square is exactly the quantity added to its neighbour — conservation is a property of the arithmetic rather than something corrected afterwards.

Over a million ticks of hard stirring, the totals drift by zero. Not within a small epsilon. Zero.

So every cell is built out of atoms that were already in the jar, and when it dies they go back. A world has a carrying capacity because there is a literal, countable amount of body available and no way whatsoever to make more of it.

Left alone, that arrangement runs down. Cells burn substrate for energy and leave waste behind; the waste accumulates; everything stops. What prevents it is the light, which lets a chloroplast turn waste back into substrate. Light in, heat out, and the same matter going round and round in between.

lightheatCHLOROPLASTwaste + light → substrateMITOCHONDRIONsubstrate → energy + wastesubstratewasteconserved exactly — every reaction is balanced and reports itself
Matter goes round the loop and never leaves it — the totals are checked to the exact integer. Energy passes through once: in as light, out as heat. A cell is a dissipative structure, not a battery.

For a long time that was true with one apology attached, and the apology was in the ledger: matter deliberately removed from the world, per chemical, and only barriers do this. Draw a wall over a square and what was dissolved in it was gone. It has been that way since the chemistry was built.

It is not any more. A wall raised over mineral keeps it, as solid — which makes rock a fifth place matter can be rather than an exit from the accounts, and rock that dissolves back into water short of that mineral is the way out again. The ledger has no leak left in it. That mattered more than it sounds: the whole claim on this page is exactness, and an exception with a paragraph of explanation attached is how exactness stops being worth claiming.

A sealed jar is the default and it is not the only option. A scenario can put a source somewhere on the slide — a vent pushing sulphide into the water, a channel carrying detritus in at one end — and where it does, it has to put a drain somewhere too. A source without a drain is not an open system, it is a slow flood: the totals climb until they hit the ceiling and then the world is full of one thing. The accounting is exact either way. What you are choosing is the boundary condition, and closed is simply the one worth starting from.

Order is what the flow leaves behind

Here is the part I find genuinely interesting.

A system with energy running through it does not stay smooth. It organises. You can see it in the convection cells in a heated pan and in the stripes on Jupiter, neither of which is alive and neither of which was designed. Structure appears because structure dissipates the gradient faster than smoothness does, and whatever dissipates faster tends to persist.

Life is what that looks like when the structure can also copy itself.

Which means there is no contradiction between evolution and the second law, and that is the objection people reach for first. Local entropy falls wherever matter gets organised into a cell. Total entropy rises anyway, because the heat leaving pays for it with change to spare. The order is not free. It is bought, and you can watch the bill.

And you can actually watch the bill

This is why the accounting has to be exact. Not because I enjoy integer arithmetic, but because a free-energy curve computed from approximate bookkeeping measures nothing at all.

first self-replicationspatial entropy of the fieldfree-energy dissipation per tickticks
The shape of the claim: where life takes hold, the spatial entropy of the chemical field falls — matter is being sorted into bodies — while free-energy dissipation rises to pay for it. Both are instrumented and plotted live, and both export as JSON. This figure is drawn to scale but is illustrative; it is not a capture from a particular run.

Four things are instrumented and plotted live while a world runs: free-energy dissipation per tick, which is what the world is spending to stay organised; the spatial entropy of the chemical field, which you should expect to fall where life takes hold; how much genomic information has accumulated in the population; and the distribution of organisational complexity across the things that are currently alive.

All four export as newline-delimited JSON, because the interesting output of this project is knowing which parameters matter, and that is not something you find out by looking at a pretty picture.

Nothing in the code knows what a predator is

The other half of what I am looking for is emergence, which is a word that gets used loosely, so here is exactly what I mean by it.

There is no predator flag. There is no organism type, no species field, no virus class, no multicellularity mode. Those are all words for patterns — things I noticed afterwards and gave names to.

  • A parasite is a cell that writes bytes into another cell's nucleus. Writing to your own nucleus and writing to your neighbour's are the same instruction with a different argument.
  • An organism is a connected component of cells joined by junctions. Nothing anywhere tracks it as an object.
  • A species is a lineage whose genome has drifted past a threshold from its founder.
  • A muscle is a cell that modulates the rest length of its junctions.

If I ever find myself adding a flag for one of these, I have stopped observing emergence and started asserting it, and the run stops being evidence of anything.

The hardest case is kin. An armed cell that cannot tell its own daughters from prey kills them, and the obvious fix — a kin check in the engine — is exactly the flag that would ruin it. So instead a cell can wear a badge: fifteen bits that anything touching it can read, that cost nothing to forge, and that the engine does nothing whatsoever with. What a badge means is a genome’s opinion, which leaves room for mimicry and for the arms race that makes recognition worth having.

Which is why there is no score

Most evolution simulators have a fitness function somewhere — a number saying how good a creature is, and a mechanism that keeps the ones scoring highly. What you get back is a very efficient answer to the question you asked.

There is no such number here and there never will be, because a fitness function is order injected from outside the system. The whole question is whether order arises from the energy flow on its own. Putting a score in would contaminate the experiment I am trying to run.

What is left is not a rule at all. A cell that spends more energy than it collects dies. A cell that copies itself faster than its neighbours becomes more of the population. That is the entire selection mechanism, and nothing in the code implements it — it falls out of matter being finite and energy having to come from somewhere.

So chemotaxis appears because cells that swim toward food leave more descendants than cells that do not. Multicellularity appears because clonal cells can stick together nearly for free. Both of those took me years to get right, and neither is written down anywhere as a goal.

That is what I am looking for. The rest of this site is the machinery that makes it hold up — the mechanisms, the worlds and the language a cell is written in.