Skip to content

[Tests] Cover headless Kit recording in the Fabric pose regression - #7864

Merged
ooctipus merged 5 commits into
isaac-sim:developfrom
nblauch:nblauch/fix-headless-capture-transforms
Sep 26, 2026
Merged

ooctipus merged 5 commits into
isaac-sim:developfrom
nblauch:nblauch/fix-headless-capture-transforms

Conversation

@nblauch

@nblauch nblauch commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

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

  • 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

  • Followed the contribution guidelines.
  • Extended the closest existing test rather than introducing a parallel suite.
  • Ran focused tests and pre-commit checks.
  • Added a test-only changelog skip fragment for isaaclab_newton.

@nblauch
nblauch requested a review from a team September 17, 2026 03:35
@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Sep 17, 2026
@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with the implementation, regression test, and documentation aligned around the required render-state refresh.

Summary

This PR fixes stale poses in headless, on-demand visualizer recordings by performing a render-state refresh before capture instead of only forwarding kinematics.

  • Calls sim.render() for capture-only visualizers when continuous rendering is disabled.
  • Updates the regression test to verify render-state publication.
  • Documents synchronization requirements for custom visualizer recorders.
  • Adds a changelog fragment for the fix.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[VideoRecorder requests frame] --> B{Continuous rendering active?}
    B -- No --> C[sim.render]
    C --> D[Publish backend transforms]
    D --> E[Refresh visualizers]
    B -- Yes --> F[Use continuously refreshed state]
    E --> G[Capture RGB frame]
    F --> G
Loading

Reviews (1) · Last reviewed commit: "Refresh render state before on-demand vi..."

@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

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: VideoRecorder construction, 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. In record_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.

Comment thread docs/source/features/record_video.rst Outdated
interval options.

Custom visualizer recorders
~~~~~~~~~~~~~~~~~~~~~~~~~~

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.

🔵 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.

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.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@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_rendering is 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.

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.

#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():

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.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@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 -f in 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.

@nblauch
nblauch requested a review from hujc7 as a code owner September 18, 2026 20:25
matthewtrepte added a commit to matthewtrepte/IsaacLab that referenced this pull request Sep 23, 2026
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.
@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 Sep 25, 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 Sep 26, 2026
@ooctipus

Copy link
Copy Markdown
Collaborator

Thanks @nblauch for the real Fabric regression. I reran test_root_pose_write_is_visible_on_next_render_without_step[video_recorder] against unchanged develop 3fc02c8e0 on GPU 1 (RTX 5090), importing only the test from this PR: passed. No recorder or other production-code patch was applied. It checks current Fabric poses after direct writes and CUDA graph replay, no physics advancement, and one Kit app update per capture.

The relevant behavior changed in merged #7941: KitVisualizer.render_rgb_array() now requests transforms through the shared Fabric backend and SDP. Newton's pre_render() is now the inherited no-op, so the original explanation and the mock that publishes transforms from pre_render() no longer represent this path.

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.

@ooctipus ooctipus changed the title Fix render-state refresh for headless video capture [Tests] Cover headless Kit recording in the Fabric pose regression Sep 26, 2026
@ooctipus

Copy link
Copy Markdown
Collaborator

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 Sep 26, 2026
@ooctipus ooctipus added the ci:run-docker Trigger the on-demand Docker and GPU CI workflow label Sep 26, 2026
@ooctipus
ooctipus merged commit 299fd2f into isaac-sim:develop Sep 26, 2026
53 of 84 checks passed
@ooctipus
ooctipus deleted the nblauch/fix-headless-capture-transforms branch September 26, 2026 12:50
isaaclab-bot Bot pushed a commit that referenced this pull request Sep 26, 2026
…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)
@isaaclab-bot

isaaclab-bot Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as 8c40ccc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci:run-docker Trigger the on-demand Docker and GPU CI workflow 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.

5 participants