Repository navigation
[Tests] Cover headless Kit recording in the Fabric pose regression - #7864
Conversation
|
There was a problem hiding this comment.
Isaac Lab Review Bot
The capture path now uses sim.render() under the existing not sim.is_rendering guard, with corresponding test, documentation, and changelog updates. The new documentation subsection has an undersized reStructuredText title underline that can trigger a Sphinx warning and should be corrected before merge.
- Design and architecture: The synchronization change remains localized to on-demand visualizer capture and uses the simulation’s existing public rendering lifecycle without changing recorder ownership or source routing.
- API:
VideoRecorderconstruction, source strings, and frame return types remain unchanged. The externally visible capture synchronization behavior is documented, but the new subsection’s heading markup must be fixed so warning-as-error documentation builds remain clean. - Implementation: The updated capture branch calls
sim.render()before both standard and tiled visualizer capture when continuous rendering is disabled, and the regression test exercises that branch. Inrecord_video.rst, the underline beneath “Custom visualizer recorders” is one character shorter than the title, which Sphinx reports as a title-underline warning; extend it to at least the title length.
Minor fixes needed. Posted 1 actionable finding inline.
Automated review; human maintainers own approval decisions.
| interval options. | ||
|
|
||
| Custom visualizer recorders | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
There was a problem hiding this comment.
🔵 Suggestion · Implementation — Section underline shorter than title
The new subsection title "Custom visualizer recorders" is 27 characters, but the ~ underline on this line is 26. Sphinx emits a "Title underline too short" warning for this, which fails docs builds configured with warnings-as-errors. Extend the underline by at least one character to match the title length.
There was a problem hiding this comment.
Not sure this is the right way since this would trigger a full render and then another one for the viz rendering? Is there no way to have a sync transform instead?
There was a problem hiding this comment.
@AntoineRichard I added regression coverage in d54a1c3 and checked the render paths more closely.
For the single headless Newton + Kit visualizer case, this does not double-render: sim.render() publishes transforms through pre_render(), but headless KitVisualizer.step() returns before pumping Kit. The subsequent render_rgb_array() performs the app update. The GPU test verifies exactly one actual Kit app update per capture, including after CUDA graph replay. In normal non-headless/continuous rendering, the existing not sim.is_rendering guard skips the new call.
However, your broader concern is valid: sim.render() updates every visualizer and dispatches render callbacks. There are configurations where that can add rendering:
- Mixed headless visualizers: recording Kit can also refresh a Rerun streaming camera, or a Viser streaming camera with connected clients. With a non-Isaac-RTX streaming renderer, these can run while
sim.is_renderingis false. - Multiple recorders sharing a headless Newton tiled view: each
sim.render()advances the visualizer step counter, invalidating its cached composite and potentially rendering the same camera again within the same physics step. - Registered render callbacks can themselves perform additional rendering.
Those broader cases are findings from tracing the code, not GPU-tested reproductions. The added tests establish freshness and render cadence for the covered paths, not an absence of extra rendering in every configuration.
My recommendation is that the Isaac Lab team propose a more complete capture-preparation/synchronization solution, covering transform publication, necessary visualizer state updates, and shared capture deduplication, and likely revert #7642 in the meantime. That would restore the previous behavior for both native and downstream custom recorders while the complete solution is developed, at the cost of restoring the previous continuous-rendering overhead. This PR fixes the native-recorder regression but does not automatically repair custom recorders that call visualizers directly.
There was a problem hiding this comment.
#7642 does seem to be a good change though, it should improve training performance by quite a bit when recording is enabled. I think we can merge this in as a patch for now and keep another issue to do a larger refactoring of the recording/rendering sync
|
|
||
| def test_visualizer_source_refreshes_physics_before_on_demand_capture(): | ||
| """On-demand capture reads a frame after physics transforms are synchronized.""" | ||
| def test_visualizer_source_refreshes_render_state_before_on_demand_capture(): |
There was a problem hiding this comment.
hm does this modified test fail without the change to video_recorder? that it now detects the previous regression with stale rendering in headless video recording?
if not, it'd be good to add a test that does so that we don't reintroduce the previous issue
There was a problem hiding this comment.
@matthewtrepte Yes: the original updated test fails when the recorder is switched back to sim.forward(). I have now expanded the coverage in d54a1c3, including a real GPU/Fabric regression rather than relying only on the mocked recorder test.
The video_recorder case of test_root_pose_write_is_visible_on_next_render_without_step reads the real Fabric world matrices consumed by Kit/RTX after pose writes and CUDA graph replay. It checks that capture publishes the current pose without advancing physics and performs exactly one actual Kit app update per capture.
Verified by temporarily restoring only the recorder's original sim.forward() call: the GPU test fails on stale Fabric transforms. Restoring the fix makes it pass. The lightweight orchestration test also rejects an intentionally injected second Kit app update.
Validation:
- 147 tests passed across the recorder, simulation/visualizer orchestration, and Newton adapter suites.
- All 7 tests in the GPU/Fabric file passed on RTX 6000 Ada.
- Full repository checks passed with
uv run --no-project --active isaaclab -fin the prepared environment.
The added coverage also checks repeated and tiled capture, the continuous-rendering guard, idle recording windows, and headless Newton GL/RTX capture cadence. I am also replying to Antoine with the remaining mixed-visualizer/multiple-recorder concerns. My recommendation is for the Isaac Lab team to propose a more complete solution and likely revert #7642 in the meantime; this native-recorder patch does not resolve the downstream custom-recorder compatibility issue in #7863.
Replace the capture-time sim.render() with sim.forward() plus a new narrow SimulationContext.pre_render() that only delegates to physics_manager.pre_render() (e.g. Newton's Fabric/USD transform sync). sim.render() also steps every other visualizer, fires every registered render callback, and advances the shared render generation, which can double-render mixed headless visualizers or invalidate another recorder's cached frame within the same physics step, as flagged by Antoine and traced further by Nicholas on isaac-sim#7864.
|
run-ci |
|
run-ci |
|
Thanks @nblauch for the real Fabric regression. I reran The relevant behavior changed in merged #7941: Existing develop coverage tests normal render-time Fabric freshness, but not this real recorder entry point. I am reducing this PR to a minimal recorder variant of that existing GPU test, removing the production change, stale documentation, and overlapping mock tests. That preserves the useful regression without making one capture step every visualizer and render callback. This verifies the Newton/headless-Kit path; it does not establish that every downstream recorder or mixed-visualizer case in #7863 is resolved. |
|
run-ci |
…7864) # Description Extended `test_root_pose_write_is_visible_on_next_render_without_step` with a headless `VideoRecorder` variant. It reads the real Fabric world matrices after direct pose writes and CUDA graph replay, checks authored scale, and verifies capture does not advance physics. The existing normal-render variant remains. Kit capture already requests transforms through the shared Fabric backend and SDP after #7941. The regression passes without any production fix. This PR adds the missing recorder-entry-point coverage only: no production or documentation changes, no new test function or test file. Related: #7863. Mixed visualizers and downstream custom recorders remain outside this regression's scope. ## Type of change - Tests only ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Validation - Ran the original PR's real recorder regression against unchanged develop `3fc02c8e0`: passed with develop's existing `sim.forward()` call. - Negative control: disabling only the SDP transform request in `KitVisualizer.render_rgb_array()` makes the retained recorder variant fail on stale Fabric poses. - All 9 tests in `source/isaaclab_newton/test/physics/test_newton_fabric_body_sync.py` passed on GPU 1 (RTX 5090). - All 33 tests in `source/isaaclab/test/envs/test_video_recorder.py` passed. - Repository formatting, lint, and changelog checks passed via `uv run isaaclab -f`. ## Checklist - [x] Followed the contribution guidelines. - [x] Extended the closest existing test rather than introducing a parallel suite. - [x] Ran focused tests and pre-commit checks. - [x] Added a test-only changelog skip fragment for `isaaclab_newton`. --------- Co-authored-by: Kelly Guo <[email protected]> Co-authored-by: Octi Zhang <[email protected]> (cherry picked from commit 299fd2f)
|
Backported to |
Description
Extended
test_root_pose_write_is_visible_on_next_render_without_stepwith a headlessVideoRecordervariant. It reads the real Fabric world matrices after direct pose writes and CUDA graph replay, checks authored scale, and verifies capture does not advance physics. The existing normal-render variant remains.Kit capture already requests transforms through the shared Fabric backend and SDP after #7941. The regression passes without any production fix. This PR adds the missing recorder-entry-point coverage only: no production or documentation changes, no new test function or test file.
Related: #7863. Mixed visualizers and downstream custom recorders remain outside this regression's scope.
Type of change
Release backport
developValidation
3fc02c8e0: passed with develop's existingsim.forward()call.KitVisualizer.render_rgb_array()makes the retained recorder variant fail on stale Fabric poses.source/isaaclab_newton/test/physics/test_newton_fabric_body_sync.pypassed on GPU 1 (RTX 5090).source/isaaclab/test/envs/test_video_recorder.pypassed.uv run isaaclab -f.Checklist
isaaclab_newton.