Skip to content

fixed rendering during eval#28

Open
m2kulkarni wants to merge 5 commits intosync-upstreamfrom
mohit/fix-render
Open

fixed rendering during eval#28
m2kulkarni wants to merge 5 commits intosync-upstreamfrom
mohit/fix-render

Conversation

@m2kulkarni
Copy link

No description provided.

@greptile-apps
Copy link

greptile-apps bot commented Feb 24, 2026

Greptile Summary

Switched from Transformer to Recurrent policy architecture and enhanced rendering system for adaptive driving agents during evaluation. Added support for multi-scenario rendering with scenario counters, dual-policy population play (ego vs co-player), centered camera positioning for full map views, and new human replay video rendering functionality.

Key changes:

  • Configuration updates to use Recurrent architecture instead of Transformer
  • Added k_scenarios support for rendering multiple consecutive scenarios per evaluation
  • Implemented population play infrastructure (ego agents + co-player policy with conditioning)
  • Enhanced visualization with scenario counter overlays and improved camera centering
  • Added render_human_replay_videos function for evaluation video generation
  • Unified RNN/Transformer loading logic to use single rnn_name parameter

Issue found:

  • Critical logic bug in pufferlib/utils.py:500 where the rendering loop doesn't iterate over different maps

Confidence Score: 2/5

  • Contains a critical logic bug that will cause incorrect behavior during human replay rendering
  • While most changes are well-structured (config updates, architecture refactoring, visualization enhancements), there's a critical bug in render_human_replay_videos where the loop renders the same map multiple times instead of iterating through different maps. This defeats the purpose of the num_maps parameter and will produce duplicate videos.
  • pufferlib/utils.py requires immediate attention - the render_human_replay_videos function has a logic error in the rendering loop

Important Files Changed

Filename Overview
pufferlib/config/ocean/adaptive.ini Config changes to switch from Transformer to Recurrent architecture, adjust agent counts, and add rendering parameters
pufferlib/ocean/drive/drive.c Fixed typo in demo comment and hardcoded demo values to avoid config dependency
pufferlib/ocean/env_config.h Added k_scenarios and co-player population play configuration parsing
pufferlib/pufferl.py Unified RNN/Transformer loading via rnn_name, added human replay video rendering during eval
pufferlib/ocean/drive/visualize.c Added multi-scenario rendering, dual-policy population play support, centered camera for full map view, and scenario counter overlay
pufferlib/utils.py Added render_human_replay_videos function and updated render_videos to use correct INI file and pass rendering parameters

Last reviewed commit: 6d8d963

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +500 to +501
for map_idx in range(num_maps):
result = subprocess.run(cmd, cwd=os.getcwd(), capture_output=True, text=True, timeout=600, env=env_vars)
Copy link

Choose a reason for hiding this comment

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

Loop renders same map repeatedly instead of different maps. The cmd doesn't change between iterations - no --map-name specified. Either remove the loop (set num_maps=1) or add map selection logic like in render_videos at line 380-383.

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.

1 participant