Skip to content

Deterministic replay

Collimate can make an exec reproducible: run the same command on the same template with the same seed and you get the same result. This matters for RL — you want a graded rollout you can re-grade, debug, or replay — and for any workload where "run it again and get the same thing" is a requirement.

Bit-exact determinism (same seed, identical output) applies to replay-enabled templates and runtimes. On any template you always get the echoed seed and the seed_ack verdict, which tells you exactly whether the run is reproducible.

Every exec can pin the guest's cryptographic RNG with a seed — 32 bytes as 64 hex characters:

{
"code": "import random; print(random.random())",
"seed": "c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00"
}

Omit seed and the sandbox draws fresh entropy. Either way, the seed actually used is echoed back in the response:

{
"stdout": "0.844421851525…\n",
"exit_code": 0,
"seed": "c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00c0ffee00",
"seed_ack": "verified"
}

So even a rollout you ran with seed=None is replayable — persist response.seed and re-send it later to reproduce the run.

seed_ack reports whether the guest actually reseeded its CRNG with your seed — this is the difference between "we asked for determinism" and "we confirmed it":

seed_ackMeaning
verifiedThe guest reseeded and confirmed it; the run is reproducible.
no-ackThe template supports the handshake but didn't confirm this run.
offThe template doesn't advertise the seed-ack handshake.
(mismatch)The reseed or its checksum failed — treat the run as non-reproducible.
from collimate_rl import connect, rollout_once
client = connect() # reads COLLIMATE_API_KEY
# First run — capture the seed.
r1 = rollout_once("python", code="import random; print(random.random())",
client=client)
# Later — replay it bit-for-bit.
r2 = rollout_once("python", code="import random; print(random.random())",
seed=r1.seed, client=client)
assert r1.stdout == r2.stdout