draft: refactor spawn - #516
Conversation
Greptile SummaryThe PR refactors simulation assets around a declaration, Spawn commit, runtime preparation, and facade-binding lifecycle.
Confidence Score: 2/5The PR does not appear safe to merge because Spawn attribute operations and articulation overrides remain broken, and failed facade binding cannot be retried. Spawn rigid-body attribute methods still raise for supported facade operations, articulation finalization still omits configured non-mass physics attributes, and prepare() records a committed result before binding succeeds so a retry can skip the failed callbacks. Files Needing Attention: embodichain/lab/sim/objects/backends/spawn.py, embodichain/lab/sim/objects/articulation.py, embodichain/lab/sim/sim_manager.py
|
| Filename | Overview |
|---|---|
| embodichain/lab/sim/sim_manager.py | Centralizes declaration materialization and facade binding in SimulationManager.prepare(). |
| embodichain/lab/sim/objects/backends/spawn.py | Adds tensor-layout adapters for Spawn rigid-body and articulation batches. |
| embodichain/lab/sim/objects/articulation.py | Adds declared and Spawn-bound articulation lifecycle support with post-bind configuration. |
| embodichain/lab/gym/envs/base_env.py | Splits scene declaration from post-prepare robot and sensor configuration. |
| embodichain/lab/sim/spawn/scene.py | Coordinates Spawn declarations, commits, and facade bind callbacks. |
Reviews (6): Last reviewed commit: "prepare envs" | Re-trigger Greptile
| def fetch_friction( | ||
| self, data: torch.Tensor, body_ids: torch.Tensor | None = None | ||
| ) -> None: | ||
| del data, body_ids | ||
| self._unsupported_property("friction") | ||
|
|
||
| def apply_friction(self, data: torch.Tensor, body_ids: torch.Tensor) -> None: | ||
| del data, body_ids | ||
| self._unsupported_property("friction") |
There was a problem hiding this comment.
Ready view exposes unsupported attributes
When a caller invokes set_friction or get_friction on a Spawn-bound rigid object, the ready body view dispatches to methods that unconditionally raise NotImplementedError, causing existing rigid-object attribute operations to fail. The finalized Newton attribute path also invokes the unsupported friction, restitution, and contact-offset setters.
Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/lab/sim/objects/backends/spawn.py
Line: 280-288
Comment:
**Ready view exposes unsupported attributes**
When a caller invokes `set_friction` or `get_friction` on a Spawn-bound rigid object, the ready body view dispatches to methods that unconditionally raise `NotImplementedError`, causing existing rigid-object attribute operations to fail. The finalized Newton attribute path also invokes the unsupported friction, restitution, and contact-offset setters.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
add_*APIs and stable object facades through a declaration → prepare → bind lifecycle.sim.prepare(), including rigid, articulation, robot, soft-body, cloth, and rigid-object-group integration.Validation
Type of change
Dependency
Requires the matching DexSim Spawn implementation.