Skip to content

Add more reset camera tests for articulations and pause/resume - #8482

Merged
maxkra15 merged 10 commits into
isaac-sim:mainfrom
pv-nvidia:fix/first-reset-camera-stale-8428
Nov 11, 2026
Merged

maxkra15 merged 10 commits into
isaac-sim:mainfrom
pv-nvidia:fix/first-reset-camera-stale-8428

Conversation

@pv-nvidia

@pv-nvidia pv-nvidia commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Extend the existing reset camera test with checks of the Fabric world transforms. Tests only, no production change.

Fixes the remaining test gap of #8428. #8433 fixed the defect.

What changed

test_env_reset_restores_initial_pose_in_camera_observation in source/isaaclab/test/sensors/test_first_frame_textured_rendering.py now also reads omni:fabric:worldMatrix of the cube:

  • after the first reset,
  • after the cube moves, so that a stale Fabric cannot match the later reset pose,
  • after the later reset.

RTX renders from these matrices. The Fabric checks show if a failure comes from the Fabric publication or from the render path. The depth image checks stay unchanged.

Validation

Mutation checks. Each change was applied temporarily, and the file was run:

Mutation Result
PhysxManager.play() re-syncs Fabric on the first start (code before #8433) Fails at the first-reset Fabric check (0.15 m off)
num_rerenders_on_reset = 0 Fabric checks pass, only the image check fails (IoU 0.370)

CI cost

No new test file, so no additional Kit start-up. Local timing of the file with warm caches (pytest time, two runs each):

Branch test_first_frame_textured_rendering.py
develop 18.0 s, 18.2 s
This PR 17.6 s, 18.2 s

The added cost is below the run-to-run variation.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

🤖 Generated with Claude Code

@pv-nvidia pv-nvidia self-assigned this Oct 12, 2026
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Oct 12, 2026
@pv-nvidia
pv-nvidia force-pushed the fix/first-reset-camera-stale-8428 branch from bcecdac to e17ecc2 Compare October 12, 2026 12:41
@pv-nvidia
pv-nvidia marked this pull request as ready for review October 12, 2026 13:02
@pv-nvidia
pv-nvidia requested a review from a team October 12, 2026 13:02

@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: Style consistency (2), Test quality (1). Other reviewed categories look good.

  • PR description: Retitle the PR to describe test coverage rather than a fix, and remove the review-history sentence about renamed variables; the remaining scope, baseline results, limitation, and validation match the diff.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Implementation looks good.
  • Style consistency: The reset helpers specify physical configuration inconsistently, increasing drift risk; document camera_height in metres and share one constant for the camera far clip and silhouette threshold.
  • Test quality: The strict resume xfail accepts any AssertionError, so pose or step-count regressions appear expected; confine xfail to the IoU assertion or use distinct exception types for preconditions.

Minor fixes needed. Posted 3 inline findings.

Automated review; human maintainers own approval decisions.

@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issue remains in the reviewed changes.

Summary

This PR moves the reset tests into the PhysX package and adds checks for articulation links and pause/resume.

  • Cube reset tests now check Fabric poses and returned camera images.
  • Cartpole reset tests now check joint-driven link poses in Fabric.
  • A resume test records stale Fabric poses that clear after a physics step.

Reviews (4) · Last reviewed commit: "Harden the reset Fabric checks after rev..." · Reviewed by Greptile

@pv-nvidia
pv-nvidia force-pushed the fix/first-reset-camera-stale-8428 branch from e17ecc2 to 33c8297 Compare October 12, 2026 13:45
@pv-nvidia pv-nvidia changed the title Fix/first reset camera stale 8428 Add first reset camera tests for articulations and pause/resume Oct 12, 2026
@AntoineRichard

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 Oct 12, 2026
@AntoineRichard

AntoineRichard commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

@pv-nvidia looks like the CI is failing? I re-ran it, still failed? the tests look reasonable otherwise

@pv-nvidia
pv-nvidia marked this pull request as draft October 12, 2026 18:01
@pv-nvidia

Copy link
Copy Markdown
Contributor Author

@AntoineRichard yes, the tests succeeded on my local machine, but not on CI. I also noticed they are PhysX specific, so the location is wrong. Furthermore I don't like image comparison, I will replace the tests with fabric worldmatrix reading, although this then misses the stale image test, so I need some more time to dig into this. Converted back to draft

@pv-nvidia
pv-nvidia marked this pull request as ready for review October 13, 2026 13:09
@pv-nvidia

Copy link
Copy Markdown
Contributor 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 Oct 13, 2026
@pv-nvidia pv-nvidia changed the title Add first reset camera tests for articulations and pause/resume Add more reset camera tests for articulations and pause/resume Oct 13, 2026
@StafaH

StafaH commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Hi @pv-nvidia, can you add to the PR description how much this adds to CI time?

@AntoineRichard

Copy link
Copy Markdown
Collaborator

@StafaH CI time for this PR, from the per-file wall times in the CI run on 9e0bd1cc:

Before After Change
isaaclab_physx/test/envs/test_env_reset_fabric_poses.py (new) — 39.5 s +39.5 s
isaaclab/test/sensors/test_first_frame_textured_rendering.py (one test removed) 26.6 s (median of 9 runs) 23.4 s −3 s
Net ≈ +36 s
  • The new file's 39.5 s is about 27.7 s of Kit startup with cameras plus 11.8 s for the three tests: 6.4 s cube/camera, 4.4 s articulation, 1.1 s pause/resume xfail.
  • The isaaclab_physx job runs 4 test files at a time, so that job gets about 10 s longer. The end-to-end pipeline does not get longer, because isaaclab_rl and isaaclab_visualizers finish later.
  • The new file has run only once in CI, so its 39.5 s is a single sample.

@pv-nvidia

pv-nvidia commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the measurement. You are right: almost all of the cost came from the second Kit start-up of the new file.

The PR now adds the Fabric checks to the existing reset test in test_first_frame_textured_rendering.py, and the separate file is gone:

  • The Cartpole test is removed. The physx-cartpole-kit-tiled golden image and test_articulation.py already fail for the same mutations (play() from before Fix/first reset camera stale 8428 #8433, update_kinematics() as a no-op).
  • The strict xfail resume test is removed. It guarded no Isaac Lab code.

Local timing of the file, warm caches: develop 18.0–18.2 s, this PR 17.6–18.2 s. The PR description has the details.

Add a Cartpole first-reset test whose joint offsets move links through
forward kinematics, which follows a different Fabric path than rigid
root pose writes. The test fails with the PhysxManager.play() code from
before isaac-sim#8433 (IoU 0.400) and passes with the fix.

Add a strict xfail test for a reset directly after pause and resume.
omni.physx.fabric force_update() ignores GPU tensor pose writes after the
resume re-attach until the next simulate() call. Only a dedicated stale
frame error counts as the expected failure, so pose and step-count
regressions still fail the test. The test flags when a PhysX update
fixes this limitation.

Restore the check that the cube holds the reset pose while the reference
frame stabilizes. Share the scene setup, step, pose, and silhouette
helpers between the reset tests, use the core Cartpole test scene, and
scope the tests to the default CUDA device through test_devices().
An empty reference silhouette now fails the resume test instead of
counting as the expected stale frame. The camera height argument of the
reset scene helper now states its unit.
The reset camera tests configure PhysX, Fabric, and the Kit renderer,
so they belong with the PhysX tests. Move them unchanged to
source/isaaclab_physx/test/envs/test_env_reset_camera_observation.py.
The textured first-frame test stays in the core sensor tests.
The reset tests compared depth silhouettes of camera images. Issues
isaac-sim#6394 and isaac-sim#8428 were both stale Fabric transforms after a reset, and RTX
renders from omni:fabric:worldMatrix. Compare that attribute with the
expected poses instead. The checks are exact and need no reference
frames, IoU thresholds, or stabilization steps.

The articulation test captures the Fabric link transforms right after
the reset and compares them with the PhysX link poses after one physics
step. It also checks that the reset already ran forward kinematics.

The scene keeps a camera, because RTX cameras switch on continuous
Fabric transform updates. The file is now
test_env_reset_fabric_poses.py.
The resume test raised a custom exception for its expected failure.
pytest stores every exception of a test call in sys.last_exc, and the
Kit launcher exits with status 1 at exit when sys.last_exc is set. As
the last test in its file, the xfail test made the file fail in CI
although pytest reported 2 passed and 1 xfailed.

Call pytest.xfail() instead. It raises a BaseException, which pytest
does not store in sys.last_exc. The strict marker accepts only that
exception, so other failures and an unexpected pass still fail the test.

The stale pose after a resume does not depend on the Fabric re-attach.
Without the re-attach, Fabric keeps the pose from before the pause.
Describe the limitation as a timeline resume limitation.
The Fabric checks cannot see a stale observation from the render path,
for example when the reset does not render again. No other test checks
the image content that a reset returns. Restore the depth silhouette
comparison of the first and the later reset in the cube test, next to
its Fabric checks. With num_rerenders_on_reset = 0, the Fabric checks
pass and only the image check fails (IoU 0.370).

The articulation and resume tests keep their Fabric checks only.
RTX writes +inf where a ray hits nothing, so a finite depth marks a
silhouette pixel. The extra depth bounds never filtered a pixel. If the
background encoding changes, the check that the reference silhouettes
do not overlap fails.

Rename the Fabric rotation matrices to orientation_matrices, because
rotations suggests Euler angles or quaternions, and name the
translation row positions.
The custom clipping range served the old depth bounds of the silhouette.
The scenes have no geometry near the camera or beyond the default far
clip, so the default range renders the same silhouettes.

The comment on pytest.xfail() now names the cause: the Kit launcher
exits with status 1 when sys.last_exc is set.
Read Fabric without prefetching USD data, so a prim that is missing in
Fabric cannot fall back to its authored spawn pose. Assert that the
world matrix attribute exists.

In the resume test, read the PhysX pose directly, because the asset
data returns the written pose until the next physics step. Accept the
stale Fabric pose as the expected failure only when one physics step
clears it, so a permanent freeze fails. Re-raise the error when
--runxfail turns pytest.xfail() into a no-op.

Count zero depth as background, because RTX fills a frame that it did
not render with zeros. Remove copies of observations that the
observation manager already returns as snapshots, use
get_current_stage(fabric=True) and map_body_ids_to_backend(), and
describe how Fabric Hierarchy and FSD feed RTX.
The separate test file started a second Kit app with cameras, which
cost about 28 s in CI. Add the Fabric checks to
test_env_reset_restores_initial_pose_in_camera_observation, where the
reset camera test lived before. The checks read the cube transform in
Fabric after the first reset, after the move, and after the later reset.

Remove the Cartpole test. The physx-cartpole-kit-tiled golden image
fails when play() re-syncs Fabric on the first start, and both that
golden image and test_articulation.py fail when update_kinematics()
does nothing.

Remove the strict xfail resume test. It guards no Isaac Lab code.
@pv-nvidia
pv-nvidia force-pushed the fix/first-reset-camera-stale-8428 branch from 74b7b45 to 2b43819 Compare October 19, 2026 14:49
@pv-nvidia

Copy link
Copy Markdown
Contributor 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 Oct 19, 2026
@AntoineRichard

Copy link
Copy Markdown
Collaborator

@StafaH Updated CI timing after the rework on 2b43819d, which supersedes my numbers above. The PR now adds about 0 s:

test_first_frame_textured_rendering.py Wall (s) Test (s)
This PR (CI run on 2b43819d) 26.56 5.50
Baseline (median of 9 runs on 2026-10-19 and 2026-10-20) 26.53 (range 25.58–27.70) 5.64

@maxkra15 maxkra15 self-assigned this Oct 28, 2026
@maxkra15
maxkra15 self-requested a review October 28, 2026 12:43

@maxkra15 maxkra15 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.

The Fabric pose assertions extend the existing reset test cleanly. Matrix checks and current-head GPU tests pass. No remaining review findings.

@maxkra15
maxkra15 merged commit 4c5343f into isaac-sim:main Nov 11, 2026
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants