Skip to content

Integrate WorldParticle dynamics with DexSim Provider - #902

Open
CSYSLAM wants to merge 2 commits into
mainfrom
feat/worldparticle-dynamics
Open

CSYSLAM wants to merge 2 commits into
mainfrom
feat/worldparticle-dynamics

Conversation

@CSYSLAM

@CSYSLAM CSYSLAM commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Description

Integrate WorldParticle into EmbodiChain as a model family and a per-scene Newton Provider, following the NeRD model ownership pattern. DexSim retains only a reusable native particle inference adapter; networks, checkpoint loading, authored features/topology, coordinate conversion, operator dependencies, resources and demos live here.

Dependency: DexSim !1525, commit 3229af3b081720735275deb80d0344476ccad7ac, supplies dexsim.engine.newton_physics.particle_inference.ParticleInferenceSolver. The published SDK without that adapter is insufficient; use the matching locally built CPython 3.12 JIT wheel. Source merge is not SDK release approval.

  • Add lazy embodichain_models.dynamics.worldparticle exports, frozen official network/checkpoint support, and a production NPZ initial-state codec. The 9 migrated neural source files are AST-equivalent to the previous vendored implementation; weights are unchanged.
  • Add lab/sim/physics/worldparticle.py and the worldparticle solver entry point. Explicit SDK config objects pass through without resolving unrelated built-in solver imports. Default/mapping solver selection remains unchanged; no AutoSolver-to-DexUni fallback is added.
  • Permit explicit Provider deformable declarations, leaving final particle-kind support to DexSim's capability checks. Add SimulationManagerCfg.enable_default_ground=True; this model-boundary scene explicitly disables native collision ground. Ordinary ground defaults remain unchanged.
  • Add four demos through embodichain run-example learning/worldparticle: Fancy Fluid, Cloth on Ball, Duck forward deformation, and Deep Fluid with generated initial conditions. Use native 1920×1080 OfflineRT rendering and fresh live inference on reset.
  • Add an optional ABI-pinned Python 3.12/Torch 2.7.1+cu128/SM120 runtime, NumPy 2.2.6 to satisfy the existing LeRobot dependency, and matching Torchvision. Operator wheels and the existing resource archive use immutable SHA256 identities. Download/verify 19 asset files explicitly; weights, environments and wheels are outside Git and the distribution.

No separate issue; implements the requested cross-repository integration.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Screenshots

Native first/middle/final cloth captures were verified locally at 1920×1080. The final frame drapes the cloth over its authored sphere. No checkpoint or generated image binary is committed.

Validation

Source: cc7306a81706e3a76fbc8e932d90faaec224b5ce, base 97d7f21a2c5c38f423566f7db2c87ccba3a1a17a.

  • 53 focused tests passed: model/Provider/data (19), deformable contracts (26), generic SDK adapter (4), and Spawn material compatibility (4). Existing coverage was migrated; the new config test protects the reproduced unconditional AutoSolver import failure. Extended ground/deformable cases protect public options and capability delegation.
  • Existing DexSim Provider and functional render-stream regressions: 105 passed. Dependency export tooling: 53 passed. Ground lifecycle: 10 passed. API-doc tooling: 11 passed.
  • All four full inference demos produced finite position/velocity: fluid 199, cloth 80, duck 15, Deep Fluid 199 steps. Initial states follow official task stride then frame slice; cloth starts at frame 10 with authored velocity.
  • Fixed-seed cloth comparison against the preceding implementation: exact initial state, first-step position MSE 6.80e-11, full 80-step trajectory MSE 1.76e-6. This is migration parity, not a new model accuracy claim.
  • SimulationManager declared 4,900 cloth particles and successfully stepped, reset and cleaned up. Native 80-step window/camera rendering and the installed run-example CLI passed.
  • Built and installed the native DexSim JIT wheel; installed adapter bytes match the SDK source and wheel. Built the EmbodiChain wheel and verified model, Provider, entry point, licenses and provenance, with no checkpoints/environment payloads.
  • pip check: 364 installed packages compatible. black .: 1,781 files unchanged. API inventory: 3293/3293 exports documented. Context checks passed.
  • Sphinx dummy build succeeded after committing the source; 796 warnings remain, so this does not claim a warning-free documentation build.

