Skip to content

Add acked packet count to connection stats to make short-term loss rate more precisely#2440

Open
xxoo wants to merge 10 commits into
cloudflare:masterfrom
xxoo:codex-stats-acked-packets
Open

Add acked packet count to connection stats to make short-term loss rate more precisely#2440
xxoo wants to merge 10 commits into
cloudflare:masterfrom
xxoo:codex-stats-acked-packets

Conversation

@xxoo
Copy link
Copy Markdown

@xxoo xxoo commented Apr 16, 2026

Why

Using lost / sent for short-term loss estimation is misleading because sent includes a significant share of packets that are still in flight.
For immediate control decisions, this inflates the denominator and underestimates actual loss.
This change uses resolved outcomes instead: lost / (acked + lost) or (lost - spurious_lost) / (acked + lost).

What changed

  • Added acked (number of acknowledged packets) to quiche::Stats.
  • Extended ACK processing outcomes with acked_packets and propagated it to connection-level stats.
  • Added acked to C FFI quiche_stats and populated it in quiche_conn_stats().
  • Updated apps/quiche-server loss-rate calculation from lost / sent to lost / (acked + lost), with zero-denominator protection.
  • Added/updated tests, including a dedicated test that validates stats().acked.

Compatibility

  • Rust API breaking: quiche::Stats has a new public field (acked).
  • C ABI breaking: quiche_stats layout now includes acked.

Validation

  • cargo test --all-targets --features=async,ffi,qlog --workspace
  • cargo test --doc --features=async,ffi,qlog --workspace

@xxoo xxoo requested a review from a team as a code owner April 16, 2026 00:24
Copy link
Copy Markdown

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

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: 0ad3d1845f

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

Comment thread apps/src/bin/quiche-server.rs Outdated
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