EvoLab · design charter · §4

The steploop

The first layer that is engineering, not biology: how one tick actually executes. It assembles the principles already locked in §2 and §3, grounded in how real cell simulators (PhysiCell / BioFVM) implement their main loop.

frame locked single-threaded grounded: PhysiCell
4.1

The tick is the slow clock

Cell decisions are the expensive part, so they run least often — the tick is the cell-decision cadence. Cheaper physics can iterate finer within a tick.

PhysiCell exploits the multiple time scales of a multicellular system by running three separate step sizes — diffusion fastest, mechanics medium, cell processes slowest — each on its own clock rather than every step. We borrow the structure, adapted to our solver:

4.2

One tick, seven phases

A fixed order, the same every tick, closing on the conservation check. Reading top to bottom is one tick; the loop repeats.

next tick 1 snapshot clusters connected components · engulf reads this 2 recompute light top-down, derived (no memory) 3 cells act  ·  reaction half shuffled · async · live: sense→GRN→effectors 4 mechanics  ↻ substepped swim/buoyancy/drag · springs · overlaps 5 field update  ·  diffusion half 1 implicit solve: 4 matter + 3 markers · POM sink 6 births & deaths newborns act next tick · deaths → POM 7 canary Σ matter = fixed totals · monitor, never renorm
Operator splitting: phase 3 applies cell exchange live (the reaction half); phase 5 is the single diffusion solve (the diffusion half). Phase 4 alone substeps.

Why this order

4.3

Structure & determinism

Two rules keep the loop conservation-safe and exactly reproducible.

Structural changes are queued

Bonds formed or broken, and new cells, take effect next tick — and the cluster snapshot (phase 1) is taken at tick start. This mirrors PhysiCell, which flags division and removal during the cell pass and processes those queues serially afterward to avoid corruption. It keeps the live act-phase from mutating the structure it is iterating over.

Multi-stream RNG

One master seed derives independent substreams — one for the shuffle, one for mutation (§5), one for movement noise. Same master seed reproduces a run bit-for-bit; changing the mutation rate never shifts the shuffle order, so an effect stays attributable to its cause. This generalizes §2.5's separate shuffle stream.

4.4

Performance & threading

Settled against the real runtime, by probing the actual artifact sandbox rather than assuming.

SINGLE-THREADED — CONFIRMED

Browser JS runs one thread per context, and the only CPU-parallel escape hatch is a Web Worker. Probes showed every standard Worker route (classic-blob, module-blob, data:) blocked by the sandbox CSP, and SharedArrayBuffer absent / not cross-origin-isolated. So the simulation logic is single-threaded. The asynchronous loop loses no parallelism we could have had.

Where speed actually comes from

Floor: everything must run correctly in plain single-threaded JS. WebGPU and WASM are detected at runtime and used only as graceful bonuses, since another device or browser may lack them.

log

Decisions & carry-ins

H5Engulf's colony-effective size — resolved: connected components computed once in phase 1, read all tick. H67-field + neighbour cost — resolved: spatial binning on the lattice (O(n)); WebGPU optional for the field solve. G4 / H4Newborn / death ordering — resolved: deaths leave the act order immediately (matter → POM); newborns instantiated in phase 6, act next tick. splitOperator splitting — reaction (cell exchange) applied live in phase 3; diffusion one implicit solve in phase 5. rngMulti-stream RNG locked — master seed → independent shuffle / mutation / noise streams. → §5Genome & mutation feed the mutation stream; must support recurrence / memory (H7) so small cells can run-and-tumble.