Skip to content

Share sensor storage and capabilities across backends - #8820

Merged
ooctipus merged 10 commits into
isaac-sim:mainfrom
ooctipus:refactor/shared-math-kernels
Nov 5, 2026
Merged

ooctipus merged 10 commits into
isaac-sim:mainfrom
ooctipus:refactor/shared-math-kernels

Conversation

@ooctipus

@ooctipus ooctipus commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

PVA's standard output arrays, cached Warp/Torch views, and reset defaults now have one owner in core. Each backend keeps its public PvaData class and inherits that storage. The core PvaData factory and BasePvaData interface remain available. Direct use of the backend classes and base interface is documented as deprecated; imports do not warn, and no removal release is scheduled.

PvaCfg.data_types selects pose (required), velocity, acceleration, and projected gravity. Disabled groups allocate no output buffer and raise NotImplementedError when read. Each backend declares its supported groups. The shared BasePva owns validation, reset, and acceleration visualization; backends own native acquisition, solver mappings, and measurement conversion. Kernels take the optional output arrays separately, and the shared writer receives resolved Boolean options. Newton's native gather kernel remains in its backend.

IMU, PVA, and frame-transformer equations have shared core kernel owners. Contact and frame-transformer packed reads use the existing memory.concat operation with buffer-lifetime-aware capture. Redundant PhysX/OV PVA, IMU, and joint-wrench kernel files and the PhysX frame kernel file are removed; OV's frame kernel keeps its native operation. The contribution guide now records the ownership and test criteria used here. The PR changes 59 files, with 1,081 additions and 1,693 deletions against its merge base.

Review boundary and migration

Antoine requested a consistent data-container direction. This PR retains the PVA public hierarchy and imports while sharing their storage implementation. IMU, joint wrench, frame transformer, and contact retain their existing public data hierarchies; a broader hierarchy removal can be reviewed separately. Ray-caster and camera data are untouched. See the PVA migration notes and per-package changelog fragments for direct-data users.

This is part 4/4. #8842, #8843, and #8844 are merged; their implementation commits are absent from this branch. All working branches are in ooctipus/IsaacLab. No upstream mirror branch is used.

Validation

Head: 9d0a4cf37, based on upstream main at e125fd749. On this head, 11 shared sensor tests and 4 real Newton PVA tests pass locally. Formatting, changelog checks, git diff --check, and a file-by-file owner/forbidden-path audit pass. The public PVA imports and inherited factory path are exercised without import warnings. The earlier 782-test local run and broader benchmark series belong to older revisions, so they are not claimed as current-head proof. Full PhysX/OV simulation coverage requires CI; Docker CI for this head is pending. On the prior head, its only failing job was performance smoke: Isaac Sim aborted while creating shared memory on the runner, so no performance conclusion was possible.

Historical paired environment timings were noisy and do not establish a general FPS improvement. The operation-level concatenation timings and full reproduction method are in merged #8843.

@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Oct 26, 2026
@ooctipus ooctipus changed the title Centralize shared Warp math and memory operations Unify Warp math, memory, and PVA capabilities Oct 26, 2026
@ooctipus ooctipus changed the title Unify Warp math, memory, and PVA capabilities Unify Warp math, memory operations, and sensor capabilities Oct 26, 2026
@ooctipus ooctipus changed the title Unify Warp math, memory operations, and sensor capabilities Share sensor storage and capabilities across backends Oct 26, 2026
ooctipus added a commit that referenced this pull request Oct 27, 2026
## Description

Quaternion/frame equations, heading, interval scaling, and Jacobian
shifts were independently implemented in backend and task packages. Give
shared mathematics one core owner, `isaaclab.utils.warp.math`, and
migrate consumers to it. Device operations compose into fused caller
kernels. Warp's `wp.map(..., return_kernel=True)` predeclares
rank-1/rank-2 inverse rotation and heading, plus rank-2 interval
scaling, using Warp's per-operation compilation modules. Zero-extent
input and output descriptors avoid allocation and singleton-broadcast
specialization; callers keep their existing launch cache. There is no
project-specific elementwise mapping factory.

