Skip to content

Articulation Reordering Part 9: Cache read launches - #6479

Merged
kellyguo11 merged 7 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/articulation-reordering-p9
Jul 30, 2026
Merged

kellyguo11 merged 7 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/articulation-reordering-p9

Conversation

@AntoineRichard

@AntoineRichard AntoineRichard commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Caches recorded Warp commands for articulation ordering and stable post-read kernels in the PhysX, Newton, and OVPhysX backends. This avoids repeated Warp launch setup while preserving CPU behavior and CUDA graph capture. Cached commands are discarded when articulation data is rebound or ordering buffers are rebuilt so recorded array arguments cannot become stale.

OVPhysX now also exposes articulation COM/link Jacobians, mass matrices, and gravity compensation through the backend-agnostic data API. Same-timestamp COM, mass, inertia, and armature writes invalidate the affected computed-dynamics buffers before the next read.

This is stacked after #6341.

Relationship to #6674

Commit 00c869a0f8 contains the focused OVPhysX articulation-dynamics portion of #6674, excluding its unrelated deformable-task changes. The cache and freshness work is isolated in 8bd23d94ed. If #6674 merges first, the overlapping dynamics commit can be dropped while rebasing and the cache commit retained.

Type of change

  • New feature (non-breaking change which adds functionality)

Validation

  • ./isaaclab.sh -f
  • Focused cache, lifecycle, generalized-dynamics, and CPU dynamics regressions: 9 passed.
  • Focused OVPhysX CUDA dynamics shard, after confirming the GPU was idle: 4 passed.
  • Changelog tooling: 90 passed.
  • Added focused PhysX coverage for command reuse and reset invalidation.
  • Added focused Newton coverage for command reuse, reset invalidation, and graph-capture fallback.
  • Performance measurements are documented in the articulation ordering investigation report.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh -f
  • My changes generate no new warnings
  • I have added tests that cover the feature
  • I have added changelog fragments for isaaclab_physx, isaaclab_newton, and isaaclab_ovphysx
  • My name already exists in CONTRIBUTORS.md

Documentation screenshots are not applicable.

@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Jul 13, 2026
@AntoineRichard
AntoineRichard force-pushed the antoiner/articulation-reordering-p9 branch 9 times, most recently from 685637a to 7ddbc40 Compare July 20, 2026 08:01
@AntoineRichard
AntoineRichard force-pushed the antoiner/articulation-reordering-p9 branch from 7ddbc40 to 2c640cf Compare July 21, 2026 15:08
@AntoineRichard
AntoineRichard force-pushed the antoiner/articulation-reordering-p9 branch 4 times, most recently from 4c7ba86 to 5a00c43 Compare July 27, 2026 08:43
@AntoineRichard
AntoineRichard force-pushed the antoiner/articulation-reordering-p9 branch from 5a00c43 to 8db54cb Compare July 28, 2026 21:17
Record stable PhysX ordering reads once and replay their Warp commands. Avoid nested recording during Newton CUDA graph capture, and discard cached commands when articulations reset or ordering buffers are rebound.
Cache stable PhysX and Newton articulation read kernels so repeated property refreshes avoid Python and Warp launch setup. Preserve eager execution for dynamic scalar inputs and invalidate commands only when their captured buffers can change.
Warp returns no recorded command for zero-sized launch dimensions. Treat that result as a completed no-op so fixed and zero-DOF articulations can initialize with read caching enabled.
Cover Warp recording calls that return no launch command in both Newton and PhysX. The regression tests ensure zero-sized read launches remain no-ops without polluting the command cache.
Clarify that the articulation read caching and task environment updates require no user migration. This keeps each Changed entry compliant with the changelog fragment policy.
@AntoineRichard
AntoineRichard force-pushed the antoiner/articulation-reordering-p9 branch from 8db54cb to e79b9f2 Compare July 29, 2026 08:39
Expose Jacobians, mass matrices, and gravity compensation through the backend-agnostic articulation data API. Keep the focused dynamics delta separate so the overlap can be dropped cleanly if PR isaac-sim#6674 lands first.
Record stable post-read Warp launches for replay outside graph capture. Invalidate computed dynamics after same-timestamp model writes so cached Jacobians, mass matrices, and gravity forces remain coherent.
@AntoineRichard

Copy link
Copy Markdown
Collaborator Author

Included with preserved ancestry in aggregate PR #6784. Please keep this source PR unchanged; after #6784 merges, this PR can be closed as superseded if it is still open.

@AntoineRichard
AntoineRichard marked this pull request as ready for review July 29, 2026 14:09
@greptile-apps

greptile-apps Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR optimizes articulation reads and expands OVPhysX dynamics support.

  • Caches stable Warp read commands in the Newton, PhysX, and OVPhysX backends while bypassing the cache during CUDA graph capture.
  • Invalidates recorded commands when simulation bindings or articulation-ordering buffers are rebuilt.
  • Adds OVPhysX COM/link Jacobians, mass matrices, and gravity-compensation forces with body/joint reordering.
  • Invalidates OVPhysX dynamics buffers after same-timestamp pose, COM, mass, inertia, and armature writes.
  • Adds focused cache lifecycle, CPU fallback, graph-capture, ordering, and dynamics regression coverage.

Confidence Score: 5/5

The PR appears safe to merge, with cache invalidation and dynamics freshness handled across the affected lifecycle paths.

Recorded launches are bypassed where required and cleared when captured array arguments may change, while OVPhysX dynamics buffers are invalidated after the model writes that affect their values; no actionable defect remains.

Important Files Changed

Filename Overview
source/isaaclab_newton/isaaclab_newton/assets/articulation/articulation_data.py Adds cached CUDA read launches and clears them when Newton bindings or ordering buffers are rebuilt.
source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation_data.py Reuses recorded commands for stable PhysX read and reordering kernels, with ordering-rebuild invalidation.
source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation.py Registers generalized-dynamics bindings and invalidates affected dynamics caches after model-property writes.
source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation_data.py Adds cached reads and backend-agnostic Jacobian, mass-matrix, and gravity-compensation properties with freshness handling.
source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/kernels.py Adds the COM-to-link-origin Jacobian transformation used by the new OVPhysX data API.
source/isaaclab_newton/test/assets/test_articulation.py Adds regression coverage for command reuse, reset invalidation, CPU behavior, and graph-capture fallback.
source/isaaclab_physx/test/assets/test_articulation.py Adds focused PhysX coverage for cached command reuse and ordering-reset invalidation.
source/isaaclab_ovphysx/test/assets/test_articulation.py Adds OVPhysX generalized-dynamics, cache lifecycle, ordering, and same-timestamp freshness tests.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Read[Articulation property read] --> Device{CUDA outside graph capture?}
    Device -- No --> Direct[Launch Warp kernel directly]
    Device -- Yes --> Cached{Recorded command cached?}
    Cached -- No --> Record[Record command with stable arguments]
    Record --> Replay[Launch recorded command]
    Cached -- Yes --> Replay
    Rebind[Binding rebind or ordering-buffer rebuild] --> Clear[Clear recorded commands]
    Clear --> Cached
    Write[OVPhysX dynamics-affecting write] --> Invalidate[Invalidate affected timestamped dynamics buffers]
    Invalidate --> Read
Loading

Reviews (1): Last reviewed commit: "Cache OvPhysX articulation reads" | Re-trigger Greptile

@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

No material issues were identified in the reviewed diff.

  • Design and architecture: No material concerns.
  • API: No material concerns.
  • Implementation: No material concerns.

Ship it. No actionable findings were identified in the reviewed diff.

The PR exceeded the automated context budget, so some file content was truncated.

Conservative automated review; human maintainers own approval decisions.

@kellyguo11
kellyguo11 merged commit 3f47589 into isaac-sim:develop Jul 30, 2026
48 of 50 checks passed
kellyguo11 added a commit that referenced this pull request Aug 1, 2026
# Description

This aggregate PR preserves the ancestry of the articulation reordering
and selector stack so it can be reviewed and merged as one coherent
change.

Merge order preserved in this branch:

- #6507 — articulation ordering element-kind refactor
- #6479 — P9 cached articulation reads across Newton, PhysX, and
OVPhysX, including OVPhysX computed dynamics
- #6741 — rigid asset cache invalidation
- #6652 — P10 signed `int32`/`int64` selector support inside Warp work
kernels
- #6740 — P11 per-asset cached `ProxyArray` finder selectors and
explicit legacy return modes

The P10 commits remain ancestors of P11. The source PRs should stay open
and unchanged until this aggregate PR merges; they can then be closed as
superseded.

Related overlap: #6674. This branch includes the OVPhysX Jacobian,
mass-matrix, and gravity-compensation side folded into P9.

Key outcomes:

- Articulation work kernels accept signed 32-bit and signed 64-bit item
selectors without Torch conversion allocations.
- Raw kernel APIs use dtype-aware factories while retaining
compatibility aliases for deprecated kernels.
- Stable articulation reads are cached for Newton, PhysX, and OVPhysX.
- OVPhysX exposes computed dynamics through the backend-agnostic
articulation data API.
- Asset finders provide opt-in cached, immutable `ProxyArray` selectors
with zero-copy Torch and Warp views and per-asset LRU ownership.
- Implicit legacy finder returns are deprecated; `as_proxy=False`
retains them explicitly during migration.
- Rigid asset state/property writes invalidate same-timestamp derived
caches correctly.
- Changelog entries are consolidated to one fragment per touched
package.

## Asset performance before and after this PR

The table compares the PR merge-base (`a050ceade7`) with the pushed PR
head (`00c8c25cb1`) on an RTX 5090 using CUDA, 4,096 instances, 100
warmup calls, and 1,000 measured calls per operation. It contains only
timed asset method/property calls; application and benchmark startup are
excluded.

Values are the equal-weight mean of the per-operation mean latencies for
operations present on both revisions. The pre-PR `torch_tensor` mode and
post-PR `torch_tensor_int32` mode both generate CUDA `torch.int32`
selectors. Lower is better.

| Backend | Asset | Matched methods / data properties | API methods,
before → after | Data properties, before → after |
|---|---|---:|---:|---:|
| PhysX | Articulation | 24 / 65 | 129.12 → 90.82 µs (-29.7%) | 6.94 →
5.22 µs (-24.8%) |
| PhysX | Rigid object | 13 / 40 | 82.48 → 54.65 µs (-33.7%) | 16.36 →
7.86 µs (-51.9%) |
| PhysX | Rigid-object collection | 13 / 69 | 218.32 → 131.36 µs
(-39.8%) | 64.13 → 27.86 µs (-56.6%) |
| Newton | Articulation | 24 / 64 | 108.64 → 62.01 µs (-42.9%) | 6.48 →
4.70 µs (-27.4%) |
| Newton | Rigid object | 8 / 40 | 66.34 → 43.16 µs (-34.9%) | 15.21 →
10.28 µs (-32.5%) |
| Newton | Rigid-object collection | 8 / 78 | 83.08 → 50.47 µs (-39.3%)
| 37.99 → 12.12 µs (-68.1%) |
| OVPhysX | Articulation | 24 / — | 237.21 → 209.79 µs (-11.6%) |
Baseline failed preflight¹ |
| OVPhysX | Rigid object | 8 / 40 | 144.43 → 142.74 µs (-1.2%) | 18.57 →
15.36 µs (-17.3%) |
| OVPhysX | Rigid-object collection | 8 / 78 | 185.65 → 191.17 µs
(+3.0%) | 46.75 → 41.31 µs (-11.6%) |

API-method latency improved in 8 of 9 backend/asset pairs. Data-property
latency improved in every comparable pair.

¹ The merge-base OVPhysX articulation data benchmark fails during
`body_com_jacobian_w` preflight, while the post-PR suite passes. That
data row is excluded instead of mixing unmatched measurements. The new
`int64` and Warp selector modes are also excluded from this before/after
table because they have no pre-PR equivalent; the post-PR all-mode
matrix passes across all nine backend/asset pairs.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Documentation update

## Verification

- Aggregate ordering, dtype-kernel, proxy-cache, consumer,
documentation, and benchmark matrix: **868 passed**.
- Shared articulation, rigid-object, and rigid-object-collection
interface suites: **6,059 passed, 71 skipped, 68 expected failures**.
- OVPhysX computed dynamics: **4 CUDA tests passed** and **4 CPU tests
passed** in separate processes due the backend process-global device
lock.
- Changelog tooling: **90 passed**.
- `./isaaclab.sh -f`: all hooks passed at the pushed HEAD.
- Independent aggregate review: no remaining Critical, Important, or
Minor findings.

Full Kit-backed PhysX/Newton live asset suites were not completed
locally because the available Kit environment timed out during startup;
CI should provide that coverage.

## Screenshots

Not applicable.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks with `./isaaclab.sh -f`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no unexpected new warnings
- [x] I have added tests that prove the fixes and features are effective
- [x] I have added one changelog fragment under
`source/<pkg>/changelog.d/` for every touched package
- [x] My name already exists in `CONTRIBUTORS.md`

---------

Co-authored-by: Kelly Guo <[email protected]>
matthewtrepte pushed a commit to matthewtrepte/IsaacLab that referenced this pull request Aug 4, 2026
# Description

Caches recorded Warp commands for articulation ordering and stable
post-read kernels in the PhysX, Newton, and OVPhysX backends. This
avoids repeated Warp launch setup while preserving CPU behavior and CUDA
graph capture. Cached commands are discarded when articulation data is
rebound or ordering buffers are rebuilt so recorded array arguments
cannot become stale.

OVPhysX now also exposes articulation COM/link Jacobians, mass matrices,
and gravity compensation through the backend-agnostic data API.
Same-timestamp COM, mass, inertia, and armature writes invalidate the
affected computed-dynamics buffers before the next read.

This is stacked after isaac-sim#6341.

## Relationship to isaac-sim#6674

Commit `00c869a0f8` contains the focused OVPhysX articulation-dynamics
portion of isaac-sim#6674, excluding its unrelated deformable-task changes. The
cache and freshness work is isolated in `8bd23d94ed`. If isaac-sim#6674 merges
first, the overlapping dynamics commit can be dropped while rebasing and
the cache commit retained.

## Type of change

- New feature (non-breaking change which adds functionality)

## Validation

- `./isaaclab.sh -f`
- Focused cache, lifecycle, generalized-dynamics, and CPU dynamics
regressions: 9 passed.
- Focused OVPhysX CUDA dynamics shard, after confirming the GPU was
idle: 4 passed.
- Changelog tooling: 90 passed.
- Added focused PhysX coverage for command reuse and reset invalidation.
- Added focused Newton coverage for command reuse, reset invalidation,
and graph-capture fallback.
- Performance measurements are documented in the articulation ordering
investigation report.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks with `./isaaclab.sh -f`
- [x] My changes generate no new warnings
- [x] I have added tests that cover the feature
- [x] I have added changelog fragments for `isaaclab_physx`,
`isaaclab_newton`, and `isaaclab_ovphysx`
- [x] My name already exists in `CONTRIBUTORS.md`

Documentation screenshots are not applicable.
matthewtrepte pushed a commit to matthewtrepte/IsaacLab that referenced this pull request Aug 4, 2026
# Description

This aggregate PR preserves the ancestry of the articulation reordering
and selector stack so it can be reviewed and merged as one coherent
change.

Merge order preserved in this branch:

- isaac-sim#6507 — articulation ordering element-kind refactor
- isaac-sim#6479 — P9 cached articulation reads across Newton, PhysX, and
OVPhysX, including OVPhysX computed dynamics
- isaac-sim#6741 — rigid asset cache invalidation
- isaac-sim#6652 — P10 signed `int32`/`int64` selector support inside Warp work
kernels
- isaac-sim#6740 — P11 per-asset cached `ProxyArray` finder selectors and
explicit legacy return modes

The P10 commits remain ancestors of P11. The source PRs should stay open
and unchanged until this aggregate PR merges; they can then be closed as
superseded.

Related overlap: isaac-sim#6674. This branch includes the OVPhysX Jacobian,
mass-matrix, and gravity-compensation side folded into P9.

Key outcomes:

