Skip to main content
A world declares supported time models in its manifest; a session runs in exactly one. [AWP-TIM-001]

Lockstep

In lockstep the world is paused between advances and time moves only when told to. v0.1 defines exactly one advancement policy, on_tick: the world advances only in response to world.tick. Accepting an action never advances time by itself. A per-tick channel is an observation channel granted with rate_hz: null in a lockstep session: it delivers a frame per advance rather than at a rate.
  • A lockstep world MUST declare tick_policy: "on_tick" and MUST advance only in response to world.tick. [AWP-TIM-002]
  • After each advance, the world MUST send every action.status and world.event produced by the advance on the control channel before the world.tick result, and MUST send exactly one frame carrying the advance’s tick on every subscribed per-tick channel, before accepting the next advance. The agent MUST treat the advance as complete only when it holds the result and, on every subscribed per-tick channel, a frame whose tick equals the result’s; on the inline binding those frames precede the result. [AWP-TIM-003]
  • Wall-clock time MUST NOT influence world state in lockstep mode (determinism requirement; see reproducibility). [AWP-TIM-004]
  • Session clock. In lockstep the session clock is simulated time: it MUST advance only with advances, by the same positive amount for every advance, and MUST NOT move between them. Everything produced by an advance carries the clock value of the tick it produces, and anything the world stamps between advances (admission results, pongs, session state) carries the current tick’s value. Timing bounds on the session clock — deadline_ms, valid_until_ns, max_basis_age_ms, max_action_rate_hz, approval_timeout_ms — therefore measure simulated time. The clock counts advances; it is not the tick. tick is world state that world.reset and world.restore may move, even backward, while the session clock only moves forward (AWP-CLK-001); a world whose tick has so diverged from its session clock carries the tick’s simulated time in ts_sim_ns (AWP-CLK-003). [AWP-TIM-013]
  • Initial observations. Immediately after session.ready, and after every obs.subscribe, the world MUST send one frame carrying the current tick on each newly subscribed per-tick channel; after session.resume it MUST send, once the replay is sent, a resync keyframe carrying the current tick on every subscribed per-tick channel (AWP-TRN-008), which also completes an advance whose frames the agent did not receive (AWP-TIM-003), and the agent waits for it before acting, so the agent always observes before it acts. [AWP-TIM-009]
  • Staging. action.submit in lockstep is admitted immediately (AWP-LIF-002) and the action is staged: the world MUST NOT begin executing it before the next advance, and MUST transition it to executing at the start of that advance so its first effects appear in the advance’s frames. Cancelling a staged action before the advance has no side effects. [AWP-TIM-010]
  • Advances. world.tick { expected_tick, count } performs count sequential advances (default 1) from expected_tick, which MUST equal the world’s current tick; otherwise the call fails with AWP_TICK_MISMATCH carrying the current tick in data.tick and nothing advances, so a call retried after a lost result cannot advance twice. Each advance delivers its frames, statuses, and events as in AWP-TIM-003 before the next begins; the result { tick } is sent after the last. Extended actions spanning several ticks report progress on each advance. [AWP-TIM-011]
  • Tick authority. The manifest declares tick_authority: any_session (the default for worlds that admit one lockstep session at a time) or barrier (the default when several lockstep sessions may be bound: the world advances once every bound, non-observer lockstep session has called world.tick for the current tick, delivering the same advance to all). Under barrier, every bound non-observer lockstep session has tick authority without any admin grant, because its call advances nothing on its own. Under any_session, one call advances every bound session, so on a world that may bind more than one lockstep session world.tick requires the tick admin grant (AWP-MA-005); on a world that binds one lockstep session at a time, that session has tick authority without the grant. world.tick from a session that lacks authority — an observer session, or a session without a required grant — MUST fail with AWP_TICK_NOT_AUTHORIZED. Sessions other than the caller learn of an advance through the advance itself: its statuses, events, and per-tick frames (AWP-TIM-003). [AWP-TIM-012]
  • Barrier calls. Under barrier, a world.tick records that its session is ready for count advances. The world advances while every bound non-observer lockstep session has advances left, delivering each advance as in AWP-TIM-003, and sends each call’s result after its last advance. Bound sessions include suspended ones, so the world waits for a session whose connection is lost until it resumes and calls again, or its reconnect window expires and it closes. A session has at most one pending call: another world.tick from it fails with AWP_BUSY. A pending call ends without advancing if:
    • its connection is lost, and nothing is answered;
    • world.reset or world.restore moves the tick: the call fails with AWP_TICK_MISMATCH carrying the new tick in data.tick;
    • its session closes, failing with AWP_SESSION_EXPIRED, or becomes an observer session (AWP-EMB-003), failing with AWP_TICK_NOT_AUTHORIZED.
    A session that leaves the barrier no longer holds it back, and a session bound while others wait joins it. [AWP-TIM-014]

Wire trace

A complete lockstep exchange for one action on a single-session on_tick world. Heartbeats and id values are elided.
The agent-side loop is therefore observe → submit → tick → read statuses/frames, never submit → await completion alone: without a tick the world never advances and a completion never arrives.

Streaming

  • The world advances in real time regardless of agent activity. Observation frames are pushed at negotiated rates, each carrying its capture time ts_mono_ns and its send time ts_send_ns (AWP-OBS-006); the agent relates them to its own clock through the heartbeat exchange (AWP-CLK-006..009). [AWP-TIM-005]
  • Telemetry. In streaming sessions the world MUST send a session.telemetry notification at least once per second aggregating, over the preceding window, the quantities defined in Latency and staleness: pipeline latency overall and per channel, admission latency, observation-to-action latency, and command latency, each present whenever at least one sample fell in the window. [AWP-TIM-006]
  • Worlds MUST declare safety_policy.safe_state (behavior and watchdog_ms) and enforce it as specified in Liveness and safe state (AWP-SAF-003..008); worlds MAY declare safety_policy.max_basis_age_ms and then enforce stale-intent rejection (AWP-SAF-013). [AWP-TIM-007]

Wire trace

One observation→action cycle on a streaming session over the inline binding. Heartbeats other than the synchronization sample, id values, and the jsonrpc field are elided.

Declaration

Worlds offering both models MUST implement identical manifests, schemas, and action lifecycles across them; only advancement and delivery semantics may differ. [AWP-TIM-008]