Repository navigation
Apply pending seeds when Gymnasium vector environments reset - #408
Merged
Denys88 merged 2 commits intoNov 19, 2026
Merged
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #408 +/- ##
=========================================
Coverage ? 58.26%
=========================================
Files ? 70
Lines ? 8872
Branches ? 0
=========================================
Hits ? 5169
Misses ? 3703
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Denys88
approved these changes
Nov 19, 2026
Denys88
left a comment
Owner
There was a problem hiding this comment.
Pending seed consumed once on the next reset, with per-env offsets on the manual path. Note: #426 touches the same manual-path seeding in the constructor; if both land, one of them needs to drop that part (their tests fail when combined).
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.
Problem
GymnasiumVecEnv.seed(seed)records a value that reset never consumes. Reseeding therefore fails to reproduce initial observations in both synchronous and asynchronous native vector environments and in custom manual environments. The manual path also ignores the constructor's seed.Change
Keep a pending reset seed, pass it to the next reset, and consume it once. Manual environments receive distinct
seed + indexvalues. Subsequent unseeded resets continue each environment's random stream.The regression suite uses real CartPole environments with one and three actors, seeds 0 and 42, native sync and async execution, and manual vectorization. A recording environment verifies that explicit seeds are applied exactly once and forwarded with the per-environment offset.
Validation
Validated head:
72f09f5ac8efac282730884398b7eb8d137df205.#332 fixes Runner seed parsing; this addresses the vector environment's public reset-seeding path.