Backends retain native solver access and policies. Quaternion `xyzw`,
spatial `(linear, angular)`, frames, and existing non-unit-quaternion
behavior are explicit contracts. The reorientation task also corrects
its quaternion angular error to use `xyzw` components and
shortest-rotation math. Deleted duplicate definitions and the Newton
state-math module have no forwarding aliases. Shared math entry points
use operation names: `quat_rotate_inv[rank]`, `heading[rank]`,
`scale_intervals`, and `shift_jacobian_reference`. The device operation
remains `scale_interval`; no `_kernel` compatibility aliases remain.

This is an ownership refactor; no general environment-FPS improvement is
claimed.

## Validation

62 tests passed across shared math (7), ray casting (16), and
experimental observation/reward/termination parity (39). The shared math
cases exercise both ranks with independently strided inputs and outputs,
untouched padding, and CUDA graph replay after all inputs change.
Interval scaling checks positive and negative runtime factors.

All six native asset/articulation kernel modules compiled on CUDA. An
import probe forbidding allocation, launch, and compilation passed. The
architecture gate rejects restored custom-factory files, retired helper
names, `_kernel` aliases, and forbidden backend dependencies; numerical
tests separately protect the equations. Restoring the retired factory
failed the intended gate. A centralized audit of all five review-change
paths confirmed that the math equations are unchanged and the deleted
factory has no callers.

All GPU checks used `CUDA_VISIBLE_DEVICES=0`, Python 3.12, Warp 1.17,
and the dependencies locked by main `fa569a550`. Each PR was tested in
an isolated source checkout with verified import paths. Full `isaaclab
--format`, changelog validation, `git diff --check`, and the combined
clean Sphinx build passed. The integration branch also passed shared
math, shared sensor contracts, and real Newton PVA tests (17 checks).
Existing dependency deprecation warnings remain; complete OV/PhysX
simulator tests require CI runtimes unavailable locally.

## Review and dependencies

This is an independent PR against `main`, part 1/4 of the shared Warp
refactor. It has no unmerged code dependency. The complete series is
#8842 (math), #8843 (memory), #8844 (wrench), and #8820 (sensor
integration), where the final end-to-end results are reported. Working
branches are hosted only in `ooctipus/IsaacLab`.

## Checklist

- [x] Contribution guidelines and test-audit criteria applied
- [x] Full formatting and lint checks passed
- [x] Documentation and per-package changelog fragments included
- [x] Focused numerical/behavioral checks and structural regression
gates passed
- [ ] GitHub checks for the Warp map follow-up
ooctipus added a commit that referenced this pull request Oct 28, 2026
## Description

Reuse Warp's native views, indexed arrays, copy and fill for ordinary
memory movement. A single frequency-agnostic owner,
`isaaclab.utils.warp.memory`, retains selection normalization, component
views, boolean-masked updates, and measured fused operations. Physical
equations, application frequencies, native gathering and simulator
row-ID bookkeeping remain with their owners.

`memory.concat(first, second, result)` now packs components through
`tile_load`, `tile_empty`, `tile_assign` and `tile_store`. It owns
validation, scalar views and the tiled grid. No array storage is
allocated. Contiguous rank-1 and rank-2 arrays share the same cached
specialization; strided arrays retain their layout. Specialization
depends on scalar type and component widths, without
body/joint/pose/velocity concepts. The cached kernel factory stays
private to this operation.

The existing launch cache records commands returned by a launch
operation. Asset readers pass typed Warp arrays (`.warp` for public
proxy properties) directly to `memory.concat`; other cached kernels pass
`wp.launch`. This keeps layout preparation out of repeated eager reads
and keeps operation-specific code out of the launch cache. CPU calls and
CUDA graph capture invoke the operation directly. Callers must clear
recorded commands when bound storage changes.

Ordinary selected writes use `wp.indexedarray` with `wp.copy` or
`.fill_()`. `resolve_1d_indices` returns contiguous int32 selectors:
existing contiguous int32 storage is reused, while strided/int64 inputs
require a copy/cast. Full-shaped sources select the same source and
destination views. The general `make_copy`, `make_fill`, selector-width
dispatch and `full_source` flags are removed. Small boolean-mask kernels
retain dynamic device selection without compaction; custom factories
construct only requested isolated kernels, without eager variant
registries.

**Migration:** import `resolve_1d_mask` from
`isaaclab.utils.warp.memory`; the experimental re-export is removed.
Warm execution paths before graph capture. Indexed conversion during
capture requires Warp's memory pool. Concatenation inputs and output
must not overlap; recorded commands require stable storage. Sensor
callers and their buffer-lifetime handling are in #8820.

## Validation

Regression validation on `366a86fdf`: **741 tests passed** —
articulation contracts (487), rigid-object contracts (231), shared
memory (13), mocked IMU/PVA recording (8), and mocked frame-transformer
recording (2). The asset suites exercised PhysX, Newton, and OVPhysX
with pinned optional OV dependencies; 16 unsupported cases skipped and 5
expected failures remain. The sensor unit cases ran with Kit bootstrap
disabled, using their existing mocked views. Before the fix, the same
suites reproduced all 37 failures covered by those local boundaries.

Asset readers explicitly supply `.warp` views to the host concat
operation. Tendon writers pass their already normalized int32 device
selectors directly to the native binding, and sensor unit fixtures
create the selector buffers normally owned by initialization. The
contribution guide distinguishes host operations from `wp.launch`
argument conversion. A file-by-file audit checked all 10 changed paths
and all 36 concat calls in the six affected data classes. Full
formatting, changelog validation and `git diff --check` passed.

Earlier unchanged checks cover actuator collection (29), launch caching
(1), and asset runtime boundaries (14), plus CPU/CUDA, float32/float64,
gradients, tile tails, strides, and graph replay in the memory suite.
The prior structural audit, negative controls and clean Sphinx build
remain applicable. No kernel implementation changed in this correction.

Checks used GPU 0 (RTX 5090), Python 3.12 and Warp 1.17 with verified
checkout imports. All five previously failing jobs passed on this head
in [Docker CI run
40635185447](https://github.com/isaac-sim/IsaacLab/actions/runs/40635185447):
all three core shards, PhysX, and test-curobo. This verifies all 60
reported failures, including the 23 full-simulator concat cases
unavailable locally. Other jobs in the wider CI matrix may still be
running. Combined environment measurements are in #8820.

## Performance

Measured on `3c98a7b08` against `ef3fbd818`, using three fresh
processes. The subsequent caller/fixture correction leaves the measured
kernels unchanged. CUDA-event measurements use eleven alternating trials
of 200 captured operations; eager wall measurements use five alternating
trials of 1,000 calls. Repeated operations reuse the same buffers, and
all outputs are checked against NumPy.

- 65,536 contiguous 7+6-component records: captured **7.76 → 3.02 µs**
(2.57× faster); repeated recorded calls **8.40 → 4.03 µs**.
- 4,099 contiguous records, including a partial tile: captured **3.01 →
1.50 µs**.
- Strided 257×17 records: captured **3.41 → 1.67 µs**.
- 65,536 3+4-component records: captured **2.71 → 2.23 µs**. Gains
depend on the layout.
- Initializing both rank-1 and rank-2 7+6 layouts: cold-cache median
**429.66 → 362.93 ms**; warm-disk-cache median **4.67 → 2.78 ms**. These
are first-operation setup/load/compile times, excluding process imports,
context initialization and array allocation. One shared specialization
avoids the second compilation; a single tiled specialization itself did
not compile faster.

**Tradeoff:** direct uncached eager calls rebuild views: **9.42 → 27.98
µs** for the large 7+6 case. Production asset readers reuse recorded
commands; direct callers should do the same for stable hot-path buffers.
These operation-level gains do not imply a corresponding environment FPS
gain. The native-selector conversion tradeoff remains: per-call strided
int64/int32 normalization measured 1.28 → 3.33 µs captured in the
preceding follow-up.

The tiled operation follows [Warp's concatenation
example](https://nvidia.github.io/warp/stable/language_reference/_generated/warp.tile_empty.html),
validated against the pinned Warp 1.17 runtime.

## Dependencies and review

Part 2/4, independently based on `main`; #8842 is merged and this PR has
no unmerged dependency. #8844 covers wrench composition. #8820 contains
sensor integration and complete-series measurements. Working branches
exist only in `ooctipus/IsaacLab`.

## Checklist

- [x] Contribution and test-audit guidance applied
- [x] Formatting, changelog, documentation and focused checks passed
- [x] Structural gates and negative controls validated
- [ ] GitHub checks for the updated head
@ooctipus
ooctipus force-pushed the refactor/shared-math-kernels branch from fd01731 to 64f723b Compare October 28, 2026 05:27
@ooctipus ooctipus 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 Oct 28, 2026
@ooctipus
ooctipus marked this pull request as ready for review October 28, 2026 06:13
@ooctipus
ooctipus requested a review from a team October 28, 2026 06:13
@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The reviewed changes appear safe to merge.

Summary

This PR gives PvaData ownership of standard measurements and shared component views.

  • PVA sensors share output storage and let callers choose measurement groups.
  • Shared sensor helpers handle common math, resets, and packed pose reads.
  • WrenchComposer uses shared Warp kernels to write and reset forces and torques.

No actionable issues were found. Tests were inspected, not run during this review.

ooctipus explicitly identifies the removed backend data imports and shared-storage behavior as intentional breaking changes. ooctipus also states that the retained wrench dependency is intentional while #8844 remains open.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  C["PvaCfg.data_types"] --> V["BasePva checks requested groups"]
  V --> D["PvaData allocates enabled outputs"]
  V --> B["Backend gathers native state"]
  B --> K["Selected fused update kernel"]
  K --> D
  D --> W["Shared Warp and Torch component views"]
  R["Initialize / reset / STOP"] --> D
Loading

Reviews (1) · Last reviewed commit: "Validate native sensor reads and initial..." · Reviewed by 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

Needs attention: Design and architecture (1), Scope and over-engineering (1), Compatibility and deprecation (2), Style consistency (3), Test quality (1). Other reviewed categories look good.

  • PR description: The body matches the 71-file diff but buries current validation under historical benchmarks and omits the contribution-guide change and removed kernel paths; trim history and list those scope items.
  • Design and architecture: BasePva reaches into SensorBase’s private lifecycle state before construction, coupling rejected configurations to undocumented handles; add an owner-provided pre-registration validation hook.
  • Scope and over-engineering: Minimal implementation: extend PvaData, BasePva, backend PVA owners, shared sensor kernels, memory operations, and launch cache; keep sensors/pva/kernels.py and delete utils/warp/wrench.py plus #8844 rewiring. Suggested PR breakdown: (1) shared IMU/frame kernels and reset/split reuse; (2) packed contact/frame reads via memory.concat; (3) PVA storage, capabilities, backend adoption, migration, and focused validation.
  • API: API changes look good.
  • Compatibility and deprecation: Breaking changes: BasePvaData, backend PvaData exports, and public wrench-kernel entry points lack functional deprecation bridges; retain warning aliases with replacement and removal guidance.
  • Implementation: Implementation looks good.
  • Style consistency: New PVA modules violate required ClassVar annotation, member ordering, and relative-import conventions; annotate class variables, reorder members, and use relative imports.
  • Test quality: The wrench ownership test greps removed symbols and source structure already covered by factory-cache and capture behavior; remove those implementation-coupled assertions.

Significant concerns. Posted 8 inline findings.

Automated review; human maintainers own approval decisions.

"JointWrenchSensorCfg",
"JointWrenchSensorData",
"BasePva",
"BasePvaData",

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 · Compatibility — Public PVA data classes removed abruptly

BasePvaData and the backend PvaData exports are deleted, so existing imports and subclasses break on upgrade. Keep deprecated aliases emitting the established warning with replacement and removal guidance for the transition.

__backend_name__: str = "base"
"""The name of the backend for the PVA sensor."""

supported_data_types = frozenset({"pose"})

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 · Style Consistency — Class variable lacks ClassVar annotation

supported_data_types is a class variable; the guide requires a ClassVar[type] hint and the adjacent backend_name is annotated. Annotate it ClassVar[frozenset[str]] here and in the backend overrides.


def __init__(self, cfg: PvaCfg):
# Validate before SensorBase registers callbacks or enables debug visualization.
self._initialize_handle = self._invalidate_initialize_handle = self._prim_deletion_handle = 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.

🟡 Warning · Design Architecture — Subclass seeds SensorBase lifecycle handles

BasePva.init assigns SensorBase's private handle attributes so validation can raise before super().init. Any handle SensorBase later adds breaks teardown of a rejected config; add an owner-provided pre-registration validation hook instead.

raise ValueError("PVA debug visualization requires the 'acceleration' output")
return super().set_debug_vis(debug_vis)

def _invalidate_initialize_callback(self, event):

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 · Style Consistency — Properties placed after instance methods

data follows reset and set_debug_vis, and the private callback precedes it; PvaData likewise interleaves create_buffers between properties. Restore the guide's order: properties, public methods, then private methods.


import warp as wp

from isaaclab.utils.warp.math import acceleration_at_offset, velocity_at_offset

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 · Style Consistency — Use relative import for core math

isaaclab.utils.warp.math is three dots away, so the guide requires ...utils.warp.math; the adjacent pva_data.py already uses the relative form. Same issue in sensors/imu/kernels.py.

##


@wp.kernel

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 · Compatibility — Wrench kernels dropped without aliases

The public wrench kernels and selector helpers disappear from isaaclab.utils.warp.kernels with no forwarding. Re-export them with targeted deprecation warnings pointing at isaaclab.utils.warp.wrench until the removal release.

#
# SPDX-License-Identifier: BSD-3-Clause

"""Fused wrench algebra and selected reset for :class:`~isaaclab.utils.wrench_composer.WrenchComposer`.

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 · Scope Complexity — Unmerged dependency's wrench work included

wrench.py, the WrenchComposer rewiring, its tests and changelog are #8844's implementation carried here, inflating this review surface. Drop those commits and rebase once #8844 merges.

assert reset.module is not indexed_reset.module
assert reset.module.hash_module() == reset_hash

core = source_checkout_root / "source/isaaclab/isaaclab"

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 · Test Quality — Absence greps for removed symbols

The hasattr checks for deleted wrench symbols and the AST scans of wrench.py and kernels.py assert removals, not behavior. Drop them; the factory-cache and capture tests own the contract.

@maxkra15

Copy link
Copy Markdown
Contributor

could we keep BasePvaData and the backend PvaData imports available with deprecation warnings before removing them? existing imports and subclasses break immediately with this change. the migration notes help, but our contribution policy calls for deprecation in a prior release.

AntoineRichard pushed a commit that referenced this pull request Oct 29, 2026
## Description

Wrench writes duplicated selector handling and global/local buffer
routing across four set/add kernels. `isaaclab.utils.warp.wrench` now
owns force, torque and moment-arm algebra; `WrenchComposer` owns native
buffers, destination selection and state bookkeeping in one shared
preparation method.

Cached factories define and return concrete kernels in isolated Warp
modules. Writers specialize only the requested selector types and
set/add operation. Index and mask resets share one factory and one
seven-buffer reset body. Full resets still use native `zero_()`. There
are no eager variant tables or returned dispatchers.

Frame and input-presence decisions use Python metadata without reading
device values. They are fixed at graph capture; selector contents and
force/torque values remain device inputs and can change during replay.
Exclusive destinations retain ordinary read-add-write assignments.
Kernel contracts document frames, launch shapes, null inputs and
moment-arm semantics; buffer names spell out their meaning.

**Deprecation until Isaac Lab 3.2:** all 11 old wrench entry points in
`isaaclab.utils.warp.kernels` remain importable and emit
`DeprecationWarning` with the removal release and migration path. Old
kernel objects remain launchable with their original signatures,
including generic index kernels, masks, Torch/Warp selector helpers and
five-buffer frame routing. A lazily loaded compatibility module adapts
those signatures to the shared wrench operations; the composer uses the
new API directly. Use `WrenchComposer`, or `isaaclab.utils.warp.wrench`
for direct launches. The new writer factory accepts the selected
force/torque destinations rather than five buffers plus `is_global`. The
release note records deprecation instead of an immediate breaking
removal.

## Validation

Head `028b0fd80`, based on `main` at `9860e2bd8` after #8843 merged.
**38 WrenchComposer tests passed**, covering index/mask set/add, both
selector widths, local/global frames, moment arms, partial/full reset,
lazy composition and CUDA replay. Seven compatibility cases exercise all
deprecated entry points and check warning text, original launch
signatures, frame routing, null inputs and numerical results on CUDA.
Those cases also passed on CPU during development and failed against the
pre-fix imports for the intended missing-symbol errors.

The structural audit verified file ownership, one-way compatibility
dependencies, lazy loading and all 11 deprecated star imports. Full
repository formatting, changelog validation and `git diff --check`
passed; the private compatibility module also passed explicit Ruff
checks. A clean Sphinx HTML build (`-E -a -W --keep-going`) passed with
zero warnings. Focused CUDA-event measurements of the six current
mask/index set/add/reset variants found no material latency change after
extracting the shared device functions.

Full simulator CI previously passed on `ce4676b33` in [Docker run
40656490099](https://github.com/isaac-sim/IsaacLab/actions/runs/40656490099).
That result predates the deprecation change; [Docker CI for the new
head](https://github.com/isaac-sim/IsaacLab/actions/runs/40860136394)
was triggered with `run-ci` and is queued. Local validation used Python
3.12 and Warp 1.17 with verified checkout imports.

Focused command: `CUDA_VISIBLE_DEVICES=0 uv run python -m pytest
source/isaaclab/test/utils/test_wrench_composer.py -q`.

## Why retain a fused partial reset?

On an RTX 5090 (driver 580.178.04), resetting seven `vec3f` buffers with
shape 4,096×16 and half the environments selected took **2.98 µs** with
the fused indexed reset versus **20.42 µs** for seven native
indexed-view clears. The masked case took **2.00 µs** versus **8.70 µs**
for seven shared masked fills. These are CUDA-event medians of nine
alternating trials, each capturing 100 resets after warmup; indexed
views were prebuilt. Shapes 4,096×1 and 65,536×16 were also checked for
correctness and timing. This measures the value of retaining existing
fusion, not a new throughput improvement.

The previous fused implementation (`be26c2dcf`, identical wrench source
in `64f723ba7`) and the refactored `3c2b3c107` had comparable repeated
latency. Three fresh-process trials of the first masked reset measured
cold kernel initialization **279.36 → 262.86 ms**, and warm disk-cache
initialization **1.63 → 1.70 ms**. These timings predate the deprecation
adapters and include factory/compilation/launch and synchronization,
excluding imports, CUDA context setup and allocation; they are not
environment-startup measurements. No environment FPS gain is claimed.

## Review and dependencies

Independent PR against `main`, part 3/4 of the shared Warp refactor.
#8842 and #8843 are merged; #8820 contains sensor integration and
complete-series measurements. All working branches are in
`ooctipus/IsaacLab`.

## Checklist

- [x] Contribution and test-audit guidance applied
- [x] Formatting, changelog and focused tests passed
- [x] Structural audit and regression gates passed
- [ ] GitHub checks for the updated head

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please make the data-container architecture consistent across sensors before merging. The rationale for consolidating PVA output storage also applies to the other sensors that retain Base*Data interfaces, data factories, and backend-specific containers. Removing those layers only for PVA leaves this refactor halfway through.

The backend implementations show the same opportunity elsewhere:

  • IMU: all three containers own the same two output arrays and cached proxies; the differences are initialization guards and bookkeeping.
  • Joint wrench: PhysX and OV have identical executable container code; Newton uses the same storage/getters with a different allocation-argument name.
  • Frame transformer: the exposed measurements are the same. PhysX/OV use separate position/quaternion buffers, while Newton uses packed transforms and component views. Consolidation requires adapting the writers and preserving the intended view/aliasing contract.
  • Contact sensor: substantial allocation/getter/history/timing code can be shared, but the common design must preserve backend capabilities, unsupported outputs, and existing fallback behavior. These differences should be represented explicitly.

Please take one consistent direction: either complete the shared-data consolidation and removal of redundant data hierarchies across these sensors, or retain the PVA data hierarchy and public imports until the broader change is ready. Ray-caster and camera data already use shared core containers, with extensions for additional measurements, so they do not need artificial removals. Backend-native acquisition, solver mappings, and measurement conversion should remain with their backend owners.

Public removals also need the repository's deprecation and migration path. The storage improvements are useful, but please finish the architectural transition consistently rather than leave PVA as a one-off exception.

Comment on lines -313 to -315
.. autoclass:: BasePvaData
:show-inheritance:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we remove this?

BaseJointWrenchSensor
BaseJointWrenchSensorData
BasePva
BasePvaData

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here?

FrameTransformer
FrameTransformerData
Imu
ImuData

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if you remove pvadata, why do we keep imudata? Or any other sensor data tbh?

@ooctipus
ooctipus force-pushed the refactor/shared-math-kernels branch from 19624b3 to fc7d1da Compare November 4, 2026 07:25
@ooctipus

ooctipus commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

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 Nov 4, 2026
@ooctipus

ooctipus commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

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 Nov 4, 2026
@ooctipus

ooctipus commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

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 Nov 4, 2026
@AntoineRichard

Copy link
Copy Markdown
Collaborator

Please clean up the PVA documentation/comments and remove the deprecation wording introduced in this PR.

sensor.data was already the measurement-access API, so “Read measurements through sensor.data in new code” suggests a migration that users do not need to make. BasePvaData remains the active interface and return type, and the backend PvaData classes are still instantiated and returned through the factory and sensor.data. Sharing their storage implementation does not require deprecating these public types.

Please:

  • Remove the added .. deprecated:: notices from BasePvaData and the backend PvaData docstrings.

  • Remove the corresponding deprecation wording in the migration guide and the pva-data-hierarchy.deprecated.rst changelog fragments.

  • Replace the “remain importable” / “in new code” language with a direct explanation of the implementation change, for example:

    PVA output storage and getters are now shared across backends. Existing public data classes remain available, and measurements continue to be accessed through sensor.data.

Please retain the documentation of the actual behavior changes: optional output groups, shared-memory views, and standardized initialization/reset/STOP defaults.

Pose Velocity Acceleration Sensor
---------------------------------

The PVA data hierarchy remains available. Read standard measurements from

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why have this comment?

Comment on lines +65 to +66
The existing ``BasePvaData`` and backend-specific ``PvaData`` classes remain
importable. Read measurements through ``sensor.data`` in new code.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why have this comment? Isn't that the default way to access data?

from isaaclab_physx.sensors import ContactSensor, ContactSensorData
from isaaclab_physx.sensors import Imu, ImuData
from isaaclab_physx.sensors import Pva, PvaData
from isaaclab_physx.sensors import Pva, PvaData # Direct PvaData use is deprecated; prefer sensor.data

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why this comment?

@cache
def make_pva_writer(data_types: frozenset[str]):
"""Return the shared device writer for the requested output groups."""
velocity = "velocity" in data_types

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we avoid this somehow here (e.g. pass the arguments seperately as bool, and do this resolution elsewhere)

from isaaclab.sensors.frame_transformer.kernels import frame_transformer_update_kernel
from isaaclab.sensors.imu.kernels import imu_update_kernel
from isaaclab.sensors.pva.kernels import make_pva_update, pva_reset_kernel
from isaaclab.sensors.pva.pva_data import _PvaDataStorage

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Cannot import underscore function

self._data._lin_acc_b,
self._data._ang_acc_b,
self._data._projected_gravity_b,
self._data.buffers,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I feel like I prefer independant arguments rather than this buffers class

@ooctipus
ooctipus merged commit f644e1f into isaac-sim:main Nov 5, 2026
58 checks passed
@ooctipus
ooctipus deleted the refactor/shared-math-kernels branch November 14, 2026 09:43
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.

4 participants