Skip to content

Fix three bugs: missing raise, wrong RND broadcast index, variable typo#180

Merged
ClemensSchwarke merged 1 commit intoleggedrobotics:mainfrom
jashshah999:fix/critical-bugs-missing-raise-wrong-index-typo
Feb 25, 2026
Merged

Fix three bugs: missing raise, wrong RND broadcast index, variable typo#180
ClemensSchwarke merged 1 commit intoleggedrobotics:mainfrom
jashshah999:fix/critical-bugs-missing-raise-wrong-index-typo

Conversation

@jashshah999
Copy link
Copy Markdown
Contributor

Summary

Fixes three independent bugs found during code review:

  • rnn.py: NotImplementedError is constructed but never raised in RNN.reset(), causing silent failure when resetting hidden state of done environments with a custom hidden state
  • ppo.py: broadcast_parameters() loads model_params[1] (critic state) into the RND predictor instead of model_params[2] (its own state), corrupting RND weights during multi-GPU distributed training
  • cnn_model.py: Variable name typo latend_cnn -> latent_cnn in CNNModel.get_latent()

Changes

All three fixes are minimal and self-contained:

  1. Add raise keyword before NotImplementedError(...) in rnn.py:65
  2. Change model_params[1] to model_params[2] in ppo.py:516
  3. Rename latend_cnn to latent_cnn in cnn_model.py:122-124

Test plan

  • All 25 existing tests pass
  • Each fix is a one-line change with no behavioral side effects beyond correctness

1. rnn.py: Add missing `raise` before NotImplementedError -- the exception
   was being constructed but never raised, causing silent failure when
   resetting hidden state of done environments with a custom hidden state.

2. ppo.py: Fix wrong index in broadcast_parameters -- when RND is enabled,
   the predictor was loading model_params[1] (critic state) instead of
   model_params[2] (its own state), corrupting RND weights during
   multi-GPU training.

3. cnn_model.py: Fix variable name typo `latend_cnn` -> `latent_cnn`.
Copy link
Copy Markdown
Collaborator

@ClemensSchwarke ClemensSchwarke left a comment

Choose a reason for hiding this comment

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

Thanks a lot @jashshah999 :)

@ClemensSchwarke ClemensSchwarke merged commit fc1ac19 into leggedrobotics:main Feb 25, 2026
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.

2 participants