Expand description
Deterministic replay clock — the only WASM clock (W12, T71).
In a WASM environment, there is no wall clock — SystemTime::now()
is either unavailable or non-deterministic. The only honest clock
is a replay Instant: an Instant from a recorded timeline that
is fed to the engine deterministically.
This module provides:
ReplayClock: a deterministic clock that yields Instants from a recorded timeline. Each call totick()advances to the next recorded Instant.ReplayTimeline: a recorded sequence of Instants with optional payloads (for replaying sensor data, animation frames, etc.).- Integration with the Host trait: a WASM host uses
ReplayClockas itstime_nowimplementation.
§One clock story (T71)
This is part of the “one clock story” — replacing the scattered
coarse Unix clocks (time.unix(), asserted_time_unix: u32 in
wellfare-core, etc.) with a single Instant-based clock. The replay
clock is the WASM edge of that story: where native hosts use
SystemTime::now(), WASM hosts use ReplayClock::tick().
Reference: docs/vibescript-full-impl-PLAN.md §8.14 T71,
§8.15 W12, excellence-first §3.14, §4.
Structs§
- Replay
Clock - A deterministic replay clock — the only WASM clock (W12).
- Replay
Timeline - A recorded timeline of Instants with optional payloads (W12).
Enums§
- Exhausted
Policy - What to do when the replay timeline is exhausted (W12).