Skip to content

Support explicit resets for completed episodes - #8234

Draft
cvolkcvolk wants to merge 6 commits into
isaac-sim:release/3.0.0from
cvolkcvolk:cvolkcvolk/feature/exact-episode-lifecycle
Draft

cvolkcvolk wants to merge 6 commits into
isaac-sim:release/3.0.0from
cvolkcvolk:cvolkcvolk/feature/exact-episode-lifecycle

Conversation

@cvolkcvolk

@cvolkcvolk cvolkcvolk commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Add an option to finish an episode without automatically starting another one. Callers can use reset(env_ids) to start replacements in the environments they choose.

With three parallel environments and three requested episodes, the first environment to finish should wait while the other two complete. Today, ManagerBasedRLEnv.step() immediately resets it and starts a fourth episode. Simply skipping that reset leaves recording and observation histories tied to the wrong episode boundaries.

What changes?

  • ManagerBasedRLEnvCfg.autoreset_mode supports SAME_STEP (the default) and DISABLED. The environment owns active_episode_mask; callers decide when to start episodes through reset() or reset_to().
  • With automatic resets disabled, completed environments keep their final observations and return zero rewards and no further completion signals. Recordings finish once, at completion.
  • Partial resets refresh only the selected observations and their delay/history buffers. Continuing environments retain their observations and histories.
  • Training wrappers reject disabled automatic resets because they require replacements within the same step.

Physics and manager computations continue in inactive environments. Existing manager logs are generated on reset and are not frozen terminal summaries. Partial observation updates support function callbacks and built-in history/delay buffers; unsupported stateful observation terms, modifiers, and noise models are rejected before reset changes scene state.

Usage

cfg.autoreset_mode = gym.vector.AutoresetMode.DISABLED
env = ManagerBasedRLEnv(cfg)
observations, _ = env.reset()
observations, rewards, terminated, truncated, extras = env.step(actions)
completed_env_ids = (terminated | truncated).nonzero().flatten()
# Start replacements when the caller is ready.
observations, _ = env.reset(env_ids=completed_env_ids)

Background: Arena needs exact episode limits, with finished environments waiting for the remaining episodes to complete.

Type of change

  • New feature
  • Bug fix for partial-reset observation histories

Validation

  • 102 focused tests passed across episode behavior, recorders, partial observations, buffers, and all five training wrappers. This includes CUDA-graph buffer coverage and four simulation cases covering partial-reset histories on CPU and CUDA.
  • The wrapper and observation regressions were also checked against the behavior before their fixes.
  • Formatting and pre-commit checks passed. Documentation built with warnings treated as errors.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks through uv run isaaclab -f
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria
  • I have added a changelog fragment for every touched package
  • I have added my name to CONTRIBUTORS.md or my name already exists there

@github-actions github-actions Bot added documentation Improvements or additions to documentation enhancement New feature or request isaac-lab Related to Isaac Lab team labels Oct 1, 2026
@cvolkcvolk cvolkcvolk changed the title Add lifecycle hooks for finite episode evaluation Separate episode completion from starting new episodes Oct 1, 2026
Comment thread docs/source/api/lab/isaaclab.envs.rst Resolved
Comment thread docs/source/api/lab/isaaclab.envs.rst Resolved
@cvolkcvolk cvolkcvolk changed the title Separate episode completion from starting new episodes Support explicit resets for completed episodes Oct 1, 2026
@StafaH StafaH mentioned this pull request Oct 9, 2026
6 of 7 tasks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant