Fix stale Gaussian splat handles after set_visible_worlds() - #4084
Fix stale Gaussian splat handles after set_visible_worlds()#4084aneangel wants to merge 1 commit into
Conversation
Gaussian shape names were derived from len(_gaussian_instances), a counter that reset to zero every time set_visible_worlds() rebuilt the list. This caused world N's shape to steal world 0's old backend name, leaving world N's original handle orphaned in _scene_handles as a frozen, still-visible duplicate. Two changes fix this: - Use the stable global shape index s as the name suffix instead of the sequential counter, so each shape's name is invariant across visibility changes. - After repopulating _gaussian_instances, hide handles for any Gaussian name that is no longer in the active set. Closes newton-physics#4020
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthrough
ChangesGaussian visibility fix
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: 🔵 Low · up to The change fixes stale Gaussian renders by preserving stable shape identities and hiding handles that are no longer active, but an interrupted visibility rebuild could still leave obsolete handles visible and unreachable for cleanup; the PR is mergeable with explicit owner awareness of this bounded failure-path risk. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
set_visible_worlds()left stale, still-visible Gaussian splat handlesbehind in
ViewerViser(and any other backend that tracks handles byname).
Gaussian shape names were generated using
len(_gaussian_instances)asa sequential counter. That counter resets to zero every time
set_visible_worlds()rebuilds the list, so world N's shape would stealworld 0's old backend name. World N's original name became an orphan
in
_scene_handles— its handle was never visited again, so it wasnever hidden or removed. The result was a frozen duplicate rendering at
the shape's last known position alongside the live copy.
Two changes fix this:
s(its position inthe model's fixed shape array) as the name suffix instead of
len(_gaussian_instances). Each shape's name is now invariant acrossset_visible_worlds()calls._gaussian_instances, hide handlesfor any Gaussian name that is no longer in the active set.
Closes #4020
Checklist
changelog fragment instructions
Test plan
All pass with no failures.
Bug fix
Steps to reproduce (without this PR):
set_visible_worlds([1])and render another frame.once as a frozen duplicate stuck at its prior position.
Minimal reproduction: see the script in issue #4020.
Summary by CodeRabbit
Bug Fixes
Documentation