Skip to content

Fix Newton frame-transform freshness - #8285

Merged
StafaH merged 4 commits into
isaac-sim:developfrom
StafaH:fix/newton-frame-transform-freshness
Oct 3, 2026
Merged

StafaH merged 4 commits into
isaac-sim:developfrom
StafaH:fix/newton-frame-transform-freshness

Conversation

@StafaH

@StafaH StafaH commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

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 through sim.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

  • Bug fix

Validation

  • uv run python -m pytest source/isaaclab_newton/test/sensors/test_frame_transformer.py -q: 3 passed on CUDA.
  • Initialization and reset regression assertions failed without the sensor refresh.
  • Standalone CPU sampling, outer CUDA capture/replay after target teleports, and single-environment hard-reset/reinitialization checks passed.
  • Formatting/lint, changelog validation against the PR base, and git diff --check passed.
  • Validation limitation: a two-environment full simulation hard reset hits a site-map size mismatch on both the previous PR revision and this revision. Episode resets and partial resets pass.

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.

Revision Mean sensor update Mean step + sensor update
Base 10f86515f 45.5 µs 229.9 µs
Previous fix 3e57959a2 65.8 µs 230.5 µs
Optimized fix 154043500 26.7 µs 232.0 µs

The 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

  • Backport to the active release branch

Checklist

  • Read the contribution guidelines
  • Ran formatting and lint checks
  • Validated the changed behavior and applied the test-audit criteria
  • Added a package changelog fragment
  • Contributor already listed in CONTRIBUTORS.md

@StafaH
StafaH requested a review from a team October 3, 2026 03:25
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Oct 3, 2026
@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes when frame-transform sensors refresh their data.

The PR appears safe to merge; no actionable regression was established.

Summary

The PR moves Newton frame-transform sampling from every physics step to frame-transformer buffer updates, allowing reads immediately after initialization or reset to use current state.

  • Removes the manager’s per-step native frame-transform refresh.
  • Adds initialization and reset freshness assertions.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Frame-transformer data read] --> B{Buffers need updating?}
  B -- Yes --> C[Resolve pending FK]
  C --> D[Sample native frame transforms]
  D --> E[Copy selected environments into output buffers]
  B -- No --> F[Return existing buffers]
  E --> F
Loading

Reviews (1) · Last reviewed commit: "Fix Newton frame-transform freshness on ..."

@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

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 and NewtonManager._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]

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 — 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.

@StafaH

StafaH commented Oct 3, 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 Oct 3, 2026
@StafaH
StafaH merged commit 9eacda9 into isaac-sim:develop Oct 3, 2026
58 checks passed
@StafaH
StafaH deleted the fix/newton-frame-transform-freshness branch October 10, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants