A simulation test can restore every visible joint to its starting pose and still begin the next episode with memory of the previous one. A controller integrator, action-delay queue, policy hidden state or observation wrapper may survive outside the state that the physics reset function owns.

The result can look like unstable training or unexplained seed sensitivity when it is actually an incomplete episode boundary. The key question is not whether reset was called, but which components promised to reset and what initial condition they established.

### A robot application has more state than joint positions

Even the physical initial condition includes velocities and relevant actuator states, not merely a pose. Around the simulator sit additional stateful components: filtered observations, previous-action features, accumulated reward terms, recurrent-policy memory and pending commands.

Resetting the engine cannot automatically reset an external controller that the engine does not own. Conversely, reconstructing a controller without clearing the wrapper's action queue can still deliver an old reference into the new episode.

The official [Gymnasium environment API](https://gymnasium.farama.org/api/env/) defines reset as returning the environment to an initial internal state and producing the initial observation. It also documents seed behaviour. That API contract does not inspect every custom wrapper or external policy on an application's behalf; their reset responsibilities need explicit implementation and tests.

### Compare histories, not only seeds

A useful diagnostic starts from two different preceding histories. One run reaches reset after an uneventful episode; another reaches it after prolonged contact, saturation or a timeout. Then apply the same declared reset configuration and a fixed initial action sequence.

Compare the earliest divergence across:

- Simulator positions, velocities and relevant actuator state.
- Controller state, filters and queued actions.
- The initial observation and the state from which it was computed.
- Recurrent-policy state, if the policy participates in the test.
- Reward accumulators, termination flags and wrapper step counters.

Using a scripted action prefix can separate environment-reset behaviour from a learned policy's sensitivity. A fresh-process run is a useful comparison, but a difference does not by itself identify which state was retained.

Matching seeds alone is insufficient if different code paths consume random draws or some components use separate random generators. Likewise, bitwise equality may be inappropriate for a nondeterministic backend. Define numerical tolerances and repeatability expectations before interpreting a mismatch as a reset defect.

### Make the reset ordering observable

One possible contract is to suspend stepping, discard old pending work, restore the declared physical and controller initial conditions, refresh observations, and only then expose the new episode to the policy. The exact order depends on the simulator and control architecture; it should be documented rather than inferred from visual motion.

Record an episode identifier through the command and observation paths so delayed results from the previous episode can be identified. A new observation object with an old cached image is still an old observation.

### Not every persistent state is a bug

Some experiments intentionally carry battery state, temperature or adaptation across trials. Erasing those quantities could invalidate a continuing-task experiment. The important distinction is between declared persistence and accidental carryover, with metrics interpreted under the chosen design.

Recreating the entire environment improves isolation in some systems but adds startup cost. Selective reset is faster and more flexible, yet needs a maintained state inventory and regression tests as wrappers evolve.

**Open engineering question:** can two different pre-reset histories change your first post-reset control outputs when the declared initial condition is the same? Which component's reset contract would explain or prohibit that difference?