Context review: the existing neural-dynamics overview delegates family inventory to the updated model catalog README; simulation ownership/lifecycle guidance remains accurate. DexSim's corresponding context was updated in !1525.

Limits and release boundary

  • Validated runtime: Linux x86_64/glibc >=2.35, Python 3.12, Torch 2.7.1+cu128/CXX11 ABI, SM120 and the pinned Open3D/FlashAttention operators. Other platforms are not qualified.
  • WorldParticle supports one CUDA particle world, static authored boundaries, inference and reset. No functional gradients, CUDA Graph capture, native rigid coupling or contact-force reports. Duck demonstrates forward inference, not inverse optimization; Deep Fluid has no official reference trajectory.
  • EmbodiChain's pre-existing default/mapping Newton configuration and the requested DexSim checkout have an AutoSolver API mismatch. This PR changes only the explicit Provider config path and does not silently rewrite defaults. The ordinary .venv is untouched; the prepared .venv-worldparticle uses the explicit Provider demo path.
  • WorldParticle's root MIT license and its vendored ToMe CC-BY-NC-4.0 license/provenance are retained. Model code ships with the EmbodiChain wheel; this PR does not establish commercial redistribution permission. Weight/data rights also require independent release review. No release publication is requested.
  • Full CI and release/AOT/cross-GPU acceptance remain pending; the user owns CI tracking.

Checklist

  • I have run the black . command to format the code base.
  • I reviewed affected documentation and agent context, updated it where needed, or explained why no update was needed.
  • Public API changes are reflected in the API docs (python docs/scripts/check_api_docs.py), if applicable
  • I verified appropriate behavioral coverage, reviewed the necessity of added or extended tests, and explained when no new tests were needed.
  • Dependencies have been updated, if applicable.

@CSYSLAM CSYSLAM added physics Physics backends, dynamics, contacts, fluids, deformables and physics solvers. dependencies Dependency versions, upgrades and compatibility. dexsim DexSim SDK interfaces, version adaptation and integration. model Neural model architectures, inference, weights and model contracts. feature New user-facing capabilities. labels Oct 29, 2026
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 3/5

[Medium impact] The PR adds a bounded WorldParticle inference path to DexSim scenes.

The PR is not ready to merge because applied forces can still be ignored and coordinate conversions can still lose precision.

Fix All in CodexFindings

  1. P1 Applied forces do nothing ▶
  2. P1 Coordinates lose precision ▶
  3. P2 Required source notice missing ▶
Fix with agent prompt
### Issue 1
extensions/embodichain_models/embodichain_models/dynamics/worldparticle/model.py:57-59
`WorldParticleModel.__call__` accepts acceleration for every checkpoint, but networks with `velhead=False` never read it. Changing an applied force therefore leaves the prediction unchanged, despite the public acceleration contract. Preserve the frozen network's behavior, but reject unsupported force changes or expose this restriction instead of silently accepting them.

### Issue 2
extensions/embodichain_models/embodichain_models/dynamics/worldparticle/model.py:65-71
If a caller runs this model inside CUDA autocast, the coordinate conversions inherit that context and round positions, velocities, and acceleration. Even `q.float()` does not keep the final matrix multiply in float32. This breaks the promised float32 conversion and can feed lost precision into later steps. Disable autocast explicitly around the conversions while keeping BF16 enabled for the network.

### Issue 3
examples/learning/worldparticle/relocate_open3d_wheel.py:1-2
The new `relocate_open3d_wheel.py` script lacks the Apache 2.0 header and DexForce 2021–2026 copyright notice required by `AGENTS.md` for new source files. Add the standard header before merging to satisfy this repository requirement.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds frozen WorldParticle models and a per-scene DexSim Provider, with authored particle inputs, four demos, and a pinned optional runtime.

Since the previous review:

  • WorldParticle models predict particle positions and velocities from authored inputs.
  • A Newton Provider runs WorldParticle inference in one CUDA particle world.
  • Four WorldParticle demos show fluid, cloth, duck, and Deep Fluid inference.
  • The WorldParticle setup checks its assets and pins a matching runtime.

No new findings were accepted.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Checkpoint and authored inputs] --> B[WorldParticleModel]
  C[Newton solver configuration] --> D[WorldParticleProvider]
  D --> B
  D --> E[DexSim ParticleInferenceSolver]
  E -->|Current particle state| B
  B -->|Predicted particle state| E
Loading

Reviews (2) · Last reviewed commit: "fix(sim): Support registered particle pr..." · Reviewed by Greptile

Comment on lines +57 to +59
arguments = dict(
k_partite=self.k_partite, external_force=acceleration @ self.rotation
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Applied forces do nothing

WorldParticleModel.__call__ accepts acceleration for every checkpoint, but networks with velhead=False never read it. Changing an applied force therefore leaves the prediction unchanged, despite the public acceleration contract. Preserve the frozen network's behavior, but reject unsupported force changes or expose this restriction instead of silently accepting them.

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/embodichain_models/embodichain_models/dynamics/worldparticle/model.py
Line: 57-59

Comment:
**Applied forces do nothing**

`WorldParticleModel.__call__` accepts acceleration for every checkpoint, but networks with `velhead=False` never read it. Changing an applied force therefore leaves the prediction unchanged, despite the public acceleration contract. Preserve the frozen network's behavior, but reject unsupported force changes or expose this restriction instead of silently accepting them.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex Fix in Claude Code

Comment on lines +65 to +71
model_position = position @ self.rotation
model_velocity = velocity @ self.rotation
with torch.autocast("cuda", dtype=torch.bfloat16):
q, qd = self.network(
(model_position, model_velocity, feature, box, box_feats), **arguments
)
return q.float() @ self.rotation.T, qd.float() @ self.rotation.T

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Coordinates lose precision

If a caller runs this model inside CUDA autocast, the coordinate conversions inherit that context and round positions, velocities, and acceleration. Even q.float() does not keep the final matrix multiply in float32. This breaks the promised float32 conversion and can feed lost precision into later steps. Disable autocast explicitly around the conversions while keeping BF16 enabled for the network.

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/embodichain_models/embodichain_models/dynamics/worldparticle/model.py
Line: 65-71

Comment:
**Coordinates lose precision**

If a caller runs this model inside CUDA autocast, the coordinate conversions inherit that context and round positions, velocities, and acceleration. Even `q.float()` does not keep the final matrix multiply in float32. This breaks the promised float32 conversion and can feed lost precision into later steps. Disable autocast explicitly around the conversions while keeping BF16 enabled for the network.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex Fix in Claude Code

Comment on lines +1 to +2
#!/usr/bin/env python3
"""Remove build-host search paths and assign a new immutable wheel build tag."""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Required source notice missing

The new relocate_open3d_wheel.py script lacks the Apache 2.0 header and DexForce 2021–2026 copyright notice required by AGENTS.md for new source files. Add the standard header before merging to satisfy this repository requirement.

Context Used: AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: examples/learning/worldparticle/relocate_open3d_wheel.py
Line: 1-2

Comment:
**Required source notice missing**

The new `relocate_open3d_wheel.py` script lacks the Apache 2.0 header and DexForce 2021–2026 copyright notice required by `AGENTS.md` for new source files. Add the standard header before merging to satisfy this repository requirement.

**Context Used:** AGENTS.md ([source](https://github.com/dexforce/embodichain/blob/main/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Codex Fix in Claude Code

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

dependencies Dependency versions, upgrades and compatibility. dexsim DexSim SDK interfaces, version adaptation and integration. feature New user-facing capabilities. model Neural model architectures, inference, weights and model contracts. physics Physics backends, dynamics, contacts, fluids, deformables and physics solvers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant