Skip to content

docs(id): record fallback latency budgets for #5797 - #7861

Merged
dezren39 merged 4 commits into
mainfrom
queue/13213-5797-latency-budget
Nov 14, 2026
Merged

dezren39 merged 4 commits into
mainfrom
queue/13213-5797-latency-budget

Conversation

@dezren39

@dezren39 dezren39 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Closes #5797 on merge.

Adds doc/2026-11-08T23-05-00Z_design_id5797_latency_budget_measurement.md with per-tier interactive, ordinary-sync and bulk budgets; per-attempt and overall negotiation deadlines; component allocations; and a reproducible measurement plan for proxy/TLS, broker/framing, HOL/multiplexing, keepalive/idle and reconnect/resumption.

Preserves #5671's fallback order and E2E boundary, consumes #5791/#5794 as settled inputs, keeps Workers out of bulk SLOs, and records open-sibling assumptions/reconciliation points. Numeric values are proposed acceptance targets, not measured results; no runtime changes are included.

Verification: git diff --cached --check and local Markdown file/anchor target check. No runtime tests apply to this docs-only change.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 8, 2026 23:56
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T22:11:58.234819Z
We couldn’t complete this review. Comment @codex review to try again.
422d0c2 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 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: 71e0d44f43

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


| ID | Tier | GOODPUT floor (p50) | Completion p95 | Notes |
|---|---|---|---|---|
| LB-12 | T0 direct UDP | ≥ 5 MiB/s | ≤ 30 s for 128 MiB | absolute baseline floor at P2 only |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make the P2 throughput budgets achievable in both directions

For client-to-peer transfers, P2's 20 Mbps uplink (§3.2) permits at most about 2.38 MiB/s before protocol overhead, so this 5 MiB/s floor and 30 s completion target are impossible: 128 MiB takes at least 53.7 s. LB-7's 4 MiB/s and 3 s ordinary-sync targets are likewise unreachable. W3/W4 do not restrict transfers to downloads, and §4.4 invalidates the baseline when T0 misses this floor, so a correct upload implementation cannot produce a passing reference run. Specify transfer direction and direction-specific budgets, or raise P2's uplink rate to support the stated targets.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in commit 422d0c2: section 4.4 now states direction explicitly — the LB-12..LB-16a floors and the LB-7 sync target are download-direction; the upload direction at P2 (20 Mbps uplink, ~2.38 MiB/s ceiling) gets its own budgets (T0 >= 2 MiB/s, 128 MiB <= 64 s; LB-7 upload >= 2 MiB/s / <= 6 s), W3/W4 run in both directions, and the profile-invalidation rule applies per direction.

| **W2** | ID query mix | 1 KiB request / ≤ 4 KiB response, 10 req/s for 3 min | IRTT, TTFB, error rate |
| **W3** | Ordinary sync | 8 MiB in 64 KiB logical chunks, split into ≤ 16 KiB wire DATA payloads; acknowledged | SYNC, goodput |
| **W4** | Bulk | 128 MiB sequential in 1 MiB logical chunks, split into ≤ 16 KiB wire DATA payloads | GOODPUT, completion |
| **W5** | Mixed | W4 saturates the test tier (target 90% of its measured maximum goodput) + W1 concurrently on the same tier | interactive IRTT under load, HOL bound |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Sustain bulk load throughout the mixed-load sampling interval

W5 combines a single 128 MiB W4 transfer with W1's five-minute interactive workload, but does not repeat the transfer or restrict latency samples to the overlap. On P1's 100 Mbps path, the transfer can finish in roughly 11 seconds, leaving over 95% of the interactive samples unloaded. The pooled p95 can therefore pass G6 even when interactive latency during saturation exceeds the mixed-load p95 bound; the separate, looser p99 bound does not prevent that false pass. Repeat bulk transfers throughout the measured interval, or compute mixed-load percentiles only from samples taken while bulk is active.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in commit 422d0c2: W5 now repeats bulk transfers back-to-back for the whole W1 sampling interval, and the section 4.4 mixed-load rule computes its percentiles only from interactive samples taken while bulk load is active — an unloaded tail can no longer dilute the measurement into a false pass.

Comment on lines +239 to +241
network floor is 2×RTT = 60 ms at P2 (one request and one response leg).
"Broker hop" is an extra RTT when the path traverses a relay; the
polling row uses the poll interval instead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Count the request-response network delay as one RTT