- Articulation work kernels accept signed 32-bit and signed 64-bit item
selectors without Torch conversion allocations.
- Raw kernel APIs use dtype-aware factories while retaining
compatibility aliases for deprecated kernels.
- Stable articulation reads are cached for Newton, PhysX, and OVPhysX.
- OVPhysX exposes computed dynamics through the backend-agnostic
articulation data API.
- Asset finders provide opt-in cached, immutable `ProxyArray` selectors
with zero-copy Torch and Warp views and per-asset LRU ownership.
- Implicit legacy finder returns are deprecated; `as_proxy=False`
retains them explicitly during migration.
- Rigid asset state/property writes invalidate same-timestamp derived
caches correctly.
- Changelog entries are consolidated to one fragment per touched
package.

## Asset performance before and after this PR

The table compares the PR merge-base (`a050ceade7`) with the pushed PR
head (`00c8c25cb1`) on an RTX 5090 using CUDA, 4,096 instances, 100
warmup calls, and 1,000 measured calls per operation. It contains only
timed asset method/property calls; application and benchmark startup are
excluded.

Values are the equal-weight mean of the per-operation mean latencies for
operations present on both revisions. The pre-PR `torch_tensor` mode and
post-PR `torch_tensor_int32` mode both generate CUDA `torch.int32`
selectors. Lower is better.

| Backend | Asset | Matched methods / data properties | API methods,
before → after | Data properties, before → after |
|---|---|---:|---:|---:|
| PhysX | Articulation | 24 / 65 | 129.12 → 90.82 µs (-29.7%) | 6.94 →
5.22 µs (-24.8%) |
| PhysX | Rigid object | 13 / 40 | 82.48 → 54.65 µs (-33.7%) | 16.36 →
7.86 µs (-51.9%) |
| PhysX | Rigid-object collection | 13 / 69 | 218.32 → 131.36 µs
(-39.8%) | 64.13 → 27.86 µs (-56.6%) |
| Newton | Articulation | 24 / 64 | 108.64 → 62.01 µs (-42.9%) | 6.48 →
4.70 µs (-27.4%) |
| Newton | Rigid object | 8 / 40 | 66.34 → 43.16 µs (-34.9%) | 15.21 →
10.28 µs (-32.5%) |
| Newton | Rigid-object collection | 8 / 78 | 83.08 → 50.47 µs (-39.3%)
| 37.99 → 12.12 µs (-68.1%) |
| OVPhysX | Articulation | 24 / — | 237.21 → 209.79 µs (-11.6%) |
Baseline failed preflight¹ |
| OVPhysX | Rigid object | 8 / 40 | 144.43 → 142.74 µs (-1.2%) | 18.57 →
15.36 µs (-17.3%) |
| OVPhysX | Rigid-object collection | 8 / 78 | 185.65 → 191.17 µs
(+3.0%) | 46.75 → 41.31 µs (-11.6%) |

API-method latency improved in 8 of 9 backend/asset pairs. Data-property
latency improved in every comparable pair.

¹ The merge-base OVPhysX articulation data benchmark fails during
`body_com_jacobian_w` preflight, while the post-PR suite passes. That
data row is excluded instead of mixing unmatched measurements. The new
`int64` and Warp selector modes are also excluded from this before/after
table because they have no pre-PR equivalent; the post-PR all-mode
matrix passes across all nine backend/asset pairs.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Documentation update

## Verification

- Aggregate ordering, dtype-kernel, proxy-cache, consumer,
documentation, and benchmark matrix: **868 passed**.
- Shared articulation, rigid-object, and rigid-object-collection
interface suites: **6,059 passed, 71 skipped, 68 expected failures**.
- OVPhysX computed dynamics: **4 CUDA tests passed** and **4 CPU tests
passed** in separate processes due the backend process-global device
lock.
- Changelog tooling: **90 passed**.
- `./isaaclab.sh -f`: all hooks passed at the pushed HEAD.
- Independent aggregate review: no remaining Critical, Important, or
Minor findings.

Full Kit-backed PhysX/Newton live asset suites were not completed
locally because the available Kit environment timed out during startup;
CI should provide that coverage.

## Screenshots

Not applicable.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks with `./isaaclab.sh -f`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no unexpected new warnings
- [x] I have added tests that prove the fixes and features are effective
- [x] I have added one changelog fragment under
`source/<pkg>/changelog.d/` for every touched package
- [x] My name already exists in `CONTRIBUTORS.md`

---------

Co-authored-by: Kelly Guo <[email protected]>
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.

2 participants