Repository navigation
docs: clarify VecEnv observation buffer lifetime - #235
Merged
ClemensSchwarke merged 5 commits intoOct 9, 2026
Merged
ClemensSchwarke merged 5 commits into
ClemensSchwarke merged 5 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Clarify coverage for DistillationRunner and observations returned by previous calls.
Review effort: Lite
Findings: 1
What changed in this PR
Documents the VecEnv observation-buffer lifetime contract without changing runtime behavior.
Changes:
- Clarifies observation immutability requirements.
- Adds Hugo to the contributor list.
| File | Summary |
|---|---|
rsl_rl/env/vec_env.py |
Documents observation buffer lifetime and mutation constraints. |
CONTRIBUTORS.md |
Adds a contributor entry. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| `rsl_rl/utils/utils.py`, which provides detailed information on the expected configuration. | ||
|
|
||
| Do not modify the TensorDict or tensors returned by the previous `get_observations()` call in place. | ||
| PPO retains that observation reference until `process_env_step()` copies it into rollout storage after |
Collaborator
|
Hi @Mikasa0503, |
ClemensSchwarke
approved these changes
Oct 9, 2026
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
Document that a VecEnv must not mutate a previously returned observation TensorDict or its underlying tensors in place during step().
PPO.act() retains the observation reference, while process_env_step() copies it into rollout storage only after env.step() returns. Reusing and overwriting the same buffer can therefore replace the observation associated with an action with the next observation. This PR clarifies the environment contract and does not change runtime behavior.
Closes #222
Validation