Chronos/DBWaitlist

Worlds

Simulations

Fork hundreds of worlds from one moment, run a script in each, score them and keep the best.

SoonThese pages describe Chronos Cloud, which opens from the waitlist. Running Chronos yourself? Self-host docs

SIMULATE

A simulation tries many variations at once. It forks n worlds from one moment, runs the same SQL script in each in parallel, scores each with a query, keeps the best and discards the rest. Forks are instant, so a thousand worlds of a real database cost what they change.

syntax
SIMULATE n WORLDS [FROM base] AS prefix  RUN 'script'  SCORE 'select ...'  [ASC | DESC] [KEEP k | KEEP ALL] [SEED s] [THREADS t]
which price change earns most, on last month's orders?
simulate 1000 worlds from main as trial  run $$update prices set p = p * (0.9 + random() * 0.2) where sku % 100 = $1 % 100$$  score $$select sum(p * sold) from prices$$  keep 10 seed 42;

Its parts

PartDefaultMeaning
FROM basethe session’s worlda world, or 'name@when'
RUNrequiredany statements. $1 is the world’s index, $2 its seed. It can’t fork, merge, restore, switch or drop worlds, or change settings (0A000)
SCORErequiredone SELECT whose first value is a number
DESC / ASCDESChighest score first, or lowest
KEEPALLworlds kept, best first; the rest are discarded
SEED0seeds random() and gen_random_uuid() with the world’s index
THREADSevery free core

Strings can be dollar-quoted ($$…$$, $tag$…$tag$). Script and score together are at most 32 KB. KEEP k needs room for k + 1 worlds at once under the plan’s open-world limit; KEEP ALL needs n.

Results

ColumnMeaning
world, idthe world (prefix_i)
index, seed$1 and $2
scorenull if it failed
errorthe failure, with its SQLSTATE
keptwhether the world was kept

Rows are best first, failed worlds last. Kept worlds hold their inputs in metadata sim (seed, index, script, score query, score, base and moment), so you can read them, diff them, and merge the winner like any world.

Repeatable by design

  • Each world’s random numbers come from the simulation’s seed and the world’s index, and its clock stands at the base moment: the same simulation gives the same worlds on any machine and any number of threads.
  • serial numbers are the exception: they come from the database’s shared counters, so they differ between runs.

REPLAY WORLD

syntax
REPLAY WORLD world [AS name]

Forks a kept world’s base as it was then, runs its script and score again with the same index and seed, and compares: identical, rows_differing, score now and recorded_score then. The replay is dropped unless AS name keeps it. It needs history back to the simulation’s moment. MCP: simulate, replay.

What it’s for

  • Pricing and allocation: try many parameter choices on real data and keep the best.
  • Agent evaluation: run a candidate prompt’s SQL in many worlds and score the outcomes against a query.
  • Migrations: run a migration in a few worlds of last week’s data and check every one passes the merge checks.
Simulations · Chronos