[BUG FIX] Fix per-environment and PD control commands in the differentiable rigid-body simulation. - #3089
Merged
duburcqa merged 6 commits intoJul 22, 2026
Conversation
… PD control, tangential contact forces, and mixed constraint activity.
… PD control commands.
…vel loss to a scalar before the buffer is overwritten.
… low-level loss to a scalar before the buffer is overwritten.
… low-level loss to a scalar before the buffer is overwritten.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #3087, fixing two ways differentiable-scene input commands were silently dropped, and closing the coverage gaps that hid them.
control_dofs_velocity,control_dofs_position,control_dofs_position_velocity) were neither tracked nor rejected in differentiable scenes, so per-step-varying targets were replayed as the last command for every step, corrupting the backward primals for all other tracked inputs. They are now tracked and replayed; a gradient-bearing PD target raises (usecontrol_dofs_forcefor differentiable inputs).Coverage: per-environment split inputs, per-step PD targets, multi-environment constraint tests (mixed per-environment limit activity), a tangential contact force component, and a nonzero cross-tree weld rotation bias. Both weld fixtures'
relposesign is also corrected (pose of body2 in body1's frame; the inverted value left them violated at rest - confirmed against MuJoCo).Related Issue
Follow-up to #3087.
How Has This Been / Can This Be Tested?
pytest tests/grad/ --backend cpu: 48 passed, 10 skipped on macOS M4 Max (fp64); 46 passed, 12 skipped on Apple Metal (fp32); 58/58 on linux CPU (fp64) and CUDA (fp32).Checklist:
Submitting Code Changessection of CONTRIBUTING document.