restore obs_slots_boundary_kept for obs dim#453
Open
Yvonne511 wants to merge 6 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restores fixed-size road observation slots so model slicing and C observation packing stay aligned across dropout-enabled training and clean evaluation. It also adds render-client teardown during vector env close paths.
Changes:
- Uses
obs_slots_lane_n/obs_slots_boundary_nfor observation sizing and Torch road slices. - Updates C road observation layout and padding to reserve max lane/boundary slots.
- Adds client cleanup before vector env teardown and inside
c_close.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
pufferlib/ocean/torch.py |
Aligns model road observation slicing with fixed max slot counts. |
pufferlib/ocean/drive/drive.py |
Updates Python observation dimension calculation and adds explicit render-client close loops. |
pufferlib/ocean/drive/drive.h |
Updates C observation size/layout/padding and closes render clients during env teardown. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+489
to
+490
| for i in range(self.num_envs): | ||
| binding.vec_close_client(self.c_envs, i) |
Comment on lines
+820
to
+821
| for i in range(self.num_envs): | ||
| binding.vec_close_client(self.c_envs, i) |
Comment on lines
+3577
to
+3580
| if (env->client) { | ||
| close_client(env->client); | ||
| env->client = NULL; | ||
| } |
Comment on lines
+494
to
+495
| for i in range(self.num_envs): | ||
| binding.vec_close_client(self.c_envs, i) |
There was a problem hiding this comment.
this might be the right thing to do, but include in separate PR
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.
Changes from 7eaee60 to a412614


Previously buffer always is sized by max_lane_segment_observations (the max, regardless of dropout), and unused slots were zero-padded. Later renamed max_lane_segment_observations → obs_slots_lane_n and obs_lane_segment_count → obs_slots_lane_kept. This introduce a bug when training with dropout and eval without it.
Close envs