Skip to content

Use adaptive HTTP/2 windows for the remote cache connection - #49

Merged
senamakel merged 3 commits into
mainfrom
adaptive-window
Oct 15, 2026
Merged

senamakel merged 3 commits into
mainfrom
adaptive-window

Conversation

@senamakel

@senamakel senamakel commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

The remote client kept hyper's fixed HTTP/2 flow-control windows (2 MiB per stream, 5 MiB per connection). Against grpcs://cache.tinyhumans.ai from GitHub-hosted runners (~120 ms away), that caps reads at about 5 MiB / 0.12 s ≈ 40 MiB/s per connection, however fast the link is. A warm chottu-core job fetches gigabytes of hits. Endpoint::http2_adaptive_window(true) makes hyper probe the bandwidth-delay product with pings and grow the windows to match.

The server side of the same problem (nginx's 64k request-body window, which capped uploads at ~0.5 MiB/s per stream) is fixed in gh-hosted-runner#18.

Behavior change: none beyond flow control: the client may send HTTP/2 BDP pings.

Validation: cargo fmt --check, clippy -D warnings, test --all-features (exit 0) and cargo doc -D warnings are all clean.

Not covered by an automated test: Endpoint exposes no getter for its window settings, and the in-process fake has no latency to show a window limit. The effect will show as fetch throughput in chottu-core's next warm run, which I'll report on the chottu PR. No bench/bench.py numbers either: the harness measures local compiles, not WAN transfer.

Summary by CodeRabbit

  • New Features
    • Remote blob reads now use HTTP/2 adaptive flow-control windows. The existing connection timeout remains in place, and ByteStream reads continue to avoid the gRPC message-size limit.
  • Documentation
    • Updated the remote lookup documentation to describe adaptive flow control for blob reads and the existing ByteStream read behavior.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b2997fc3-03f7-4422-be05-809ee5bad991
📥 Commits

Reviewing files that changed from the base of the PR and between 2a7ef4b and 06094be.

📒 Files selected for processing: 2
  • crates/tinymold-remote/src/client/mod.rs
  • docs/specs/remote.md
+-----------------------------------------------------+
| Merge conflicts fear my conflict-resolution skills. |
+-----------------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-15T22:33:03.318085Z 6824ac2 PR opened
ℹ️ 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: 6824ac2371

ℹ️ 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 crates/tinymold-remote/src/client/mod.rs Outdated
@tinysweeper

tinysweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

This pull request tunes the remote cache client's HTTP/2 connection to use adaptive flow-control windows, adding a single builder call on the tonic endpoint and a matching documentation sentence in the remote spec. Review found no defects across the critique, security, tests, commits, and description lanes; the change only alters HTTP/2 flow-control sizing without introducing new input handling, auth changes, network targets, or subprocesses.

State: Ready for maintainer review
Priority: none
Reviewed head: 06094be00138
Updated: 2026-10-15T22:41:50Z

Review snapshot

Change surface Files Review signal Count
Production 1 Active findings 0
Tests 0 Noted findings 0
Documentation 1 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: Test coverage is assessed from changed tests and lane evidence; execution is not claimed without trusted check data.

What changed

Two files changed: `crates/tinymold-remote/src/client/mod.rs` adds `.http2_adaptive_window(true)` to the tonic `Endpoint` construction in `Client::new`, with an explanatory comment about hyper's fixed windows versus bandwidth-delay product growth; `docs/specs/remote.md` adds a sentence describing that the connection uses HTTP/2 adaptive flow-control windows so reads from a distant cache are not held to a fixed window per round trip.

Features

  • Added — Adaptive HTTP/2 flow-control windows for the remote cache connection: The remote client's tonic endpoint is now built with `.http2_adaptive_window(true)`, so flow-control windows can grow toward the bandwidth-delay product instead of being limited to hyper's fixed per-stream and per-connection windows, allowing a read to move more than one window per round trip. This is transport tuning only; it adds no new input handling, auth change, network target, or subprocess. (crates/tinymold-remote/src/client/mod.rs#impl Client {)
  • Modified — Remote spec documentation for adaptive flow-control windows: The remote spec now states that the connection uses HTTP/2 adaptive flow-control windows, so reads from a distant cache are not held to a fixed window per round trip, keeping the documented behavior aligned with the client tuning change. (docs/specs/remote.md#sharing a key.)

Tests

  • no_new_test — The change adds one builder call, `.http2_adaptive_window(true)`, to the gRPC endpoint plus a two-line doc update; the effect is remote-server window growth that no unit test in this repository can observe, and the existing `Client::allowance` tests already pin the only thing the client computes locally.: No new test is appropriate. No assertion in the diff is unverifiable and no branch is added, so nothing here can regress silently in a way a test would catch. I could not independently verify hyper's default window sizes or that `http2_adaptive_window` exists on this tonic's `Endpoint`; a wrong method name would surface only at compile time, which is not visible from the diff. (crates/tinymold-remote/src/client/mod.rs#impl Client {)

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 2 files; 0 findings. _The code index is behind this pull request (indexed at `6824ac237142`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The diff adds a single builder call, `.http2_adaptive_window(true)`, to the tonic endpoint construction. It changes only HTTP/2 flow-control sizing and introduces no new input handling, auth change, network target, or subprocess. Nothing in the change is a reportable defect; the only caveat I could not verify is whether this tonic version exposes `http2_adaptive_window`, but the diff itself does not prove a missing symbol and the dependency is a released tonic 0.14. 1 file was not security-reviewed: docs/specs/remote.md (prose or tabular data). _The code index is behind this pull request (indexed at `6824ac237142`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The change adds one builder call, `.http2_adaptive_window(true)`, to the gRPC endpoint and a two-line doc update. This is a transport tuning flag whose effect is a remote-server behaviour (window growth) that no unit test in this repository can observe; the existing `Client::allowance` tests already pin the only thing the client computes locally. No assertion in the diff is unverifiable, no branch is added, and nothing here can regress silently in a way a test would catch — so the absence of a new test is appropriate. The diff introduces no defect I can identify; note that I could not independently verify hyper's default window sizes or that `http2_adaptive_window` exists on this tonic's `Endpoint` (the trait-building chain means a wrong method name would surface only at compile time, which I cannot see from the diff alone). _The code index is behind this pull request (indexed at `6824ac237142`), so retrieved context may be out of date._

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The change is a one-line client tuning addition (`.http2_adaptive_window(true)` on the tonic endpoint) plus a matching docs/specs/remote.md sentence; the description accurately states the behaviour change (client may send HTTP/2 BDP pings), that the server-side nginx fix lives in another PR, and that no automated test or bench numbers cover it. No defects found. _The code index is behind this pull request (indexed at `6824ac237142`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, glm-5.3-flash, deepseek-v4.1-flash
  • Spend: $0.000585
  • Tokens: 93284 input · 4520 output · 9472 cached · 87 embedding
Head State Pass summary
06094be00138 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-15T22:41:50Z)

tinysweeper 0.1.2

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit 6843b89 into main Oct 15, 2026
25 of 26 checks passed

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

tinysweeper found nothing blocking. Approving.

             $0.0006 · 93,284 in / 4,520 out · 9,472 cached (10%) · ladder/vectors-oai3, glm-5.3-flash, deepseek-v4.1-flash · 87 embedded
critique:    $0.0003 · 26,907 in / 1,478 out · 0 cached (0%)      · glm-5.3-flash
security:    $0.0002 · 27,202 in / 1,540 out · 1,792 cached (7%)  · deepseek-v4.1-flash, glm-5.3-flash
tests:       $0.0000 · 14,120 in / 201 out   · 2,176 cached (15%) · deepseek-v4.1-flash
description: $0.0001 · 23,184 in / 680 out   · 5,504 cached (24%) · deepseek-v4.1-flash

@senamakel
senamakel deleted the adaptive-window branch October 16, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant