Skip to content

[Visualizers] Keep Newton marker batch sizes fixed when prototypes switch - #8338

Merged
kellyguo11 merged 4 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/fix-newton-marker-prototypes
Oct 9, 2026
Merged

kellyguo11 merged 4 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/fix-newton-marker-prototypes

Conversation

@AntoineRichard

@AntoineRichard AntoineRichard commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Newton-family marker rendering logged only the markers selected for each prototype and hid prototypes with no markers. When a multi-prototype marker switched prototype mid-run (for example the Lift pose markers moving from position_far to position_near), a batch that had only been logged as hidden gained its first instances after rendering started. OVRTX rejects that with WRITE_FLOOR_VIOLATION, so --video newton_rtx recordings of the Lift tasks stopped after 9 to 37 frames.

  • Log every marker in every prototype batch and zero-scale the markers that use another prototype, so each batch keeps a fixed instance count from the first frame.
  • Frame-marker line width uses the largest marker scale, so zero-scaled markers do not thin visible lines.

Migration: none. Dependencies: none.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Validation

  • uv run python -m pytest source/isaaclab_visualizers/test/test_newton_adapter.py: 74 passed. The new prototype-switch test fails before the fix, where the unused prototype is logged hidden with no instances.
  • isaaclab play --checkpoint pretrained --video newton_rtx for Isaac-Lift-Franka, Isaac-Lift-KukaAllegro, Isaac-Lift-Cable-Franka, Isaac-Lift-Cloth-Franka and Isaac-Lift-Soft-Franka: 300 of 300 frames each with no WRITE_FLOOR_VIOLATION (9 to 37 frames before). Isaac-Lift-Franka with --video newton_gl renders the same markers.
  • Requires [Core] Draw debug markers in on-demand video captures #8337 for markers to be dispatched in headless captures; without it the recordings complete but show no markers.

Follow-ups

Zero scaling is a temporary workaround: Newton's log_instances has no per-instance visibility, and changing a batch's count rebuilds it in ViewerRTX. newton-physics/newton#4539 requests PointInstancer-backed batches that resize and hide instances in place; the code is marked TODO(newton-physics/newton#4539) and logs only the shown markers once it lands. The WRITE_FLOOR_VIOLATION itself is fixed upstream by newton-physics/newton#4393.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab -f
  • I have made corresponding changes to the documentation (no documented behavior changes)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment for every touched source package
  • My name already exists in CONTRIBUTORS.md

🤖 Generated with Claude Code

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Multi-prototype markers logged each prototype's selected markers only and
hid empty prototypes, so a prototype first used mid-run created instance
geometry after rendering started. OVRTX rejects that with
WRITE_FLOOR_VIOLATION, which cut Lift recordings to a few frames. Log
every marker per prototype and zero-scale the ones it does not show.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Oct 6, 2026
@AntoineRichard
AntoineRichard marked this pull request as ready for review October 6, 2026 17:30
@AntoineRichard
AntoineRichard requested a review from a team October 6, 2026 17:31
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Fixes marker batch sizing logic in visualization rendering.

The PR appears safe to merge, with a non-blocking frame-marker appearance regression to address.

Findings

  1. P2 Frame axes become too thick ▶

Summary

The PR keeps Newton prototype batches at a fixed instance count by logging every marker for each prototype and zero-scaling nonmatching markers. It also changes frame-line width calculation and adds a mesh-prototype switching regression test.

Reviews (1) · Last reviewed commit: "Keep Newton marker batch sizes fixed whe..."

starts, ends, colors = _build_frame_lines(selected_translations, selected_orientations, selected_scales)
width = max(float(selected_scales.mean().item()) * 0.05, 0.0025)
# Zero-scaled markers of other prototypes must not thin the visible lines.
width = max(float(selected_scales.amax().item()) * 0.05, 0.0025)

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 Frame axes become too thick
For a frame marker with non-uniform scales, this uses the largest axis scale to set the width of every axis. For example, scales of (0.01, 0.01, 10) produce a width of 0.5, versus about 0.167 before this change. Short axes can therefore look disproportionately thick. The width calculation should exclude zero-scaled markers without replacing the visible markers’ mean scale with their largest component.

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

  • PR description: The body matches the diff; remove the generated-with attribution and add reproducible baseline/candidate frame-time and memory measurements with revisions, command, task, hardware, backend, environment count, and warmup.
  • 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: The fixed-size invariant excludes marker_indices=None, so later indexed frames can still create non-primary prototype instances and trigger OVRTX write-floor failures; zero-scale those batches initially.
  • Style consistency: The selected_* locals are now identity aliases with misleading subset names; remove them and use the full-batch values directly.
  • Test quality: Test quality looks good.

Minor fixes needed. Posted 2 inline findings.

Automated review; human maintainers own approval decisions.

if not torch.any(selected):
self._hide_batch(viewer, name, newton_cfg, render_id)
continue
if marker_indices is None and proto_index != 0:

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.

🟡 Warning · Implementation — None indices path still hides batches

With marker_indices=None the non-zero prototypes are hidden, so a later indexed frame gives those batches their first instances and re-triggers the OVRTX write-floor failure. Zero-scale them instead of hiding.

continue

selected_translations = translations[selected]
selected_translations = translations

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.

🟡 Warning · Style Consistency — Stale selected_ aliases no longer select

selected_translations and selected_orientations are now identity assignments, and the selected_ prefix claims a per-prototype subset the fix removed. Drop both aliases and use translations, orientations, and count directly.

else:
selected_scales = scales[selected] * default_scale_tensor
selected_scales = scales * default_scale_tensor
if marker_indices is not None:

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 ideally to disable a marker, we can use some disable / hide convention, rather than zero scaling.
also not sure zero scaling introduces a perf hit, since my understanding would be the zero scaled markers are still being iterated-on per update

could you check if a different method exists or if there's any perf hit from zero scaling? thanks!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed that a hide convention is the right model. I checked what Newton's ViewerRTX (1.6.1) allows today:

  • After the first frame, changing a batch's instance count, colors, materials or opacities rebuilds it: the prim is removed, re-exported as USD and republished (_replace_runtime_prim). Only transforms, scales and whole-batch hidden update in place, so there is no public per-instance hide.
  • A Newton-only repro confirms it on OVRTX 0.5 / OVStage: fixed count and whole-batch hide/show run fine, while a first instance or a count change fails with WRITE_FLOOR_VIOLATION. That crash is fixed by Render a borrowed ovstage in ViewerRTX newton-physics/newton#4393, but count changes would still rebuild the batch on every switch.

I opened newton-physics/newton#4539 for PointInstancer-style per-instance visibility on log_instances. Until it lands, this PR keeps zero scaling as a temporary workaround, marked with a TODO(newton-physics/newton#4539), so batch counts stay fixed. The cost is the extra zero-scale transforms per frame, e.g. 3 × 50 instead of 50 markers for a Lift pose group. In 3b67258 I also covered the marker_indices=None path, dropped the aliases, and sized frame lines from the shown markers only.

AntoineRichard and others added 2 commits October 7, 2026 11:54
Track newton-physics/newton#4539 for per-instance visibility, which
replaces zero scaling. Keep the instance count fixed when marker_indices
is None too, drop the identity aliases, and size frame lines from the
shown markers only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 Oct 7, 2026
@kellyguo11

Copy link
Copy Markdown
Contributor

@matthewtrepte @AntoineRichard need to fix the failing test case

The render tests from isaac-sim#8220 expected unused prototype batches to be
hidden and each batch to log only its own markers. Every prototype batch
now logs all markers and zero-scales the ones it does not show, so the
tests check that contract instead, including a prototype switch between
frames. The adapter test duplicated that switch and is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@maxkra15

maxkra15 commented Oct 9, 2026

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 Oct 9, 2026
@maxkra15
maxkra15 self-requested a review October 9, 2026 14:02
@AntoineRichard
AntoineRichard enabled auto-merge (squash) October 9, 2026 14:04
@kellyguo11
kellyguo11 disabled auto-merge October 9, 2026 16:03
@kellyguo11
kellyguo11 merged commit b30e5bd into isaac-sim:develop Oct 9, 2026
59 checks passed
@isaaclab-bot

isaaclab-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as 44624ed.

isaaclab-bot Bot pushed a commit that referenced this pull request Oct 9, 2026
…itch (#8338)

# Description

Newton-family marker rendering logged only the markers selected for each
prototype and hid prototypes with no markers. When a multi-prototype
marker switched prototype mid-run (for example the Lift pose markers
moving from `position_far` to `position_near`), a batch that had only
been logged as hidden gained its first instances after rendering
started. OVRTX rejects that with `WRITE_FLOOR_VIOLATION`, so `--video
newton_rtx` recordings of the Lift tasks stopped after 9 to 37 frames.

- Log every marker in every prototype batch and zero-scale the markers
that use another prototype, so each batch keeps a fixed instance count
from the first frame.
- Frame-marker line width uses the largest marker scale, so zero-scaled
markers do not thin visible lines.

Migration: none. Dependencies: none.

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Validation

- `uv run python -m pytest
source/isaaclab_visualizers/test/test_newton_adapter.py`: 74 passed. The
new prototype-switch test fails before the fix, where the unused
prototype is logged hidden with no instances.
- `isaaclab play --checkpoint pretrained --video newton_rtx` for
`Isaac-Lift-Franka`, `Isaac-Lift-KukaAllegro`,
`Isaac-Lift-Cable-Franka`, `Isaac-Lift-Cloth-Franka` and
`Isaac-Lift-Soft-Franka`: 300 of 300 frames each with no
`WRITE_FLOOR_VIOLATION` (9 to 37 frames before). `Isaac-Lift-Franka`
with `--video newton_gl` renders the same markers.
- Requires #8337 for markers to be dispatched in headless captures;
without it the recordings complete but show no markers.

## Follow-ups

Zero scaling is a temporary workaround: Newton's `log_instances` has no
per-instance visibility, and changing a batch's count rebuilds it in
`ViewerRTX`. newton-physics/newton#4539 requests PointInstancer-backed
batches that resize and hide instances in place; the code is marked
`TODO(newton-physics/newton#4539)` and logs only the shown markers once
it lands. The `WRITE_FLOOR_VIOLATION` itself is fixed upstream by
newton-physics/newton#4393.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks with `uv run isaaclab -f`
- [ ] I have made corresponding changes to the documentation (no
documented behavior changes)
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment for every touched source package
- [x] My name already exists in `CONTRIBUTORS.md`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

(cherry picked from commit b30e5bd)
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