Skip to content

chore: rustc: 1.97.1 -> 1.98.1 - #11534

Merged
basvandijk merged 3 commits into
masterfrom
bas/rust-1.98.1
Sep 14, 2026
Merged

basvandijk merged 3 commits into
masterfrom
bas/rust-1.98.1

Conversation

@basvandijk

@basvandijk basvandijk commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Upgrade the rust toolchain from 1.97.1 to 1.98.1. See:
https://blog.rust-lang.org/2026/08/20/Rust-1.98.0/.

The cargo clippy fixes this needs are in the PR below this one in the stack, so this PR is
just the version bump in rust-toolchain.toml and bazel/rust.MODULE.bazel, plus the NNS
governance canbench baseline that the new codegen shifts.

Only one benchmark moved by more than the 5% noise threshold of
//rs/nns/governance:governance-canbench_test:

status name calls ins ins Δ% HI HI Δ% SMI SMI Δ%
+ neuron_metrics_calculation 3.67M +7.52% 0 0.00% 0 0.00%

so rs/nns/governance/canbench/canbench_results.yml was regenerated with
bazel run //rs/nns/governance:governance-canbench_update. The two icrc1 ledger canbench tests
stay within their noise threshold, so their results files are unchanged.

CI then flagged two more targets, both fixed here:

//rs/bitcoin/ckbtc/minter:ckbtc_minter_canbench_test — regenerated with
bazel run //rs/bitcoin/ckbtc/minter:ckbtc_minter_canbench_update (34 instruction counts).

//rs/recovery/subnet_splitting:integration_test — this one has no _update target; its
expected values are hardcoded in the test, so all ten were re-pinned by hand from a single
1.98.1 reference run, in one consistent source/destination orientation.

What changed is the partition, not the workload. Every total is identical — canisters 20,
ingress messages 39, remote 10, local 28, http outcalls 10, heartbeats 694 — and total
instructions moved by 0.0016%. split-finder solves a symmetric MILP over load samples derived
from measured execution, and that tiny shift was enough to flip a near-tied optimum to a
different partition; both balance instructions ~50/50, so both are equally optimal for the
solver's objective.

metric 1.97.1 1.98.1
states_sizes_bytes 6335280 / 2927104 3693264 / 5539880
canisters_installed 14 / 6 8 / 12
ingress_messages_executed 26 / 13 15 / 24
remote_subnet_messages_executed_lower_bound 6 / 4 4 / 6
local_subnet_messages_executed_upper_bound 19 / 9 11 / 17
http_outcalls_executed 8 / 2 4 / 6
heartbeats_and_global_timers_executed 313 / 381 368 / 326

Before changing the values I checked that this is a real shift and not a flake: the test is
deterministic (5/5 uncached runs on 1.98.1 give byte-identical values), and on 1.97.1 this
machine reproduces the currently committed values exactly and passes — so the environment
agrees with CI and the new values should too.

⚠️ Worth a separate look by the owners: because the test pins the exact solution of a
degenerate optimisation, it will keep flipping on unrelated changes. Asserting on the totals
and on the ~50/50 instruction balance — which both partitions satisfy — would make it robust.

No repin is needed: no third-party crate dependency changed, so the Cargo.Bazel.*.lock files
are unaffected.

🤖 Generated with Claude Code

Copilot AI 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.

🟢 Approval recommended

The change is a consistent, isolated toolchain version bump plus a mechanically updated benchmark baseline with no remaining references to the old version.

Pull request overview

Upgrades the repository’s Rust toolchain to 1.98.1 across both the Rust toolchain file and Bazel rules_rust toolchain configuration, and updates the NNS governance canbench baseline to reflect instruction-count shifts from the new compiler/codegen.

Changes:

  • Bump rust-toolchain.toml channel from 1.97.1 to 1.98.1.
  • Bump Bazel rules_rust toolchain versions from 1.97.1 to 1.98.1.
  • Regenerate rs/nns/governance canbench baseline numbers (YAML) to match new measurements.
File summaries
File Description
rust-toolchain.toml Updates the Rust toolchain channel to 1.98.1.
bazel/rust.MODULE.bazel Updates the Bazel Rust toolchain version to 1.98.1 to keep Bazel in sync.
rs/nns/governance/canbench/canbench_results.yml Updates governance canbench instruction counts to the new baseline after the toolchain bump.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@basvandijk
basvandijk marked this pull request as ready for review September 10, 2026 13:04
@basvandijk
basvandijk requested review from a team as code owners September 10, 2026 13:04

@github-actions github-actions 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.

This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):

  1. Update unreleased_changelog.md (if there are behavior changes, even if they are
    non-breaking).

  2. Are there BREAKING changes?

  3. Is a data migration needed?

  4. Security review?

How to Satisfy This Automatic Review

  1. Go to the bottom of the pull request page.

  2. Look for where it says this bot is requesting changes.

  3. Click the three dots to the right.

  4. Select "Dismiss review".

  5. In the text entry box, respond to each of the numbered items in the previous
    section, declare one of the following:

  • Done.

  • $REASON_WHY_NO_NEED. E.g. for unreleased_changelog.md, "No
    canister behavior changes.", or for item 2, "Existing APIs
    behave as before.".

Brief Guide to "Externally Visible" Changes

"Externally visible behavior change" is very often due to some NEW canister API.

Changes to EXISTING APIs are more likely to be "breaking".

If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.

If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.

Reference(s)

For a more comprehensive checklist, see here.

GOVERNANCE_CHECKLIST_REMINDER_DEDUP

@zeropath-ai

zeropath-ai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to 0c415e7.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► bazel/rust.MODULE.bazel
    Update Rust toolchain to 1.98.1
Bug Fix —

@basvandijk
basvandijk dismissed github-actions[bot]’s stale review September 10, 2026 13:05

No canister behaviour changes

@basvandijk
basvandijk force-pushed the bas/rust-1.98.1 branch 3 times, most recently from cb9659f to fc825f0 Compare September 10, 2026 13:35
@basvandijk
basvandijk requested a review from a team as a code owner September 10, 2026 15:40
@github-actions github-actions Bot added the @defi label Sep 10, 2026
@basvandijk
basvandijk requested a balanced review from Copilot September 10, 2026 15:40
@zeropath-ai

zeropath-ai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to 0c415e7.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► bazel/rust.MODULE.bazel
    Update Rust toolchain version to 1.98.1
Bug Fix ► rs/recovery/subnet_splitting/tests/integration_tests.rs
    Adjust expected metric values in load_metrics_e2e_test()
Enhancement ► rs/nns/governance/canbench/canbench_results.yml
    Update benchmark instruction counts (numerical deltas across many benches)
Enhancement ► rs/bitcoin/ckbtc/minter/canbench/results.yml
    Update benchmark instruction counts (numerical deltas across many benches)

Copilot AI 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.

🟢 Approval recommended

The synchronized toolchain bump and baseline updates are consistent with the documented deterministic test results.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Base automatically changed from bas/clippy-fixes-for-rust-1.98.1 to master September 12, 2026 18:34
@basvandijk
basvandijk requested a review from a team as a code owner September 12, 2026 18:34
basvandijk and others added 3 commits September 12, 2026 20:34
Upgrade the rust toolchain from 1.97.1 to 1.98.1. See:
https://blog.rust-lang.org/2026/08/20/Rust-1.98.0/.

The clippy fixes this needs are in the PR below this one in the stack, so
this PR is just the version bump in `rust-toolchain.toml` and
`bazel/rust.MODULE.bazel`, plus the NNS governance canbench baseline that
the new codegen shifts.

Only one benchmark moved by more than the 5% noise threshold of
//rs/nns/governance:governance-canbench_test:

    | status | name                       | calls |   ins |  ins Δ% |
    |--------|----------------------------|-------|-------|---------|
    |   +    | neuron_metrics_calculation |       | 3.67M |  +7.52% |

so `canbench/canbench_results.yml` was regenerated with
`bazel run //rs/nns/governance:governance-canbench_update`. The two icrc1
ledger canbench tests stay within their noise threshold, so their results
files are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Regenerated with `bazel run //rs/bitcoin/ckbtc/minter:ckbtc_minter_canbench_update`
after CI reported //rs/bitcoin/ckbtc/minter:ckbtc_minter_canbench_test as
failing on the new toolchain.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CI reported //rs/recovery/subnet_splitting:integration_test as failing on
the new toolchain. There is no `_update` target for it - the expected
values are hardcoded in the test - so they were re-pinned by hand from a
single 1.98.1 reference run.

What actually changed is the *partition*, not the workload: every total is
identical (canisters 20, ingress messages 39, remote 10, local 28, http
outcalls 10, heartbeats 694) and the total instructions moved by 0.0016%.
`split-finder` solves a symmetric MILP over load samples derived from
measured execution, and that tiny shift was enough to flip a near-tied
optimum to a different partition - both of which balance instructions
~50/50, so both are equally optimal for the solver's objective.

Checked before changing anything:
- The test is deterministic, not flaky: 5/5 uncached runs on 1.98.1 gave
  byte-identical values.
- On 1.97.1 this machine reproduces the currently committed values exactly
  (14/6, 26/13, 6/4, 6335280/2927104) and the test passes, so the
  environment agrees with CI and the new values should too.
- All ten values come from one reference run and are written in a single
  consistent source/destination orientation, as `assert_eq_oriented!`
  requires.

Note for the owners: because this pins the exact solution of a degenerate
optimisation, it will keep flipping on unrelated changes. Making it robust
(e.g. asserting on totals and on the ~50/50 instruction balance, which both
splits satisfy) would be worth doing separately.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@basvandijk
basvandijk added this pull request to the merge queue Sep 14, 2026
Merged via the queue into master with commit df047c0 Sep 14, 2026
42 checks passed
@basvandijk
basvandijk deleted the bas/rust-1.98.1 branch September 14, 2026 08:28
basvandijk added a commit that referenced this pull request Sep 14, 2026
## Problem

The `Bazel Build with RBE` step of the `CI RBE Evaluation` workflow
times out on
essentially every push to master:

```
[36,930 / 36,936] [Sched] Compiling Rust bin icp_features (2 files); 5239s ... (3 actions, 0 running)
Error: The action 'Bazel Build with RBE' has timed out after 90 minutes.
```

The action is not compiling slowly — it never starts. `[Sched]` is
Bazel's marker
for *queued on the remote executor*, the number next to it is queue
time, and
`0 running` confirms nothing is executing. The build reaches 36,926 of
36,936
actions in 46 minutes and then spends the remaining 44 waiting. When one
of these
actions did eventually get a slot it finished in about a second:

```
11:58:23  [36,926 / 36,936] [Sched] Compiling Rust bin unix (2 files); 4439s ... (5 actions, 0 running)
11:58:46  [36,926 / 36,936] Compiling Rust bin tests (2 files); 0s remote, remote-cache ... (5 actions, 1 running)
11:58:57  [36,928 / 36,936] Compiling Rust bin unix (2 files); 1s remote, remote-cache ...
```

## Cause

Two things combine:

1. **A target-level `exec_properties` applies to every action the target
owns**,
not just the test run. So on a `rust_test`, `exec_properties = {"cpu":
"16"}`
also lands on the `Rustc` action that compiles the test binary. The
`cpu:n`
tag that #10786 replaced only ever affected the test action, so that PR
   widened the reservation without meaning to.
2. **Namespace RBE workers run 16 actions concurrently** (hence
`--jobs=240` for
   15 workers). An action asking for `cpu: 16` therefore only fits on a
completely drained worker, which under cluster load essentially never
happens.

The `cpu: 8` targets in the same build are unaffected and compiled in
16–27s
throughout, which confirms the threshold is the worker size rather than
target
complexity:

| target | cpu | outcome |
| --- | --- | --- |
| `pocket-ic-server-head-nns` | 8 | compiled in 25s |
| `neuron_test` | 8 | compiled in 16s |
| `upgrade_canister_test` | 8 | compiled in 0–11s |
| `icp_features`, `icp_features-head-nns` | 16 | starved 87 min →
timeout |

This has been failing on every master push since `rustc: 1.97.1 ->
1.98.1`
(#11534) landed, which invalidated the Rust compile cache and forced
these test
binaries to be rebuilt. Because the compiles never finish they never
populate the
CAS, so each run retries from scratch. Earlier failures hit the `Bazel
Test with
RBE` step with the same signature (`Testing //packages/pocket-ic:slow`
queued for
7154s).

The non-RBE `Bazel Test All` job is unaffected: it runs locally on one
large
runner, where `cpu: 16` is just a local core reservation.

## Fix

Prefix the property with `test.` so it is scoped to the `test` exec
group, i.e.
to the test action only, restoring the semantics of the original `cpu:n`
tag.

This is applied to every `cpu` execution property, not only the ones
that
currently starve — a compile action never needed the reservation, and
reserving
cores for it only wastes RBE capacity.

## Verification

- `bazel build //... --nobuild` analyzes all 3348 targets successfully,
which
  also confirms `test` is a valid exec group for every rule touched here
(`rust_test`, `rust_ic_test`, the `rust_test_suite` variants and
`sh_test`);
an unknown exec group fails analysis with *"Tried to set exec_properties
for
  non-existent exec groups"*.
- `bazel aquery //packages/pocket-ic:icp_features` shows the reservation
has
  moved off the compile action:

  ```
  Rustc              cpu-related execution_info: []
TestRunner cpu-related execution_info: [{'key': 'cpu', 'value': '16'}]
  ```
- `bazel run //:buildifier` reports no formatting changes.

## Follow-up

This does not by itself fix the `Bazel Test with RBE` step, where the
test action
still asks for a whole worker and can starve the same way. Lowering
those
reservations below the worker size is left to a follow-up. It may also
be worth
raising the whole-worker starvation with Namespace — a scheduler with
reservation
or backfill shouldn't starve a 16-CPU request indefinitely.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
valorjesson-commits pushed a commit to valorjesson-commits/ic that referenced this pull request Oct 3, 2026
Upgrade the rust toolchain from 1.98.1 to 1.99.0. See:
https://blog.rust-lang.org/2026/10/01/Rust-1.99.0/.

The `cargo clippy` fixes this needs are in the PR below this one in the
stack (dfinity#11734). This PR is
therefore the version bump in `rust-toolchain.toml` and
`bazel/rust.MODULE.bazel`, plus the test
data that the new codegen (LLVM 22 → 23) shifts.

**`//rs/bitcoin/ckbtc/minter:ckbtc_minter_canbench_test`** was
regenerated with
`bazel run //rs/bitcoin/ckbtc/minter:ckbtc_minter_canbench_update`. All
7 benchmark totals stay
within the noise threshold (+0.10% to +0.49%), but 7 small `::greedy`
scopes moved beyond it:

| status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% |

|--------|----------------------------------------------------|-------|--------|---------|----|--------|-----|---------|
| + | `build_unsigned_transaction_6_10_btc::greedy` | 1 | 13.41K |
+10.91% | 0 | 0.00% | 0 | 0.00% |
| + | `build_unsigned_transaction_4_10m_sats::greedy` | 1 | 4.45K |
+10.54% | 0 | 0.00% | 0 | 0.00% |
| + | `build_unsigned_transaction_5_1_btc::greedy` | 1 | 4.45K | +10.54%
| 0 | 0.00% | 0 | 0.00% |
| + | `build_estimate_retrieve_btc_fee_1_50k_sats::greedy` | 1 | 4.74K |
+9.67% | 0 | 0.00% | 0 | 0.00% |
| + | `build_unsigned_transaction_1_50k_sats::greedy` | 1 | 4.74K |
+9.67% | 0 | 0.00% | 0 | 0.00% |
| + | `build_unsigned_transaction_2_100k_sats::greedy` | 1 | 4.79K |
+9.54% | 0 | 0.00% | 0 | 0.00% |
| + | `build_unsigned_transaction_3_1m_sats::greedy` | 1 | 3.28K |
+8.82% | 0 | 0.00% | 0 | 0.00% |

**`//rs/nns/governance:governance-canbench_test`** was regenerated with
`bazel run //rs/nns/governance:governance-canbench_update`. One of its
28 benchmarks moved beyond
the 5% noise threshold:

| status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% |

|--------|----------------------------|-------|-------|---------|----|--------|-----|---------|
| - | `neuron_metrics_calculation` | | 3.36M | -8.53% | 0 | 0.00% | 0 |
0.00% |

**`//rs/registry/canister:registry-canbench_test`** was regenerated with
`bazel run //rs/registry/canister:registry-canbench_update`. One of its
14 benchmarks moved beyond
the noise threshold:

| status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% |

|--------|-------------------------------------------------------------|-------|---------|---------|-----|--------|-----|---------|
| - | `measure_routing_table_invariant_checks_shards_and_unsharded` | |
227.82M | -2.87% | 140 | 0.00% | 0 | 0.00% |

**`//rs/ledger_suite/icrc1/ledger:canbench_u64_test`** and
**`:canbench_u256_test`** were
regenerated with `bazel run
//rs/ledger_suite/icrc1/ledger:canbench_u64_update` and
`:canbench_u256_update`. Both moved the same way. u64:

| status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% |

|--------|-----------------------------------------------|-------|---------|---------|-----|--------|-----|---------|
| + | `bench_icrc1_transfers::icrc103_get_allowances` | 1 | 5.35M |
+17.25% | 0 | 0.00% | 0 | 0.00% |
| + | `bench_icrc1_transfers::icrc2_approve` | 1 | 17.78B | +3.15% | 28
| 0.00% | 128 | 0.00% |
| + | `bench_icrc1_transfers::icrc2_transfer_from` | 1 | 19.81B | +2.93%
| 3 | 0.00% | 0 | 0.00% |
| + | `bench_icrc1_transfers` | | 50.12B | +2.26% | 264 | 0.00% | 256 |
0.00% |
| - | `bench_icrc1_transfers::upgrade` | 1 | 497.85M | -5.66% | 202 |
0.00% | 128 | 0.00% |
| - | `bench_icrc1_transfers::post_upgrade` | 1 | 347.07M | -8.19% | 73
| 0.00% | 0 | 0.00% |

u256:

| status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% |

|--------|-----------------------------------------------|-------|---------|---------|-----|--------|-----|---------|
| + | `bench_icrc1_transfers::icrc103_get_allowances` | 1 | 6.24M |
+14.34% | 0 | 0.00% | 0 | 0.00% |
| + | `bench_icrc1_transfers::icrc2_approve` | 1 | 18.35B | +3.23% | 28
| 0.00% | 128 | 0.00% |
| + | `bench_icrc1_transfers::icrc2_transfer_from` | 1 | 20.27B | +3.02%
| 3 | 0.00% | 0 | 0.00% |
| + | `bench_icrc1_transfers` | | 51.70B | +2.36% | 262 | 0.00% | 256 |
0.00% |
| - | `bench_icrc1_transfers::upgrade` | 1 | 492.28M | -6.75% | 200 |
0.00% | 128 | 0.00% |
| - | `bench_icrc1_transfers::post_upgrade` | 1 | 341.50M | -9.70% | 71
| 0.00% | 0 | 0.00% |

**`//rs/recovery/subnet_splitting:integration_test`** has no `_update`
target. Its expected values
are hardcoded in the test, so all ten were re-pinned by hand from one
1.99.0 reference run, in that
run's source/destination orientation.

As with 1.98.1 (dfinity#11534), what changed is the *partition*, not the
workload:

* Every total is identical: canisters 20, ingress messages 39, remote
10, local 28, http outcalls 10,
heartbeats 694. Total instructions moved by 0.013% and total state size
by 0.26%.
* The split-finder solves a symmetric MILP over load samples derived
from measured execution, and
  that is enough to flip a near-tied optimum to a different partition.
* Both partitions balance instructions ~50/50, which the test also
checks.

| metric | 1.98.1 | 1.99.0 |
| --- | --- | --- |
| `states_sizes_bytes` | 3693264 / 5539880 | 5016967 / 4240197 |
| `canisters_installed` | 8 / 12 | 11 / 9 |
| `ingress_messages_executed` | 15 / 24 | 21 / 18 |
| `remote_subnet_messages_executed_lower_bound` | 4 / 6 | 5 / 5 |
| `local_subnet_messages_executed_upper_bound` | 11 / 17 | 15 / 13 |
| `http_outcalls_executed` | 4 / 6 | 6 / 4 |
| `heartbeats_and_global_timers_executed` | 368 / 326 | 341 / 353 |

The test is deterministic: 5/5 uncached runs on 1.99.0 give
byte-identical estimates. As noted in
dfinity#11534, it pins the exact solution of a degenerate optimisation, so it
will keep flipping on
unrelated changes too. Asserting on the totals and on the ~50/50
instruction balance would make it
robust.

The other three canbench suites (ckETH minter, ICP ledger, SNS
governance) stay within their noise
thresholds. CI passes on all targets (`CI_ALL_BAZEL_TARGETS`), including
the Windows PocketIC jobs
and Build Determinism.

No repin is needed. The `Cargo.Bazel.*.lock` digests hash the
`cargo`/`rustc` of rules_rust's own
host tools (pinned at 1.98.0 by rules_rust 0.74.0), not the version
selected by `rust.toolchain`,
and no third-party crate changed. rules_rust 0.74.0 ships no checksums
for 1.99.0 (nor for the
current 1.98.1), so the toolchain is downloaded unverified, exactly as
1.98.1 is today.

Also checked, since tests won't necessarily catch these:

* **`RangeInclusive`**
([rust#155114](rust-lang/rust#155114)): an
exhausted
range now reports different `start()`/`end()`. No code in the repo
observes a range after
  iterating it.
* **Wasm**: the `wasm32-unknown-unknown` target features are identical
on both toolchains.
Canister-like modules built with the canister flags use no new Wasm
proposal, and they pass
  validation configured like the IC's.
* **LLVM bitcode**: rustc 1.99.0 emits LLVM 23 bitcode, which the
hermetic LLVM 22 `lld` cannot read.
This is harmless today: canisters (`-C linker-plugin-lto`) link with
rustc's bundled `rust-lld`, and
native links carry no bitcode. Until the hermetic toolchain reaches LLVM
23, though, don't route
  wasm links through it or add `-C linker-plugin-lto` to native targets.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
AleDema pushed a commit to AleDema/ic that referenced this pull request Nov 18, 2026
Upgrade the rust toolchain from 1.99.1 to 1.100.0. See:
https://blog.rust-lang.org/2026/11/12/Rust-1.100.0/.

The `cargo clippy` fixes this needs are in the PR below this one in the
stack (dfinity#12142). This PR
is therefore the version bump in `rust-toolchain.toml` and
`bazel/rust.MODULE.bazel`, plus:

* checksums for the 1.100.0 archives our builds download, which
rules_rust 0.75.0 doesn't have,
* the removal of the `clippy::double_must_use` allow, which 1.100.0 no
longer needs,
* an off-by-one fix in the `subnet_splitting` integration test that
1.100.0's codegen exposes,
* the test data that the new codegen shifts.

## Canbench

Five of the eight canbench suites moved beyond their noise thresholds,
all towards *fewer*
instructions. Heap and stable-memory increases are unchanged everywhere,
and only `instructions`
lines changed in the results files.

| suite | totals beyond the noise threshold | change of all totals |
results file |
| --- | --- | --- | --- |
| ckBTC minter | 0 of 7 (but 7 scopes) | -0.26% to -0.74% | regenerated
|
| ckETH minter | 1 of 1 | -5.20% | regenerated |
| ICRC-1 ledger (u64) | 1 of 2 (and 5 of its scopes) | -0.22% to -3.76%
| regenerated |
| ICRC-1 ledger (u256) | 1 of 2 (and 5 of its scopes) | -0.22% to -3.73%
| regenerated |
| registry | 2 of 14 | +0.10% to -5.34% | regenerated |
| ICP ledger | 0 of 1 | -0.55% | unchanged |
| NNS governance | 0 of 28 (5% threshold) | +1.67% to -2.11% | unchanged
|
| SNS governance | 0 of 1 | +0.01% | unchanged |

**`//rs/bitcoin/ckbtc/minter:ckbtc_minter_canbench_test`** was
regenerated with
`bazel run //rs/bitcoin/ckbtc/minter:ckbtc_minter_canbench_update`. All
7 benchmark totals stay
within the noise threshold (-0.26% to -0.74%), but 7 small `::greedy`
scopes moved beyond it. They
more than undo the +9% to +11% that 1.99.0 added to the same scopes
(dfinity#11735):

| status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% |

|--------|----------------------------------------------------|-------|--------|---------|----|--------|-----|---------|
| - | `build_unsigned_transaction_2_100k_sats::greedy` | 1 | 4.15K |
-13.35% | 0 | 0.00% | 0 | 0.00% |
| - | `build_estimate_retrieve_btc_fee_1_50k_sats::greedy` | 1 | 4.10K |
-13.48% | 0 | 0.00% | 0 | 0.00% |
| - | `build_unsigned_transaction_1_50k_sats::greedy` | 1 | 4.10K |
-13.48% | 0 | 0.00% | 0 | 0.00% |
| - | `build_unsigned_transaction_6_10_btc::greedy` | 1 | 11.50K |
-14.29% | 0 | 0.00% | 0 | 0.00% |
| - | `build_unsigned_transaction_4_10m_sats::greedy` | 1 | 3.81K |
-14.38% | 0 | 0.00% | 0 | 0.00% |
| - | `build_unsigned_transaction_5_1_btc::greedy` | 1 | 3.81K | -14.38%
| 0 | 0.00% | 0 | 0.00% |
| - | `build_unsigned_transaction_3_1m_sats::greedy` | 1 | 2.62K |
-20.09% | 0 | 0.00% | 0 | 0.00% |

**`//rs/ethereum/cketh/minter:cketh_minter_canbench_test`** was
regenerated with
`bazel run //rs/ethereum/cketh/minter:cketh_minter_canbench_update`. Its
only benchmark moved beyond
the noise threshold:

| status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% |

|--------|--------------------|-------|-------|---------|-----|--------|-----|---------|
| - | `bench_post_upgrade` | | 1.14B | -5.20% | 290 | 0.00% | 0 | 0.00%
|

**`//rs/ledger_suite/icrc1/ledger:canbench_u64_test`** and
**`:canbench_u256_test`** were
regenerated with `bazel run
//rs/ledger_suite/icrc1/ledger:canbench_u64_update` and
`:canbench_u256_update`. Both moved the same way. u64:

| status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% |

|--------|-----------------------------------------------|-------|---------|---------|-----|--------|-----|---------|
| - | `bench_icrc1_transfers` | | 48.23B | -3.76% | 264 | 0.00% | 256 |
0.00% |
| - | `bench_icrc1_transfers::icrc2_transfer_from` | 1 | 18.87B | -4.76%
| 3 | 0.00% | 0 | 0.00% |
| - | `bench_icrc1_transfers::upgrade` | 1 | 473.43M | -4.91% | 202 |
0.00% | 128 | 0.00% |
| - | `bench_icrc1_transfers::icrc2_approve` | 1 | 16.78B | -5.65% | 28
| 0.00% | 128 | 0.00% |
| - | `bench_icrc1_transfers::post_upgrade` | 1 | 323.70M | -6.73% | 73
| 0.00% | 0 | 0.00% |
| - | `bench_icrc1_transfers::icrc103_get_allowances` | 1 | 3.94M |
-26.26% | 0 | 0.00% | 0 | 0.00% |

u256:

| status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% |

|--------|-----------------------------------------------|-------|---------|---------|-----|--------|-----|---------|
| - | `bench_icrc1_transfers` | | 49.77B | -3.73% | 262 | 0.00% | 256 |
0.00% |
| - | `bench_icrc1_transfers::icrc2_transfer_from` | 1 | 19.32B | -4.72%
| 3 | 0.00% | 0 | 0.00% |
| - | `bench_icrc1_transfers::upgrade` | 1 | 468.90M | -4.75% | 200 |
0.00% | 128 | 0.00% |
| - | `bench_icrc1_transfers::icrc2_approve` | 1 | 17.32B | -5.58% | 28
| 0.00% | 128 | 0.00% |
| - | `bench_icrc1_transfers::post_upgrade` | 1 | 318.12M | -6.85% | 71
| 0.00% | 0 | 0.00% |
| - | `bench_icrc1_transfers::icrc103_get_allowances` | 1 | 4.84M |
-22.50% | 0 | 0.00% | 0 | 0.00% |

**`//rs/registry/canister:registry-canbench_test`** was regenerated with
`bazel run //rs/registry/canister:registry-canbench_update`. Two of its
14 benchmarks moved beyond
the noise threshold:

| status | name | calls | ins | ins Δ% | HI | HI Δ% | SMI | SMI Δ% |

|--------|-------------------------------------------------------------|-------|---------|---------|-----|--------|-----|---------|
| - | `get_subnet_for_canister_100_times_100` | | 27.17M | -3.28% | 0 |
0.00% | 0 | 0.00% |
| - | `measure_routing_table_invariant_checks_shards_and_unsharded` | |
211.57M | -5.34% | 138 | 0.00% | 0 | 0.00% |

The other three suites (ICP ledger, NNS governance, SNS governance) stay
within their noise
thresholds, so their results files are unchanged.

## `subnet_splitting`

**`//rs/recovery/subnet_splitting:integration_test`** has no `_update`
target, and it needed two
commits:

1. **A bound fix.** On 1.100.0 the split-finder's optimal split uses all
10 allowed cuts, and puts
both the first and the last canister on the side it reports, so it
reports 6 ranges. The test
allowed only `MAX_CUTS.div_ceil(2)` = 5. But 10 cuts make up to 11
segments that alternate
between the two subnets, so one side can get 6 of them. The test now
allows `MAX_CUTS / 2 + 1`,
and its failure message gives that bound and the ranges (it used to say
"at most 10").
2. **A re-pin.** All ten expected values were re-pinned by hand from one
1.100.0 reference run, in
   that run's source/destination orientation.

As with 1.99.0 (dfinity#11735), what changed is the *partition*, not the
workload:

* Every total is identical: canisters 20, ingress messages 39, remote
10, local 28, http outcalls
10, heartbeats 694. Total instructions moved by 0.004% and total state
size by 0.23%.
* Both partitions balance instructions ~50/50, which the test also
checks.

Source / destination as each run reports them (which group is which is
arbitrary):

| metric | 1.99.1 | 1.100.0 |
| --- | --- | --- |
| `states_sizes_bytes` | 3712908 / 5569325 | 5044173 / 4259662 |
| `instructions_executed` | 144307301 / 145741551 | 145713211 /
144348562 |
| `canisters_installed` | 8 / 12 | 11 / 9 |
| `ingress_messages_executed` | 15 / 24 | 21 / 18 |
| `remote_subnet_messages_executed_lower_bound` | 4 / 6 | 5 / 5 |
| `local_subnet_messages_executed_upper_bound` | 11 / 17 | 15 / 13 |
| `http_outcalls_executed` | 4 / 6 | 6 / 4 |
| `heartbeats_and_global_timers_executed` | 368 / 326 | 341 / 353 |

The test is deterministic: 3/3 uncached runs on 1.100.0 give identical
estimates. But it pins the
exact solution of a degenerate optimisation, and it has now been
re-pinned six times since
September, mostly for unrelated changes (dfinity#11171, dfinity#11534, dfinity#11735, dfinity#11774,
dfinity#12043, dfinity#11932). Asserting
on the totals and on the ~50/50 instruction balance would make it
robust.

## Clippy allows

`ci/scripts/rust-lint.sh` and the PocketIC Windows lint
(`.github/workflows/pocket-ic-tests-windows.yml`)
no longer pass `--allow clippy::double_must_use`, and `rust-lint.sh`
drops the comment that explained
both allows. Clippy 0.1.100 ships the fix for the
`#[async_trait]` false positive
([rust-lang/rust-clippy#17547](rust-lang/rust-clippy#17547)),
and without the allow the lint reports nothing in the workspace.
`redundant_field_names` stays
allowed: 0.1.100 still flags the same 41 sites in thiserror and
derive-new output, and the fix

([rust-lang/rust#164816](rust-lang/rust#164816))
ships in 1.101.

## Toolchain checksums and repin

rules_rust 0.75.0 (released 2026-10-26, still the latest) ships
checksums for 1.99.1 but not for
1.100.0, and it downloads an archive unverified when it has no checksum
for it. So `rust.toolchain`
now passes `sha256s` for the 21 archives of 1.100.0 that builds on our
supported hosts
(`aarch64-apple-darwin`, `aarch64-unknown-linux-gnu` and
`x86_64-unknown-linux-gnu`) download between
them:

* `rustc`, `cargo`, `clippy`, `llvm-tools` and `rust-analyzer` for each
of the three hosts
* `rust-std` for the three hosts and for the targets they cross-compile
to: `wasm32-unknown-unknown`,
and `x86_64-apple-darwin`, which the darwin CI job builds
`pocket-ic-server` for
  (`--platforms=//:macos-intel`)
* `rust-src`

rules_rust also registers toolchains for 8 other hosts and for the
`wasm32-wasip1` and
`wasm32-wasip2` targets. But Bazel only downloads a toolchain when a
build selects it, and our builds
never select those. Neither does CI's target selection: its
`rdeps(//..., …)` queries load the
closure of `bazel query 'deps(//...)'`, which contains none of the Rust
toolchain repositories. A build on another host, or for a new target,
would
download those archives unverified, so the comment above the dict says
what to add when supporting
one. An exception on a supported host: building `//:rustfmt` (alone or
as part of `//...`) with
`--platforms=//:macos-intel` also fetches the `x86_64-apple-darwin`
tools unverified, because
rules_rust's rustfmt rule makes the target platform an execution
platform. Nothing in the repo or
CI does that.

The checksums are the `xz_hash`es from the GPG-signed
`channel-rust-1.100.0.toml`. They match the
`.sha256` files at the exact URLs rules_rust downloads from, and the
archives themselves, each of
which has a valid signature. The dict can go once a rules_rust release
ships these checksums.

A key that doesn't match what rules_rust looks up is silently ignored,
so the keys were checked
against Bazel too:

* Force-fetching the 8 toolchain repositories those builds use, through
an empty repository cache,
downloads and verifies 19 of the 21 archives on x86_64 Linux. The other
2 are `rust-analyzer` for
the two arm64 hosts, which only those hosts fetch. None of them triggers
the "canonical
reproducible form" DEBUG message that Bazel prints when a rules_rust
toolchain repository
downloads an archive it has no checksum for. As a control, the
`wasm32-wasip2` repository, which
our builds don't use, does: the `sha256s` it suggests adds its
`rust-std`, which isn't in the dict.
* Corrupting a single checksum makes the fetch fail with `Checksum was …
but wanted …`. Tried for
`rust-std` for `x86_64-apple-darwin` and `wasm32-unknown-unknown`,
`rustc` for
`aarch64-unknown-linux-gnu`, `llvm-tools` for `aarch64-apple-darwin`,
and `rust-analyzer` for
  `x86_64-unknown-linux-gnu`.
* On x86_64 Linux, `bazel build //... --nobuild` fetches no Rust
toolchain archive without a
  checksum.

No repin is needed. The `Cargo.Bazel.*.lock` digests hash the
`cargo`/`rustc` of rules_rust's own
host tools (1.99.1 in rules_rust 0.75.0), not the version selected by
`rust.toolchain`, and no
third-party crate changed. Bazel accepts the existing lock files.

## Also checked, since tests won't necessarily catch these

* **Never type**
([rust#155499](rust-lang/rust#155499)): `!` is
stable,
`Infallible` is now an alias for it, and the never-type fallback is `!`
on all editions. Only 5
crates are not on edition 2024 under Cargo (`rate_limits` and four
`guest_upgrade` crates; Bazel
already builds them as 2024), and they compile cleanly. The only `impl
From<Infallible>`
  (`ic-protobuf`'s `ProxyDecodeError`) compiles too.
* **`Iterator::{min,max}(_by_key)`**
([rust#160203](rust-lang/rust#160203))
now call `Ord::{min,max}` and `PartialOrd::{lt,le,gt,ge}`, so they can
only behave differently
for types that override those inconsistently with `cmp`. No first-party
type overrides them.
* **Wasm and LLVM**: the `wasm32-unknown-unknown` target spec is
identical on both toolchains, and
LLVM stays on 23 (23.1.1 → 23.1.5), so the LLVM-bitcode caveat from
dfinity#11735 is unchanged.
* **Cargo's build-directory layout** changed. The only code that parses
build paths,
`canister_sandbox`'s profile detection, matches `/target/<profile>/` and
still does. Bazel is
  unaffected.
* **Cargo's new `[lints.cargo]`**: the warn-by-default
`unused_dependencies` lint now reports 30
dependencies in 24 manifests during `cargo clippy --workspace
--all-targets`, plus an unused
workspace dependency (`ring`) and a redundant `homepage`
(`ic-management-canister-types`). These
are warnings, so CI doesn't fail on them. Some are false positives: the
lint only sees the host
target, so dependencies used only on `wasm32`, like
`ic-dummy-getrandom-for-wasm`, look unused.
  This PR leaves them to their owners.
* **rustfmt**: stable 1.11.0 accepts the tree unchanged.

## Testing

* `./ci/scripts/rust-lint.sh` exits 0 on 1.100.0.
* All 8 canbench tests and the `subnet_splitting` integration test pass.
* `bazel build` of all 2,091 Rust targets, including the 110 wasm
canisters, succeeds on 1.100.0.
That covers the `wasm32`-only code and Bazel-only crates that `cargo
clippy` doesn't see.
* `bazel build //... --nobuild` analyzes all 3,387 targets, and
buildifier is clean.
* After merging dfinity#12142's review changes, on 1.100.0: `rust-lint.sh`,
`cargo check` of
`ic-sns-governance` and `ic-admin`, and `bazel build` of the 6 directly
affected targets pass, and
so do 60 of the 61 non-system tests within two hops of the changed
files. The other one,
`golden_state_swap_upgrade_twice`, can't fetch its golden state over SSH
from the dev environment.
* CI with `CI_ALL_BAZEL_TARGETS` passed on 5546a65. The commits since
(the checksums, the
`rust-lint.sh` comment and the merged dfinity#12142 review changes) get the
default diff-based CI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants