Skip to content

Add volume and surface deformable schema fragment families - #6673

Merged
ooctipus merged 1 commit into
isaac-sim:developfrom
vidurv-nvidia:vidurv/deformable-fragments
Sep 28, 2026
Merged

ooctipus merged 1 commit into
isaac-sim:developfrom
vidurv-nvidia:vidurv/deformable-fragments

Conversation

@vidurv-nvidia

@vidurv-nvidia vidurv-nvidia commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds volume and surface deformable schema fragments to the existing fragment API.

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

  • Backport this pull request to the active release branch after it merges into develop

@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Jul 22, 2026
StafaH added a commit that referenced this pull request Aug 21, 2026
# 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`
@vidurv-nvidia vidurv-nvidia added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 1, 2026
@vidurv-nvidia vidurv-nvidia added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 15, 2026
@vidurv-nvidia
vidurv-nvidia marked this pull request as ready for review September 15, 2026 20:23
@vidurv-nvidia
vidurv-nvidia requested a review from a team September 15, 2026 20:23
@greptile-apps

greptile-apps Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR is not yet safe to merge because deformable type detection can make the wrong authoring decision for nested deformable hierarchies.

Findings

  1. P1 Nested Body Type Confusion ▶
  2. P1 Deformable type is ignored ▶
  3. P1 Refinement setting is ignored ▶
  4. P1 Public material API removed ▶

Summary

This PR adds volume and surface deformable schema-fragment families, backend-specific deformable setup hooks, spawner integration, deformable material fragments, documentation, and tests. The latest changes address all three previous review findings by rejecting opposite-type targets, forwarding mesh refinement, and restoring the renamed public material function through a deprecated compatibility alias.

  • Adds backend-neutral deformable mesh creation with PhysX and Newton anchor setup.
  • Adds expression-targeted volume and surface deformable writers and spawner configuration slots.
  • Generalizes physics-material fragment spawning to rigid, deformable, and mixed fragment lists.
  • Preserves the former rigid-body material writer name as a deprecated forwarding alias.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Spawner deformable slot] --> B[Resolve target expression]
  B --> C{Body anchor exists?}
  C -- No --> D[Create simulation mesh]
  D --> E[Backend setup_deformable_body]
  E --> F[Apply fragments]
  C -- Yes --> G[Infer authored deformable type]
  G --> H{Requested type matches?}
  H -- Yes --> F
  H -- No --> I[Warn and skip]
Loading

Reviews (2) · Last reviewed commit: "Skip deformable targets authored as the ..."

