Skip to content

fix(audio): drive the capture gap test on its local task - #7976

Merged
kixelated merged 37 commits into
mainfrom
quest/m0/nightly/macos
Nov 6, 2026
Merged

kixelated merged 37 commits into
mainfrom
quest/m0/nightly/macos

Conversation

@kixelated

@kixelated kixelated commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The scheduled macOS job cannot compile an_empty_gap_buffer_marks_the_next_samples: it spawns a non-Send capture producer. November 5's job confirms the failure before any tests execute.

Approach

Drive capture and its two reader assertions concurrently in the same task with tokio::select!. Completion of the assertions drops the producer; unexpected producer termination fails the test. Producer::run already documents its macOS local-task requirement, and the CLI runs capture in a LocalSet. No Send guarantee is added.

Keep the quest, updated with what remains and the websocket investigation. moq-dev/moq#7829 already reproduced the November 2 timeout on native macOS and fixed the client being dropped before server admission completed, with 100/100 native repetitions passing. Later scheduled runs fail before reaching it. moq-dev/moq#7667 owns independent failure reporting, not this compile fix.

Impact

  • Public API: none.
  • Wire: none.

Alternatives

An unsafe Send implementation would contradict the existing local-task contract. A LocalSet in this test is unnecessary: the producer and assertions can be polled together directly.

Choices made without asking

Retain the existing Linux PR gate. The existing native Platform check uses cargo check --all-targets and catches this error; it runs nightly and for release PRs, rather than on every main PR. Adding a macOS runner to every PR is not a cheap gap closure. A synthetic non-Send test marker would catch test spawns but leave production callers unchecked and remove the non-macOS Send assertion from test builds. Preserve the real platform types and contract checks. No workflow changes overlap with the reporting PR.

Validation

  • nix run .#quest -- gate nix develop --command just ci origin/main: passed (exit 0), including all check phases, GitHub tooling tests, and 1,642 Rust tests (61 skipped).
  • nix run .#quest -- check --base origin/main --branch quest/m0/nightly/macos: passed, 579 documents.
  • git diff --check: passed.
  • Native macOS validation remains scheduled after landing; the quest retains the week of scheduled-main websocket evidence wait.

Review

Claude Code / Claude Opus 5.5, medium effort, via quest review --base origin/main, session 065b8d07-0b42-4d8c-b4fe-209cfb22dcfa.

Round 1 requested consideration of a synthetic non-Send Linux test backend. Fixed the missing alternatives discussion in the quest, recording why that changes test-platform contracts without covering production callers. Round 2 reviewed ac64fc04a33bf69a93479117d50340057a5da60e: no findings. Head 7f0433be12afc2e04bc7deef9fd94fb689df9433 adds only a conflict-free merge with main; the capture and quest files are identical to that reviewed head. No new round is required under the merge exemption.

Landing decision

The maintainer authorized landing through the 2026-11-06 quest-complete session. The coordinator queues this PR. The scheduled validation wait remains in the quest rather than blocking this compile fix.

Follow-ups

The earlier direnv-hook test failure did not recur in this full local CI run. Consider isolating benchmark build-regression fixtures from the shared performance benchmark lock: the tooling phase spent hours queued behind unrelated benchmarks. No follow-up quest was created.

(Written by GPT-6.1 Sol with medium effort)

shermerL and others added 18 commits November 5, 2026 19:36
…pped (#7878)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Luke Curley <kixelated@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: quest fixer <quest-fixer@localhost>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: GPT-6.1 <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Grok 4.7 <noreply@x.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Quest-Claim: 19966b04994b0ad3
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Nightly's macOS platform job passes fix(audio): drive the capture gap test on its local task Nov 5, 2026
kixelated and others added 11 commits November 5, 2026 20:57
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: moq-bot <moq-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: moq-bot <moq-bot@users.noreply.github.com>
…7764)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
#7942)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: quest fixer <quest-fixer@localhost>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: moq-bot <moq-bot@users.noreply.github.com>
Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: moq-bot <moq-bot@users.noreply.github.com>
kixelated and others added 7 commits November 5, 2026 23:18
…ants (#7656)

Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…nch runs (#7928)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
Co-authored-by: moq-bot <moq-bot@users.noreply.github.com>
…e track (#7956)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: moq-bot <moq-bot@users.noreply.github.com>
Co-authored-by: quest fixer <quest-fixer@localhost>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: quest fixer <quest-fixer@localhost>
…by their lifetime (#7884)

Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ts end (#7951)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: quest fixer <quest-fixer@localhost>
@kixelated
kixelated marked this pull request as ready for review November 6, 2026 09:50

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed head: 7f0433be12afc2e04bc7deef9fd94fb689df9433.

Findings: No actionable correctness issues found in the capture-test fix or its quest update.

Fix status and direction:

  • rs/moq-audio/src/capture.rs:859–865 removes the tokio::spawn Send bound by polling capture and both assertions in the test's own task. This matches Producer::run's macOS contract and the CLI's existing local-task handling without adding an unsafe Send guarantee.
  • The empty gap marker still precedes two retained sample buffers. Both reader assertions remain required for success; premature producer completion panics, and successful assertions drop the capture future. The existing non-macOS Send assertions remain intact.
  • Keep the scoped fix and the outstanding native-validation follow-up. A green scheduled macOS run and the subsequent week of websocket evidence remain unverified; the quest correctly stays open for them. No additional code change is requested by this review.

Scope and limits: GitHub-only static review of the two-file branch delta against live main at 1a6ac473d75fcbfd5d23bdbdfd64eb4750b077ad, including capture/fanout lifetime behavior, the ScreenCaptureKit handle, CLI local-task execution, and platform workflow wiring. The PR API also exposes a much larger file list against an older base; unrelated changes already present on current main were not re-reviewed. I did not run builds/tests or native macOS validation. The exact-head Check run was still in progress when inspected; the PR's local-test results are author-reported, not independently rerun here.

Rechecked immediately before submission: open, non-draft, unchanged head, and no existing published review to duplicate. This is a COMMENT review, not merge approval.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Capture gap test driven on the test's own task — an_empty_gap_buffer_marks_the_next_samples replaces tokio::spawn(producer.run()) with a tokio::select! between producer.run() and the two reader assertions, panicking if the producer stops early. The reader branch completing drops the run future, which Stream::read documents as cancel-safe, so the device is released exactly as the old run.abort() did. The pattern matches production (rs/moq-cli/src/publish.rs drives capture.run() in the same select on the local task) and needs no Send or unsafe.
  • Quest update — quest/m0/nightly/macos.md records the fix, keeps the quest open for the scheduled macOS evidence, and marks independent Nightly reporting as #7667's work. Its ## Waiting item names a check a later run can evaluate, and the cited #7829 fix is present in the tree (the websocket test was repaired, not skipped).

The capture-and-quest delta against current main is exactly these two files; the 1266-file PR list comes from the recorded base (40796ae) being on an older main lineage. I verified the 2026-11-05 job log: both reported errors come from the single capture.rs:859 spawn site, so this fix closes the compile failure rather than advancing past it.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit ad653dd Nov 6, 2026
11 checks passed
@kixelated
kixelated deleted the quest/m0/nightly/macos branch November 6, 2026 10:05
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.

3 participants