Skip to content

Make deformables Newton-only and limit differentiation to kinematics - #564

Draft
yuecideng wants to merge 3 commits into
feature/newton-physics-backendfrom
codex/newton-only-deformables
Draft

Make deformables Newton-only and limit differentiation to kinematics#564
yuecideng wants to merge 3 commits into
feature/newton-physics-backendfrom
codex/newton-only-deformables

Conversation

@yuecideng

@yuecideng yuecideng commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Description

Summary

  • Make volume and surface deformable objects exclusive to the Newton backend; Default now rejects soft/cloth declarations explicitly.
  • Compile SoftObjectCfg and ClothObjectCfg into DexSim 0.5 SoftBodyDesc / ClothDesc particle-set descriptors.
  • Replace direct native soft/cloth buffers with typed particle handles and packed Scene.create_particle_set_batch() state access.
  • Keep render topology separate from volumetric collision topology, and update examples, tutorials, project context, and tests.
  • Rename DifferentiableEmbodiedEnv to DifferentiableEnv and restrict it to NewtonPhysicsCfg(requires_grad=True).
  • Make the differentiable environment kinematics-only: action, task FK, observation, and reward run on one Warp tape without creating contacts, invoking the configured Newton solver, or advancing simulation time.
  • Remove the unsupported differentiable dynamics stepper, trajectory, rollout, and control-hook APIs until a separate dynamics design is implemented.

This intentionally removes the compatibility burden for the legacy Default deformable backend while EmbodiChain deformable usage is still limited and DexSim development is converging on Newton. The differentiable environment is likewise kept intentionally narrow while only analytic kinematics are supported.

No linked issue.

Breaking changes

  • Soft and cloth objects require the Newton backend, CUDA, and one of xpbd, semi_implicit, vbd, or mjvbd.
  • Default-only deformable configuration fields are removed instead of being silently ignored or translated.
  • Direct load_soft_object_from_cfg() / load_cloth_object_from_cfg() construction is no longer supported; callers must declare through SimulationManager before prepare().
  • DifferentiableEmbodiedEnv is removed without a compatibility alias; subclasses must migrate to DifferentiableEnv.
  • DifferentiableEnv rejects the Default backend and requires a Newton gradient model.
  • Differentiable subclasses now implement only _apply_action_kernel, _make_kinematic_step_fn, and _read_outputs; dynamics modes and solver control hooks are removed.
  • Public differentiable solver-stepper and gradient-rollout helpers are removed until dynamics differentiation is supported.
  • Gradient-mode mutation and post-finalization deformable additions remain explicitly unsupported.

Dependency and known boundary

This adaptation targets the upcoming DexSim 0.5 typed particle-set scene API; no dependency pin is changed in this PR.

The current DexSim clone path can materialize a different render vertex count for replicated file-backed soft bodies. EmbodiChain detects that mismatch during Spawn binding and raises an actionable error before the renderer reaches the native upload/crash path. The volume GPU test therefore uses one environment; multi-environment cloth remains covered.

Newton gradient configuration still resolves a semi-implicit solver for scene setup, but DifferentiableEnv never advances it. Differentiable dynamics remain explicitly out of scope.

Type of change

  • Breaking change
  • Documentation update

Screenshots

Not applicable.

Validation

  • 142 passed — focused deformable config, descriptor, facade, backend-parity, and visualization tests
  • 9 passed — real CUDA/Newton soft-body and cloth tests (--run-gpu)
  • 16 passed, 2 deselected — CPU differentiable-environment tests
  • 2 passed, 16 deselected — real CUDA/Newton Franka FK/autograd tests (--run-gpu)
  • 27 passed, 1 deselected — APG, trainer, and Newton planar regression tests
  • 18 passed — simulation-manager configuration tests
  • 7 passed — agent-context map tests
  • 8 passed — API documentation checker tests
  • API docs are aligned: 1860/1860 exports documented
  • Black 26.3.1 reports all 865 Python files unchanged after formatting
  • Changed files pass compileall, header/future-import checks, and git diff --check
  • Sphinx dummy build succeeds; existing repository warnings remain

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation.
  • Public API changes are reflected in the API docs (python docs/scripts/check_api_docs.py).
  • I have added tests that prove the changes are effective.
  • Dependencies have been updated, if applicable. (No pin change is required.)

Replace Default soft and cloth buffers with DexSim typed Newton particle-set descriptors, batched state access, and render topology.

BREAKING CHANGE: soft and cloth objects now require the Newton backend on CUDA, and Default-only deformable configuration fields are removed.
@yuecideng yuecideng added physics Things related to physics breaking dexsim Things related to dexsim object Simulation object assets labels Aug 28, 2026
Rename DifferentiableEmbodiedEnv to DifferentiableEnv, require the Newton backend, and remove unsupported differentiable dynamics stepping APIs until that phase is designed.
@yuecideng yuecideng changed the title Make deformable objects Newton-only Make deformables Newton-only and limit differentiation to kinematics Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking dexsim Things related to dexsim object Simulation object assets physics Things related to physics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant