Repository navigation
Conversation
[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.
|
| arguments = dict( | ||
| k_partite=self.k_partite, external_force=acceleration @ self.rotation | ||
| ) |
There was a problem hiding this comment.
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.| 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 |
There was a problem hiding this comment.
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.| #!/usr/bin/env python3 | ||
| """Remove build-host search paths and assign a new immutable wheel build tag.""" |
There was a problem hiding this 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)
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!
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, suppliesdexsim.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.embodichain_models.dynamics.worldparticleexports, 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.lab/sim/physics/worldparticle.pyand theworldparticlesolver 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.SimulationManagerCfg.enable_default_ground=True; this model-boundary scene explicitly disables native collision ground. Ordinary ground defaults remain unchanged.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.No separate issue; implements the requested cross-repository integration.
Type of change
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, base97d7f21a2c5c38f423566f7db2c87ccba3a1a17a.6.80e-11, full 80-step trajectory MSE1.76e-6. This is migration parity, not a new model accuracy claim.SimulationManagerdeclared 4,900 cloth particles and successfully stepped, reset and cleaned up. Native 80-step window/camera rendering and the installedrun-exampleCLI passed.pip check: 364 installed packages compatible.black .: 1,781 files unchanged. API inventory: 3293/3293 exports documented. Context checks passed.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
.venvis untouched; the prepared.venv-worldparticleuses the explicit Provider demo path.Checklist
black .command to format the code base.python docs/scripts/check_api_docs.py), if applicable