T-051: Performance review 1: profile everything, plan the big wins
Goal
The first top-down look at speed, once a real breeding world exists. Find out where the time and memory go, how the sim scales, what stops worlds from being 10 or 100 times larger and runs from being 100 times longer, and whether the structure itself should change.
Evan, 2026-12-02: this is a permanent goal of the project, and big structural changes are
on the table. See "Speed is a feature" in docs/DESIGN.md section 12.
Scope
- Profile the real thing. Use checkpoints from a living world (long runs or tuning batches), not only synthetic benchmarks. Add any missing realistic world to the standard suite (T-050).
- Scaling curves, measured: steps per second against number of cells, and against threads from 1 to 12. Memory per cell. Checkpoint size and write time. Log growth per generation.
- What breaks first as worlds grow and runs lengthen: memory, cache behaviour, log and checkpoint size, identifiers running out, numerical trouble far from the origin, the cost of determinism, and anything else you find.
- Take the clear wins that are contained. Measure before and after each one.
- Write
docs/perf/ROADMAP.md: the structural options, ranked by gain against cost and risk, each with the measurement that suggests it. - Propose tickets for the structural changes worth doing, in your Result section, with the expected gain and what could go wrong.
Directions that might be worth considering. These are examples only. Do not treat them as a list to implement. Follow the measurements:
- Data layout and memory use per cell.
- Vector instructions.
- How work is split across cores.
- Updating still or slow things less often.
- A contact search that copes with very mixed cell sizes (see "Scale is free").
- Running physics on the graphics card.
- Splitting one world across machines.
- Design choices that shorten a generation.
Rules
- Determinism, the matter audit and checkpoint compatibility must survive. If a change alters results, say so and say why that is acceptable.
- No speed-up may break a principle in
CLAUDE.md. - The heavy computing is benchmark runs, not agent time. Start runs, read results, decide.
Done when
- ☐ The profile and the scaling curves are in
docs/perf/, with charts. - ☐ Each win taken has before and after numbers in the history (T-050).
- ☐
docs/perf/ROADMAP.mdexists and ranks the structural options. - ☐ The Result says plainly how large a world and how long a run this machine can manage today, and what the next factor of ten would take.
Added 2026-12-02: leads from the first merges
- Twelve threads give only about 5 times the speed of one at 100,000 cells (T-001 baseline). Six of the twelve cores are efficiency cores. Find out how much of the gap is the cores and how much is the code.
- All collected ideas are in
docs/perf/IDEAS.md. Judge them by measurement.