P2 specifies 15 ms one-way delay and 30 ms RTT, so the request and matching response used to define IRTT incur 30 ms of network delay, not 60 ms. For relayed paths, §3.2 also explicitly splits that same delay across the two legs, so traversing the relay does not itself introduce the additional 30 ms network RTT allocated here. These duplicated network costs distort every component allocation and can hide processing or queueing overruns in the diagnostic decomposition required by §6.6. Account for the shaped path once, measure broker processing separately, and reallocate the remaining budget explicitly.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in commit 422d0c2: section 4.3 network floor is now 1xRTT = 30 ms at P2 (a request and its matching response incur one RTT of network delay); the broker-hop column is broker processing only (10 ms), since section 3.2 splits the same shaped delay across relay legs — no second network RTT. Headroom reallocated so every row still sums to its LB budget, and the broker/framing bullet now budgets processing (<= 10 ms) instead of 1 RTT + 10 ms.

every attempt consumes the same shared NEG budget, which is never extended
to fit additional candidates.

| Parent tier / carrier shape | LB-31 SETUP p95 at P2 | Per-attempt hard deadline P2 | Per-attempt hard deadline P4 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Define negotiation deadlines for the P1 and P3 profiles

The per-attempt deadlines are specified only for P2 and P4, and LB-25–LB-27 likewise provide interactive negotiation bounds only for those two profiles. However, §6.4 requires W9 negotiations per profile, G3 checks these deadlines, and §6.7 explicitly includes P1 in the PR gate and P3 in the pre-release matrix. Those required runs therefore have no defined negotiation pass/fail bounds, forcing the harness implementer to invent timeout policy. Supply P1/P3 values or explicitly state which existing bounds each profile must use.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in commit 422d0c2: section 5 now defines P1 and P3 negotiation bounds explicitly — P1 uses the P2 per-attempt deadlines, LB-25 NEG bounds, and the 1.5 s LB-27 cap; P3 uses the P4 per-attempt deadlines, LB-26 NEG values (p95 <= 9 s, hard 12 s), and the 3.5 s LB-27 cap — so the section 6.4 W9 runs and the section 6.7 P1/P3 gates have defined pass/fail bounds.

@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1
state: picked-up
task: 17282
lane: code-a
worker: repo-worker-code
What: Shepherding PR #7861 to a terminal outcome (90-day review open-PR pass). Verified fresh: PR #7861 OPEN, head b7acd4f, no held / user/owned / do-not-merge / do-not-auto-edit labels; issue #5797 OPEN; docs-only (one new 751-line design doc, not on current main). Codex left FOUR P2 findings on the doc, all credible internal-consistency defects (P2 throughput budgets unachievable in the upload direction; W5 mixed-load sampling can false-pass; IRTT decomposition double-counts the shaped RTT; negotiation deadlines undefined for the P1/P3 profiles that section 6.4/6.7 require runs on). Disposition: fix all four in the doc in this PR, reply to each thread, then merge.
Next: worktree, targeted doc edits per finding, reply to the four Codex threads, merge current main, push, and merge on its merits.

@dezren39 dezren39 added work/assigned Queue worker lifecycle state queue/claimed Queue worker lifecycle state status/in-progress Queue worker lifecycle state labels Nov 14, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1
state: merge-ready
task: 17282
lane: code-a
worker: repo-worker-code
What: Merging PR #7861 on its merits, with all four Codex P2 findings fixed in the doc (commit 422d0c2; each finding thread has a reply): (1) throughput budgets are now direction-specific — download targets unchanged, P2 upload gets achievable budgets bounded by the 20 Mbps uplink; (2) W5 repeats bulk transfers across the whole sampling interval and the mixed-load percentiles count only samples taken under active bulk load; (3) the section 4.3 allocation counts the shaped RTT once (network floor 30 ms) and budgets broker processing separately, headroom reallocated so rows still sum to their LB budgets; (4) section 5 defines P1/P3 negotiation deadlines and NEG bounds explicitly. Current main merged cleanly; diff against main is the single design doc. git diff --check clean.

@dezren39
dezren39 merged commit 824e49e into main Nov 14, 2026
1 of 2 checks passed
@dezren39
dezren39 deleted the queue/13213-5797-latency-budget branch November 14, 2026 22:13
@dezren39 dezren39 removed status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state work/assigned Queue worker lifecycle state labels Nov 14, 2026
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.

id: design: latency budget & measurement plan per fallback tier (from #5671)

1 participant