Skip to content

[Bug Report] Environment reset can skip renderer scene-state publication #6609

Description

@ruziniuuuuu

Problem

RenderContext publishes renderer scene state at most once for a physics-step
count. An environment reset can change asset state and call forward() without
advancing that count, but the environment reset paths do not invalidate the
scene-state cadence. The first camera read after reset can therefore skip the
official renderer transform update and reuse pre-reset transforms.

This affects all reset implementations that own _reset_idx():

  • ManagerBasedEnv
  • ManagerBasedRLEnv (which overrides the manager base implementation without
    calling super())
  • DirectRLEnv
  • DirectMARLEnv

Minimal reproduction

The lifecycle defect is renderer-independent:

env.sim.render_context._last_scene_state_step = 7
env.reset()
assert env.sim.render_context._last_scene_state_step is None

On current develop, the value remains 7 for all four environment types.
Temporarily removing the proposed fix makes this regression fail with
assert 7 is None.

Newton/OVRTX evidence

The issue was originally reproduced with Isaac Lab
v3.0.0-beta2.patch1, isaaclab_newton==0.13.6, Newton 1.2.1,
isaaclab_ov==0.4.2, and ovrtx==0.3.0.312915:

  • Before reset, every audited official OVRTX body matrix matched Newton
    body_q with maximum absolute error 1.67e-6.
  • After a same-step reset without cadence invalidation, Newton body state and
    camera pose were correct, but OVRTX matrix error grew to about 1.79--1.99
    and a non-temporal depth AOV retained the displaced pose.
  • Calling only the public patch1
    RenderContext.reset_transform_cadence() restored matrix error to 1.67e-6.
  • With cadence invalidation, baseline versus first post-reset depth MAE was
    2.33e-7; displaced versus post-reset depth MAE was about 0.484.

No custom transform publication, stage rebuild, native OVRTX history reset,
CPU-transform fallback, or warm-up was used. Native Renderer.reset() is not
part of the solution: it restarts RTPT accumulation and makes immediate beauty
frames intentionally cold, while the non-temporal depth test proves cadence
invalidation alone fixes the stale geometry.

Expected behavior

After environment state has been reset, the next renderer update must publish
scene state even when the physics-step count did not advance.

Proposed fix

Call RenderContext.reset_scene_state_cadence() at the end of each environment
reset implementation listed above and add backend-neutral regression coverage
for all four paths. This keeps transform ownership in RenderContext and the
official renderer adapters and does not introduce renderer-specific lifecycle
hooks.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions