Repository navigation
feat(studio): guided setup on first launch - #7
Conversation
Quest-Claim: 579298a7a5ac44a3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…starting Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 38 minutes. View limit details
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. CodeRabbit Verify
|
Setup now starts the engine with an Autosave it opens only once the creator picks a start, so a missing scene file is never created before setup finishes. Both starts create the file through the autosave's first save, and setup refuses to overwrite a file that appeared meanwhile. The save on quit runs only once an engine exists. The Output panel keeps main's broadcast and encoding rows plus the Canvas row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 98187f4
No confirmed actionable defects found. Device and encoder errors and measurement fallback are surfaced. The automatic probe uses the real broadcast path, a collision risk already acknowledged by the PR; relay arbitration was not independently verified.
Verification: static review only; no tests, device checks or live relay checks run.
Each canvas's encoder probe now times a 15-frame burst of a panning picture through the program's own copy and encode path, and setup proposes only canvases that copy and encode a frame within three quarters of its period. When none keeps up, it proposes the one closest to keeping up. A burst that falls behind stops early, so a slow encoder costs no more time than a fast one. The uplink headroom now follows the Health panel's degraded threshold, so a proposal is not graded degraded the moment it goes live, and rates use the Health panel's formatting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: c5a17d4
P2 — Reserve the setup file atomically (rs/moq-studio/src/setup.rs:782–790). try_exists() and Autosave::open() are separate, and the collection returned by open is discarded. If another process creates the file after the check, including before autosave's first write, this setup can overwrite the newly created scene despite the no-overwrite promise. Atomically create/reserve the path or make the initial write create-new and fail on existence; add a concurrent-creation regression test.
The earlier real-broadcast probe collision risk remains unchanged and acknowledged. Verification: static review only; no tests or device checks run.
Setup's proposal is now the scene model's first edit, recorded in the history, so undo returns to the empty scene and the autosave writes both files. Engine::start takes the Launch with autosave's Loaded. The first save of a missing scene file refuses one another program created since. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h the autosave The autosave's own read is the check, and its first save refuses a file created after it, so no window remains where setup could replace one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dropping the runtime waits out its blocking pool, so a probe stuck on a camera permission prompt held the studio open after its window closed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Devices panel keeps main's off-runtime listing for macOS, on a thread of its own like setup's probes, so a stuck listing cannot hold the studio open on quit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 9d8eb42
The earlier setup-file overwrite finding is addressed: setup checks the autosave's own read, and the first write uses a no-clobber persist. No new actionable issues found in the updated setup and history integration. Moving potentially stuck probes off the runtime's blocking pool is a reasonable way to avoid holding shutdown open. Static review only; I did not independently run device, encoder, or relay tests.
Fits guests to guided setup (#7): the room joins `engine::Launch` as an `Arc`, since setup clones the launch, and is loaded before setup so bad guest flags still fail at startup. Guests are followed once the engine starts, after setup has recorded its scene. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
The first launch of
moq-studioopened an empty 1080p30 studio. To go live, a creator had to find their devices, guess a canvas their machine and uplink can carry, and read the docs. This finishes quest/m0/guided-setup.md.Approach
When the scene file does not exist, the window opens on a setup screen instead of the studio. It runs three checks in the background, and each failure is shown with its reason:
ui.rstodevices.rswith typed fields so setup and the Devices panel share it.moq_video::render::export::Exporter::new, the same probe the program uses at startup. It records the encoder it settled on, whether it reads the GPU, and the bitrate. Then it times a 15-frame burst through that exporter and a fresh encoder: a panning picture is copied, waited on, and encoded, as the program's encode thread does. The first frame (a keyframe) is untimed, and the burst stops once its average can no longer come in under budget.uplink.rs): a probe publish at the--broadcastpath, using one-shot connections:The proposal, explained in plain words beside each choice:
Start with an empty scene opens a new collection on the chosen canvas. Start with this scene opens the same collection with the proposal as its first edit: a
Draftlabelled "Set up sceneMain", applied and recorded in the history as any panel edit is, so undo returns to the empty scene. Both start the engine with a freshAutosaveon the scene file, whose first save writes the scene file and its history at once. Nothing opens or writes the file before that, so quitting during setup leaves no file and setup runs again. A start refuses a file that appeared during setup (another studio, say) instead of overwriting it: the autosave's own read is the check, and its first save of a file it found missing refuses one created since (persist_noclobber). A failed start shows its error and can be retried with other choices.Engine::startnow takes aLaunch(GPU, relay, broadcast path, on-demand), theAutosave, and the autosave'sLoadedcollection and history, so setup can start it later. The save on quit runs only once an engine exists.The encoder probes never overlap the program's or the sources' encode sessions: each canvas's exporter and encoder are dropped before the next opens, and the start buttons appear only once every probe has finished, so the program opens its encoder at startup, ahead of the sources, as on
main.Impact
--connect, setup publishes a probe broadcast (trackprobe, filler bytes) at the--broadcastpath for about 6 s and subscribes to it through the relay.No scene-file format change.
Decisions
Exporter::newprobe, and propose only canvases whose encoder keeps up with real time. This replaces the follow-up "the encoder probe proves an encoder opens, not that it keeps up". It supersedes the quest Plan's "no separate benchmark": the burst runs through the exporter the probe already opened, not a separate test.Choices made without asking
--setupflag. Picking a new file path reruns setup.--broadcastpath, since that is the path a relay token lets the studio publish at. Following only the probe's own epoch (follow(path, Some(epoch))) never resolved through the test relay, so the viewer follows the path. A collision there is the same one the program itself would hit.hang::health::Thresholds::default().transport.headroom.degraded, 1.5), so a proposed canvas does not show as degraded in the Health panel the moment it goes live. It was 75%, which Health would grade degraded. The window stays 6 s (the transport probe's rise budget is 5 s).Studio::new's message parameter are gone.Sceneon the chosen canvas, which is what Start with an empty scene opens. Setup builds it throughDraftand records it in theLoadedhistory before the engine starts, rather than committing after, so the autosave's first save already holds it.!Sendon macOS, so they cannot be spawned on the runtime (#14 moved the panel to the blocking pool for that).Verification
just cipasses locally on macOS (Apple M4) at the reviewed head, capture features included now that #14 builds them: 71 tests passed.autosave::tests::leaves_a_file_created_since_it_found_none: a scene file created after the autosave found none is left as it is, and the error stays shown.setup::tests::times_every_canvasandengine::tests::the_program_reaches_a_relay(ignored, injust render-swand so the nightly) pass on an Apple M4 with VideoToolbox after the merge.moq_relay::test_relay, and an unreachable relay fails with a message naming the connection.Alternatives
moq-video(Exporter::new). It would need a moq change and a pin bump, and the studio already has every public piece (Exporter::copy,Encoder::encode) to time its own path.bitratefield in the scene file, set from the uplink. It is a new user-facing surface, and encode-control will make the bitrate follow the grant live.Follow-ups
origin::Consumer::follow(path, Some(epoch))did not resolve for a broadcast announced with that epoch throughmoq_relay::test_relay. This is worth checking in moq: either the relay does not carry the epoch, or the probe used it wrong.Review
quest review), head 9d8eb42, round 2: no findings.mainblocked dropping the runtime. They now run on threads of their own; the second merge (fix(studio): build and run on macOS with capture #14, quest: plan follow-ups of the 2026-11-02 quest-complete merges #12) gives the Devices panel's listing the same treatment.try_exists, and the autosave's first save of a file it found missing usespersist_noclobber, so a file another program creates meanwhile is never replaced.autosave::tests::leaves_a_file_created_since_it_found_nonecovers it.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)