feat: add indexed fabric transform kernels for local/world matrix propagation#5675
feat: add indexed fabric transform kernels for local/world matrix propagation#5675pv-nvidia wants to merge 12 commits into
Conversation
619c037 to
42b7971
Compare
42b7971 to
9388fa6
Compare
c3e6fe1 to
64cb827
Compare
…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)
- 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'
…l-stack" This reverts commit 735132e.
aaed9d9 to
c9dcf47
Compare
eda2b1c to
6668393
Compare
6668393 to
a51094f
Compare
Greptile SummaryThis PR adds four new
Confidence Score: 5/5Safe 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
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
Reviews (2): Last reviewed commit: "test: replace scipy with warp builtins i..." | Re-trigger Greptile |
Motivation
FabricFrameViewcurrently only accelerates world poses via Fabric. To support Fabric-acceleratedget/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):decompose_indexed_fabric_transformscompose_indexed_fabric_transformsupdate_indexed_local_matrix_from_worldlocal = inv(parent) * worldupdate_indexed_world_matrix_from_localworld = parent * localTests:
wp.KernelinstancesDocs:
isaaclab.utils.warp.fabricmoduleNote
These kernels are purely additive — no existing behavior changes. They form the foundation for the upcoming Fabric-accelerated local-poses feature in
FabricFrameView.