T-065: Fill a world with grown bodies from genome files
Goal
Genomes grow into bodies (T-010), but only inside the growth lab. No command puts grown
bodies into a world that runner can run and the viewer can open. Every ticket that needs
real bodies in a real world is waiting for that: the look (T-015), the atlas (T-054), the
physics review (T-009), the gait lab (T-016), and Evan, who wants to see them.
Make it one command to start a run from any set of genomes.
Scope
runner runcan start a world from genomes: files (the TOML the growth lab reads and writes), a folder of them, random genomes from a seed, mutants of a given genome, or a mix, with a count for each. The bodies incrates/sim/src/genome/zoo.rsare one source among others, not a special case.- Placement is general: scattered through the water or resting on the floor, without overlaps, for bodies from one cell to tens of thousands.
- The world starts as eggs that grow, or as bodies already grown, by choice. Growing in the world must use the sim's own development stage and pay for cells the normal way.
- This is a testbed, like
--soup. Say so wherever it shows, and state plainly what it does to conservation: where the starting matter and energy come from. - It must not become the way real worlds are founded. That decision belongs to T-018.
- The run opens in the viewer natively and on the web, and can be published with
scripts/publish-run.sh.
Done when
- ☐ A run started from a mix of hand-written, random and mutant genomes grows, runs
100,000 steps and resumes exactly after
kill -9, like any run. - ☐ Bodies nobody planned: a run of 500 random genomes. Report how many grew, how many could not be placed and why.
- ☐ Screenshots from the native viewer in
docs/media/T-065/, and the same run published to a preview of the runs site, opened in Chrome and in Safari's engine. - ☐
docs/RUNS.mdexplains the command. - ☐
scripts/perf.sh --checkshows no slowdown, and a world file for a genome-grown world is added todocs/perf/worlds/so the benchmark suite has real bodies in it.
Notes
- The physics is still a placeholder until T-009 merges. Bodies will jiggle and thin ones will fold. That is expected.
- Other agents are working in
crates/sim/src/physics/,metabolism/andlineage/, and T-019 is editingcrates/runner/src/run.rsarounddrain_world_logs. Keep changes there small.
Result
Branch t-065-worlds-from-genomes. Built by an agent on 2026-12-02.
What works
runner run --genomes SPEC (repeatable) starts a run from any set of genomes:
FILE.toml (the growth lab's format), a folder of them, random=N, zoo / zoo:NAME,
and mutant:SOURCE=N, mixed freely, with a count each. Options: --grown (bodies already
grown, default eggs that grow through the development stage and pay for each cell),
--place water|floor, --orient random|upright, --provision F, --mutations N,
--tries N, --gap D, --fill F. Guide: docs/RUNS.md, "A world from genomes".
- The sim side is
sim::testbed::genomes(crates/sim/src/testbed/genomes.rs): it grows each genome's plan with no world (Embryo), turned the way it will face, gives each egg exactly what its plan costs (plus the worst-case f32 rounding of paying for that many cells), and places bodies largest first at the first of--triesrandom spots where every cell is inside the box, above the floor and--gapclear of every other body's cells. Nothing assumes a shape: 1 cell and 65,535 cells go through the same test. develop::spawn_grown(new, besidespawn_egg) puts an already grown body in a world. Tested: a grown body is cell for cell the body plan its egg grows into.- It is labelled a testbed everywhere it shows: the terminal,
run.toml([start] kind = "genomes", withmatter_createdandenergy_created),runner info,run.json(testbed: true) and the runs list's start text. Paths are cut to file names in anything published. seeded.tsvin the run folder: every organism asked for, its plan, what was created for it, whether it was placed and why not.crates/runner/examples/grew.rs: joinsseeded.tsvwith any checkpoint byuidand says how many bodies are whole, still growing, stopped short or gone, and how many planned bonds exist. Writesgrew.tsv.docs/perf/worlds/genomes-grown.toml: 178 grown real bodies, 30,490 cells, in the benchmark suite (kind = "genomes"is a new start kind for world files).
Done-when checks
Mix, 100,000 steps, kill -9. `--genomes zoo --genomes random=100 --genomes
mutant:zoo=2 --seed 7 --set develop.max_cells=3000`, eggs: 137 of 145 placed (8 larger
than the world), 27,997 cells when grown. Run once straight through and once killed with
kill -9 at steps 7,402, 24,079 and 36,506 and resumed: both ended at step 100,000 with
state hash a10ce2169c2b5d98 and identical logs/stats.tsv. All 137 grew their whole
planned body. The automated version is genome_world_killed_while_growing_resumes_exactly
in crates/runner/tests/runs.rs (60 kills while the eggs grow, same world and logs).
500 random genomes, default world 128 x 64 x 128, seed 1, eggs, no cell cap, run to step 1,300 (the slowest placed plan takes 1,164 steps):
| organisms | |
|---|---|
| placed, grew the whole planned body | 481 |
| placed, stopped short, still growing or gone | 0 |
| not placed: larger than the world | 9 |
| not placed: no free spot in 200 tries | 10 |
- Placed bodies: 192 one cell, 192 of 2 to 10 cells, 66 of 11 to 100, 20 of 101 to 1,000, 11 over 1,000 (largest 43,671). Median 2 cells. 142,216 cells in all.
- Larger than the world: bodies 82 to 362 units across in some direction. Four are genomes that never stop growing (stopped at 65,535 cells); two have only 17 and 18 cells but cells so large and far apart that they are 67 and 82 units tall.
- No free spot: bodies 25 to 50 units across, placed after the larger ones, in a world 64
tall whose floor takes some of that height. A bigger world (
--set world.size=...or--fill) places them. - Building the world takes about 5 seconds on 4 threads, almost all of it growing the plans of the four genomes that never stop.
Screenshots (native viewer, offscreen), docs/media/T-065/:
show-overview.png and show-close.png (grown zoo, zoo mutants and 60 random genomes),
floor.png (upright on the floor), eggs-step-0.png and eggs-step-1000.png (the mix
above, as eggs and grown), web-chrome.png, web-webkit.png.
Published to a preview: t-065.alife-runs.pages.dev , run t065-genomes
(runs/t065-show, grown, 83 organisms, 10,196 cells, 3 checkpoints to step 3,000).
Opens at alife-kz9.pages.dev/?run=t065-genomes&runs=https%3A%2F%2Ft-065.alife-runs.pages.dev%2F ,
which forwards to the kept viewer for its format. Chrome (webfps.mjs): 60 fps, world
running at 30 steps/s, no console errors. Safari's engine (webkit-probe.sh, iPhone
profile): drawing, 59.7 fps, verdict smooth. The web viewer was not rebuilt: the
checkpoint's format (5f45f6556b099107) matches a viewer the store already keeps, and
target/web was pointed at a copy of it for the publish.
docs/RUNS.md explains the command.
scripts/perf.sh --check: every existing world same, exit 0 (table in the report).
The new world is "new" (main cannot build it); compared with itself it gives 36 steps/s
on 1 thread and 91 on 4.
What is worse than hoped
- Real bodies are far slower per cell than the soup. The genome world runs at about 0.9 µs per cell per step on one thread, against 0.12 µs for the soup: 7 times. Four threads give only 2.5 times, because a few 3,000-cell bodies are each stepped by one thread. One 65,535-cell body stops a world: 1.8 steps/s on any thread count, and the 500-random world ran at 1 step/s. The profile is all in the placeholder physics' per-organism closure. Likely causes: the closure handles one organism on one thread, and dense bodies of small cells put hundreds of cells in each 2-unit index cell. This is T-009's to judge.
- Eggs growing in the placeholder water miss many planned bonds: 79% made in the mix,
54% in the 500 (almost all in the two 43,000-cell lumps). By the time a cell is born,
its planned neighbours have been pushed beyond
develop.bond_stretch. That is the limitdocs/GENOME.mdsection 3 describes.--grownbodies have every bond. For looking at bodies before T-009, prefer--grown. - The viewer draws no sea floor, so
floor.pngcannot show the bodies touching it. The placement test checks it. - The mutants are
mutate_oncesteps, notGenome::mutateat the genome's own rates, so that every mutant differs. A run that wants "what copying does" would need a flag.
Merged (orchestrator, 2026-12-02)
Merged into main at 8c625f5. Tests, lint and the memory-safety check ran on the merged tree.
My own review, with bodies nobody listed: the three genomes in docs/media/T-010/review/
(comb, nested, urchin), four mutants of each and 40 random genomes, started as eggs on the
floor, upright, with twice the provision. 55 of 55 placed, 16,048 cells at step 600, and the
checkpoint is byte for byte the same on 1 and 4 threads. A world of 6 units placed the 12
bodies that fit and reported the other 21 by reason. A missing file, mutant:random and a
count of 0 each give a clear message and no world.
Published to production as first-bodies: alife-kz9.pages.dev/?run=first-bodies
(71 bodies, 10,597 cells, states at steps 0, 750, 1500, 2250 and 3000; &step=0 opens the
eggs and they grow in the browser). 60 fps in Chrome, 59 in Safari's engine as an iPhone,
42 with the processor slowed four times. Pictures: docs/media/T-065/merge-*.png.
Two things to know:
- A mutant can have its parent's genome hash (
nested mutant 0in my run). One mutation event does not always change the genome, so "every mutant differs from its parent" is not exact. - The speed findings (one body on one thread, real bodies 7 times dearer per cell than the
soup) are in
docs/perf/IDEAS.mdand in T-066.