Skip to content

Fix DR Legs Kamino P-ADMM divergence - #7638

Open
AntoineRichard wants to merge 3 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/fix-drlegs-padmm-divergence
Open

Fix DR Legs Kamino P-ADMM divergence#7638
AntoineRichard wants to merge 3 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/fix-drlegs-padmm-divergence

Conversation

@AntoineRichard

@AntoineRichard AntoineRichard commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Description

Stabilize the DR Legs Kamino P-ADMM preset under bounded random joint targets by disabling the
driven-joint solver effort limit only for Newton/Kamino. The PhysX presets retain the authored
3.1 N m limit, and the Kamino penalty parameter is restored to its original rho_0=0.02.

Re-enable IsaacContrib-DrLegs-Walk in the contributed-environment smoke suite and add coverage
proving that the nested effort-limit preset resolves to inf for Newton/default and 3.1 for
both PhysX aliases.

The finite effort limit adds solver-side constraint rows; the failure is in their interaction with
the closed-loop Kamino P-ADMM solve, rather than ordinary controller-side torque clipping. This is a
temporary Isaac Lab workaround for newton-physics/newton#4173. Its explicit
tradeoff is that Newton no longer enforces the robot's 3.1 N m driven-joint torque cap until the
upstream constraint instability is fixed. PhysX behavior is unchanged.

Fixes #7625

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Screenshots

Not applicable.

Testing

  • uv run isaaclab -f
  • uv run python tools/changelog/cli.py check develop
  • Effort-limit preset regression: failed for both Newton/default variants before the fix; all four
    Newton and PhysX variants pass after the fix
  • test_contrib_environments[IsaacContrib-DrLegs-Walk] (CUDA): passed in 12/12 fresh 20-step runs
  • Final focused CUDA run: 5/5 tests passed together

Checklist

Docker and GPU tests run on demand. Push the commits you want tested, then
comment run-ci on the pull request.

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation (not applicable; no public API or workflow changed)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@AntoineRichard
AntoineRichard requested a review from a team September 8, 2026 12:44
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Sep 8, 2026

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isaac Lab Review Bot

The patch raises the shared DR Legs Kamino P-ADMM rho_0 preset from 0.02 to 2.0, re-enables IsaacContrib-DrLegs-Walk in the contributed-environment smoke suite, and adds a seeded regression covering finite transitions and the authored 100 rad/s joint-velocity limit. The changes are focused and accompanied by an isaaclab_tasks changelog fragment.

  • Design and architecture: The solver adjustment remains encapsulated in _kamino_newton_cfg(), and the existing skip mechanism is preserved by removing only the obsolete DrLegs-Walk exclusion. Because the factory supplies both default and newton_kamino, the retune also affects the sibling HoldPose configuration; this is a non-blocking performance and convergence tradeoff to monitor.
  • API: No public symbols, signatures, exports, or registrations are changed. The observable default solver behavior changes through the preset value, and that user-visible adjustment is documented in the package changelog fragment.
  • Implementation: The regression follows the file's CUDA and environment-count conventions, deterministically seeds the environment and action space, checks transition tensors and joint velocity across five steps, and closes the environment before clearing the simulation context. The smoke-suite path is restored by removing the prior substring skip.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR raises the DR Legs Kamino P-ADMM initial penalty to stabilize random joint-target simulation, restores the Walk environment to contributed smoke coverage, and adds a deterministic seed-zero regression.

  • Changes rho_0 from 0.02 to 2.0 for the shared DR Legs Kamino configuration.
  • Validates bounded joint velocity over deterministic random-action transitions.
  • Adds the required Isaac Lab Tasks changelog fragment.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking gap in the regression's finite-transition assertion.

The solver mitigation and smoke-test restoration are consistent with the reported failure, but the new regression can accept infinite observations or rewards because its shared validation helper only detects NaN values.

Files Needing Attention: source/isaaclab_tasks/test/contrib/test_contrib_environments.py

Important Files Changed

Filename Overview
source/isaaclab_tasks/isaaclab_tasks/contrib/dr_legs/hold_pose_env_cfg.py Raises the shared DR Legs Kamino P-ADMM initial penalty to prevent the observed solver divergence.
source/isaaclab_tasks/test/contrib/test_contrib_environments.py Re-enables Walk smoke coverage and adds a deterministic regression, but its transition-validity helper does not reject infinity.
source/isaaclab_tasks/changelog.d/antoiner-fix-drlegs-padmm-divergence.rst Documents the DR Legs P-ADMM stabilization fix.

Reviews (1): Last reviewed commit: "Fix DR Legs Kamino solver divergence" | Re-trigger Greptile

for _ in range(5):
actions = torch.as_tensor(action_space.sample(), device=env.unwrapped.device, dtype=torch.float32)
transition = env.step(actions)
assert all(_check_valid_tensor(data) for data in transition[:-1])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Infinity Passes Transition Check

The regression claims to verify finite transitions, but _check_valid_tensor only rejects NaN values and accepts positive or negative infinity. An infinite observation or reward could therefore pass this assertion when joint velocities remain bounded, leaving the stated finite-transition guarantee untested. Please use an explicit finiteness check such as torch.isfinite.

return params


def test_dr_legs_walk_seed_zero_remains_finite():

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test would be doubled with the smoke test, if we want this specialized test, we should keep the skip in the task list above so it gets skipped in the smoke, or we can keep just the smoke test and remove this specialized test.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed the specialized seed-zero test and its now-unused imports. DR Legs remains enabled in the shared 20-step smoke test; the backend preset test remains because it covers the separate Newton-versus-PhysX configuration contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants