Skip to content

Fix update of step reward when weight is zero #2392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bikcrum
Copy link

@bikcrum bikcrum commented Apr 28, 2025

Description

This pull request fixes a bug where _step_reward could retain stale values when a reward term's weight was dynamically changed back to zero.
Previously, when a reward term had zero weight, the computation skipped updating _step_reward, assuming that it would stay correct.
However, if the weight was first changed from zero to nonzero and then back to zero during runtime (e.g., in curriculum settings), stale nonzero values could persist, causing incorrect reward visualizations or logging.

This change explicitly sets reward_manager._step_reward to zero when a reward term has zero weight, ensuring correctness regardless of dynamic weight changes.

Fixes #2391

No new dependencies are introduced by this change.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Screenshots

Not applicable.

Checklist

  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

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.

[Bug Report] Step reward retains stale values when weight is dynamically set back to zero
1 participant