Skip to content

fix(sharpa-avatar): report missing gloves and stop stale output [1.7] - #1578

Merged
fvaloppi-nv merged 3 commits into
release/1.7.xfrom
codex/backport-stale-output-withdrawal-1.7
Nov 25, 2026
Merged

fvaloppi-nv merged 3 commits into
release/1.7.xfrom
codex/backport-stale-output-withdrawal-1.7

Conversation

@fvaloppi-nv

@fvaloppi-nv fvaloppi-nv commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Backports the stale-output withdrawal correction from #1577 to release/1.7.x, following merged PR #1515. The original reminders and freshness checks are already present; this follow-up withdraws and recreates each dataset's output independently and preserves setup errors/backoff until recovery. Addresses #1421 and Internal Bug ID: 7022089.

  • Track the startup wait state separately for the left and right Avatar gloves. Log the missing side immediately and repeat the reminder every minute until it is streaming.
  • Stop publishing cached HUMAN, RAW, and ROBOT output after its source timestamp has not advanced for the 3-second freshness window. Use the same freshness rule for health status and output delivery.
  • Add regression coverage for independent per-side reminders and the dataset freshness boundary.
  • Withdraw each unusable HUMAN, RAW, or ROBOT output resource so consumers release cached samples; recreate only that output on recovery. Setup failures remain isolated with bounded retries, including across intermittent missing payloads.

Type of change

  • Bug fix (non-breaking change)

Testing

The following validation was reported by source PR #1422 and was not repeated for this port:

  • Built sharpa_avatar_plugin_tests with production Avatar SDK 1.7.3-17.
  • Relevant CTest selection: 14 passed.
  • clang-format-14 --dry-run --Werror on changed C++ files: passed.
  • SKIP=check-copyright-year pre-commit run --all-files: passed.

Physical-glove validation is still required. I do not currently have hardware available to reproduce the reported startup sequence. QA should start with the right glove off and the left glove on, confirm that right-side reminders continue after the left connects, then power on the right glove and confirm that the reminders stop. The stale-output path should also be checked with a non-advancing dataset timestamp and recovery on a fresh sample.

Validation repeated for this 1.7 backport:

  • Compiled and ran the SDK-independent tracker and stream regression target: 17 CTest cases passed under ASan/UBSan; see follow-up validation below.
  • clang-format 14.0.6 --dry-run --Werror on all changed C++ files: passed.
  • SKIP=check-copyright-year pre-commit run --all-files: passed.
  • Full plugin build and physical-glove validation were not repeated: this host has neither the Avatar SDK nor glove hardware.

Adversarial review: two independent review passes identified retained HUMAN and joint-output resources and a retry-backoff bypass; all were corrected. The tests cover resource withdrawal/recreation, left/right and dataset isolation, empty payloads, physical readiness, standard/vendor exceptions, and retry timing. Real runtime and hardware validation remain pending.

Follow-up review fixes

  • Physical readiness now follows fresh ingress from startup and reconnect; each dataset owns its output setup and retries independently.
  • Health and delivery use the same payload-validity predicate. Empty or wrong-category successful fetches do not advance accepted-data freshness.
  • Output delivery exceptions withdraw only the failing resource and retain per-dataset error/backoff state; health is published after output processing.
  • Same-handle ingress outages retain timestamp baselines, so an unchanged SDK cache cannot revive an output. A new device generation clears the baseline.
  • Added an SDK-independent CI target that compiles the actual tracker and health sources against synthetic boundary dependencies. Startup/reconnect isolation, empty/wrong payloads, delivery failure, and cached-stamp recovery are exercised through the real tracker flow.

Validation repeated on both PR branches: all 17 CTest cases passed under AddressSanitizer/UndefinedBehaviorSanitizer (leak detection disabled under ptrace), with project compiler warnings treated as errors. Formatting and the full pre-commit hook set passed. The exercised dataset state/reason pairs were checked against the actual Python reducer; the full binding-dependent Python suite was unavailable locally.

A fresh adversarial pass covered lifecycle, failure isolation, and the test/build contracts, with no remaining confirmed blocker. Synthetic tests do not validate vendor ABI, callback timing, physical haptics, or actual OpenXR teardown acknowledgments. Shared runtime cleanup remains best-effort; live SDK/runtime and hardware QA are still required.

Checklist

  • Contribution guidelines reviewed.
  • Regression tests added.
  • Commit signed off under DCO.
  • Physical-glove QA completed.

Summary by CodeRabbit

  • Bug Fixes
    • Hand-tracking data that has stopped updating is no longer published or applied to hand and joint tracking.
    • Glove readiness reminders are now tracked independently for each side, with reminders no more than once per minute while a glove is unready.

Signed-off-by: fvaloppi-nv <fvaloppi@nvidia.com>
Signed-off-by: fvaloppi-nv <fvaloppi@nvidia.com>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds StreamOutputRecovery to manage per-dataset output resources. Joint-frame publishing and HUMAN hand injection now check dataset usability before creating or using outputs. Unusable outputs are withdrawn, and setup failures are recorded with a bounded retry interval. Tests cover output withdrawal, independent dataset recovery, and retry behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant push_joint_frames
  participant StreamOutputRecovery
  participant output_setup_callback
  participant dataset_pusher
  push_joint_frames->>StreamOutputRecovery: update with dataset usability
  alt output is unusable
    StreamOutputRecovery->>StreamOutputRecovery: reset output
  else output is absent and retry is due
    StreamOutputRecovery->>output_setup_callback: create output
    output_setup_callback-->>StreamOutputRecovery: pusher or setup exception
  end
  StreamOutputRecovery-->>push_joint_frames: return pusher or nullptr
  opt pusher is available
    push_joint_frames->>dataset_pusher: push joint frames
  end
Loading

Possibly related PRs

  • NVIDIA/IsaacCapture#1577: This PR is described as the main-branch version of the same output-withdrawal and recovery change.
Merge Risk: Minimal · up to aa4ac

This change withdraws stale or unusable per-dataset outputs and recreates them individually on recovery, with bounded setup retries. No concrete merge-blocking defect was identified. Real-runtime and physical-glove validation remain with the author.

Security architecture risk: Low · up to aa4ac

The change improves stale-data handling by withdrawing individual outputs. The remaining risk is limited to cleanup failures: the tracker can discard an output locally without confirming that the runtime removed it before trying to recreate it.

Retained concerns

  • Low · reliability · inferred: Per-dataset withdrawal discards the local owner even when runtime teardown is not confirmed. The joint-output destructor logs a failed destroy and discards the handle; the hand-output cleanup does not check the destroy result. If the runtime retains the old resource, the tracker cannot retry its removal and may try to recreate the same logical output while stale state remains visible. The cleanup behavior already existed, but the base did not invoke it for individual dataset interruptions while the glove remained ready.
Security review details

Security Blast Radius

  • observed — The changed resource operations target the session's hand and joint outputs. Dataset-level withdrawal acts on one side and category; whole-glove teardown removes all outputs for that side.

Trust Boundaries and Controls

  • observed — The per-dataset recovery path requires an enabled output, a ready glove, a fresh dataset, and usable payload before creating or using the output. This is a freshness and availability control, not an identity check.

Hardening Proposals

  • proposed — Make the result of runtime withdrawal observable to the tracker, and define what recovery should do after a failed destroy. Verify that consumers release the old sample and bind to the recreated output under the same logical identity.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two main behaviors in this backport: reporting missing gloves (per-side startup wait reminders) and stopping publication of stale output (withdrawing unusable output resources and …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the two main behaviors in this backport: reporting missing gloves (per-side startup wait reminders) and stopping publication of stale output (withdrawing unusable output resources and recreating them on recovery). The changeset covers both, and the [1.7] tag and fix type match the backport intent. The title is specific and concise, so it describes the primary change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0348476 and aa4ac7e.

Files selected for processing: 5

  • src/plugins/sharpa_avatar/AGENTS.md
  • src/plugins/sharpa_avatar/core/avatar_hand_tracking_plugin.cpp
  • src/plugins/sharpa_avatar/core/inc/avatar/avatar_hand_tracking_plugin.hpp
  • src/plugins/sharpa_avatar/core/inc/avatar/avatar_stream_health.hpp
  • tests/cpp/plugins/sharpa_avatar/test_avatar_stream_health.cpp

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

…oads

Signed-off-by: fvaloppi-nv <fvaloppi@nvidia.com>
@fvaloppi-nv
fvaloppi-nv merged commit 5745d55 into release/1.7.x Nov 25, 2026
33 checks passed
@fvaloppi-nv
fvaloppi-nv deleted the codex/backport-stale-output-withdrawal-1.7 branch November 25, 2026 19:17

This branch was previously deployed

1 inactive deployment
dev — 24b170fa Deployed Nov 24, 2026 by fvaloppi-nv via publish-wheel #7266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants