Module replay

Source
Expand description

Bounded deterministic replay timelines. Games own checkpoint/input semantics; the timeline owns fixed ticks, accepted events, hashes, seeking and byte limits.

Structs§

EventInput
EventIter
Header
Limits
Playback
Immutable shared tape plus a cursor. Seeking restores the nearest earlier checkpoint once, then advances at most the caller’s work budget per pump. Verification stops at the first divergence. A seek verifies only the restored checkpoint and subsequent steps; start from the beginning to check every tick.
Recorder
All metadata and byte buffers reserve their budgets at start. A rejected tick changes no buffers; reaching a limit leaves the complete prefix exportable.
Recording
ReplayMismatch
The first divergence observed since starting, seeking, or resetting playback.

Enums§

PlaybackError
PlaybackStatus
Cursor state; a failed verification is never reported as Self::Finished.
ReplayChecksum
Which values disagree in a ReplayMismatch.
ReplayError

Constants§

MAX_CHECKPOINTS
MAX_EVENTS
MAX_EVENT_BYTES
MAX_FILE_BYTES
MAX_INPUT_BYTES
MAX_STATE_BYTES
MAX_TICKS

Traits§

ReplayWorld
Restore must stage/validate before replacing the game. Step applies recorded inputs exactly once; expected events are for comparison/presentation, not a second application of already simulated authoritative damage.

Functions§

derive_seed
Stateless deterministic seed derivation for a tick/channel, independent of render cadence and unrelated systems consuming random values.
input_checksum
Stable FNV-1a checksum of input bytes, including empty input. This is a diagnostic checksum, not a cryptographic integrity check.