Use a distinct seed per environment rebuild - #1007
Open
alexmillane wants to merge 4 commits into
Open
Conversation
alexmillane
commented
Aug 4, 2026
alexmillane
left a comment
Collaborator
Author
There was a problem hiding this comment.
Self review.
Comment on lines
+89
to
+90
| # Rebuild 0 builds the run unchanged; each later rebuild offsets the seed so its fresh | ||
| # construction differs (e.g. a build-time light-direction variation resolves to a new value). |
Collaborator
Author
There was a problem hiding this comment.
Shorten to. Runs are the same except for their seeds.
Comment on lines
+91
to
+94
| assert received_run_cfgs[0] is run | ||
| assert [cfg.environment_builder.seed for cfg in received_run_cfgs] == [base_seed, base_seed + 1] | ||
| assert run.rollout_limit == RolloutLimitCfg(num_episodes=5) | ||
| assert run.environment_builder.seed == base_seed |
Collaborator
Author
There was a problem hiding this comment.
This doesn't actually test that the second run is the same except for the seed. Consider copying run, altering the seed and testing:
assert received_run_cfgs == [run_seed_1, run_seed_2]
alexmillane
marked this pull request as ready for review
August 4, 2026 09:54
alexmillane
requested review from
cvolkcvolk,
peterd-NV,
qianl-nv,
viiik-inside,
xyao-nv and
zhx06
as code owners
August 4, 2026 09:54
Contributor
|
Too many files changed for review. ( Bypass the limit by tagging |
alexmillane
force-pushed
the
alex/fix/per_rebuild_seeding
branch
from
August 4, 2026 10:02
ffbcf70 to
97d5476
Compare
alexmillane
commented
Aug 4, 2026
alexmillane
left a comment
Collaborator
Author
There was a problem hiding this comment.
self review 2
Comment on lines
+136
to
+138
| Without this every rebuild constructs with the same seed, so build-time variations | ||
| (e.g. the directional-light direction) resolve to the same value on each rebuild. | ||
| Rebuild 0 keeps the configured seed (``seed + 0``) so single-rebuild runs are unchanged. |
Collaborator
Author
There was a problem hiding this comment.
Remove the details here.
alexmillane
force-pushed
the
alex/fix/per_rebuild_seeding
branch
from
August 4, 2026 11:39
21f144a to
89b7372
Compare
Offset the environment-builder seed by the rebuild index so each fresh construction differs. Without this every rebuild constructs with the same seed, so build-time variations (e.g. directional-light direction) resolve to the same value on each rebuild. Rebuild 0 keeps the configured seed so single-rebuild runs are unchanged, and the original config is never mutated. Signed-off-by: alex <amillane@nvidia.com>
alexmillane
force-pushed
the
alex/fix/per_rebuild_seeding
branch
from
August 4, 2026 11:42
89b7372 to
6c4caea
Compare
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.
Summary
Distinct env-builder seed per rebuild
Detailed description
_cfg_for_rebuild, which offsetsenvironment_builder.seedby the rebuild index. Rebuild 0 keeps the configured seed so single-rebuild runs are unchanged, and the original config is never mutated (a fresh copy viadataclasses.replace).