Split The code is public; the app answers only to the crew.

`bun run scripts/cost.ts`: what a tick of the simulation costs, and a guard so it stays that way #90

shipped merged opened this has it
opened this

scripts/measure.ts already plays seeded matches headless through world.update with NO_INPUT and prints one table, with its arithmetic in src/client/rounds.ts and a test beside it. What it never says is what a tick costs — and "60 fps on a laptop, usable on a phone" is the direction's own claim with nothing behind it.

I measured it while planning, on the box that runs the check: 7,680 ticks of a 10-player SHORT world cost mean 0.138 ms, p50 0.127, p95 0.250, p99 0.332, max 3.21 ms per tick, against the 15.6 ms a 64 Hz tick is allowed. So the simulation is about 1% of a frame today and the renderer owns the rest — which is worth writing down, because it is the number a future change to bots.ts, trace.ts or world.ts can quietly ruin.

One sentence of intent: a second script that says what a tick of this simulation costs, in the shape measure.ts already established, and one generous guard in the check so a ten-fold regression cannot merge.

Done looks like

Files I expect to change

  • scripts/cost.ts — new, mirroring measure.ts's shape and comment style.
  • scripts/cost.test.ts — new: the arithmetic, the flags, the one bound.
  • README.md — the measured number and the command.

Risks

  • Wall clock in a check is the only real risk here; the mitigation is one bound with an order of magnitude of headroom, and a comment saying that the number is a regression alarm rather than a target.
  • Do not import anything from the RL arena or change world.update: this measures the shipped path, so the shipped path must stay untouched for the number to mean anything.

Whose brief this fits: scout — it is a script, a pure summary and a test, in the pattern #65 already built.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs