Skip to content

fix(webxr): align input replays across XR sessions - #1063

Draft
yanziz-nvidia wants to merge 1 commit into
mainfrom
yanziz/fix-cross-session-replay-calibration
Draft

fix(webxr): align input replays across XR sessions#1063
yanziz-nvidia wants to merge 1 commit into
mainfrom
yanziz/fix-cross-session-replay-calibration

Conversation

@yanziz-nvidia

Copy link
Copy Markdown
Collaborator

Description

Client-side input recordings are stored in the active R3F scene reference space. A new XR session may establish a different origin even when both sessions use the same reference-space type, so replaying the stored coordinates directly can shift the hand trajectory.

This change:

  • stores an optional gravity-aligned viewer pose with new version 1 recordings;
  • computes a recorded-scene to current-scene translation and yaw transform on the first replay frame of each XR session;
  • freezes and reuses that alignment for the rest of the session, while invalidating it when the reference space resets;
  • preserves identity alignment for direct replay in the same reference space;
  • keeps legacy version 1 JSON recordings compatible (they replay with the existing spatial behavior);
  • applies the same spatial alignment to frame-paced and time-paced replay.

Calibration assumption: the headset must be at the same physical calibration pose at recording start and when replay first starts in a new XR session. Without a shared world marker or tracked table pose, the client cannot distinguish origin drift from the operator physically moving the headset.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

  • npm test -- --runInBand — 7 suites, 109 tests passed
  • npm test -- --runInBand src/xrInputRecorder.test.ts — 36 tests passed
  • targeted ESLint and Prettier checks for the changed recorder files
  • SKIP=check-copyright-year pre-commit run --all-files — passed

Checklist

  • I have read and understood the contribution guidelines
  • I have run the linter and formatter with SKIP=check-copyright-year pre-commit run --all-files
  • Documentation impact was covered with code comments and this PR description; no user-facing configuration was added
  • I have added tests that prove my fix/feature works
  • I have signed off all my commits (git commit -s) per the DCO

Signed-off-by: Yanzi Zhu <yanziz@nvidia.com>
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant