Conversation
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.
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1790
When an episode terminates/truncates during
step(),DummyVecEnvandSubprocVecEnvauto-reset without passing the pendingseed/optionsset viavec_env.seed()orvec_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 useSubprocVecEnv.step_async(): send (action, seed, options) to workersSubprocVecEnv._worker(): pass seed/options to auto-resetSubprocVecEnv.step_wait(): clear seed/options for terminated envsSeeds/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.