Skip to content

build_action_restarts ​

python
build_action_restarts(path: TrajectoryRepositoryPath, environment: SnapshotEnvironment) -> dict[int, tuple[bytes, bytes]]

Replay a stored route and mint a restart at EVERY action offset, not only at segment boundaries.

The backward curriculum's rung is whatever restart density it is given. Segment-boundary restarts make the rung a whole marker gap -- 22 precise actions at the cavern-15 wall, which pure PPO never crossed across three grids and two pulse designs. Salimans & Chen moved their start point back a few FRAMES at a time; this is that. The emulator is deterministic, so replaying the route and snapshotting after each action mints a restart at any offset for free.

Offset k is the state after executing actions [0, k); offset 0 is the route's initial state. Each entry carries the observation frame stack at that offset, so a restart is not blind to motion.

Derived state, rebuilt rather than checkpointed (a snapshot is ~130-235KB and a route has hundreds of actions, so ~30-70MB per route in memory but far too much for every checkpoint).

Parameters:

  • path (TrajectoryRepositoryPath) – The stored route to replay.
  • environment (SnapshotEnvironment) – A single environment to replay through. Left at the end of the route.

Returns:

  • dict[int, tuple[bytes, bytes]] – Action offset -> (machine state, raw stacked-observation bytes) at that offset.

Source