﻿# Gazebo multi_step: preserve pause semantics and observe completed iterations

Trace WorldControl pause handling, queued acknowledgement and pending iterations before using a Gazebo multi_step response as a state-snapshot barrier.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/simulation-gazebo-multi-step-pause-queued-acknowledgement/
Language: en

## A successful response can precede the requested advance

A twin client asks for bounded stepping, receives a successful service response and immediately snapshots state. The snapshot can still precede the intended iterations. Inspect what the server acknowledges before using a request-response boundary as a simulation barrier. World-control acceptance and completed physics updates are distinct events. The application needs an observation associated with the resulting iteration, not only evidence that its command reached a service that returned true.

## Keep pause and multi_step in one request interpretation

The [WorldControl message](https://raw.githubusercontent.com/gazebosim/gz-msgs/gz-msgs11/proto/gz/msgs/world_control.proto) carries pause separately from step and multi_step. In the inspected [SimulationRunner](https://raw.githubusercontent.com/gazebosim/gz-sim/gz-sim9/src/SimulationRunner.cc), processing first applies the requested pause state, then adds multiStep only if the world is paused. A request that unpauses the world therefore does not take that bounded-step branch merely because multi_step is present. The world having been paused before the request is not enough when the same command changes its pause state.

## Read the acknowledgement at its actual boundary

The handler constructs control data, appends it to a world-controls queue and returns a successful boolean. Later processing updates pending iterations and temporarily unpauses bounded stepping. Those operations are not represented by a per-request completed-state payload in this response. Do not infer full completion from a successful transport call or response boolean. Retain request order and account for other control clients, because an unrelated pause or stepping command can alter the conditions under which the requested advance proceeds.

## Propose an isolated stepping fixture

A proposed fixture should use an isolated world-control client and a known initial iteration. Submit explicit pause and multi_step fields, then observe iteration-associated state until the intended bounded advance is established. Compare with a request that unpauses while carrying the same step count. Keep request acceptance time separate from the final observation. No Gazebo experiment was executed here, and this protocol does not claim the statistics stream emits every intermediate iteration without throttling.

## Accept the snapshot together with its iteration

Retain world identity, request fields, engine revision, initial and final iteration, pause state and the snapshot’s computation boundary. If a transport snapshot lacks enough correlation to establish which advance it follows, add an appropriate application-level synchronization method rather than guessing from wall delay. A fixed sleep can conceal a race on a fast host and fail on a slower one. Document reset boundaries separately because iteration numbering can restart.

## Keep completion narrower than physical correctness

The [Redfish task guide](/journal/guide-reliability-redfish-task/) explains a neighboring acknowledgement boundary; [software reproducibility](/journal/software-stack-reproducibility/) supports preserving request and server behavior. Here acceptance means the intended bounded simulation advance and associated snapshot were actually observed under the reviewed implementation. It does not validate numerical accuracy, controller stability or hardware timing. Those claims need separate evidence after the stepping boundary has been established.
