Skip to content

fix(demo): the VR demo keeps its spatial mix through catalog estimate updates - #9744

Merged
kixelated merged 2 commits into
mainfrom
quest/m0/interop-green/vr-catalog-rebuild
Nov 27, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m0/interop-green/vr-catalog-rebuild

Conversation

@kixelated

@kixelated kixelated commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/interop-green/vr-catalog-rebuild.md.

Summary

The scheduled Interop step VR catalog fields (just test vr) threw InvalidAccessError at output.disconnect(split) in run 45873739689. It reproduced locally 2 of 2.

Why the catalog arrives four times: the publisher really sends four. Logging each update's JSON showed a live fMP4 import republishing its catalog while its estimates settle: video and audio bitrate appear, audio bitrate rises (111270, 118419, 118422), and sync.interval appears. Neither the relay nor the JS reader repeats anything, so there is nothing to fix there.

What broke the test: demo/vr rebuilt its whole spatial audio graph (and the picture's layout) on every audio or video config change, so each estimate update closed the old mix. That dropped the test's meter tap, which then read a dead branch and threw on disconnect. It also glitched the demo's sound for real viewers.

  • demo/vr/src/index.ts: the picture's layout and the sound's placement are now computed signals of only the fields they use (projection, stereo, layout). The signals' deep equality keeps them unchanged across estimate updates, so the mix and the layout rebuild only when something they lay out by changes.
  • test/interop/clients/js/vr.ts: ears() checks the demo still holds the mix it tapped before disconnecting, and otherwise fails with the demo rebuilt its spatial mix mid-measurement instead of a bare InvalidAccessError.
  • quest/m0/aac-resume-stall.md: notes that a live fMP4 import republishes its catalog as estimates settle, since that quest also saw repeated catalogs without a resubscribe.
  • Deletes the finished quest.

Public API: none. Wire: none.

Caused by

  • moq-dev/moq#8781 - the VR demo rebuilt its audio graph on every catalog config change, and its test tapped that graph assuming it stays put (found by check). Which change in 420b8dc..b509328 moved an estimate update into the ear window is not pinned; the race was there from the start.

Decisions

  • Fix the demo rather than make the test follow a rebuilt mix: rebuilding the HRTF graph on a bitrate estimate is a real glitch for viewers, and with it fixed a mid-measurement rebuild only happens on a layout change the fixture never makes, so the test fails loudly on it instead of carrying reconnect logic.
  • No change to how often the publisher republishes its catalog: the max bitrate only rises, so the updates are bounded and settle within a few seconds.

Validation

  • Before: just test vr failed 2 of 2 locally with the same InvalidAccessError as CI.
  • After: just test vr passed 4 of 4 locally (ahead L 0.314 R 0.089, facing L 0.127 R 0.125).
  • Second check: with a temporary log in Spatial's constructor, one run built the mix once across three catalog updates.
  • just check passes; tsc --noEmit passes for demo/vr and test/interop/clients/js.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown (arm A)

(Written by Claude Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: 393fc62
  • Base: origin/main at 83e10f0
  • Risk: low, The change touches only the VR demo (`demo/vr/src/index.ts`), an interop test (`test/interop/clients/js/vr.ts`), and quest plan docs; a bug could at worst break the demo's spatial audio or make the VR interop step fail, which affects no published consumer or peer and is fully undone by a revert.
  • Classified: low by Claude Code, claude-haiku-5-5, low effort, session 412622ce-d47e-4cf6-9473-48ab09d3adc1
  • Risk file: bb7b1c0de60b
  • Local review: none, since the head is low risk

kixelated and others added 2 commits November 26, 2026 23:37
… updates

A live fMP4 import republishes its catalog while its bitrate and sync
estimates settle. The VR demo rebuilt its whole audio graph on each one,
which dropped the test's meter tap mid-measurement, so `just test vr`
threw on disconnect. The demo now rebuilds the picture and the mix only
when a field they lay out by changes, and the test fails with a clear
message if the mix is rebuilt under it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title The VR test measures the spatial mix across catalog updates fix(demo): the VR demo keeps its spatial mix through catalog estimate updates Nov 27, 2026
@kixelated
kixelated marked this pull request as ready for review November 27, 2026 07:45
@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The VR demo now derives picture and audio placement separately, then uses those values to update scene layout and create the spatial listener. The interop test checks that listener output remains unchanged after audio sampling. A planning document adds an example of four live fMP4 catalog updates, and a prior catalog-rebuild investigation document is deleted.

Merge Risk: Minimal · up to 393fc

The VR demo no longer rebuilds its spatial audio mix on estimate-only catalog updates, and the interop test now fails with a clear message if it does. No concrete merge-blocking risk was identified. The change is small and easy to revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the VR demo keeps its spatial audio mix through catalog estimate updates. The changeset matches this. The demo now derives layout and placement from only projection, s…
Description check Passed The description relates directly to the changeset. It explains the failing VR interop step, the cause (the demo rebuilding its spatial audio graph on each catalog config change), the fix in demo/vr/sr…
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.
Full details: Title check

Explanation

The title names the main change: the VR demo keeps its spatial audio mix through catalog estimate updates. The changeset matches this. The demo now derives layout and placement from only projection, stereo, and layout fields, so estimate-only updates no longer rebuild the spatial mix. The title is specific and uses the conventional fix(demo) prefix.

Full details: Description check

Explanation

The description relates directly to the changeset. It explains the failing VR interop step, the cause (the demo rebuilding its spatial audio graph on each catalog config change), the fix in demo/vr/src/index.ts, the test change in test/interop/clients/js/vr.ts, the quest documentation edits, and the validation steps.

Finishing Touches

Simplify code

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

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 946fab8a-fd9b-4474-b14e-0c65cce52895
Commits

Reviewing files that changed from the base of the PR and between 83e10f0 and 393fc62.

Files selected for processing: 4

  • demo/vr/src/index.ts
  • quest/m0/aac-resume-stall.md
  • quest/m0/interop-green/vr-catalog-rebuild.md
  • test/interop/clients/js/vr.ts
Files with no reviewable changes: 1

  • quest/m0/interop-green/vr-catalog-rebuild.md

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

@kixelated
kixelated added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 9d6472c Nov 27, 2026
7 checks passed
@kixelated
kixelated deleted the quest/m0/interop-green/vr-catalog-rebuild branch November 27, 2026 10:42
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