Skip to content

Fix reset options/seeds ignored on auto-reset in VecEnv - #2289

Closed
dafahaha wants to merge 2 commits into
DLR-RM:masterfrom
dafahaha:master
Closed

dafahaha wants to merge 2 commits into
DLR-RM:masterfrom
dafahaha:master

Conversation

@dafahaha

@dafahaha dafahaha commented Sep 17, 2026 •

Copy link
Copy Markdown

Fixes #1790

When an episode terminates/truncates during step(), DummyVecEnv and SubprocVecEnv auto-reset without passing the pending seed/options set via vec_env.seed() or vec_env.reset(seed=..., options=...). Reset options are silently ignored, breaking reproducibility.

Changes:

  • DummyVecEnv.step_wait(): pass seed/options to auto-reset, consume per-env values after use
  • SubprocVecEnv.step_async(): send (action, seed, options) to workers
  • SubprocVecEnv._worker(): pass seed/options to auto-reset
  • SubprocVecEnv.step_wait(): clear seed/options for terminated envs

Seeds/options are used once per environment, matching explicit reset() semantics.

Disclosure: AI code assistant used as an aid for implementation; bug analysis and design done manually.

Fixes DLR-RM#1790

Pass pending seeds and options to env.reset() when environments auto-reset due to termination/truncation in step_wait().

Changes:
- DummyVecEnv.step_wait(): pass seed/options to auto-reset, consume per-env values after use
- SubprocVecEnv.step_async(): send (action, seed, options) tuple to workers
- SubprocVecEnv._worker(): receive seed/options, pass to auto-reset
- SubprocVecEnv.step_wait(): clear seed/options for terminated envs

Semantics: seeds/options are used once per environment, matching explicit reset() behavior.
Part of DLR-RM#1790 fix. SubprocVecEnv changes: step_async sends (action, seed, options), _worker passes them to auto-reset, step_wait clears used values.
@dafahaha dafahaha changed the title Fix: pass reset options/seeds during auto-reset on episode termination Fix reset options/seeds ignored on auto-reset in VecEnv Sep 17, 2026
@dafahaha

Copy link
Copy Markdown
Author

Fixes #1790

When an episode terminates/truncates during step(), DummyVecEnv and SubprocVecEnv auto-reset without passing the pending seed/options set via vec_env.seed() or vec_env.reset(seed=..., options=...). Reset options are silently ignored, breaking reproducibility.

Changes:

  • DummyVecEnv.step_wait(): pass seed/options to auto-reset, consume per-env values after use
  • SubprocVecEnv.step_async(): send (action, seed, options) to workers
  • SubprocVecEnv._worker(): pass seed/options to auto-reset
  • SubprocVecEnv.step_wait(): clear seed/options for terminated envs

Seeds/options are used once per environment, matching explicit reset() semantics.

@araffin araffin added the LLM generated We do not accept LLM generated issues/PR, please tell your human label Sep 18, 2026
@araffin araffin closed this Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM generated We do not accept LLM generated issues/PR, please tell your human

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Reset options ignored when resetting due to termination / truncation from within wrapper's step

2 participants