Repository navigation
[Visualizers] Keep Newton marker batch sizes fixed when prototypes switch - #8338
kellyguo11 merged 4 commits into
Conversation
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]>
|
| 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
🟡 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 |
There was a problem hiding this comment.
🟡 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: |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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-batchhiddenupdate 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.
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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
run-ci |
|
@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]>
|
run-ci |
|
Backported to |
…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)
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_fartoposition_near), a batch that had only been logged as hidden gained its first instances after rendering started. OVRTX rejects that withWRITE_FLOOR_VIOLATION, so--video newton_rtxrecordings of the Lift tasks stopped after 9 to 37 frames.Migration: none. Dependencies: none.
Type of change
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_rtxforIsaac-Lift-Franka,Isaac-Lift-KukaAllegro,Isaac-Lift-Cable-Franka,Isaac-Lift-Cloth-FrankaandIsaac-Lift-Soft-Franka: 300 of 300 frames each with noWRITE_FLOOR_VIOLATION(9 to 37 frames before).Isaac-Lift-Frankawith--video newton_glrenders the same markers.Follow-ups
Zero scaling is a temporary workaround: Newton's
log_instanceshas no per-instance visibility, and changing a batch's count rebuilds it inViewerRTX. newton-physics/newton#4539 requests PointInstancer-backed batches that resize and hide instances in place; the code is markedTODO(newton-physics/newton#4539)and logs only the shown markers once it lands. TheWRITE_FLOOR_VIOLATIONitself is fixed upstream by newton-physics/newton#4393.Checklist
uv run isaaclab -fCONTRIBUTORS.md🤖 Generated with Claude Code
Release backport
develop