type(cfg).__name__,
deformable_type,
)
targets, creation_candidates, any_skipped = _match_fragment_targets(prim_path_expr, has_deformable_body_api, stage)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Deformable type is ignored

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment on lines +345 to +351
writer(
props_expr(prim_path, pattern),
fragments,
create_if_missing=True,
stage=stage,
warn_missing_material=warn_missing_material,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Refinement setting is ignored

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.

Suggested change
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,
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Public material API removed

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_fragments is 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_refinement to tetrahedralization despite the documented contract, and legacy collision_props values 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(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@vidurv-nvidia

Copy link
Copy Markdown
Contributor Author

Thanks — all three were real. Fixed in cc111e50bbd, 6a8361d95f6, 61c2b2a2cd2.

Refinement setting is ignored — confirmed against develop: the legacy path passes tetrahedralization_edge_length_fac = 1.0 / cfg.edge_refinement, so the fragment path was silently running at the writer default 0.1 instead of 0.25 at the default edge_refinement=4. Wired through, gated on the volume branch only (surface deformables are not tetrahedralized, so passing it there would be misleading). New parametrized test asserts 0.25 on the volume slot and asserts the kwarg is absent on surface; it fails with KeyError: 'tetrahedralization_edge_length_fac' without the fix.

Public material API removed — you're right, and it contradicts the repo's own rule in AGENTS.md ("do not remove or rename public API symbols without deprecating them in a prior release"). spawn_rigid_body_material_from_fragments is restored as a forwarding alias emitting DeprecationWarning, re-exported from the .pyi, with removal scheduled for 5.0. Test asserts the alias both warns and still authors the material; without it the import raises ImportError.

Deformable type is ignored — confirmed. The discriminator is not on the body anchor at all: it is stamped on the sim mesh (OmniPhysics{Volume,Surface}DeformableSimAPI for PhysX, Physics{Volume,Surface}DeformableSimAPI for Newton), while has_deformable_body_api only tests the type-agnostic body API.

Mismatched targets are now skipped with a warning rather than authored:

Prim '/World/Cloth' is already authored as a surface deformable but was matched by
'/World/Cloth' as a volume deformable; skipping it. Author it through the surface
deformable family instead.

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 /World/.* over a scene containing both kinds unusable. Skipping lets correctly-typed targets proceed, which is the point of expression matching. It rides the existing any_skipped channel — the same one instanced matches already use — so the writer returns False and callers checking the return value see it. A prim whose type cannot be determined (no sim mesh yet) is treated permissively, so nothing that worked before regresses.

Test builds a surface-authored body, calls apply_volume_deformable_properties, and asserts the writer returns False, setup_deformable_body was never called, and no omniphysics:mass was authored. Without the filter it fails with assert True is False — i.e. it reproduces exactly the bug you described.

Suites run green: test_deformable_fragments 10, test_spawn_meshes 21, test_material_fragments 24, physx test_physx_deformable_fragments 3, plus adjacent fragment/material suites.

Comment on lines +783 to +789
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Nested Body Type Confusion

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

ooctipus added a commit that referenced this pull request Sep 20, 2026
# 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]>
@maxkra15

Copy link
Copy Markdown
Contributor

Thanks @vidurv-nvidia , just a few things left:

  • Rebase onto current develop and rerun CI. The current merge incorrectly moves legacy deprecation decorators onto the new PhysX/Newton fragment classes.
  • Fix deformable-type detection for nested deformable bodies.
  • Reject legacy collision_props on the new mesh deformable path instead of silently ignoring them.
  • Update the deformable slot type hints to include the supported bare-fragment and list forms.
  • Change collision_iteration_multiplier from float to int to match the USD uint schema.
  • Remove the already-consumed vidurv-regex-fragment-targeting changelog fragments from Drive fragment schema writers by prim path expressions #6640.

@vidurv-nvidia vidurv-nvidia removed the ci:run-docker Trigger the on-demand Docker and GPU CI workflow label Sep 23, 2026
@vidurv-nvidia vidurv-nvidia added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 23, 2026
@vidurv-nvidia

Copy link
Copy Markdown
Contributor Author

@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 develop, and full CI is running now. The part worth your attention: deformable writers create a simulation mesh rather than tune an existing one, so the bare-fragment shorthand anchors on the spawn prim instead of widening to the subtree the way the other families do.

@vidurv-nvidia vidurv-nvidia added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 23, 2026
ooctipus pushed a commit that referenced this pull request Sep 24, 2026
# 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
@maxkra15

Copy link
Copy Markdown
Contributor

Thanks @vidurv-nvidia , just a few things left:

  • Rebase onto current develop and rerun CI. The current merge incorrectly moves legacy deprecation decorators onto the new PhysX/Newton fragment classes.
  • Fix deformable-type detection for nested deformable bodies.
  • Reject legacy collision_props on the new mesh deformable path instead of silently ignoring them.
  • Update the deformable slot type hints to include the supported bare-fragment and list forms.
  • Change collision_iteration_multiplier from float to int to match the USD uint schema.
  • Remove the already-consumed vidurv-regex-fragment-targeting changelog fragments from Drive fragment schema writers by prim path expressions #6640.

some of theses issues remain and also merge conflict need to be resolved

@ooctipus

Copy link
Copy Markdown
Collaborator

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 28, 2026
@ooctipus
ooctipus force-pushed the vidurv/deformable-fragments branch from 4d24199 to 9f6c90e Compare September 28, 2026 19:02
@ooctipus

Copy link
Copy Markdown
Collaborator

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 28, 2026
@ooctipus
ooctipus merged commit 465ac73 into isaac-sim:develop Sep 28, 2026
53 checks passed
isaaclab-bot Bot pushed a commit that referenced this pull request Sep 28, 2026
## 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)
@isaaclab-bot

isaaclab-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as eaf64e6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants