Skip to content

restore obs_slots_boundary_kept for obs dim#453

Open
Yvonne511 wants to merge 6 commits into
emerge/temp_trainingfrom
emerge/temp_training_oom
Open

restore obs_slots_boundary_kept for obs dim#453
Yvonne511 wants to merge 6 commits into
emerge/temp_trainingfrom
emerge/temp_training_oom

Conversation

@Yvonne511
Copy link
Copy Markdown
Collaborator

@Yvonne511 Yvonne511 commented May 29, 2026

Changes from 7eaee60 to a412614
Screenshot 2026-05-28 at 9 27 44 PM
Screenshot 2026-05-28 at 9 29 38 PM
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

Copilot AI review requested due to automatic review settings May 29, 2026 02:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_n for 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 thread pufferlib/ocean/drive/drive.py Outdated
Comment on lines +489 to +490
for i in range(self.num_envs):
binding.vec_close_client(self.c_envs, i)
Comment thread pufferlib/ocean/drive/drive.py Outdated
Comment on lines +820 to +821
for i in range(self.num_envs):
binding.vec_close_client(self.c_envs, i)
Comment thread pufferlib/ocean/drive/drive.h Outdated
Comment on lines +3577 to +3580
if (env->client) {
close_client(env->client);
env->client = NULL;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not relevant, strip from PR

Comment thread pufferlib/ocean/drive/drive.py Outdated
Comment on lines +494 to +495
for i in range(self.num_envs):
binding.vec_close_client(self.c_envs, i)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might be the right thing to do, but include in separate PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants