Skip to content

Opt-in Ovstage integration into OVRTX Renderer - #6602

Merged
rilei-nvidia merged 5 commits into
isaac-sim:developfrom
rilei-nvidia:ovstage-integration
Jul 27, 2026
Merged

rilei-nvidia merged 5 commits into
isaac-sim:developfrom
rilei-nvidia:ovstage-integration

Conversation

@rilei-nvidia

@rilei-nvidia rilei-nvidia commented Jul 18, 2026 •

Copy link
Copy Markdown
Collaborator

Description

A opt-in ovstage implementation to ovrtx that can be enabled via ISAAC_LAB_OVRTX_USE_OVSTAGE=1.

Ovrtx-only methods have been suffixed with _legacy, and ovrtx+ovstage methods suffixed with _ovstage

Notable differences in the ovstage code path:

  1. Lack of zero-copy writes to xform and points
    • Will be addressed in ovstage 0.1.1
  2. Stage.clone expects clone targets to not exist at all
    • Changed order of operations and how we export the stage to string pre-clone
  3. Lack of PrimMode.EXISTING_ONLY and MUST_EXIST. Stage.write_attributes default to PrimMode.UPSERT which will write if present, otherwise create.

Render correctness tests now include ovstage variant. So they run both the ovrtx-only codepath, and ovrtx+ovstage code path.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@rilei-nvidia
rilei-nvidia requested a review from a team July 18, 2026 09:58
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team infrastructure labels Jul 18, 2026
@rilei-nvidia
rilei-nvidia force-pushed the ovstage-integration branch from 641fd3b to 62f299e Compare July 18, 2026 10:01
@greptile-apps

greptile-apps Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces an opt-in ovstage integration into the OVRTXRenderer, enabled via ISAAC_LAB_OVRTX_USE_OVSTAGE=1. The ovstage library takes ownership of scene data (transforms, deformables, particles, cloning) while OVRTX retains rendering, replacing the renderer-owned scene APIs deprecated in ovrtx 0.4.

  • Existing methods are suffixed _legacy and new _ovstage implementations are added; thin dispatch wrappers on public methods (render, update_transforms, etc.) select the path once at construction from _use_ovstage.
  • export_stage_to_string gains a keep_env_roots flag; the ovstage clone path passes False so non-source env roots are stripped before export, since Stage.clone requires target paths to not pre-exist.
  • Rendering tests are now parametrized via an ovstage_variant conftest fixture; ovstage is wired up as a new optional install selector (ov[ovstage]) in pyproject.toml and install.py.

Confidence Score: 4/5

Safe to merge with the conftest fixture fix applied; the new ovstage code path is well-isolated behind a dispatch flag and does not touch legacy behaviour.

The ovstage_variant fixture does not unset ISAAC_LAB_OVRTX_USE_OVSTAGE for the legacy parametrization. If that env var is already set in the environment, both variants silently exercise the ovstage path and the legacy renderer is never validated.

Files Needing Attention: source/isaaclab_tasks/test/conftest.py — the ovstage_variant fixture needs an explicit delenv for the legacy branch. source/isaaclab_ov/pyproject.toml — the team has agreed to revert the hard ovstage dependency before merge.

Important Files Changed

Filename Overview
source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py Adds the full ovstage rendering code path (~770 lines): dispatch methods, init/clone/update/render/cleanup ovstage implementations, and two DLTensor helpers.
source/isaaclab_tasks/test/conftest.py Adds ovstage_variant fixture; the legacy branch does not explicitly unset ISAAC_LAB_OVRTX_USE_OVSTAGE, so a pre-set env var causes both variants to exercise ovstage.
source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_usd.py Adds keep_env_roots flag to export_stage_to_string; logic is correct and covered by the new test.
pyproject.toml Adds ovstage as a root-level optional extra and a pinned constraint; consistent with install.py changes and uv.lock.
source/isaaclab_ov/pyproject.toml Adds ovstage as a hard dependency, contradicting the PR's opt-in intent; flagged in a prior review thread and the team has agreed to revert it before merge.
source/isaaclab/isaaclab/cli/commands/install.py Adds ovstage to the valid selector set and the all expansion.
source/isaaclab_tasks/test/rendering_test_utils.py Adds ovstage_variant column to the HTML report; straightforward and correct.
source/isaaclab/test/cli/test_uv_run_pyproject.py Adds assertion that ovstage spec appears in the ovstage optional extra.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[OVRTXRenderer.__init__] --> B{ovrtx_use_ovstage_enabled?}
    B -- Yes --> C[_init_fields_ovstage]
    B -- No --> D[_init_fields_legacy]
    E[prepare_stage] --> F{_use_ovstage?}
    F -- Yes --> G[_capture_env_root_xforms_ovstage]
    G --> H[export_stage_to_string keep_env_roots=False]
    F -- No --> I[export_stage_to_string keep_env_roots=True]
    J[_initialize_from_spec dispatch] --> K{_use_ovstage?}
    K -- Yes --> L[population.open_usd_from_string]
    L --> M{num_envs > 1?}
    M -- Yes --> N[_clone_sources_ovstage]
    N --> O[_update_scene_partitions_after_clone_ovstage]
    O --> P[setup xform/deformable/particle bindings]
    M -- No --> P
    P --> Q[advance_write_floor + attach_ovstage]
    K -- No --> R[renderer.load_usd_from_string + clone_usd]
    S[Per-frame loop] --> T{_use_ovstage?}
    T -- Yes --> U[update transforms/geometries/camera ovstage]
    U --> V[advance_write_floor + renderer.step ordinal]
    T -- No --> W[bind_attribute writes + renderer.step]
    X[cleanup dispatch] --> Y{_use_ovstage?}
    Y -- Yes --> Z[release queries + detach_ovstage + ExitStack.close]
    Y -- No --> AA[unbind + renderer.unload]
Loading

Reviews (3): Last reviewed commit: "Add opt-in ovstage path to the OVRTX ren..." | Re-trigger Greptile

Comment thread source/isaaclab_ov/pyproject.toml Resolved
@rilei-nvidia
rilei-nvidia force-pushed the ovstage-integration branch 7 times, most recently from 58b70e2 to 2332ab8 Compare July 20, 2026 01:34
@rilei-nvidia
rilei-nvidia marked this pull request as draft July 20, 2026 02:57
@rilei-nvidia
rilei-nvidia force-pushed the ovstage-integration branch 5 times, most recently from 6bd8772 to 463afac Compare July 23, 2026 06:59
@rilei-nvidia
rilei-nvidia force-pushed the ovstage-integration branch from 463afac to 7692ef9 Compare July 25, 2026 00:31
@rilei-nvidia
rilei-nvidia marked this pull request as ready for review July 25, 2026 00:42
@rilei-nvidia rilei-nvidia changed the title Shimmed Ovstage integration into OVRTX Renderer Opt-in Ovstage integration into OVRTX Renderer Jul 25, 2026
@rilei-nvidia

Copy link
Copy Markdown
Collaborator Author

@greptile-apps please review!

@rilei-nvidia
rilei-nvidia force-pushed the ovstage-integration branch 2 times, most recently from 7187848 to cf86bbb Compare July 25, 2026 03:06
@rilei-nvidia
rilei-nvidia force-pushed the ovstage-integration branch 2 times, most recently from 51bcc95 to b84e688 Compare July 26, 2026 00:53
@huidongc

huidongc commented Jul 26, 2026 •

Copy link
Copy Markdown
Collaborator

Marking the default code path "legacy" sounds a little contradictory. I think we'd better do the "legacy" renaming when we make ovstage code path the opt-out. We are not convinced yet the ovstage code path will be the default for GA.

Re the dispatch approach, instead of still mixing scene data management inside the OVRTX renderer class, I wonder maybe we could create a cleaner design:

  1. Defne a OVStageScene class to which we will delegate all the scene data loading/updating calls.
  2. When opting to use the ovstage code path, every existing method of OVRTXRenderer just redirects the scene management to the new class:
class OVRTXRenderer:

    def do_something(self, foo, bar):
        if self._ovstage_scene is not None:
            self._ovstage_scene.do_something(foo, bar)
            return

        # update scene data using deprecated ovrtx APIs.
       ...

It seems to me this approach has a clean separation of scene data management vs. rendering and is also achievable as a short term goal.

For long term, maybe we can explore to have the simulation side to create/update the ovstage scene, then the renderer class just takes the ovstage scene for rendering, this will then enable single shared source of truth between sim and render. But it is likely a question we will try to answer after GA, probably together with the scene data provider refactoring to replace newton manager usage in the renderer class.

@huidongc

Copy link
Copy Markdown
Collaborator
image

@rilei-nvidia

rilei-nvidia commented Jul 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Hey @huidongc - thanks for taking a look

Marking the default code path "legacy" sounds a little contradictory. I think we'd better do the "legacy" renaming when we make ovstage code path the opt-out. We are not convinced yet the ovstage code path will be the default for GA.

I went through a few different names and chose legacy because those ovrtx APIs as of 0.4 are now deprecated. legacy was a clear and short suffix for internally identifying our intention to replace it.

_ovrtx was another option I considered but it didn't make sense because even in the ovstage codepath we'd be using ovrtx. Would you prefer something like _current or _default? If you have stronger naming options please shout out

Re the dispatch approach, instead of still mixing scene data management inside the OVRTX renderer class, I wonder maybe we could create a cleaner design:

That could be stronger design longer term and should be a follow up PR.

The goal of this PR is to get equivalent ovstage functionality to match what we had with ovrtx and I felt the dispatch method was the simplest to follow due to the parallel nature (for both an agent and human). Form-wise it is not too different from having a OvstageSceneData class, it is just relocating the code. I am aware of a few changes going into ovrtx over the next week so I also don't want to rock the boat too much.

There are shared members and methods on the OVRTXRenderer class between the ovstage and ovrtx code paths. For some of them, which class (Renderer vs SceneData) they should live on will require more thought, and design around the OvstageSceneData interface for it to work cleanly. I think this deserves a proper design session and better understanding of requirements, such as the current access pattern of the Newton Manager

back to the legacy path here would silently ignore an explicit request and make the
renderer look like it had honoured it.
"""
value = os.environ.get(_USE_OVSTAGE_ENV, "0").strip()

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.

I think the environment variable is fine for our CI and testing, but if we eventually want this to be a user-specific setting, we should look at making this a render cfg parameter instead

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That sounds good. I will ticket this up as a follow up!

self._exported_usd_string = None # Free memory

# If temp_usd_dir is set, write the combined USD stage to a temporary file.
if self.cfg.temp_usd_dir is not 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.

just curious, is this mostly for the legacy path now?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is currently a debugging feature for both paths to get a copy of the usda stage before we load it in ovrtx / ovstage

Comment thread source/isaaclab_ov/pyproject.toml Resolved
@rilei-nvidia
rilei-nvidia requested a review from marcodiiga as a code owner July 27, 2026 03:11
ovrtx 0.4 deprecates its renderer-owned scene APIs in favour of split
ownership, where ovstage owns the scene data and ovrtx owns only
rendering.

Operations that differ between the two models now route through a thin
dispatch method to a _legacy or an _ovstage variant. The legacy
implementations are left untouched, keeping the diff additive at the
cost of some duplication. The path is selected once per renderer from
the ISAAC_LAB_OVRTX_USE_OVSTAGE environment variable and defaults to off,
so existing deployments are unaffected until they opt in and install
the wheel via ov[ovstage].
@rilei-nvidia
rilei-nvidia force-pushed the ovstage-integration branch from 11a7700 to 2804350 Compare July 27, 2026 03:36
@rilei-nvidia
rilei-nvidia merged commit 06c0b6c into isaac-sim:develop Jul 27, 2026
86 of 91 checks passed
matthewtrepte pushed a commit to matthewtrepte/IsaacLab that referenced this pull request Aug 4, 2026
ooctipus pushed a commit that referenced this pull request Sep 28, 2026
# Description

`scripts/benchmarks/nsys_trace.json` referenced six `OVRTXRenderer`
methods that were renamed or consolidated away, so `test_nsys_trace.py`
failed to resolve them. The test skips when `isaaclab_ov` is not
importable, which is why this only surfaces on PRs that install the `ov`
extra — for example #7137, where it fails the required `isaaclab (core)
[1/3]` check.

Each rename was verified against the commit that made it:

| Removed | Replaced by | Commit |
|---|---|---|
| `_clone_sources_in_ovrtx`, `_clone_sources_ovstage` | `_clone_sources`
| #8045 |
| `_update_scene_partitions_after_clone_ovstage` |
`_update_scene_partitions_after_clone` (already listed) | #8045 |
| `_setup_xform_bindings` | `_setup_xform_bindings_legacy`,
`_setup_xform_bindings_ovstage` | #6602 |
| `_setup_deformable_bindings`, `_setup_particle_bindings` |
`_setup_geometry_bindings_legacy`, `_setup_geometry_bindings_ovstage` |
#7995 |

Both the `legacy` and `ovstage` variants are listed because
`ISAAC_LAB_OVRTX_USE_OVSTAGE` selects the path at runtime, so the config
has to resolve under either setting.

Net 17 traced functions to 16. No code or behaviour change — this only
brings the NVTX trace definitions back in line with the functions that
exist.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

Notes on the checklist: no changelog fragment is required —
`tools/changelog/cli.py` scopes to `source/`, and this change is under
`scripts/`. No new test is added because `test_nsys_trace.py` already
covers this exactly; it is the test that currently fails and will pass
with this change. No documentation change is needed as no public API or
behaviour changes.
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 infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants