THREE.JS / FOUNDATIONS 211

Keep the inputs.

A checkpoint is only useful when the inputs after it can be replayed. This worker owns a fixed-tick command log, restores a checkpoint, and re-applies the same events to prove the resulting world bytes match.

Initializing Preparing worker

Creating the main-thread scene while the worker loads deterministic Rapier...

physics
-
bodies
-
checkpoint
-
transfer
-
events
-
replay
-
step ms
-
fps
-
Input-log controlsbox #1

The worker is loading deterministic Rapier. Once ready, the selected index will address one fixed-tick body command.

Authoritative input contracttick before solver step
event.tick = simulationStep + 1schedule the next fixed tick
world.step()apply queued inputs before stepping
world.takeSnapshot()capture a checkpoint payload
World.restoreSnapshot(bytes)rebuild the worker world
replay(events, from, to)replay only post-checkpoint inputs
postMessage(bytes, [buffer])transfer checkpoint state

The log records semantic commands with fixed ticks, not rendered frames. Replay restores the checkpoint, replays events through the original target tick, and compares the resulting serialized world bytes with the uninterrupted branch.

Selected bodypending
group-
index-
body slot-
position-
velocity-

The worker is loading deterministic Rapier. Restored body order will remain mapped to these instance slots.

Based on the official Three.js worker guidance, Rapier serialization guide, determinism guide, World API, and InstancedMesh docs. Measurements are local browser evidence, not a universal rollback or networking claim.

THREE.JS FOUNDATIONS LAB