Repository navigation
Conversation
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.
|
| def _step_env_rtx() -> None: | ||
| env.step(action=actions) | ||
|
|
||
| with _visualizer_debug_case("newton_rtx", backend_kind): |
There was a problem hiding this comment.
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!
| 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",)) |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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_idsparameter is trailing and defaults toFalse, so existing callers retain their behavior. The sanitization helper and_render_productsshim 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_markersremain valid, the GL path retains raw group ids, and the RTX changes restore previously unavailable marker andLdrColoroutput rather than removing supported behavior. - Implementation: The render-var setter safely preserves existing short-name keys and accepts
None, and marker identity is restored withtry/finally. The remaining implementation concern is the temporary mutation ofmarker.group_id; the shim should also declare its owned_ovrtx_render_productsstate explicitly and access it directly instead of usinggetattr(..., None). - Style consistency: Move
_sanitize_newton_marker_group_idbelow the publicNewtonVisualizationMarkersclass 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_productsfield 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_FakeSimulationContextscaffolding 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) |
There was a problem hiding this comment.
🔵 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: |
There was a problem hiding this comment.
🔵 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) |
There was a problem hiding this comment.
🔵 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): |
There was a problem hiding this comment.
🔵 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.
|
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.
|
run-ci |
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.
|
run-ci |
…-markers-and-ldrcolor-fix
|
run-ci |
|
run-ci |
…anup Fix first RTX capture and simplify color output aliases
|
run-ci |
|
run-ci |
|
Backported to |
…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)
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]>
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
ovrtx0.5, render outputs are keyed/Render/Vars/LdrColor, but Newton'sViewerRTXlooks upLdrColor. The lookup failed silently, so the window was never drawn to and headless capture raised.NewtonViewerRTXnow aliases the color output asLdrColorwhenovrtxis 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
LdrColorfix the integration test and a unit test fail; without id sanitizing the marker check fails.newton_rtxwindow with no patches, Kuka Allegro (4 envs,newton_mjwarp) renders the scene and the table markers.Notes
LdrColorfix relies on Newton's private_render_productsand 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.Release backport
develop