Repository navigation
Opt-in Ovstage integration into OVRTX Renderer - #6602
Conversation
641fd3b to
62f299e
Compare
Greptile SummaryThis PR introduces an opt-in
Confidence Score: 4/5Safe 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 Files Needing Attention: source/isaaclab_tasks/test/conftest.py — the Important Files Changed
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]
Reviews (3): Last reviewed commit: "Add opt-in ovstage path to the OVRTX ren..." | Re-trigger Greptile |
58b70e2 to
2332ab8
Compare
6bd8772 to
463afac
Compare
463afac to
7692ef9
Compare
|
@greptile-apps please review! |
7187848 to
cf86bbb
Compare
51bcc95 to
b84e688
Compare
|
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:
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. |
|
Hey @huidongc - thanks for taking a look
I went through a few different names and chose
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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
just curious, is this mostly for the legacy path now?
There was a problem hiding this comment.
This is currently a debugging feature for both paths to get a copy of the usda stage before we load it in ovrtx / ovstage
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].
…rtx or ovphysx gets installed
… access all members
11a7700 to
2804350
Compare
# 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.

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_ovstageNotable differences in the ovstage code path:
Render correctness tests now include ovstage variant. So they run both the ovrtx-only codepath, and ovrtx+ovstage code path.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there