Repository navigation
Add opt-in live OVD recording to OVPhysX - #9194
pdherasciec wants to merge 8 commits into
Conversation
Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
|
run-ci |
Signed-off-by: Pablo de Heras Ciechomski <115007036+pdherasciec@users.noreply.github.com>
|
run-ci |
|
run-ci |
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>
|
run-ci |
[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
SummaryAdds opt-in live OVD recording through the existing native handle.
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
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 |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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)]) |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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)): |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
|
is the usage the same as before? namely, do these CLI args still work the same? |
|
based on your diagram above, it looks like this supports multiple (non overlapping) captures. |
|
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>
|
run-ci |
|
@matthewtrepte I updated the animation guide in
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>
|
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 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>
|
run-ci |
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
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.
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
mainate6fc4fd, the seven OVD-specific Windows cases and the local strict documentation build passed. The headless guide example produced a capture with 40 completed frames inovd-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
Type of change