Skip to content

feat: add indexed fabric transform kernels for local/world matrix propagation#5675

Open
pv-nvidia wants to merge 12 commits into
isaac-sim:developfrom
pv-nvidia:pv/indexed-fabric-kernels
Open

feat: add indexed fabric transform kernels for local/world matrix propagation#5675
pv-nvidia wants to merge 12 commits into
isaac-sim:developfrom
pv-nvidia:pv/indexed-fabric-kernels

Conversation

@pv-nvidia
Copy link
Copy Markdown
Contributor

@pv-nvidia pv-nvidia commented May 18, 2026

Motivation

FabricFrameView currently only accelerates world poses via Fabric. To support Fabric-accelerated get/set_local_poses, we need kernels that can propagate transforms between parent world matrices and child local/world matrices directly in Fabric storage — without round-tripping through USD.

Changes

New Warp kernels (operating on wp.indexedfabricarray):

Kernel Purpose
decompose_indexed_fabric_transforms Extract position/quaternion/scale from indexed fabric matrix
compose_indexed_fabric_transforms Write position/quaternion/scale into indexed fabric matrix
update_indexed_local_matrix_from_world local = inv(parent) * world
update_indexed_world_matrix_from_local world = parent * local

Tests:

  • Smoke test verifying all kernels are importable and are valid wp.Kernel instances
  • Full integration tests (requiring Fabric/USDRT) will follow in the local-poses PR

Docs:

  • Added API docs section for isaaclab.utils.warp.fabric module

Note

These kernels are purely additive — no existing behavior changes. They form the foundation for the upcoming Fabric-accelerated local-poses feature in FabricFrameView.

@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels May 18, 2026
isaaclab-review-bot[bot]

This comment was marked as outdated.

isaaclab-review-bot[bot]

This comment was marked as outdated.

@pv-nvidia pv-nvidia force-pushed the pv/indexed-fabric-kernels branch from 42b7971 to 9388fa6 Compare May 20, 2026 14:10
@pv-nvidia pv-nvidia force-pushed the pv/indexed-fabric-kernels branch 11 times, most recently from c3e6fe1 to 64cb827 Compare May 21, 2026 19:22
@pv-nvidia pv-nvidia closed this May 22, 2026
@pv-nvidia pv-nvidia reopened this May 22, 2026
pv-nvidia added 3 commits May 23, 2026 12:35
…pagation

Add Warp kernels that operate on wp.indexedfabricarray for direct
local↔world matrix propagation without round-tripping through USD:

- decompose_indexed_fabric_transforms: extract pos/quat/scale from ifa
- compose_indexed_fabric_transforms: write pos/quat/scale into ifa
- update_indexed_local_matrix_from_world: local = inv(parent) * world
- update_indexed_world_matrix_from_local: world = parent * local

Also refactor existing kernels to use wp.where (branchless) instead of
if/else for broadcast index selection.

These kernels are the foundation for Fabric-accelerated get/set_local_poses
in FabricFrameView.
- Replace indexedfabricarray hacks with plain wp.array(dtype=wp.mat44d) test kernels
- Test kernels mirror production math: local^T = world^T * inv(parent^T)
- Add 5 tests for world↔local transforms including non-orthogonal/sheared cases
- All tests run on CPU without USDRT/Fabric runtime
- Convert existing class-based tests to plain functions (IsaacLab guideline)
pv-nvidia added 5 commits May 23, 2026 12:35
- Add _local_from_world() and _world_from_local() as @wp.func
- Production fabric kernels delegate to these shared funcs
- Test kernels import and call the same funcs via wp.array adapters
- Zero copy-pasted math: tests exercise identical code paths as production
- Add _local_from_world_transposed() and _world_from_local_transposed() as @wp.func
  (names make explicit they operate on transposed storage matrices)
- Production fabric kernels delegate to these shared funcs
- Test kernels import and call the same funcs via wp.array adapters
- Remove __all__ (not an IsaacLab convention)
- Remove importability/export tests (unnecessary)
- Remove batch test (Warp handles batching)
- Add inline det != 0 assertions to world↔local tests
- Remove _local_from_world_transposed / _world_from_local_transposed
  @wp.func helpers (one-liner math, abstraction added no value)
- Add __all__ export list for public API surface
- Sync test file with full-stack state
- Changelog: 'Will be used by' → 'Used by'
@pv-nvidia pv-nvidia force-pushed the pv/indexed-fabric-kernels branch from aaed9d9 to c9dcf47 Compare May 23, 2026 10:47
@pv-nvidia pv-nvidia self-assigned this May 23, 2026
@pv-nvidia pv-nvidia marked this pull request as ready for review May 23, 2026 17:18
@pv-nvidia pv-nvidia force-pushed the pv/indexed-fabric-kernels branch from eda2b1c to 6668393 Compare May 23, 2026 17:21
@pv-nvidia pv-nvidia requested a review from ooctipus as a code owner May 23, 2026 17:21
@pv-nvidia pv-nvidia force-pushed the pv/indexed-fabric-kernels branch from 6668393 to a51094f Compare May 23, 2026 17:21
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 23, 2026

Greptile Summary

This PR adds four new @wp.kernel functions and two @wp.func helpers to isaaclab.utils.warp.fabric, enabling Fabric-accelerated local/world matrix propagation via wp.indexedfabricarray without USD round-trips. The changes are purely additive and form a foundation for the upcoming FabricFrameView.get/set_local_poses feature.

  • decompose_indexed_fabric_transforms / compose_indexed_fabric_transforms mirror the existing non-indexed kernels but skip the explicit mapping argument, since the view-to-fabric mapping is baked into the IndexedFabricArrayMat44d.
  • update_indexed_local_matrix_from_world / update_indexed_world_matrix_from_local compute local = inv(parent) * world and world = parent * local directly on transposed Fabric storage matrices using the identity (A·B)ᵀ = Bᵀ·Aᵀ, avoiding explicit transposes.
  • A new test file exercises the decompose round-trip and both matrix-propagation helpers via plain wp.array wrappers so no Fabric/USDRT runtime is required.

Confidence Score: 5/5

Safe to merge — all four kernels are purely additive and no existing behaviour is altered.

The change introduces new kernels that are never called by existing code paths, so there is no regression risk. The matrix math (transposed storage convention, float32 intermediate precision) is consistent with the patterns already established in the file. The helper @wp.func functions are directly exercised by the new tests.

No files require special attention; the new kernels in source/isaaclab/isaaclab/utils/warp/fabric.py follow the existing patterns closely.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/utils/warp/fabric.py Adds four new Warp kernels and two helper @wp.func functions for indexed Fabric matrix operations; logic is consistent with existing non-indexed kernels but has a minor docstring inaccuracy in update_indexed_local_matrix_from_world and the compose kernel reads the existing fabric matrix unnecessarily when all components are supplied.
source/isaaclab/test/utils/warp/test_fabric_kernels.py New test file covering decompose round-trip and local↔world matrix propagation math via plain wp.array wrappers; compose_indexed_fabric_transforms is not exercised (noted in a prior review thread).
source/isaaclab/changelog.d/indexed-fabric-kernels.rst Changelog entry correctly describes the new kernels but reverses the matrix multiplication order for the local-from-world formula (previously flagged in review).
docs/source/api/lab/isaaclab.utils.rst Adds an automodule section for the new isaaclab.utils.warp.fabric module; straightforward documentation change with no issues.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph "set_local_poses (upcoming)"
        SLP[Caller writes local pos/quat/scale]
    end

    subgraph "compose_indexed_fabric_transforms"
        CIF1[Read current fabric_matrices view_index]
        CIF2[_decompose_transformation_matrix]
        CIF3[Overwrite pos / rot / scale from input arrays]
        CIF4["Write wp.transpose(transform_compose) → fabric_matrices[view_index]"]
        CIF1 --> CIF2 --> CIF3 --> CIF4
    end

    subgraph "update_indexed_world_matrix_from_local"
        UW1["Read child_local_matrices[view_index] → mat44f"]
        UW2["Read parent_world_matrices[view_index] → mat44f"]
        UW3["_world_from_local_transposed: world^T = local^T × parent^T"]
        UW4["Write → child_world_matrices[view_index]"]
        UW1 --> UW3
        UW2 --> UW3 --> UW4
    end

    subgraph "update_indexed_local_matrix_from_world"
        UL1["Read child_world_matrices[view_index] → mat44f"]
        UL2["Read parent_world_matrices[view_index] → mat44f"]
        UL3["_local_from_world_transposed: local^T = world^T × inv(parent^T)"]
        UL4["Write → child_local_matrices[view_index]"]
        UL1 --> UL3
        UL2 --> UL3 --> UL4
    end

    subgraph "decompose_indexed_fabric_transforms"
        DIF1["Read fabric_matrices[view_index] → mat44f"]
        DIF2[_decompose_transformation_matrix]
        DIF3["Write pos/rot/scale → output arrays[output_index]"]
        DIF1 --> DIF2 --> DIF3
    end

    SLP --> CIF1
    CIF4 --> UW1
    UW4 -->|"consistent worldMatrix"| DIF1
Loading

Reviews (2): Last reviewed commit: "test: replace scipy with warp builtins i..." | Re-trigger Greptile

Comment thread source/isaaclab/test/utils/warp/test_fabric_kernels.py
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

None yet

Development

Successfully merging this pull request may close these issues.

1 participant