Skip to content

Add Visualization Markers in NewtonRTX and fix NewtonRTX LdrColor prefix - #8220

Merged
ooctipus merged 20 commits into
isaac-sim:developfrom
matthewtrepte:mtrepte/newton-rtx-markers-and-ldrcolor-fix
Oct 5, 2026
Merged

ooctipus merged 20 commits into
isaac-sim:developfrom
matthewtrepte:mtrepte/newton-rtx-markers-and-ldrcolor-fix

Conversation

@matthewtrepte

@matthewtrepte matthewtrepte commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes two problems with the Newton RTX visualizer (--visualizer newton_rtx). This includes Diego Ferigo's commit from #7529, merged with current develop, so it supersedes that PR.

Markers. The RTX viewer skipped visualization markers because their registry ids (prim_path::id) aren't valid USD prim paths. On the RTX path they are now rendered under a sanitized id, both live and in headless capture. The GL viewer is unchanged.

Black viewer. With ovrtx 0.5, render outputs are keyed /Render/Vars/LdrColor, but Newton's ViewerRTX looks up LdrColor. The lookup failed silently, so the window was never drawn to and headless capture raised. NewtonViewerRTX now aliases the color output as LdrColor when ovrtx is 0.5 or newer, the same version split the OVRTX camera renderer has used since #7954. Both this and the id sanitizing are workarounds and carry a TODO.

Nothing tested Newton RTX frames before, so I added test_visualizer_integration_newton_rtx.py. On the cartpole it checks that frames aren't flat, move while playing, freeze while the simulation is paused, and change when a marker is made visible. It's a separate kit-less module because OVRTX can't share a process with Kit.

Testing

  • The adapter, viewer-release and new integration tests pass. Without the LdrColor fix the integration test and a unit test fail; without id sanitizing the marker check fails.
  • Ruff and the changelog check are clean.
  • On a live newton_rtx window with no patches, Kuka Allegro (4 envs, newton_mjwarp) renders the scene and the table markers.

Notes

  • The LdrColor fix relies on Newton's private _render_products and on the key Newton authors (/Render/Vars/LdrColor), so it should go once Newton accepts both keys. There's no upstream issue yet.
  • render_rgb_array() on the async RTX viewer returns the previous submission, one frame behind. The test flushes once to compensate.
  • RTX has no Pause Rendering control, so that phase of the shared motion test runs for the GL viewer only.

Release backport

  • Backport this pull request to the active release branch after it merges into develop

diegoferigo-rai and others added 6 commits September 22, 2026 11:25
The Newton RTX visualizer overlays visualization markers on a USD stage that
rejects the "::" and other characters the marker registry group id carries,
so both the interactive RTX viewer and a headless capture recorded through it
dropped the goal poses, command arrows, and other debug markers the GL viewer
draws every frame.

Sanitize each marker group id into a valid USD prim path before logging it
into the RTX viewer, render the markers on the RTX live-step path, and add the
same marker pass to the RTX render_rgb_array headless capture. The GL viewer
keeps rendering the raw registry ids, so its behavior is unchanged. This is the
RTX counterpart of the still-open GL-only fix in isaac-sim#7011.

Add unit tests for the group-id sanitization and for the render helper both
restoring the original registry key after a sanitized RTX render and leaving
the raw GL id untouched.
…-rtx-marker-video-capture

# Conflicts:
#	source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
#	source/isaaclab_visualizers/test/test_newton_adapter.py
ovrtx 0.5 keys each frame's render vars by prim path
("/Render/Vars/LdrColor"), but Newton's ViewerRTX looks up "LdrColor".
The mismatch silently skipped the window blit and made headless capture
raise, leaving the viewer black. Alias every render var under its short
name when the render products are assigned.

Also convert the changelog fragment to the current <slug>.<type>.rst
format.
Run the existing cartpole play/pause frame checks against the Newton RTX
visualizer: frames must be non-flat, change while playing, and stay
stable while rendering is paused. The test lives in its own kit-less
module because OVRTX cannot share a process with Kit. It fails without
the render-var aliasing fix.
@matthewtrepte
matthewtrepte requested a review from a team September 30, 2026 22:24
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Sep 30, 2026
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Fixes visualization marker rendering in the Newton RTX viewer.

The PR should not merge until the RTX integration test avoids asserting a rendering pause it cannot activate.

Findings

  1. P1 RTX pause check cannot pause ▶
  2. P2 Marker rendering remains untested ▶

Summary

The PR aliases OVRTX render-variable paths for Newton RTX capture, sanitizes marker group paths for RTX display and headless capture, and adds a kit-less RTX integration test. The new test’s shared rendering-pause phase does not match the RTX viewer’s controls.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  State[Simulation state] --> Viewer[Newton RTX viewer]
  Markers[Marker registry] --> Sanitize[Sanitize group path]
  Sanitize --> Viewer
  Viewer --> OVRTX[OVRTX render products]
  OVRTX --> Alias[Alias render vars by short name]
  Alias --> Frame[Window and RGB capture]
Loading

Reviews (1) · Last reviewed commit: "Add a Newton RTX frame-motion integratio..."

def _step_env_rtx() -> None:
env.step(action=actions)

with _visualizer_debug_case("newton_rtx", backend_kind):

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.

P1 RTX pause check cannot pause The new RTX test runs the shared rendering-pause check, but the RTX viewer deliberately has no Pause Rendering button. The helper cannot pause rendering, yet the test keeps stepping physics and expects identical frames. It can therefore fail even when RTX rendering works correctly. Give RTX a supported pause check or skip this phase.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +33 to +35
def test_cartpole_env_newton_rtx_visualizer_motion_with_play_pause_newton(caplog: pytest.LogCaptureFixture) -> None:
"""Newton RTX frames are non-flat and move while playing, then freeze while rendering is paused."""
_viz_utils.run_cartpole_env_visualizers_motion_with_play_pause("newton", caplog, visualizer_kinds=("newton_rtx",))

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.

P2 Marker rendering remains untested This integration test checks scene motion but never creates or checks a visualization marker. The marker unit test replaces rendering with a mock, so a regression that leaves markers absent from RTX frames could pass both tests. Add a capture check with a visible marker.

Knowledge Base Used: Rendering pipelines and visualizer adapters

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@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 Newton RTX fixes are narrowly scoped and preserve existing GL behavior, but four maintainability issues should be addressed before merge: rendering temporarily mutates registry-owned marker identity, a private helper violates the prescribed module ordering, the render-products shim uses reflective access for a known field, and the marker tests duplicate fixture scaffolding.

  • Design and architecture: The live and headless paths consistently select RTX marker sanitization while leaving GL ids unchanged. However, the RTX path temporarily overwrites marker.group_id, which is registry-owned identity also used by marker rendering for derived names and diagnostics. Pass a sanitized render name explicitly rather than mutating and restoring owner state.
  • API: The added sanitize_group_ids parameter is trailing and defaults to False, so existing callers retain their behavior. The sanitization helper and _render_products shim are private, and no public export, registration, or documentation integration changes are required.
  • Compatibility and deprecation: Breaking changes: none identified. Existing calls to render_newton_visualization_markers remain valid, the GL path retains raw group ids, and the RTX changes restore previously unavailable marker and LdrColor output rather than removing supported behavior.
  • Implementation: The render-var setter safely preserves existing short-name keys and accepts None, and marker identity is restored with try/finally. The remaining implementation concern is the temporary mutation of marker.group_id; the shim should also declare its owned _ovrtx_render_products state explicitly and access it directly instead of using getattr(..., None).
  • Style consistency: Move _sanitize_newton_marker_group_id below the public NewtonVisualizationMarkers class with the module’s other private helpers, following the required public-functions/public-classes/private-functions ordering. Replace reflective access to the known _ovrtx_render_products field with explicit declaration and direct access.
  • Test quality: The new kit-less Newton RTX integration test covers a distinct frame contract absent from the existing Kit and Newton GL integration and golden-image suites. The render-var alias and live/headless marker paths also receive focused coverage. However, the two new marker tests duplicate _Registry, _FakeContext, and _FakeSimulationContext scaffolding already repeated in the lifecycle test; extract a shared fixture and parametrize the sanitization cases as required by the test-audit guidance.

Minor fixes needed. Posted 4 actionable findings inline.

Automated review; human maintainers own approval decisions.

# The registry is keyed on the original group id and remove_group() removes
# it by that key, so render under a sanitized id and restore the original.
original_group_id = marker.group_id
marker.group_id = _sanitize_newton_marker_group_id(original_group_id)

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.

🔵 Suggestion · Design Architecture — Renderer rewrites registry-owned marker group id

The RTX branch overwrites marker.group_id — the key the registry stores groups under and remove_group deletes by — for the duration of render(). Anything the marker derives from that id while rendering (mesh registration keys, unsupported-prototype warnings) is recorded under an id the registry never holds. Pass the sanitized render name into marker.render() instead of temporarily mutating owner state.

marker.group_id = original_group_id


def _sanitize_newton_marker_group_id(group_id: str) -> str:

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.

🔵 Suggestion · Style Consistency — Private helper placed before public class

The prescribed file structure is public functions, public classes, then private functions, and this module's other private helper _infer_newton_marker_cfg already sits below NewtonVisualizationMarkers. Move _sanitize_newton_marker_group_id down with the other private functions.


@property
def _render_products(self):
return getattr(self, "_ovrtx_render_products", 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.

🔵 Suggestion · Style Consistency — getattr default for class-owned attribute

The coding style forbids getattr with a default for known attributes or to hide a missing required attribute, and asks for optional fields to be explicit. Declare _ovrtx_render_products: dict | None = None as a class-level attribute (or set it in __init__) and read it with direct attribute access.

assert marker.group_id == original_group_id


def test_render_newton_visualization_markers_keeps_raw_group_id_without_sanitizing(monkeypatch: pytest.MonkeyPatch):

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.

🔵 Suggestion · Test Quality — Copied registry scaffolding in new marker tests

Both added marker tests re-declare _Registry, _FakeContext, and _FakeSimulationContext, which test_newton_marker_registry_lifecycle already defines in this file, and they differ only in sanitize_group_ids and the expected id. The test-audit gate lists copied fixtures as a junk pattern and asks to prefer a parametrized case over a near-duplicate test. Extract a shared fixture and parametrize the sanitize flag.

The RTX path overwrote marker.group_id, the registry key, for the
duration of render(). Add an optional render_id to
NewtonVisualizationMarkers.render() for the logged batch and mesh names,
so the marker keeps its registry key and its unsupported-prototype
warning stays under one id across viewers.

Move the sanitizing helper below the class with the other private
functions, and replace the copied registry scaffolding in the marker
tests with one fixture and a parametrized test.
The RTX viewer has no Pause Rendering control, so the rendering-pause
phases of the shared motion test did nothing for it. Run them for the GL
viewer only and keep the simulation pause and resume checks for both.

Draw a real visualization marker in the Newton RTX test and require the
captured frame to change when the marker becomes visible. Without marker
id sanitizing the real RTX stage rejects the marker path, so this fails.
@matthewtrepte

Copy link
Copy Markdown
Collaborator Author

run-ci

Map "LdrColor" to the "/Render/Vars/LdrColor" prim ViewerRTX authors, and
only when the installed ovrtx is 0.5 or newer, the version that keys
frame.render_vars by prim path. This is the same split the OVRTX camera
renderer uses, and replaces aliasing every render var by its last path
segment. Older ovrtx versions are left untouched.
@matthewtrepte

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 1, 2026
@matthewtrepte matthewtrepte changed the title Fix the black Newton RTX viewer and render markers in it Add Visualization Markers in NewtonRTX and fix NewtonRTX LdrColor prefix Oct 1, 2026
Route both marker-render sites through one NewtonVisualizer helper
instead of repeating the call and its comment. In the tests, share one
step closure between the GL and RTX blocks, reuse the async flush helper
in the marker check, and drop two assertions in the render-id test that
could not fail. Check the version gate with cache_clear() instead of
__wrapped__, and compute the expected render id independently of the
helper under test.
@matthewtrepte

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added the ci:run-docker Trigger the on-demand Docker and GPU CI workflow label Oct 1, 2026
@matthewtrepte

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 1, 2026
@matthewtrepte

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 1, 2026
…anup

Fix first RTX capture and simplify color output aliases
@matthewtrepte

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 2, 2026
@matthewtrepte

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 5, 2026
@ooctipus
ooctipus merged commit 29e500d into isaac-sim:develop Oct 5, 2026
152 of 157 checks passed
@isaaclab-bot

isaaclab-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as c7f6002.

isaaclab-bot Bot pushed a commit that referenced this pull request Oct 5, 2026
…fix (#8220)

Fixes two problems with the Newton RTX visualizer (`--visualizer
newton_rtx`). This includes Diego Ferigo's commit from #7529, merged
with current develop, so it supersedes that PR.

**Markers.** The RTX viewer skipped visualization markers because their
registry ids (`prim_path::id`) aren't valid USD prim paths. On the RTX
path they are now rendered under a sanitized id, both live and in
headless capture. The GL viewer is unchanged.

**Black viewer.** With `ovrtx` 0.5, render outputs are keyed
`/Render/Vars/LdrColor`, but Newton's `ViewerRTX` looks up `LdrColor`.
The lookup failed silently, so the window was never drawn to and
headless capture raised. `NewtonViewerRTX` now aliases the color output
as `LdrColor` when `ovrtx` is 0.5 or newer, the same version split the
OVRTX camera renderer has used since #7954. Both this and the id
sanitizing are workarounds and carry a TODO.

Nothing tested Newton RTX frames before, so I added
`test_visualizer_integration_newton_rtx.py`. On the cartpole it checks
that frames aren't flat, move while playing, freeze while the simulation
is paused, and change when a marker is made visible. It's a separate
kit-less module because OVRTX can't share a process with Kit.

## Testing

- The adapter, viewer-release and new integration tests pass. Without
the `LdrColor` fix the integration test and a unit test fail; without id
sanitizing the marker check fails.
- Ruff and the changelog check are clean.
- On a live `newton_rtx` window with no patches, Kuka Allegro (4 envs,
`newton_mjwarp`) renders the scene and the table markers.

## Notes

- The `LdrColor` fix relies on Newton's private `_render_products` and
on the key Newton authors (`/Render/Vars/LdrColor`), so it should go
once Newton accepts both keys. There's no upstream issue yet.
- `render_rgb_array()` on the async RTX viewer returns the previous
submission, one frame behind. The test flushes once to compensate.
- RTX has no Pause Rendering control, so that phase of the shared motion
test runs for the GL viewer only.

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

---------

Co-authored-by: Diego Ferigo <[email protected]>
Co-authored-by: Octi Zhang <[email protected]>

(cherry picked from commit 29e500d)
AntoineRichard added a commit to AntoineRichard/IsaacLab that referenced this pull request Oct 9, 2026
The render tests from isaac-sim#8220 expected unused prototype batches to be
hidden and each batch to log only its own markers. Every prototype batch
now logs all markers and zero-scales the ones it does not show, so the
tests check that contract instead, including a prototype switch between
frames. The adapter test duplicated that switch and is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

4 participants