Skip to content

refactor(quic)!: expose driver polls and remove transmit hints - #7707

Merged
kixelated merged 6 commits into
mainfrom
quest/m1/quic-api/poll
Nov 3, 2026
Merged

kixelated merged 6 commits into
mainfrom
quest/m1/quic-api/poll

Conversation

@kixelated

@kixelated kixelated commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The merged moq-quic waits own wakeups, but both drivers still hide their waiter-based polls. Callers also discard receive operations' obsolete ShouldTransmit hints, and Tokio's close wakeup under socket backpressure lacks controlled coverage.

Approach

  • Expose both drivers' connection, endpoint accept, and send close polls with &self, &kio::Waiter; retain existing async methods as wrappers and implement Future for send::Finished.
  • Replace Tokio endpoint Notify waits with caller-owned waiter registrations. Preserve incoming-attempt acceptance, buffered stream/datagram draining, and Uring's staged-close latch.
  • Delete ShouldTransmit, retain frame scheduling decisions as internal booleans, and update drivers, qmux, tests, fuzzing, and benchmarks.
  • Test blocked output and release on simulated sockets. The stalled-close test fails when the merged poll_closed registration is removed, with idle timeout disabled and ingress suppressed after the stall. Test finished poll/future outcomes and use the future in Uring's receive-credit coverage.
  • Complete the poll quest and remove its dependency links.
  • Drop moq-tokio's now-unused pin-project-lite dependency; the deleted Accept future was its last user.
  • Gate moq-tokio's Context-based recv::Stream::poll_received_reset on quic, so the driver-only build (--no-default-features --features driver,aws-lc-rs) compiles again. That break predates this PR on main; nightly's feature job hides it behind its earlier coroutines failure.

Impact

  • Breaking, unreleased moq-quic API: lease returns Result<Lease, Error> and poll_lease returns Poll<Result<Lease, Error>>; remove transmit-hint destructuring. restore, release, and Chunks::finalize return (); call them directly. ShouldTransmit is removed.
  • Both drivers add public waiter-based polls for stream opens/accepts, datagram receive, connection close, endpoint accept, and send close; send::Finished can be awaited with the same outcome as stopped(). Existing async signatures and close/drain behavior are unchanged.
  • No wire change or package version bump.

Alternatives

Keep the approved caller-owned waiter shape and the merged moq-quic wait ownership. Retaining transmit hints or adding driver waiter tables would duplicate responsibility. Native WebTransport's adapter removal remains its own quest; this PR adapts its current Uring callers to the public polls.

Follow-ups

None discovered outside the existing native WebTransport and acknowledgment-hook quests. No maintainer decisions remain.

Validation

On f2dd9c7524, after merging origin/main at 0eff070d67:

  • quest check --base origin/main
  • cargo clippy --all-targets -D warnings on moq-quic, moq-tokio, moq-uring, qmux, moq-bench and moq-quic-fuzz, and on moq-quic with fuzz,mux,sim,qlog.
  • just rs test -p moq-quic -p moq-tokio -p moq-uring -p qmux@0.7.0: 1,525 passed, 38 skipped.
  • sh/rs/tokio-features.sh --all, cargo doc -D warnings on the touched crates, cargo fmt --check, cargo shear, cargo sort, cargo hakari generate --diff.
  • The merge's semantic overlap: main's stream-storage release (#7740) added two let _ = chunks.finalize() calls, which now call finalize() directly. The iroh removal (#7345) touches no driver wait.
  • Earlier head 4ee591b7be: nix develop --command just ci (6,535 Rust tests passed) and the controlled mutation: removing Tokio's driver poll_closed registration fails the blocked-socket close test.

Review

Codex, gpt-6.1-sol, medium effort, round 1 reviewed f2dd9c7524 against origin/main with no findings.

Posted reviews on 4ee591b7be:

  • pullfrog: pin-project-lite unused in moq-tokio. Fixed: removed from Cargo.toml, the driver feature, and Cargo.lock.
  • OpenAI automated review: no findings.

Originally written by GPT-6.1 Sol.

(Written by Claude Opus 5.5)

kixelated and others added 3 commits November 3, 2026 00:26
Quest-Claim: e8ee455d33443ec8
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@kixelated kixelated changed the title The QUIC drivers' waits poll refactor(quic)!: expose driver polls and remove transmit hints Nov 3, 2026
@kixelated
kixelated marked this pull request as ready for review November 3, 2026 08:56
@coderabbitai

coderabbitai Bot commented Nov 3, 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 10 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: 275b0af7-e695-403f-afa8-845709328ddf
Commits

Reviewing files that changed from the base of the PR and between 0eff070 and f2dd9c7.

Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 47
  • quest/m1/quic-api/README.md
  • quest/m1/quic-api/native-web.md
  • quest/m1/quic-api/poll.md
  • quest/m2/quic-ack-hook.md
  • quest/m2/quic-sansio-driver.md
  • rs/moq-quic/MIGRATE.md
  • rs/moq-quic/benches/common/mod.rs
  • rs/moq-quic/benches/receive.rs
  • rs/moq-quic/benches/receive_bursts.rs
  • rs/moq-quic/src/connection/mod.rs
  • rs/moq-quic/src/connection/mux/mod.rs
  • rs/moq-quic/src/connection/mux/tests.rs
  • rs/moq-quic/src/connection/streams/lease.rs
  • rs/moq-quic/src/connection/streams/mod.rs
  • rs/moq-quic/src/connection/streams/recv.rs
  • rs/moq-quic/src/connection/streams/state.rs
  • rs/moq-quic/src/fuzz/connection.rs
  • rs/moq-quic/src/lib.rs
  • rs/moq-quic/src/tests/characterize/frames.rs
  • rs/moq-quic/src/tests/characterize/limits.rs
  • rs/moq-quic/src/tests/characterize/paths.rs
  • rs/moq-quic/src/tests/characterize/reset.rs
  • rs/moq-quic/src/tests/mod.rs
  • rs/moq-quic/src/tests/probe.rs
  • rs/moq-quic/src/tests/rate.rs
  • rs/moq-quic/src/tests/realtime.rs
  • rs/moq-quic/src/tests/receive_ts.rs
  • rs/moq-quic/src/tests/reset_stream_at.rs
  • rs/moq-quic/src/tests/scream.rs
  • rs/moq-quic/src/tests/sim.rs
  • rs/moq-quic/src/tests/sim/workloads.rs
  • rs/moq-quic/src/tests/util.rs
  • rs/moq-tokio/Cargo.toml
  • rs/moq-tokio/MIGRATE.md
  • rs/moq-tokio/src/quic/driver/connection.rs
  • rs/moq-tokio/src/quic/driver/endpoint.rs
  • rs/moq-tokio/src/quic/driver/recv.rs
  • rs/moq-tokio/src/quic/driver/send.rs
  • rs/moq-tokio/src/quic/driver/tests.rs
  • rs/moq-uring/MIGRATE.md
  • rs/moq-uring/src/quic/driver/connection.rs
  • rs/moq-uring/src/quic/driver/endpoint.rs
  • rs/moq-uring/src/quic/driver/recv.rs
  • rs/moq-uring/src/quic/driver/send.rs
  • rs/moq-uring/src/quic/web.rs
  • rs/moq-uring/tests/integration/credit.rs
  • rs/qmux/src/session.rs
  • 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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@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 commit: 4ee591b

Exposing the existing waiter-based operations while retaining the internal scheduling decisions is a coherent simplification. No actionable bugs found in this static review. I did not run tests or exercise socket backpressure and concurrency stress.

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

ℹ️ One minor cleanup: an unused dependency left behind. Nothing behavioral.

Reviewed changes

  • Driver polls exposed under &self, &kio::Waiter: both drivers' Connection (open/accept uni+bi, datagram receive, closed), Endpoint::poll_accept, and send::Stream/send::Finished::poll_closed are public; the async forms wrap them, and send::Finished now implements Future with the same outcome as stopped().
  • Tokio endpoint waits: the three tokio::sync::Notify fields become caller-owned kio::WaiterLists inside the state mutex, ref_count moves onto EndpointInner, and the Accept future is deleted.
  • ShouldTransmit removed: recv::Stream::{lease, poll_lease, restore, release} and Chunks::finalize drop the transmit hint (returning Result/()), with each receive path waking the transmit waiter itself; callers in qmux, benches, fuzz, and tests are updated.
  • Uring WebTransport: Session/SendStream gain a kio::Park, the handshake moves from poll_fn to kio::wait, and the callers forward to the now-public polls.
  • Tests and docs: a blocked-socket close test, a finished poll/future parity test, a finalize-wake assertion in the flow-control test, plus MIGRATE.md and quest updates.

I traced the two highest-risk surfaces myself and confirmed them with independent specialists: the endpoint Notify→WaiterList port wakes every parked waiter on the same guards as before (RecvState::handle/poll_forwards queue incoming only inside drive_recv, and EndpointDriver::poll wakes in that same locked section), and Finished's Future/poll_closed both route through StreamRef::poll_stopped on the single Wait::End list with a park disjoint from the polled state.

ℹ️ pin-project-lite is now an unused dependency

This PR removed the only pin_project! use in rs/moq-tokio — the Accept future in quic/driver/endpoint.rs — but rs/moq-tokio/Cargo.toml:89 still declares pin-project-lite and the driver feature still enables it at line 22. cargo shear reports unused optional dependency \pin-project-lite`` (a warning, so CI still passes).

Technical details
# Unused optional dependency `pin-project-lite`

## Affected sites
- `rs/moq-tokio/Cargo.toml:89` — `pin-project-lite = { version = "0.2", optional = true }`
- `rs/moq-tokio/Cargo.toml:22` — `driver = [..., "dep:pin-project-lite", ...]`

## Required outcome
- No `rs/moq-tokio` source references `pin_project`/`pin-project-lite` (`cargo shear` confirms `unused_optional_dependency`). Remove the dependency line and its `dep:pin-project-lite` entry from the `driver` feature, as AGENTS.md asks dependencies to earn their cost.

## Suggested approach (optional)
- `cargo shear --fix` (or the manual two-line edit), then re-run `just rs lint`.

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

kixelated and others added 3 commits November 3, 2026 13:19
Keep both moq-tokio MIGRATE entries, and call Chunks::finalize directly
in main's new storage and realtime tests now that it returns ().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Accept future was the last pin_project! user. Link the new MIGRATE
headings to the PR like their neighbors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
recv::Stream::poll_received_reset takes a Context only for the
WebTransport adapter, so a driver-only build flagged it as dead code.
Gate it on quic like set_drop_stop beside it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Fixed in 26572823c1: removed pin-project-lite from moq-tokio's dependencies, its driver feature, and Cargo.lock. cargo shear no longer reports it.

(Written by Claude Opus 5.5)

@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 f2dd9c7 against base 0eff070.

No new actionable issue found in the base-aware update. The driver-only build fix gates the Context-based reset adapter on quic, the feature that includes the WebTransport adapter; the public waiter-based driver operations remain available with driver alone.

Static GitHub-only review; I did not build the feature combinations or run socket and concurrency tests.

@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

Reviewed the delta since the prior pullfrog review (4ee591b7b): the origin/main merge plus two follow-up commits.

  • Merged origin/main (0eff070d6), resolving the stream-storage test conflicts to call chunks.finalize() directly, adapting the new tests/realtime.rs congestion test the same way, and keeping both the #7707 and #7345 MIGRATE.md entries.
  • Removed the now-unused pin-project-lite dependency from rs/moq-tokio and its driver feature, with the matching Cargo.lock entry, and linked the new MIGRATE headings to this PR.
  • Gated recv::Stream::poll_received_reset on quic, mirroring set_drop_stop, so the driver-only build compiles without dead code.

The prior finding (pin-project-lite unused) is fixed. I confirmed no stale ShouldTransmit, let _ = chunks.finalize(), or old-signature lease/restore/release calls survived the merge.

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 3, 2026
Merged via the queue into main with commit d1bcd57 Nov 3, 2026
11 of 12 checks passed
@kixelated
kixelated deleted the quest/m1/quic-api/poll branch November 3, 2026 22:41
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