[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 toworld.tick.[AWP-TIM-002] -
After each advance, the world MUST send every
action.statusandworld.eventproduced by the advance on the control channel before theworld.tickresult, and MUST send exactly one frame carrying the advance’stickon 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 whosetickequals 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.tickis world state thatworld.resetandworld.restoremay 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 ints_sim_ns(AWP-CLK-003).[AWP-TIM-013] -
Initial observations. Immediately after
session.ready, and after everyobs.subscribe, the world MUST send one frame carrying the current tick on each newly subscribed per-tick channel; aftersession.resumeit 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.submitin 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 toexecutingat 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 }performscountsequential advances (default 1) fromexpected_tick, which MUST equal the world’s current tick; otherwise the call fails withAWP_TICK_MISMATCHcarrying the current tick indata.tickand 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) orbarrier(the default when several lockstep sessions may be bound: the world advances once every bound, non-observer lockstep session has calledworld.tickfor the current tick, delivering the same advance to all). Underbarrier, every bound non-observer lockstep session has tick authority without any admin grant, because its call advances nothing on its own. Underany_session, one call advances every bound session, so on a world that may bind more than one lockstep sessionworld.tickrequires thetickadmin grant (AWP-MA-005); on a world that binds one lockstep session at a time, that session has tick authority without the grant.world.tickfrom a session that lacks authority — an observer session, or a session without a required grant — MUST fail withAWP_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, aworld.tickrecords that its session is ready forcountadvances. 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: anotherworld.tickfrom it fails withAWP_BUSY. A pending call ends without advancing if:- its connection is lost, and nothing is answered;
world.resetorworld.restoremoves the tick: the call fails withAWP_TICK_MISMATCHcarrying the new tick indata.tick;- its session closes, failing with
AWP_SESSION_EXPIRED, or becomes an observer session (AWP-EMB-003), failing withAWP_TICK_NOT_AUTHORIZED.
[AWP-TIM-014]
Wire trace
A complete lockstep exchange for one action on a single-sessionon_tick world. Heartbeats and id values are elided.
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_nsand its send timets_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.telemetrynotification 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 andwatchdog_ms) and enforce it as specified in Liveness and safe state (AWP-SAF-003..008); worlds MAY declaresafety_policy.max_basis_age_msand 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]