Repository navigation
Fix Newton frame-transform freshness - #8285
Conversation
|
There was a problem hiding this comment.
Isaac Lab Review Bot
The freshness fix is focused and tested, but FrameTransformer now depends directly on NewtonManager’s private sensor registry; retain the native sensor reference instead.
- PR description: The description matches the diff; replace hook-base narration with the exact pytest command and quantify the changed hot path using baseline/candidate revisions, workload, hardware, environment count, warmup, and per-read timing.
- Scope: Minimal implementation: extend
FrameTransformer._update_buffers_impl()for lazy refresh andNewtonManager._update_sensors()to remove eager refresh; keep the changelog and merged regression assertions, with no added source modules. Replace the private registry lookup by retaining the resolved native sensor reference. Scope is cohesive; no split recommended. - Compatibility and deprecation: Breaking changes: none identified. Existing frame-transform consumers retain the same API and data layout; only stale initialization and reset observations change.
Minor fixes needed. Posted 1 inline finding.
Automated review; human maintainers own approval decisions.
| if self._newton_transforms is None: | ||
| raise RuntimeError(f"FrameTransformer '{self.cfg.prim_path}': sensor is not initialized") | ||
| NewtonManager.forward() | ||
| sensor = NewtonManager._newton_frame_transform_sensors[self._sensor_index] |
There was a problem hiding this comment.
🟡 Warning · Design Architecture — Sensor indexes manager's private registry
_newton_frame_transform_sensors is manager-private state whose only remaining consumer is this external lookup, so a registry change breaks the sensor silently. Store the native sensor on the instance where _sensor_index is resolved and call it directly.
|
run-ci |
Description
Newton frame-transform observations could return zero poses after initialization or stale poses after reset forward kinematics, until the next physics step. Sample current body poses when the sensor buffers are requested and remove the redundant per-step refresh from the Newton manager. Retain the native sensor at initialization rather than looking it up on each update.
Combine copying and world-pose composition in one kernel, and reuse the existing CUDA graph capture helper to cache sampling and copying. Recapture when state or mask buffers change; discard the cache on invalidation. The sensor never calls
forward(); reset callers retain responsibility for FK throughsim.forward().Addresses the backend freshness issue identified in #6461. Extends the existing sensor test to cover initialization, reset poses before another physics step, and partial-reset masks.
Type of change
Validation
uv run python -m pytest source/isaaclab_newton/test/sensors/test_frame_transformer.py -q: 3 passed on CUDA.git diff --checkpassed.Performance
Existing frame-transform benchmark scene, Newton MJWarp, RTX PRO 6000 Blackwell / Threadripper PRO 7965WX, Linux, Python 3.12, Newton 1.6.1rc1, MuJoCo Warp 3.12.0, Warp 1.17.0. One sensor, 4,096 environments, four target frames each, 50 warmup steps and 500 measurements, synchronized on
cuda:0. Measured forced sensor updates and the combined physics-step/forced-update path separately.10f86515f3e57959a2154043500The optimized fix reduces sensor-update latency by about 59% versus the previous fix. The physics-heavy combined path remains around 0.23 ms; these measurements show no clear overall speedup. The base performed native sampling during the physics step, so its sensor-update boundary includes less work.
Release backport
Checklist
CONTRIBUTORS.md