Skip to content

quest: moq-c-rate-thread is done on main by #8964 - #9062

Merged
kixelated merged 4 commits into
mainfrom
quest/m1/precut-fixes/moq-c-rate-thread
Nov 18, 2026
Merged

kixelated merged 4 commits into
mainfrom
quest/m1/precut-fixes/moq-c-rate-thread

Conversation

@kixelated

@kixelated kixelated commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR now only deletes the quest quest/m1/precut-fixes/moq-c-rate-thread.md, because main already meets its goal.

The quest: libmoq's video rate follower (follow_reservation) ran as a task on the shared current-thread RUNTIME and blocked it on the encoder lock and on codec round trips. Its retunes, rung flushes, and encoder reopens therefore stalled every session's I/O, timers, and callbacks.

moq-dev/moq#8964 landed on main while this PR was open. It removed libmoq's follower task entirely: moq_video::encode::Producer::write now applies the grant itself, before each encode (self.follow().await, rs/moq-video/src/encode/producer.rs:280). libmoq calls that from moq_encode_video_frame on the C caller's thread through pollster. Nothing rate-related is spawned on RUNTIME anymore. A retune now stalls only that caller's encode, which is what the quest's Goal asked for.

This branch first fixed the old code by moving the follower onto its own libmoq-rate thread through a new ffi::Background::thread (head 827fc19d3d, reviewed 9/10 by Codex with no findings). After #8964 that code had nothing left to apply to. The merge of main (head 3c7f9e13b7) takes main's libmoq unchanged and drops the unused helper.

Decisions

For review:

  • Delete the quest rather than rewrite it. Its Goal holds on main (see Validation), and its Plan's mechanism (a follower task, moq-ffi's spawn_follow) no longer exists in either crate.
  • No regression test kept. The test I wrote (below) guards a follower task that no longer exists. On main nothing on the runtime takes the encoder lock, so the test would only pin an absence.

Validation

  • Regression test encode_video_follower_never_stalls_the_runtime, which goes through the C API: it publishes a video encoder that follows an allocator, holds its encoder lock as a caller's encode does, moves the bandwidth estimate, and spawns a probe task on RUNTIME.
  • quest check --base origin/main: ok. The diff from main is the quest file only.

Impact

Public API: none. Wire: none. This deletes a quest file only.

Caused by

No code change, so no culprit to name. For the record, the quest's original culprit was moq-dev/moq#6781, and moq-dev/moq#8964 removed that defect.

Follow-ups

None.

Review

  • Head: 3c7f9e1
  • Skipped: the diff from the base deletes one quest file and changes no code. The earlier code head 827fc19d3d had one Codex round (gpt-6.1-sol, medium): 9/10, no findings.

Models

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

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

kixelated and others added 3 commits November 17, 2026 19:54
A follower retuning an encoder blocks on the codec and on the encoder lock a
caller holds for a whole encode. On the shared current-thread runtime that
stalled every session's I/O, timers, and callbacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title moq-c's video rate follower runs off the session runtime fix(libmoq): the video rate follower runs off the session runtime Nov 18, 2026
…he caller's thread

The follower task this branch moved off the runtime no longer exists, so
take main's libmoq and drop the now-unused Background::thread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title fix(libmoq): the video rate follower runs off the session runtime quest: moq-c-rate-thread is done on main by #8964 Nov 18, 2026
@kixelated
kixelated marked this pull request as ready for review November 18, 2026 07:34
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 0908ebfc-353d-43ec-bb10-f3286eea6b4f
Commits

Reviewing files that changed from the base of the PR and between 16880c8 and 3c7f9e1.

Files selected for processing: 1

  • quest/m1/precut-fixes/moq-c-rate-thread.md
  • 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

@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.

Approach: sound — the quest's goal already holds on main after #8964, so deleting it is correct. I confirmed follow_reservation, spawn_follow, and Background::thread no longer exist in rs/, and rs/moq-video/src/encode/producer.rs:280 calls self.follow().await as the PR describes.

Reviewed changes

  • Quest file removed — deletes quest/m1/precut-fixes/moq-c-rate-thread.md, the only file changed.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit dcdf999 Nov 18, 2026
8 checks passed
@kixelated
kixelated deleted the quest/m1/precut-fixes/moq-c-rate-thread branch November 18, 2026 10:59
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