Skip to content

Add opt-in live OVD recording to OVPhysX - #9194

Open
pdherasciec wants to merge 8 commits into
isaac-sim:mainfrom
NVIDIA-Omniverse:codex/ovphysx-live-ovd-recording
Open

pdherasciec wants to merge 8 commits into
isaac-sim:mainfrom
NVIDIA-Omniverse:codex/ovphysx-live-ovd-recording

Conversation

@pdherasciec

@pdherasciec pdherasciec commented Nov 24, 2026 •

Copy link
Copy Markdown

Description

Kit-less OVPhysX jobs can opt in to OVD recording at startup, then use the native handle to start, stop, and restart an explicit capture while the same simulation keeps stepping. The default is off. The startup flag is keyword-only and preserves existing positional configuration arguments. A headless guide example shows a delayed FILE capture.

The runtime's capability is process-wide and must be set before the first native PhysX instance. Isaac Lab applies the requested value before construction and reports a conflict when a live runtime has frozen a different value. This change uses the existing pinned ovphysx==0.8.0.43443703471.

Recording lifecycle

The simulation keeps stepping before, between, and after two separate OVD captures.

Opt in before the first reset
           │
           ▼
Initialize and step the scene
           │
           ▼
Start recording to an explicit destination ◀──┐
           │                                  │
           ▼                                  │
Step while recording                          │
           │                                  │
           ▼                                  │
Stop recording                                │
           │                                  │
           ▼                                  │
Continue stepping the same scene ─────────────┘

Validation

On the pinned Windows wheel, I verified CPU and CUDA late starts, stops, continued stepping and restarts through the new Lab configuration. The tagged SDK decoder found eight pre-existing dynamic actors and 24 completed frame records in each of four files. Decoded positions advanced and matched live reads at both sampled frames.

On the public base used when this PR was opened, I alternated which capability setting ran first and kept recording inactive throughout the measurements. Every pair ended with identical sampled poses. All 32 measured processes independently confirmed the capability setting with a recording attempt after timing.

Workload Pairs Startup off → on Working set off → on Median paired throughput change
CPU contact 6 3.892 → 3.883 s 947.4 → 948.5 MiB −1.27%
CUDA contact 6 4.135 → 4.105 s 2040.6 → 2041.0 MiB −0.62%
CUDA airborne 4 4.129 → 4.142 s 2039.8 → 2039.2 MiB +0.55%

These timings describe one Windows 11 machine with a Core Ultra 9 285K and RTX A6000. The pair ranges cross zero, and per-process VRAM was unavailable under WDDM.

The six new regressions and all 23 OVPhysX scene-data tests passed on Windows and Ubuntu WSL with the pinned wheel. The full lifecycle suite reproduced one existing Windows path-separator assertion and one existing WSL failure where the native CUDA scene falls back to CPU. Both failures also occur on the unmodified base.

The tagged decoder also verified two delayed CPU FILE captures on Ubuntu WSL and two CPU loopback TCP captures on Windows. Each had eight dynamic actors and 24 completed frame records. The headless guide example produced 40 completed frame records, and eight mutation controls failed for their expected reasons. Formatting, changelog validation, and the Sphinx build passed. Sphinx emitted zero warnings and the build reported the same five existing Python warnings as the base. Renderer-backed recording still needs validation.

After syncing with public main, I repeated live start, stop, and restart on CPU and CUDA with the compiled-stage cache opt-out enabled. The runtime restored the previous cache mode after attach, and all four decoded captures matched advancing live poses. The same existing Windows lifecycle assertion also reproduced on the updated base.

The delayed-capture regression decodes the existing cube’s poses from completed recording frames and checks them against native pose reads as the cube falls.

On the integration with main at e6fc4fd, the seven OVD-specific Windows cases and the local strict documentation build passed. The headless guide example produced a capture with 40 completed frames in ovd-inspect summary. The rendered Linux and Windows commands include --viz kit, and their shared CLI options resolved to windowed Kit with the requested 1–3 second interval. Native Kit recording, USD export, visual import, and a fresh inspector installation remain untested. In WSL with CUDA hidden, both binding-readiness cases reproduced the same allocation failure on the untouched upstream package.

Review focus

  • Confirm that the startup option handles a shared native runtime, a late conflicting request, and a default context after full teardown.
  • Check that the existing native handle remains the control point for explicit start and stop between steps.

Type of change

  • New feature
  • Documentation update

Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Nov 24, 2026
@pdherasciec

Copy link
Copy Markdown
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 Nov 24, 2026
Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@kellyguo11

