Skip to content

test(quic): characterize moq-quic behavior - #5781

Merged
kixelated merged 19 commits into
mainfrom
quest/m1/quic/coverage/characterize
Oct 17, 2026
Merged

kixelated merged 19 commits into
mainfrom
quest/m1/quic/coverage/characterize

Conversation

@kixelated

@kixelated kixelated commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Implements quest/m1/quic/coverage/characterize.md (deleted here) from the moq-quic regression net epic.

What lands

69 characterization tests in a new rs/moq-quic/src/tests/characterize/ module, wired in with one line in tests/mod.rs. Every pair pins Cubic and deterministic packet numbers explicitly, so the harness flipping its default to BBR3 (sim.md) does not churn them.

  • schedule.rs: golden exact-order tests of the STREAM/DATAGRAM frames per packet for priorities, equal priority with and without send_fairness, a retransmit behind a higher-priority stream, a retransmit within a cwnd-limited stream, and datagrams interleaved with streams. feat(quic)!: hierarchical send groups, one per subscription #5711 should update each golden in its own diff.
  • frames.rs: frames a correct peer never sends: CRYPTO in 0-RTT, STREAM_DATA_BLOCKED / MAX_STREAM_DATA / STOP_SENDING / RESET_STREAM / STREAM on the wrong direction or unopened streams, STREAMS_BLOCKED and MAX_STREAMS past 2^60 (bidi and uni), NEW_CONNECTION_ID limit and retirement, RETIRE_CONNECTION_ID errors, NEW_TOKEN and HANDSHAKE_DONE from a client, offsets at 2^62, and final-size errors on data and reset.
  • reset.rs: RecvStream::received_reset, reset codes across the varint range, Chunks ending in Reset or Finished, stream credit returning once a reset is observed, and connection credit returned on reset, stop, and 0-RTT rejection.
  • limits.rs: set_max_concurrent_streams, set_receive_window, and set_send_window raised and lowered mid-connection, plus the 0-RTT window raise.
  • endpoint.rs: stateless resets for unknown CIDs (rate limit, 21/22-byte boundary), invalid and zero-length CIDs, long headers for unknown connections, short / undecryptable / undecodable / wrong-version Initials, a client-only endpoint answering with stateless resets, and cids_exhausted at connect, at the Initial, and at accept.
  • paths.rs: the AEAD integrity limit (through a crypto wrapper with a limit of 3), duplicate discard, invalid Retry handling, 0-RTT retransmit after Retry, path-validation failure reverting the path, and IPv4 rebinding through PathData::from_previous (with the IPv6 counterpart, which resets).

Frame error paths need a peer that misbehaves, so Connection gains one #[cfg(test)] helper, forge_packet, beside the existing decode_packet: it encrypts an arbitrary payload as the connection's next packet in a space.

Bugs found

Each one lands as an #[ignore]d test asserting the correct behavior, naming the quest this PR adds for it (three in quest/m1/quic/, the Retry bug in quest/m0/ because the shipped release has the same guard and gets a backport):

  1. /quest/m1/quic/final-size-below-received.md: a FIN below data already received is accepted. The reader gets the bytes past the final size, then Blocked forever; the stream never finishes or errors.
  2. /quest/m1/quic/close-reason-after-reset.md: after a connection closes on its own transport error, a stateless reset in the Closed state replaces the unread close reason with Reset, or reports a second ConnectionLost if the reason was already read. The fix for Draining (stateless_reset_while_draining_*) does not cover Closed.
  3. /quest/m1/quic/zero-rtt-window-raise.md: when a server raises its stream receive window between sessions, the client's 0-RTT streams keep the remembered smaller window. The server, believing it granted the larger one, never sends MAX_STREAM_DATA, so the stream stalls forever (bidi and uni). StreamsState::set_params raises only peer-initiated bidi streams, which cannot exist before the peer's parameters arrive.
  4. /quest/m0/retry-after-invalid-retry.md: a Retry the client discards (bad integrity tag, or a SCID equal to its original DCID) still bumps total_authed_packets, so the client also discards the server's genuine Retry of its retransmitted Initial and never connects. One injected or corrupted Retry kills the handshake.

Pinned, not flagged

  • STREAM_DATA_BLOCKED for an unopened or over-limit stream is only logged.
  • NEW_CONNECTION_ID with Retire Prior To above its sequence fails in the frame decoder with FRAME_ENCODING_ERROR, before the connection's PROTOCOL_VIOLATION check.
  • A RETIRE_CONNECTION_ID naming the packet's own DCID is accepted (RFC 9000 allows closing instead).
  • Offsets past 2^62 report FLOW_CONTROL_ERROR on STREAM and CRYPTO_BUFFER_EXCEEDED on CRYPTO (both allowed).
  • A port change keeps RTT and congestion state on IPv4 but resets it on IPv6.

API and wire impact

None. The only non-test change is the #[cfg(test)] Connection::forge_packet.

Checks

just check passes. The characterization suite passed 5 runs in a row with no golden drift. The ignored tests fail as expected with --run-ignored all.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 7 commits October 16, 2026 15:40
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Outcome: all six areas of the quest are covered (69 tests), and 4 bugs are pinned as #[ignore]d tests (see the description). The path tests no longer use CLIENT_PORTS or pair.latency, and nothing here touches pair.bottleneck or the harness default controller, so rebasing against the sim harness rewrite (#5780) should be trivial.

Open decisions, with my recommendation first:

  1. The ignored tests name follow-up quests that don't exist yet (/quest/m1/quic/{final-size-below-received,close-reason-after-reset,zero-rtt-window-raise,retry-after-invalid-retry}.md). I recommend adding those four quest files to this PR so the references resolve. The other option is a separate quest-plan PR.
  2. Connection::forge_packet is a #[cfg(test)] hook for forging frames. I recommend keeping it. The alternative is deriving 1-RTT keys from a key log inside the tests: no production-file edit, but about 60 lines of HKDF code.
  3. StreamsState::set_params raises the windows of peer-initiated bidi streams, but I found no way to reach that code through the public API. I recommend deleting that loop as part of the zero-rtt-window-raise fix, which should raise the client's own streams instead.

(Written by Claude Opus 5.5)

The ignored tests now point at quests that exist: the Retry bug in m0,
since the shipped release has the same guard, and the other three in the
moq-quic epic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review October 16, 2026 22:58
@kixelated

Copy link
Copy Markdown
Collaborator Author

@codex review

(Written by Claude Opus 5.5)

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 12 seconds.

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
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bb578e77-60a9-4d50-a354-b17212f11599
📥 Commits

Reviewing files that changed from the base of the PR and between 6e83641 and 7de8b6f.

📒 Files selected for processing: 17
  • quest/m0/README.md
  • quest/m0/retry-after-invalid-retry.md
  • quest/m1/quic/README.md
  • quest/m1/quic/close-reason-after-reset.md
  • quest/m1/quic/coverage/README.md
  • quest/m1/quic/coverage/characterize.md
  • quest/m1/quic/final-size-below-received.md
  • quest/m1/quic/zero-rtt-window-raise.md
  • rs/moq-quic/src/connection/mod.rs
  • rs/moq-quic/src/tests/characterize/endpoint.rs
  • rs/moq-quic/src/tests/characterize/frames.rs
  • rs/moq-quic/src/tests/characterize/limits.rs
  • rs/moq-quic/src/tests/characterize/mod.rs
  • rs/moq-quic/src/tests/characterize/paths.rs
  • rs/moq-quic/src/tests/characterize/reset.rs
  • rs/moq-quic/src/tests/characterize/schedule.rs
  • rs/moq-quic/src/tests/mod.rs

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: a2793a1e-14fd-4da6-b3b0-105888c0b255
📥 Commits

Reviewing files that changed from the base of the PR and between 3cf978c and 6e83641.

📒 Files selected for processing: 18
  • quest/m0/README.md
  • quest/m0/retry-after-invalid-retry.md
  • quest/m1/quic/README.md
  • quest/m1/quic/close-reason-after-reset.md
  • quest/m1/quic/coverage/README.md
  • quest/m1/quic/coverage/characterize.md
  • quest/m1/quic/coverage/sim.md
  • quest/m1/quic/final-size-below-received.md
  • quest/m1/quic/zero-rtt-window-raise.md
  • rs/moq-quic/src/connection/mod.rs
  • rs/moq-quic/src/tests/characterize/endpoint.rs
  • rs/moq-quic/src/tests/characterize/frames.rs
  • rs/moq-quic/src/tests/characterize/limits.rs
  • rs/moq-quic/src/tests/characterize/mod.rs
  • rs/moq-quic/src/tests/characterize/paths.rs
  • rs/moq-quic/src/tests/characterize/reset.rs
  • rs/moq-quic/src/tests/characterize/schedule.rs
  • rs/moq-quic/src/tests/mod.rs
💤 Files with no reviewable changes: 3
  • quest/m1/quic/coverage/sim.md
  • quest/m1/quic/coverage/README.md
  • quest/m1/quic/coverage/characterize.md

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

Walkthrough

The changes add QUIC characterization tests for endpoint handling, packet paths, frame validation, stream behavior, flow control, resets, and packet scheduling. They add a test-only packet-forging helper. New quest documents describe Retry handling and three QUIC behavior issues, and the required lists are updated. The previous characterization coverage plan and its links are removed. The quest documents describe proposed fixes; the changes do not include production fixes.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 6e836

No actionable issue remains in this test and documentation change. It is ready for normal merge checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding QUIC behavior characterization tests for moq-quic.
Description check Passed The description is directly related to the changeset and explains the characterization tests, helper, identified bugs, test results, and scope.
Docstring Coverage Passed Docstring coverage is 86.01% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 143 functions across 9 files. (6 skipped: 6…
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 86.01% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 143 functions across 9 files. (6 skipped: 6 unsupported.)

✨ Finishing Touches: 💡 1
⚔️ Resolve merge conflicts: 💡
  • Resolve merge conflict in branch quest/m1/quic/coverage/characterize
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • 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

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-17T06:30:24.482345Z 7de8b6f New commits
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: fd1d2f9c1c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary

  • Lands 69 characterization tests under rs/moq-quic/src/tests/characterize/, with 4 #[ignore]d tests pinning real bugs.
  • Adds the four bug quests so every ignore message resolves: /quest/m0/retry-after-invalid-retry.md (m0, since release ships the same Retry guard in moq-noq-proto 1.3.5; the fix lands on main and is then backported per CONTRIBUTING.md), plus /quest/m1/quic/{final-size-below-received,close-reason-after-reset,zero-rtt-window-raise}.md in the moq-quic epic Required list.
  • Decided (maintainer): keep the #[cfg(test)] Connection::forge_packet hook. The suite was written against current main, not the quest baseline b302891, and that is accepted.
  • Decided (maintainer): the 0-RTT fix raises the client own 0-RTT streams to the new window and deletes the unreachable peer-initiated-bidi loop in StreamsState::set_params.
  • Declined follow-ups: IPv6 rebinding state and a mid-stream priority golden.

Public API and wire: none. CI green; Codex review of fd1d2f9 found no issues.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 17, 2026
# Conflicts:
#	quest/m1/quic/coverage/README.md
#	quest/m1/quic/coverage/characterize.md
@kixelated
kixelated enabled auto-merge October 17, 2026 00:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b85987f11d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 8a9f040851

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kixelated
kixelated added this pull request to the merge queue Oct 17, 2026
@kixelated
kixelated removed this pull request from the merge queue due to a manual request Oct 17, 2026
@kixelated
kixelated enabled auto-merge October 17, 2026 01:34
kixelated and others added 2 commits October 16, 2026 18:54
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated added this pull request to the merge queue Oct 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 17, 2026
# Conflicts:
#	quest/m1/quic/coverage/README.md
#	quest/m1/quic/coverage/characterize.md
#	quest/m1/quic/coverage/sim.md
@kixelated
kixelated enabled auto-merge October 17, 2026 04:34
@kixelated
kixelated added this pull request to the merge queue Oct 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 17, 2026
kixelated and others added 2 commits October 16, 2026 23:27
# Conflicts:
#	quest/m1/quic/coverage/README.md
#5770 schedules datagrams in their send group, so ungrouped datagrams now
go before equal-priority stream data, and one that does not fit ends the
packet instead of letting streams fill it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit a17905b Oct 17, 2026
8 of 9 checks passed
@kixelated
kixelated deleted the quest/m1/quic/coverage/characterize branch October 17, 2026 08:05
kixelated added a commit that referenced this pull request Oct 20, 2026
Richer simulation workloads was the epic's last child; the benchmarks
(#5812), fuzzing (#5779, #5946), characterization tests (#5781), seeded
simulation (#5780), and coverage report (#5772) landed before it.

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