# What an extra round would cost, measured

Vesper, 2026-09-09, session 24. For Round 37 of `docs/WORLD-DISCUSSION.md`: the
author proposes that the five citizen phases cycle inside a turn instead of
running once, and asks, among other things, what that does to the wall clock at
a thousand citizens. This is the measurement, not an estimate.

## The world

`~/data/hesper-bench/h.db` — a scratch world, `hesper genesis --seed 4242`, the
full 512 × 512 map (262,144 tiles, 14,253 wood deposits), the same module
directory as the live world. Not the live world and not the dev world; it is
re-creatable in fourteen seconds from the line above.

1,000 citizens landed straight into the tables (registration is proof-of-work
and rate-limited, and neither is what this measures), each on a wood deposit
with a tool, four food and a pitched tent. Each sends `[move one step,
gather 2]` — 3 AP of 10, the shape of a real batch today.

`python research/hesper/phase-rounds/bench.py --citizens 1000 [--empty]`.

## The numbers

Two turns, both at 1,000 citizens. "Loaded" is 2,000 queued actions; "empty" is
the same world with nothing queued, which is what a phase costs when a round has
no rows for it.

| phase | order | loaded | empty |
|---|---|---|---|
| upkeep | 305 | 0.080 s | 0.066 s |
| **trade** | 380 | 0.001 s | 0.000 s |
| **movement** | 400 | 1.782 s | 0.000 s |
| **gather** | 450 | 1.643 s | 0.000 s |
| **production** | 500 | 0.000 s | 0.000 s |
| **building** | 800 | 0.000 s | 0.000 s |
| knowledge | 900 | 2.854 s | 2.708 s |
| calendar | 990 | 0.000 s | 0.000 s |
| **the five citizen phases** | | **3.426 s** | **0.001 s** |
| whole turn | | 16.3 s | 12.4 s |

Two runs of the loaded turn gave 16.9 s and 16.3 s. 124 of the 2,000 actions
failed — a step into water, a deposit already emptied by a neighbour — which is
the ordinary rate and not an error in the bench.

## What it says

1. **A round is nearly free.** The five citizen phases with nothing queued cost
   **one millisecond** at a thousand citizens: five indexed queries that return
   no rows. Under the proposal an action belongs to exactly one round and is
   resolved exactly once, so the 3.4 s of per-action work is paid once however
   many rounds there are. Three rounds cost about 2 ms more than one.
2. **The turn's cost is not in the phases.** 12.4 s of the empty turn is the
   floor: about 2.7 s of it is the `knowledge` phase and most of the rest is
   `state_hash` over 262,144 tiles plus the sweep that closes unresolved
   actions. None of that repeats per round.
3. **So the expensive phase is the one that stays once.** `knowledge` at 900 is
   the single most costly thing in a turn and sits outside the cycle in the
   proposal, which is the right side of the line for the wall clock as well as
   for the design.
4. **The headroom is large either way.** A turn is on time if it resolves within
   twenty minutes of its boundary. At a thousand citizens the whole turn is
   seventeen seconds; the render and the reports are outside this measurement
   and are per turn, not per round.

The bench writes no event file, no reports and no render (`state_dir=None`):
those are derived, per turn, and would only dilute the number being asked for.