Copy link
Copy Markdown
Contributor

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 Nov 24, 2026
@kellyguo11

Copy link
Copy Markdown
Contributor

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 Nov 24, 2026
Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@kellyguo11

Copy link
Copy Markdown
Contributor

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 Nov 24, 2026
@pdherasciec
pdherasciec marked this pull request as ready for review November 24, 2026 18:40
@pdherasciec
pdherasciec requested a review from a team November 24, 2026 18:40
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect OVPhysX jobs that create native simulation instances.

The PR appears safe to merge, with a non-blocking gap in checks of recorded contents.

Findings

  1. P2 Broken captures can pass ▶

Summary

Adds opt-in live OVD recording through the existing native handle.

  • A running OVPhysX simulation can record separate stretches without stopping.
  • OVPhysX contexts set recording capability before building native instances.
  • The contributor list includes the PR author.

pdherasciec identified the Windows path-separator assertion and WSL CUDA-to-CPU fallback as existing base failures. They are excluded from this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["First hard reset"] --> B["Read requested recording capability"]
    B --> C{"Native setting matches?"}
    C -- No --> D["Try to set native capability"]
    D -- Frozen --> E["Raise configuration conflict"]
    D -- Accepted --> F["Construct PhysX"]
    C -- Yes --> F
    F --> G{"Readback matches?"}
    G -- No --> H["Destroy candidate and raise"]
    G -- Yes --> I["Attach scene and finish reset"]
    I --> J["Step without recording"]
    J --> K["Start capture through native handle"]
    K --> L["Step while recording"]
    L --> M["Stop capture"]
    M --> J
Loading

Reviews (1) · Last reviewed commit: "Preserve positional OVPhysX configuratio..." · Reviewed by Greptile

sim.step(render=False)
assert manager.get_simulation_time() > t
physx.stop_recording()
assert not physx.is_recording() and first.stat().st_size > 0

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 Broken captures can pass

The new test checks is_recording(), elapsed simulation time, and nonempty files, but never checks the recorded actors or frames. A file containing only setup data would pass even if late recording missed existing actors or their motion. Add an automated check that decodes a delayed capture and verifies existing actors and advancing frame data.

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!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in 23ac136. The regression identifies the pre-existing cube and compares its recorded positions from completed frames with live reads. I verified that setup-only and frozen-pose captures fail. The current isaaclab_ov job passed the regression on the pinned OVPhysX wheel. CI job

@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

Needs attention: Compatibility and deprecation (1), Style consistency (2), Test quality (3). Other reviewed categories look good.

  • PR description: The title matches; clarify regression counts and collapse validation chronology, retaining sections and hardware results but adding reproducible baseline/candidate revisions, commands, backend, environment count, warmup, and metrics for the performance table.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: Breaking changes: omitted capability now overwrites inherited True or rejects a live capable runtime; preserve the old behavior through a targeted warning, migration documentation, removal guidance, and transition coverage.
  • Implementation: Implementation looks good.
  • Style consistency: New test functions omit required return annotations; add -> None to all five.
  • Test quality: The recording lifecycle test asserts clock advancement rather than native motion, allowing stalled physics during capture to pass; assert changing cube poses across recorded steps.

Significant concerns. Posted 6 inline findings.

Automated review; human maintainers own approval decisions.

return self._transforms.data


def _read_ovd_recording_capability() -> bool:

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 · Style Consistency — Move private helpers after classes

The two private functions interrupt public class declarations, contrary to the prescribed module order. Move them below the public classes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I kept the two helpers beside OvPhysxBackend, their only caller. The module already has top-level private helpers before its classes, and the contribution guide's ordering rule is for class members.

ovphysx.bootstrap()
configured = _read_ovd_recording_capability()
# The setting survives shutdown, but the setter is frozen while the native runtime is live.
if configured != requested:

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 · Compatibility — Preserve inherited recording capability

An omitted option now disables SDK-configured recording or rejects a live capable runtime. Preserve inheritance through a warned, documented deprecation transition; validate both omitted and explicit settings.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Explicit startup opt-in is the product contract for this PR. An omitted option requests False. That restores an unfrozen SDK setting to False, and a live owner with a conflicting value causes an explicit startup error. The regression suite covers both the default and the live conflict. CI job

@pytest.mark.kitless
@pytest.mark.integration
@pytest.mark.skipif(not _CPU_DEVICES, reason="Requires a selected CPU test device")
def test_default_ovd_capability_overrides_unfrozen_native_opt_in(tmp_path):

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 · Style Consistency — Annotate new test functions

The new test functions omit -> None, despite the contribution guide requiring it for functions without a return value. Add return annotations to all five.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The delayed-capture regression now has a -> None annotation. The four other test functions still lack explicit return annotations.

first = start(physx, "first")
t = manager.get_simulation_time()
sim.step(render=False)
assert manager.get_simulation_time() > t

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 · Test Quality — Verify motion during recording

The clock advances even if native motion stops during capture; file size does not prove frames advanced. Assert changing cube poses across recorded steps instead of only simulation time.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The regression now checks that the cube falls across completed recording frames and compares all three recorded heights with live reads from the same steps. It passed in the current OVPhysX job. CI job

)


@pytest.mark.parametrize(("query_fails", "cleanup_fails"), [(False, False), (True, False), (False, True)])

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 · Test Quality — Mark new kitless unit tests

The candidate-cleanup, positional-construction, and bool-validation tests need no Kit but lack kitless marks, so kitless selection omits them. Mark each test explicitly.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The three unit tests still lack explicit kitless markers. All three ran and passed in the isaaclab_ov package job. The Multi-GPU kit-less lane selects a separate test file. The delayed-capture integration test has the kitless marker. CI job

native.get_global_config = native_call
native.set_global_config = native_call
monkeypatch.setattr(manager_module, "ovphysx", native)
for value in (0, 1, "false", None, np.bool_(True)):

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 · Test Quality — Remove duplicate invalid integer

Zero and one exercise the same non-bool rejection with no distinct boundary. Keep one integer alongside the string, None, and NumPy boolean cases.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I kept 0 and 1 to cover both falsy and truthy integer inputs. The test verifies that neither reaches native startup through implicit Boolean coercion.

Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

let's also update this Docs page, which has a OVD recording section
https://isaac-sim.github.io/IsaacLab/main/source/how-to/record_animation.html

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated the animation guide. Both Isaac Sim Cartpole examples now include --viz kit. The kit-less section links to the runnable start/stop example and shows how to inspect a raw capture with ovd-inspect summary. Updated guide · Answers on capture scheduling and inspection · Cartpole launch check

@matthewtrepte

Copy link
Copy Markdown
Collaborator

is the usage the same as before? namely, do these CLI args still work the same?
uv run python scripts/tutorials/03_envs/run_cartpole_rl_env.py --anim_recording_enabled --anim_recording_start_time 1 --anim_recording_stop_time 3 physics=isaacsim_physx

@matthewtrepte

matthewtrepte commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

based on your diagram above, it looks like this supports multiple (non overlapping) captures.
should we support that usecase via CLI args, or just through code config

@matthewtrepte

Copy link
Copy Markdown
Collaborator

hm currently, do we explain in our docs how to load & use a OVD recording in IsaacLab? if not, might be helpful to add a quick tutorial section or video clip.

Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@pdherasciec

Copy link
Copy Markdown
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 Nov 24, 2026
@pdherasciec

Copy link
Copy Markdown
Author

@matthewtrepte I updated the animation guide in 9e93f6a to cover both workflows. Updated guide

  • Cartpole CLI — The existing command still selects Isaac Sim PhysX and one 1–3 s recording interval. I verified the exact arguments through the tutorial parser, backend selection, and Kit launcher settings. CLI question
  • Repeated captures — I’d keep capture timing in job code for this PR so jobs can trigger on events or steps. With kit-less OVPhysX opted in at startup, stop each capture before starting the next with a different destination. I verified two captures in the same running job on each of CPU and CUDA, with decoded positions matching live reads. Multiple-capture question
  • Inspecting a capture — The guide shows ovd-inspect summary for raw .ovd files and links to visual import in a compatible Kit app. I ran the documented headless example and inspected its 40 completed frame records. Inspection question

The local checks did not run the native Isaac Sim USD export or Kit visual import.

Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@pdherasciec

Copy link
Copy Markdown
Author

Follow-up on the Cartpole command. I checked the full pre-launch configuration. Without a visualizer, the command defaults to headless and the Isaac Sim recorder rejects it. Add --viz kit and leave HEADLESS unset or set to 0.

With that flag, I verified that the launcher selects windowed Kit and the same 1–3 s interval. Local validation stopped before native Isaac Sim launch and USD export. Both command examples are updated. Corrected guide

Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
@pdherasciec

Copy link
Copy Markdown
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 Nov 25, 2026

This branch has not been deployed

No deployments
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 isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants