Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Fixed
^^^^^

* Stabilized ``test_camera_renders_not_empty`` in
``test_shadow_hand_vision_presets.py`` by polling the camera output until
all data-type tensors are non-zero, with a 60-step cap, instead of a
single ``env.step()``. The test intermittently failed with "Camera output
is all zeros or all inf" for ``simple_shading_*_mdl`` and
``simple_shading_constant_diffuse`` variants on cold-cache CI runners
because the GPU returned a still-zero framebuffer before the MDL material
finished compiling. The three goldenfile-comparing helpers in
``rendering_test_utils.py`` already use ``flaky(max_runs=3)`` and are left
untouched.
16 changes: 15 additions & 1 deletion source/isaaclab_tasks/test/test_shadow_hand_vision_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,21 @@ def render_correctness_env(request, shadow_hand_vision_presets):
env = ShadowHandVisionEnv(cfg)
env.reset()
actions = torch.zeros(cfg.scene.num_envs, env.action_space.shape[-1], device=env.device)
env.step(actions)
# Step until all camera outputs are non-zero (RTX MDL shaders compile lazily).
# ``simple_shading_*_mdl`` presets can take 10–30 frames to produce non-zero pixels
# on cold-cache CI runners; poll up to ``_MAX_WARMUP_STEPS`` and exit early once ready.
_MAX_WARMUP_STEPS = 60
for _ in range(_MAX_WARMUP_STEPS):
env.step(actions)
outputs_ready = True
for output in env._tiled_camera.data.output.values():
tensor = output.torch
finite = torch.where(torch.isinf(tensor), torch.zeros_like(tensor), tensor)
if finite.max() <= 0.2:
outputs_ready = False
break
if outputs_ready:
break
Comment on lines +404 to +415
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 No diagnostic when warmup cap is reached

If all 60 steps complete without any output reaching the threshold, the fixture silently yields and the test fails with the standard "Camera output is all zeros or all inf" assertion error — with no indication that the warmup cap was hit. Adding a warnings.warn or print on cap exhaustion would make it immediately clear in CI logs that the problem is slow shader compilation rather than a deeper rendering bug.

yield renderer_preset, camera_preset, physics, env
env.close()

Expand Down
Loading