Skip to content

chore: Upgrade Rust to latest stable, 1.96.1 - #11260

Merged
grahamking merged 2 commits into
mainfrom
gk-rust-1.96-1
Jul 6, 2026
Merged

chore: Upgrade Rust to latest stable, 1.96.1#11260
grahamking merged 2 commits into
mainfrom
gk-rust-1.96-1

Conversation

@grahamking

@grahamking grahamking commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

The usual container and doc updates, plus new lints:

  • zip takes things that implement IntoIter so the .into_iter() calls were unnecessary.
  • sort_by_key is typically more efficient than sort_by.
  • Use checked_div removes the need to check divisor is not 0.
  • Use while let .. instead of loop { let ..

Open in Devin Review

Summary by CodeRabbit

  • Chores

    • Updated the pinned Rust version across build environments and project tooling to a newer release.
    • Aligned container build settings and local development defaults with the same Rust version.
  • Documentation

    • Refreshed setup and development docs to match the latest Rust toolchain version.
    • Updated test-running guidance to use the current pinned toolchain.
  • Style

    • Made small code cleanup improvements in iteration and sorting patterns.
    • Simplified several calculations for clearer handling when counts are zero.

New lints:
- `zip` takes things that implement `IntoIter` so the `.into_iter()`
  calls were unnecessary.
- `sort_by_key` is typically more efficient than `sort_by`.
- Use `checked_div` removes the need to check divisor is not 0.
- Use `while let ..` instead of `loop { let ..`

Signed-off-by: Graham King <grahamk@nvidia.com>
@grahamking
grahamking requested review from a team as code owners July 6, 2026 18:52
@grahamking
grahamking requested a review from a team July 6, 2026 18:52
@grahamking
grahamking requested a review from a team as a code owner July 6, 2026 18:52
@github-actions github-actions Bot added chore documentation Improvements or additions to documentation frontend `python -m dynamo.frontend` and `dynamo-run in=http|text|grpc` container labels Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

devin-ai-integration[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR bumps the pinned Rust toolchain from 1.93.1 to 1.96.1 across container Dockerfiles, Makefiles, rust-toolchain.toml files, and documentation. It also applies a batch of clippy-suggested refactors: checked_div for safe division, sort_by_key replacing sort_by, zip without into_iter(), while-let loop rewrites, and a clippy allow attribute.

Changes

Rust Toolchain Bump

Layer / File(s) Summary
Toolchain version references
container/templates/dynamo_base.Dockerfile, deploy/inference-gateway/epp/Dockerfile, deploy/inference-gateway/epp/Makefile, deploy/inference-gateway/ext-proc/Dockerfile, deploy/inference-gateway/ext-proc/Makefile, rust-toolchain.toml, lib/runtime/examples/rust-toolchain.toml, docs/development/custom-containers.md, docs/development/unified-backends.md, lib/kvbm-engine/CLAUDE.md, tests/parity/README.md
Rust version references (RUST_VERSION, RUST_IMAGE, channel) updated from 1.93.1/1.93 to 1.96.1 consistently across build files, config, and docs.

Clippy-Driven Code Refactors

Layer / File(s) Summary
Safe division via checked_div
lib/kv-router/src/indexer/branch_sharded.rs, lib/kvbm-physical/src/layout/config.rs, lib/mocker/src/scheduler/sglang/core.rs, lib/runtime/src/pipeline/network/egress/tcp_client.rs
Manual zero-check division guards replaced with checked_div(...).unwrap_or(0) while preserving zero-fallback behavior.
Zip iteration simplified
lib/bindings/kvbm/src/block_manager/vllm/connector/leader/slot.rs, lib/kvbm-engine/src/leader/session/initiator.rs, lib/kvbm-engine/src/worker/group/spmd.rs, lib/llm/src/block_manager/pool/managed/inactive.rs, lib/llm/src/preprocessor.rs, lib/mocker/src/scheduler/sglang/decode.rs
Explicit .into_iter() calls before zip removed, relying on implicit IntoIterator, preserving the same pairing/iteration semantics.
Sort refactor to sort_by_key
lib/llm/src/protocols/openai/chat_completions/aggregator.rs, lib/llm/src/protocols/openai/completions/aggregator.rs
choices sorting changed from sort_by with an index comparator to sort_by_key(|a| a.index) in both aggregation logic and tests.
Loop and misc clippy fixes
lib/mocker/src/replay/offline/single.rs, lib/kv-router/src/indexer/pruning.rs, lib/runtime/src/transports/nats.rs, lib/runtime/examples/system_metrics/tests/integration_test.rs
Loop/break patterns rewritten to while-let, next_expiries peek/pop logic separated in a locked scope, a clippy allow attribute added, and an unused reqwest import removed.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested labels: dependencies, rust-toolchain, clippy

Suggested reviewers: Rust maintainers familiar with kv-router, kvbm-engine, and llm aggregator modules

Poem:
A rabbit hopped from '93 to '96,
No more if-checks, just checked_div tricks,
Sort by key, zip without the fuss,
While-let loops replace the old "just in case, break, and cuss".
Toolchains updated, clippy appeased—
This bunny's build is finally, cleanly, pleased. 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers overview/details, but it omits the required reviewer-start section and Related Issues/issue confirmation. Add the missing "Where should reviewer start?" section and the required Related Issues section, including the linked issue or no-issue confirmation.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the PR’s main change: upgrading Rust to 1.96.1.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/kv-router/src/indexer/pruning.rs (1)

579-616: 🩺 Stability & Availability | 🔴 Critical | 🏗️ Heavy lift

Self-deadlock in queue_due
expiries stays live for the whole loop iteration, so push_worker_expiry() can re-lock self.next_expiries while that mutex is still held and hang the pruning worker. Scope the heap lock to a smaller block before touching per-worker state or calling push_worker_expiry().

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/kv-router/src/indexer/pruning.rs` around lines 579 - 616, `queue_due` can
self-deadlock because the `next_expiries` mutex stays held across the whole loop
iteration while `push_worker_expiry()` may try to lock it again. Narrow the
lifetime of the `expiries` guard in `queue_due` so the heap lock is released
before accessing `self.workers`, `state.pop_expired`, or calling
`push_worker_expiry()`, keeping only the minimal critical section around
peek/pop.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@lib/kv-router/src/indexer/pruning.rs`:
- Around line 579-616: `queue_due` can self-deadlock because the `next_expiries`
mutex stays held across the whole loop iteration while `push_worker_expiry()`
may try to lock it again. Narrow the lifetime of the `expiries` guard in
`queue_due` so the heap lock is released before accessing `self.workers`,
`state.pop_expired`, or calling `push_worker_expiry()`, keeping only the minimal
critical section around peek/pop.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4d6ded8f-bfe1-4a12-9deb-1e97bbb7e967

📥 Commits

Reviewing files that changed from the base of the PR and between b032d7a and 92805da.

📒 Files selected for processing (27)
  • container/templates/dynamo_base.Dockerfile
  • deploy/inference-gateway/epp/Dockerfile
  • deploy/inference-gateway/epp/Makefile
  • deploy/inference-gateway/ext-proc/Dockerfile
  • deploy/inference-gateway/ext-proc/Makefile
  • docs/development/custom-containers.md
  • docs/development/unified-backends.md
  • lib/bindings/kvbm/src/block_manager/vllm/connector/leader/slot.rs
  • lib/kv-router/src/indexer/branch_sharded.rs
  • lib/kv-router/src/indexer/pruning.rs
  • lib/kvbm-engine/CLAUDE.md
  • lib/kvbm-engine/src/leader/session/initiator.rs
  • lib/kvbm-engine/src/worker/group/spmd.rs
  • lib/kvbm-physical/src/layout/config.rs
  • lib/llm/src/block_manager/pool/managed/inactive.rs
  • lib/llm/src/preprocessor.rs
  • lib/llm/src/protocols/openai/chat_completions/aggregator.rs
  • lib/llm/src/protocols/openai/completions/aggregator.rs
  • lib/mocker/src/replay/offline/single.rs
  • lib/mocker/src/scheduler/sglang/core.rs
  • lib/mocker/src/scheduler/sglang/decode.rs
  • lib/runtime/examples/rust-toolchain.toml
  • lib/runtime/examples/system_metrics/tests/integration_test.rs
  • lib/runtime/src/pipeline/network/egress/tcp_client.rs
  • lib/runtime/src/transports/nats.rs
  • rust-toolchain.toml
  • tests/parity/README.md
💤 Files with no reviewable changes (1)
  • lib/runtime/examples/system_metrics/tests/integration_test.rs

@datadog-official

datadog-official Bot commented Jul 6, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 41.29% (-4.11%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a137bda | Docs | Give us feedback!

Thanks AI reviewers.

We had to re-organize the code otherwise `cargo clippy` wants this to
become `while let ..` which doesn't fit with the `break` statements.

Signed-off-by: Graham King <grahamk@nvidia.com>
@grahamking
grahamking enabled auto-merge (squash) July 6, 2026 20:20
@grahamking
grahamking merged commit 7ffed01 into main Jul 6, 2026
100 checks passed
@grahamking
grahamking deleted the gk-rust-1.96-1 branch July 6, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore container documentation Improvements or additions to documentation frontend `python -m dynamo.frontend` and `dynamo-run in=http|text|grpc` size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants