Skip to content

Report structured stream occupancy and remaining opening credit - #440

Merged
kixelated merged 2 commits into
mainfrom
feat/stream-stats
Oct 20, 2026
Merged

kixelated merged 2 commits into
mainfrom
feat/stream-stats

Conversation

@kixelated

@kixelated kixelated commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Expose a structured optional stream snapshot through Stats::streams(): locally initiated bidi/uni streams each report backend occupancy (open) and remaining peer stream-ID credit (available). A bidi stream occupies one slot until both backend halves retire. Cumulative MAX_STREAMS limits are not presented as fixed concurrent capacity. Unsupported backends retain None.

QMux maintains constant-time backend counters and snapshots both opening credits with the stream table locked. FIN, reset, and STOP_SENDING retire the actual backend entries; retaining a completed frontend does not inflate occupancy. Closed sessions report zero occupancy and credit. The legacy flow-control-free format reports None.

Regression tests exercise QMux00/01/02 through the framing engine over duplex transport: exhausted credit blocks opening, peer replenishment permits the next cumulative ID, FIN/reset release occupancy, bidi half-close retains occupancy, completed handles do not count, and returned snapshots stay immutable. At clean committed 13bd407b864e60c5c46c2762e82ca6c001516e51, focused tests, full just fix, full just check, and full just test passed. The test gate includes native/WASM coverage, 158 TypeScript tests, and both real Rust/TypeScript WebSocket interop directions across supported drafts.

Public API is additive with a default optional method. No wire or package-version change. The matching native QUIC implementation and MoQ forwarding are in moq-dev/moq#5982; dependency publication/adoption is required before consumers can use both backends together.

(written by GPT-6)

kixelated and others added 2 commits October 19, 2026 11:52
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Completed at clean 13bd407b864e60c5c46c2762e82ca6c001516e51: full fix/check/test passed, including both Rust/TypeScript WebSocket interoperability directions and QMux00/01/02 occupancy/credit regression cases. The matching native QUIC/MoQ forwarding remains moq-dev/moq#5982. Compatible publication and joint consumer adoption are separate follow-ups; no version bump, publication, merge or deployment was performed here.

(written by GPT-6)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T19:52:40.824617Z 13bd407 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d69104aa-f9b3-4b23-a069-c7ec874dafc1
📥 Commits

Reviewing files that changed from the base of the PR and between c2e93e4 and 13bd407.

📒 Files selected for processing: 5
  • rs/qmux/src/credit.rs
  • rs/qmux/src/rtt.rs
  • rs/qmux/src/session.rs
  • rs/qmux/tests/stats.rs
  • rs/web-transport-trait/src/lib.rs

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

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 13bd4

The stream statistics change is mergeable after normal checks; no unresolved material risk was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding structured stream occupancy and remaining stream-opening credit statistics.
Description check Passed The description directly explains the new Stats::streams() API, QMux behavior, supported and unsupported backends, session semantics, and regression tests.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.98.1)

Clippy execution timed out

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

Comment @coderabbitai help to get the list of available commands.

@kixelated
kixelated merged commit fff7fa7 into main Oct 20, 2026
1 check passed
@kixelated
kixelated deleted the feat/stream-stats branch October 20, 2026 15:45
This was referenced Oct 20, 2026
kixelated added a commit to moq-dev/moq that referenced this pull request Oct 20, 2026
…hook

Drop the web-transport-trait Stats::streams plumbing and its git patch on
moq-dev/web-transport#440. Native QUIC sessions in moq-tokio and moq-uring
now hand moq-quic's snapshot to moq-net through the crate-private Grouped
hook, next to wire(). The FFI and WASM adapters only wrap the browser
backend, which has no counts, so they are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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