Repository navigation
Add volume and surface deformable schema fragment families - #6673
Conversation
# Description Fix the recurring `isaaclab_rl` LEAPP export failure for `Isaac-Reach-Franka` on Newton MJWarp. The existing workaround passes `limit_cpu_threads=1` to `SimulationApp`, but the failing stack is in OpenUSD's concurrent parser and OpenUSD reads `PXR_WORK_THREAD_LIMIT` during process startup. Set that environment variable on every LEAPP child process so USD is serialized before any USD module is imported, while retaining the existing Kit-side limit. This keeps the current task and Newton backend coverage. It also adds a deterministic subprocess probe for the environment contract. Observed in unrelated PRs: - #6762: https://github.com/isaac-sim/IsaacLab/actions/runs/32343107298/job/96578439022 - #6673: https://github.com/isaac-sim/IsaacLab/actions/runs/32419190550/job/96590692454 - #7207: https://github.com/isaac-sim/IsaacLab/actions/runs/32418984574/job/96590568310 OpenUSD documents `PXR_WORK_THREAD_LIMIT=1` as single-threaded mode: https://openusd.org/dev/api/thread_limits_8h.html ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Validation - `uv run --extra sb3 --extra skrl --extra rl-games --extra leapp python -m pytest source/isaaclab_rl/test/export/test_leapp_export_flow.py -k 'openusd_thread_limit or rsl_rl-Isaac-Reach-Franka' -vv` (2 passed) - `uv run isaaclab -f` - `uv run python tools/changelog/cli.py check develop` ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with `uv run isaaclab -f` - [x] Documentation is not required for this test-only mitigation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective - [x] I have added a changelog fragment for every touched package - [x] My name is already in `CONTRIBUTORS.md`
|
| type(cfg).__name__, | ||
| deformable_type, | ||
| ) | ||
| targets, creation_candidates, any_skipped = _match_fragment_targets(prim_path_expr, has_deformable_body_api, stage) |
There was a problem hiding this comment.
Both family writers identify existing targets using only the generic deformable-body API, while the volume or surface type is encoded on the simulation mesh. If a pre-authored surface body is targeted through volume_deformable_props, or vice versa, it bypasses backend setup and receives the requested fragments while retaining its original simulation type. The spawner therefore silently produces a different deformable type than configured.
There was a problem hiding this comment.
Fixed in 61c2b2a2cd2 — mismatched targets are skipped with a warning and drag the return to False. Tightened further in ede9f0fe57b per the follow-up on nested bodies.
| writer( | ||
| props_expr(prim_path, pattern), | ||
| fragments, | ||
| create_if_missing=True, | ||
| stage=stage, | ||
| warn_missing_material=warn_missing_material, | ||
| ) |
There was a problem hiding this comment.
The new volume-fragment path does not pass 1.0 / cfg.edge_refinement to the volume writer. As a result, MeshCfg(volume_deformable_props=...) always uses the writer default of 0.1, rather than the configured target—for example, 0.25 with the default refinement of 4. This makes edge_refinement ineffective on the new path and can create unexpectedly dense simulation meshes.
| writer( | |
| props_expr(prim_path, pattern), | |
| fragments, | |
| create_if_missing=True, | |
| stage=stage, | |
| warn_missing_material=warn_missing_material, | |
| ) | |
| writer( | |
| props_expr(prim_path, pattern), | |
| fragments, | |
| create_if_missing=True, | |
| stage=stage, | |
| warn_missing_material=warn_missing_material, | |
| tetrahedralization_edge_length_fac=1.0 / cfg.edge_refinement, | |
| ) |
There was a problem hiding this comment.
Fixed in cc111e50bbd — 1.0 / cfg.edge_refinement is forwarded on the volume branch only, matching the legacy path; surface deformables are not tetrahedralized.
| __all__ = [ | ||
| "spawn_rigid_body_material", | ||
| "spawn_rigid_body_material_from_fragments", | ||
| "spawn_physics_material_from_fragments", |
There was a problem hiding this comment.
This nominally non-breaking PR removes the previously exported spawn_rigid_body_material_from_fragments name without a compatibility alias. Existing external imports of that public function will fail immediately. Please retain a deprecated forwarding alias while exposing the generalized name.
There was a problem hiding this comment.
Fixed in 6a8361d95f6 — spawn_rigid_body_material_from_fragments is restored as a deprecated forwarding alias, re-exported from the .pyi, with a test that it both warns and still authors the material.
There was a problem hiding this comment.
Isaac Lab Review Bot
The deformable fragment architecture and backend hook are coherent, but the patch introduces four actionable compatibility and contract issues: an undeprecated public function rename, incomplete slot type annotations, ignored legacy collision configuration on the new slot path, and failure to propagate mesh refinement into volume tetrahedralization.
- Design and architecture: The separation of backend-neutral mesh creation from PhysX/Newton anchor setup is well structured, and targeting the spawn prim by default avoids accidental subtree tetrahedralization. However, the new mesh deformable-slot path bypasses the existing validation that rejects legacy collision configurations, causing those settings to be silently ignored.
- API: The new fragment and material APIs are documented and exported, but
spawn_rigid_body_material_from_fragmentsis removed without the required deprecation alias, breaking existing imports. Additionally, the public deformable-slot annotations advertise only mappings even though bare fragments and fragment lists are intentionally accepted and tested. - Implementation: The backend setup preserves the legacy rest-state and visual synchronization paths. Two mesh-spawner issues remain: volume fragment creation does not forward
1.0 / edge_refinementto tetrahedralization despite the documented contract, and legacycollision_propsvalues are silently skipped rather than rejected when the new deformable slots are used.
Minor fixes needed. Posted 4 actionable findings inline.
Automated review; human maintainers own approval decisions.
|
|
||
|
|
||
| def spawn_rigid_body_material_from_fragments( | ||
| def spawn_physics_material_from_fragments( |
There was a problem hiding this comment.
🟡 Warning · Api — Public spawner renamed without deprecation alias
spawn_rigid_body_material_from_fragments was an exported public symbol (package __all__ and an autofunction entry, and it is referenced from the compiled changelog). Renaming it to spawn_physics_material_from_fragments with no forwarding symbol breaks existing imports, contrary to the rule requiring a prior deprecation and migration path. Keep a thin deprecated alias that warns and delegates, and re-export it until the announced removal.
There was a problem hiding this comment.
Same fix as the material-API thread above: 6a8361d95f6.
| # missing-material advisory when a material is configured to avoid a spurious warning | ||
| warn_missing_material = cfg.physics_material is None | ||
| for pattern, fragments in mapping.items(): | ||
| writer( |
There was a problem hiding this comment.
🟡 Warning · Implementation — edge_refinement not forwarded to tetrahedralization
The fragment path calls the volume writer without tetrahedralization_edge_length_fac, so it always uses the 0.1 default, while the legacy path passes 1.0 / cfg.edge_refinement (0.25 by default). This contradicts MeshCfg.edge_refinement's documented "same normalized target for automatic tetrahedralization" and this PR's changelog entry, and yields a much finer, slower TetWild mesh. Forward 1.0 / cfg.edge_refinement for the volume kind.
There was a problem hiding this comment.
Same fix as the refinement thread above: cc111e50bbd.
| ) | ||
| # collision tuning rides the collision family, anchored at the spawn prim so the created | ||
| # sim mesh child is reachable (e.g. {"/sim_mesh": [...]}) | ||
| collision_props_mapping = fragment_mapping(cfg.collision_props) |
There was a problem hiding this comment.
🔵 Suggestion · Implementation — Legacy collision_props silently ignored on slot path
fragment_mapping returns None for a legacy CollisionPropertiesCfg, so on the new deformable-slot path collision authoring is skipped with no error. The existing guard that raises "Deformable bodies require 'collision_props' as collision fragments" is still keyed on cfg.deformable_props, so this misconfiguration now fails silently instead of loudly. Extend that guard to cover volume_deformable_props and surface_deformable_props.
There was a problem hiding this comment.
Fixed in ff7c88625b7 — the guard now keys on either deformable fragment slot as well as the legacy field. Parametrized test over both slots; without the fix it fails with DID NOT RAISE <class 'ValueError'> on each.
| deformable_props: schemas.DeformableBodyPropertiesBaseCfg | None = None | ||
| """Deformable body properties.""" | ||
|
|
||
| volume_deformable_props: dict[str, list[schemas.DeformableBodyFragment]] | None = None |
There was a problem hiding this comment.
🔵 Suggestion · Api — Slot annotation excludes accepted bare-fragment form
Both slots are annotated dict[str, list[DeformableBodyFragment]] | None, but resolve_deformable_slot routes values through fragment_mapping, so a bare fragment or fragment list is accepted and is exercised by the new test. Sibling slots such as collision_props spell every accepted form. Widen both annotations to include the fragment and list shorthand and mention it in the docstrings.
There was a problem hiding this comment.
Fixed in ff7c88625b7 — both slots now spell the fragment and list forms like the sibling slots. The docstring also states the one way these differ from them: the shorthand anchors on the spawn prim on every spawner type and never widens to the subtree, because the deformable writers build a simulation mesh on each target.
|
Thanks — all three were real. Fixed in Refinement setting is ignored — confirmed against Public material API removed — you're right, and it contradicts the repo's own rule in Deformable type is ignored — confirmed. The discriminator is not on the body anchor at all: it is stamped on the sim mesh ( Mismatched targets are now skipped with a warning rather than authored: Chosen over the alternatives deliberately: authoring anyway is the same silent-wrong-config bug with a log line; coercing would discard already-authored simulation geometry; raising would make a legitimately mixed expression like Test builds a surface-authored body, calls Suites run green: |
| for descendant in Usd.PrimRange(prim): | ||
| for schema in descendant.GetPrimTypeInfo().GetAppliedAPISchemas(): | ||
| # multi-apply schemas carry an instance suffix (``Api:instance``); the split is a no-op | ||
| # for the single-apply sim APIs matched here | ||
| authored_type = _DEFORMABLE_SIM_API_TYPES.get(schema.split(":", 1)[0]) | ||
| if authored_type is not None: | ||
| return authored_type |
There was a problem hiding this comment.
When an anchored body contains a nested deformable body or multiple descendants with deformable simulation APIs, this loop uses the first API found anywhere in the subtree. A nested body's type can therefore be mistaken for the outer body's type, causing the writer to skip a correctly typed target or apply fragments for the opposite type.
There was a problem hiding this comment.
Fixed in ede9f0fe57b. The walk now prunes at any nested deformable-body anchor, so a nested body's simulation mesh can no longer decide the outer body's type. If a body's own simulation meshes disagree, the type is reported as undeterminable, which leaves the body an ordinary target rather than skipping or mis-typing it.
Two regression tests, both verified failing without the fix: one authors the nested body first so a plain walk hits its surface mesh before the outer body's volume mesh (assert 'surface' == 'volume' without the fix); the other gives one body disagreeing meshes.
# Description Marks the legacy physics schema config classes and writers deprecated, with per-symbol migration guidance. **Nothing is removed.** Per `AGENTS.md`, this is the prior-release deprecation that a later removal requires. Best reviewed after #7838, which converts the repo's own call sites to fragments. This PR does not depend on it to build or pass — verified that importing shipped asset configs emits the same 8 `DeprecationWarning`s on this branch and on clean `develop`, so it adds no new import-time noise — but landing the migration first keeps our own configs off the deprecated path. ## Scope **35 classes.** Core: `MassPropertiesCfg`, `RigidBodyBaseCfg`, `CollisionBaseCfg`, `JointDriveBaseCfg`, `ArticulationRootBaseCfg`, `MeshCollisionBaseCfg`, `BoundingCube/BoundingSpherePropertiesCfg`. PhysX: the 9 `Physx*PropertiesCfg` classes plus the 10 2.x aliases. Newton: 8 `Newton*`/`Mujoco*PropertiesCfg`. **13 writers.** `define_`/`modify_` × {articulation_root, rigid_body, collision, mass}, plus `modify_joint_drive_properties`, the two tendon writers, and `define_`/`modify_mesh_collision_properties`. **Excluded: everything deformable.** Its fragment families are still in #6673, so there is nothing to point users at yet. A test asserts the deformable symbols stay undeprecated so this cannot drift. ## Mechanism Uses `typing_extensions.deprecated`, which is already a dependency. A small config-class helper applies it to the generated `__init__` above `@configclass`, so construction warns once for the concrete class while importing and defining subclasses remain silent. Signatures, field aliases, `to_dict()`, `copy()`, `replace()`, and `dataclasses.replace()` remain intact. Writers use the standard decorator above `@apply_nested`. Six internal delegation calls bypass only the deprecation wrapper through `__wrapped__`, retaining subtree traversal and emitting one warning naming the public entry point. There is no custom writer decorator or nesting state. Tests that need the raw per-prim writer use `inspect.unwrap(writer)` to bypass all decorators; `modify_*.__wrapped__` now refers to the traversal wrapper. ## Removal version The legacy cfgs and writers are deprecated in **3.1** and scheduled for removal in **3.2**. ## Documentation New migration-guide section in `docs/source/migration/migrating_to_isaaclab_3-0.rst`: full deprecated→fragment table, before/after code, the two non-USD flags that moved to the spawner (`fix_root_link`, `ensure_drives_exist`), the writer table, and a warning-filter snippet for migrating incrementally. Also corrects that guide's existing "Class moves and renames" section, which still recommended `Physx*PropertiesCfg` / `*BaseCfg` as the "Recommended 3.0 pattern" — exactly what this PR deprecates. ## Type of change - Documentation update - New feature (non-breaking change which adds functionality) ## Testing **292 tests passed** locally: - `test_schemas_deprecation.py`: 88 passed. - `test_schemas_shim.py`: 142 passed. - `test_schemas.py`: 44 passed. - `test_tendon_fragments.py`: 18 passed. Covered warning messages and caller locations, construction without import-time warnings, inherited configs, direct and delegated writers, nested mesh collision, child traversal, and raw-writer access. A regression check rejects the removed custom writer decorator and depth state; it fails on the preceding implementation and passes here. All 13 writer warning messages are unchanged. An AST comparison verified that the writer bodies are unchanged apart from the six delegation calls. `uv run isaaclab -f` passed with the changelog checker configured against the PR base. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the `pre-commit` checks with `uv run isaaclab -f` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Co-authored-by: Octi Zhang <[email protected]>
|
Thanks @vidurv-nvidia , just a few things left:
|
|
@ooctipus @StafaH — could you review this today? It adds the deformable schema fragments, the last family still on the old cfg classes, so this completes the fragment framework. Between the two of you, you cover every code-owner path it touches. Every bot finding is fixed and has an inline reply, the branch is merged up with current |
# Description Migrates the remaining in-repo users of the legacy physics schema cfgs to schema fragments. These classes are deprecated in 3.1 and removed in 3.2 (#7839), so every site here currently emits `DeprecationWarning`s and would break at removal. The earlier migration (#7838) converted `source/` but never covered `scripts/`, and its grep missed the `*BaseCfg` spellings. On top of that, some new legacy usage has landed since. An AST scan (comments and docstrings excluded) finds **144 live legacy constructions or writer calls in 37 files on `develop`. This PR brings that to 0**, outside the deliberate exclusions listed below. **Scope** - **`scripts/` (29 files):** all tutorials, demos (including the MPM demos), `convert_mesh` / `convert_instanceable`, and three benchmarks. - **Task configs:** `core/reach/reach_env_cfg.py`, `contrib/ur10_particle_push`, and one of the five `contrib/nist` sites. - **Tests:** the camera-pose, first-frame-rendering and OpenCV-distortion sensor tests; the rigid/mass/collision parts of the cable and MPM tests; `test_ovphysx_gravity`. ## Mapping rules Every one of these has caused a real regression in an earlier migration: - **A bare fragment when one covers the fields.** This keeps in-place tuning such as `cfg.rigid_props.disable_gravity = True` working downstream. - **Empty legacy cfgs map only to the core `UsdPhysics*` fragment.** A fragment applies its schema even when all of its fields are `None`. `RigidBodyPropertiesCfg()` therefore becomes `UsdPhysicsRigidBodyCfg()` alone. Adding `PhysxRigidBodyCfg()` would add a `PhysxRigidBodyAPI` the legacy class never applied. - **`enabled_self_collisions` keeps its Newton mirror.** The legacy writer also authors `newton:selfCollisionEnabled`, so these sites emit `NewtonArticulationCfg` next to `PhysxArticulationCfg`. - **`disable_gravity` goes to `PhysxRigidBodyCfg`**, including on Newton-flavoured cfgs. - **`define_*` writer calls become `apply_*(..., create_if_missing=True)`**, which preserves creation. ## Verification **USD-attribute parity at every site, with negative controls.** Legacy and fragment forms are authored through the real spawners on sibling prims, and the harness diffs `GetPrimTypeInfo().GetAppliedAPISchemas()`, every authored attribute, and relationships. - `scripts/`: 64 groups. 60 are identical. The other 4 differ only in that legacy authored `physics:approximation="none"` explicitly, while the fragment leaves it unset and it resolves to the same `"none"`. 8 of 8 negative controls are flagged. - `source/`: every site is identical, and every negative control is flagged. **Task configs** are also checked end to end. Each task is loaded through its gym `env_cfg_entry_point` on both `develop` and this branch, across presets. All 22 affected spawned entities author identical USD, including the nist Franka on the real asset. A task-level negative control produces a diff. **Execution:** 13 scripts ran headless for 100–300 steps with no schema deprecations: the tutorials, bin_packing, multi_asset, the sensor demos, and tacsl. `convert_mesh` was run end to end for 6 approximations. All 29 scripts compile. The migrated test files pass. **Not runnable in the dev environment, so covered by parity only:** the Newton-physics script paths, including the MPM demos, which need a newer `newton` than was installed locally. Also the `omni.replicator`, ovrtx, and Haply scripts. CI covers the rest. ## Deliberately left on the legacy API - **Spawner, converter, and schema routing internals.** They *are* the legacy path, which must keep working until 3.2. - **Tests that exercise or compare the legacy path**, such as `test_schemas*`, the parity tests, and the legacy arms of the fragment tests. - **`integration_scene_cfgs.py`.** It is a backend-neutral core module, and its `disable_gravity` has no non-PhysX fragment home. - **Everything deformable.** The deformable deprecation PR, stacked on #6673, handles it. - **4 of the 5 `contrib/nist` sites.** They nest a mesh-collision cfg inside `collision_props`. The deprecation messages point users to a spawner `mesh_collision_props` slot, but that slot exists only on `MeshConverterCfg`, not on `UsdFileCfg` or the shape and mesh spawners. There is no supported fragment path for these sites yet. That gap needs its own fix before 3.2. ## Found along the way, not changed here - `RigidBodyMaterialCfg` is deprecated too, and 8 scripts still use it. - `convert_instanceable.py`'s mesh branch is already broken on `develop`: it passes `collision_approximation=` to `MeshConverterCfg`, which raises `TypeError`. - `docs/source/how-to/write_articulation_cfg.rst` still describes the legacy names. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the `pre-commit` checks with `./isaaclab.sh --format` - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
some of theses issues remain and also merge conflict need to be resolved |
|
run-ci |
4d24199 to
9f6c90e
Compare
|
run-ci |
## Summary
Adds volume and surface deformable schema fragments to the existing
fragment API.
```python
spawn = sim_utils.MeshRectangleCfg(
size=(0.5, 0.5),
surface_deformable_props=sim_utils.OmniPhysicsDeformableBodyCfg(mass=0.2),
collision_props=sim_utils.UsdPhysicsCollisionCfg(collision_enabled=True),
physics_material=sim_utils.OmniPhysicsSurfaceDeformableMaterialCfg(surface_thickness=0.01),
)
```
- `volume_deformable_props` and `surface_deformable_props` accept a
fragment, list, or explicit path mapping. A bare fragment targets only
the spawn prim, not every mesh below it. Only one deformable slot may be
set.
- Creation prepares the simulation mesh, applies the active backend's
body/simulation schemas, then authors the fragments. Existing bodies are
tuned without rebuilding their meshes. A supplied TetMesh is reused.
- PhysX and Newton implement the setup hook. PhysX supplies rest/bind
poses; Newton supplies its native schema tokens and visual mesh setup.
- Physics materials accept deformable fragments and mixed
rigid/deformable lists. The generalized writer is
`spawn_physics_material_from_fragments`; its former rigid-only name
remains a deprecated forwarder.
- Legacy deformable configs and entry points remain available.
OVPhysX's new fragment-slot setup is not implemented in this PR; its
existing `deformable_props` path remains supported.
## Rebase and cleanup
Rebased onto develop `5e6b21bf3`.
Removed the empty Newton body placeholder, a material-warning subtree
walk and its suppression flag, two one-use spawner helpers, redundant
callable resolution, an unused backend-hook argument, and the unused
tetrahedralization argument on the surface writer. Removed stale
changelog fragments from the already-merged dependency.
Consolidated five new test files into the remaining deformable and
existing schema suites. Tests exercise authored USD results, including
nested-body ownership, rather than a stub manager or metadata-only
assertions.
Fixed two authoring errors:
- Bare collision fragments now tune the deformable simulation mesh, not
the inert body root.
- Mesh preparation uses the explicitly supplied stage rather than
searching the current stage.
The net PR addition decreased from 2,007 to 1,280 lines, including
production code from +964 to +766 and tests from +730 to +281. These
counts compare each branch against its respective develop merge base.
## Validation
- **187 tests passed** across deformable fragments, material fragments,
mesh spawning, Newton schemas, core schemas, backend separation, schema
fragments, and deprecation coverage.
- Ran against Isaac Sim 6.1, including both PhysX and Newton schema
setup. Two unrelated asset-dependent articulation tests were excluded
from this focused run.
- Verified the collision-target and explicit-stage regression cases fail
with the previous behavior restored.
- `uv run isaaclab -f` and changelog checks passed.
- Documentation builds and the broader test matrix are left to CI.
## Type of change
New feature. Existing public entry points are retained.
## Release backport
- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`
(cherry picked from commit 465ac73)
|
Backported to |
Summary
Adds volume and surface deformable schema fragments to the existing fragment API.
volume_deformable_propsandsurface_deformable_propsaccept a fragment, list, or explicit path mapping. A bare fragment targets only the spawn prim, not every mesh below it. Only one deformable slot may be set.spawn_physics_material_from_fragments; its former rigid-only name remains a deprecated forwarder.OVPhysX's new fragment-slot setup is not implemented in this PR; its existing
deformable_propspath remains supported.Rebase and cleanup
Rebased onto develop
5e6b21bf3.Removed the empty Newton body placeholder, a material-warning subtree walk and its suppression flag, two one-use spawner helpers, redundant callable resolution, an unused backend-hook argument, and the unused tetrahedralization argument on the surface writer. Removed stale changelog fragments from the already-merged dependency.
Consolidated five new test files into the remaining deformable and existing schema suites. Tests exercise authored USD results, including nested-body ownership, rather than a stub manager or metadata-only assertions.
Fixed two authoring errors:
The net PR addition decreased from 2,007 to 1,280 lines, including production code from +964 to +766 and tests from +730 to +281. These counts compare each branch against its respective develop merge base.
Validation
uv run isaaclab -fand changelog checks passed.Type of change
New feature. Existing public entry points are retained.
Release backport
develop