Skip to content

Prevent NaN reward propagation in Humanoid tasks - #353

Open
sylvesterkaczmarek wants to merge 2 commits into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/humanoid-nan-reward
Open

sylvesterkaczmarek wants to merge 2 commits into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/humanoid-nan-reward

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Aug 22, 2026

Copy link
Copy Markdown

Prevent NaN physics states from returning a NaN learner-facing reward in Humanoid tasks. Keep the existing termination condition and use jp.where to select a zero reward for invalid states.

Rebased onto upstream main at 4057c147714b6ac09b395377f1a1724bbeacc4d3, preserving both newer Warp overflow-warning tests. The regression test now covers NaNs in either qpos or qvel.

Validation

JAX_PLATFORMS=cpu python -m pytest -q mujoco_playground/_src/dm_control_suite/dm_control_suite_test.py -k 'Humanoid or humanoid'

5 passed: two invalid-state regressions and the existing Humanoid stand, walk, and run smoke tests. Both regressions fail on unpatched main with nan != 0.0.

git diff --check passes. Ruff reports the same seven pre-existing findings in the two changed files, with no additional findings. The full suite and GPU execution were not run.

Fixes #240.

This branch has not been deployed

No deployments
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.

NAN from the simulation will ruin the training

2 participants