Skip to content

Commit 04ede1c

Browse files
authored
Merge pull request #302 from AdaWorldAPI/claude/rust-1981-bump
toolchain: Rust 1.97.1 → 1.98.1, and the chunks_exact → as_chunks shift it forces
2 parents d1f6a6d + 68c0909 commit 04ede1c

9 files changed

Lines changed: 58 additions & 43 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ env:
2121
# `LazyLock<Tier>` detection means one binary, all ISAs. Jobs that
2222
# specifically need a higher target-cpu can opt in via per-job env.
2323
RUSTFLAGS: "-D warnings"
24-
MSRV: 1.97.1
25-
BLAS_MSRV: 1.97.1
24+
MSRV: 1.98.1
25+
BLAS_MSRV: 1.98.1
2626

2727
jobs:
2828
pass-msrv:
@@ -41,18 +41,19 @@ jobs:
4141
runs-on: ubuntu-latest
4242
strategy:
4343
matrix:
44-
# Pinned to 1.97.1 to match `rust-toolchain.toml`. The workspace
45-
# bumped from 1.94.1 → 1.97.1 in commit
46-
# https://github.com/AdaWorldAPI/ndarray (this PR) to align with
47-
# bevy (edition 2024 → 1.95 MSRV) and lance-graph. 1.95 added the
48-
# `clippy::manual_checked_ops` lint which fires on
49-
# `impl_owned_array.rs::into_scalar` — fixed in this same PR.
44+
# Must equal `rust-toolchain.toml`'s channel. The version is NOT
45+
# restated in this comment on purpose: CI here does NOT read the
46+
# toolchain file (it uses `dtolnay/rust-toolchain@<version>`), so the
47+
# number lives in three places — the `MSRV`/`BLAS_MSRV` env above, the
48+
# matrix entry below, and each `dtolnay/rust-toolchain@` step. All of
49+
# them move together with the toolchain file, and its bump log is the
50+
# one place that records WHY each move happened.
5051
rust:
51-
- "1.97.1"
52+
- "1.98.1"
5253
name: clippy/${{ matrix.rust }}
5354
steps:
5455
- uses: actions/checkout@v4
55-
- uses: dtolnay/rust-toolchain@1.97.1
56+
- uses: dtolnay/rust-toolchain@1.98.1
5657
with:
5758
components: clippy
5859
- uses: Swatinem/rust-cache@v2
@@ -74,10 +75,10 @@ jobs:
7475
# That state no longer exists; the band-aid is removed in this PR.
7576
steps:
7677
- uses: actions/checkout@v4
77-
# Stable rustfmt 1.97.1 — pinned in `rust-toolchain.toml`. No
78-
# nightly dependency since rustfmt.toml is stable-clean post-PR
79-
# #133.
80-
- uses: dtolnay/rust-toolchain@1.97.1
78+
# Stable rustfmt on the pinned channel (see `rust-toolchain.toml`;
79+
# version deliberately not restated here). No nightly dependency since
80+
# rustfmt.toml is stable-clean post-PR #133.
81+
- uses: dtolnay/rust-toolchain@1.98.1
8182
with:
8283
components: rustfmt
8384
- run: cargo fmt --all --check
@@ -99,7 +100,7 @@ jobs:
99100
with:
100101
toolchain: ${{ matrix.rust }}
101102
targets: ${{ matrix.target }}
102-
# rust-toolchain.toml pins 1.97.1 — install the cross-compile target
103+
# rust-toolchain.toml pins the channel — install the cross-compile target
103104
# for that toolchain too, since dtolnay/rust-toolchain only installs
104105
# for the matrix value which may differ from the pinned version.
105106
- run: rustup target add ${{ matrix.target }}
@@ -126,7 +127,7 @@ jobs:
126127
- uses: dtolnay/rust-toolchain@stable
127128
with:
128129
targets: wasm32-unknown-unknown
129-
# rust-toolchain.toml pins 1.97.1 — install the wasm target for the pinned
130+
# rust-toolchain.toml pins the channel — install the wasm target for the pinned
130131
# toolchain too (dtolnay installs for `stable`, which may differ).
131132
- run: rustup target add wasm32-unknown-unknown
132133
- uses: actions/setup-node@v4
@@ -155,7 +156,7 @@ jobs:
155156
- uses: dtolnay/rust-toolchain@stable
156157
with:
157158
targets: aarch64-unknown-linux-gnu
158-
# rust-toolchain.toml pins 1.97.1 — install the aarch64 target for the
159+
# rust-toolchain.toml pins the channel — install the aarch64 target for the
159160
# pinned toolchain too (dtolnay installs for `stable`, which may differ).
160161
- run: rustup target add aarch64-unknown-linux-gnu
161162
- name: install aarch64 cross toolchain + qemu-user
@@ -210,7 +211,7 @@ jobs:
210211
name: hpc-stream-parallel/rayon
211212
steps:
212213
- uses: actions/checkout@v4
213-
- uses: dtolnay/rust-toolchain@1.97.1
214+
- uses: dtolnay/rust-toolchain@1.98.1
214215
- uses: Swatinem/rust-cache@v2
215216
- uses: taiki-e/install-action@nextest
216217
- name: cargo check (no rayon — scalar path unchanged)

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2021"
1010
# of the contract crate happens to still succeed today — a coincidence, not a
1111
# guarantee, and exactly what an untested MSRV declaration buys. Declare what is
1212
# actually verified.
13-
rust-version = "1.97"
13+
rust-version = "1.98"
1414
authors = [
1515
"Ulrik Sverdrup \"bluss\"",
1616
"Jim Turner"

‎crates/numeric-tests/tests/accuracy.rs‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,18 +269,17 @@ fn accurate_mul_with_column_f64() {
269269
let a = gen::<f64, _>(Ix2(m, k), rng);
270270
let b_owner = gen::<f64, _>(Ix2(k, k), rng);
271271
let b_row_col;
272-
let b_sq;
273272

274273
// pick dense square or broadcasted to square matrix
275-
match i {
276-
0..=3 => b_sq = b_owner.view(),
274+
let b_sq = match i {
275+
0..=3 => b_owner.view(),
277276
4..=7 => {
278277
b_row_col = b_owner.column(0);
279-
b_sq = b_row_col.broadcast((k, k)).unwrap();
278+
b_row_col.broadcast((k, k)).unwrap()
280279
}
281280
_otherwise => {
282281
b_row_col = b_owner.row(0);
283-
b_sq = b_row_col.broadcast((k, k)).unwrap();
282+
b_row_col.broadcast((k, k)).unwrap()
284283
}
285284
};
286285

‎examples/morton_cascade_probe.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl Pyramid {
101101
for l in 1..=k as usize {
102102
let prev = &levels[l - 1];
103103
let mut cur = Vec::with_capacity(prev.len() / 4);
104-
for node in prev.chunks_exact(4) {
104+
for node in prev.as_chunks::<4>().0 {
105105
let mn = node.iter().map(|p| p.0).fold(f32::INFINITY, f32::min);
106106
let mx = node.iter().map(|p| p.1).fold(f32::NEG_INFINITY, f32::max);
107107
cur.push((mn, mx));

‎examples/onebrc_cascade_probe.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ impl Pyramid {
201201
for l in 1..=k as usize {
202202
let prev = &levels[l - 1];
203203
let mut cur = Vec::with_capacity(prev.len() / 4);
204-
for q in prev.chunks_exact(4) {
204+
for q in prev.as_chunks::<4>().0 {
205205
cur.push(Node {
206206
min: q.iter().map(|n| n.min).fold(f32::INFINITY, f32::min),
207207
max: q.iter().map(|n| n.max).fold(f32::NEG_INFINITY, f32::max),

‎rust-toolchain.toml‎

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
[toolchain]
2-
channel = "1.97.1"
3-
# Pinned to 1.97.1 (2026-08-05). Aligns ndarray with the rest of the
4-
# AdaWorldAPI stack — lance-graph, OGAR, ruff, MedCare-rs, woa-rs, a2ui-rs and
5-
# stockfish-rs are all on 1.97.1; ndarray was the last sibling still declaring
6-
# 1.95, so a consumer path-dep'ing both it and lance-graph-contract saw two
7-
# different MSRVs.
2+
channel = "1.98.1"
3+
# The pinned version is the `channel` line ABOVE — deliberately not restated
4+
# here. This comment used to open "Pinned to 1.97.1", and this file's own
5+
# warning explains why that is a trap: "A stale comment on a version pin is how
6+
# the next reader learns the wrong number." A bump edits `channel` and leaves
7+
# prose behind, so the prose keeps only the rationale.
8+
#
9+
# Rationale: ndarray moves in lockstep with the rest of the AdaWorldAPI stack —
10+
# lance-graph, OGAR, ruff, MedCare-rs, woa-rs, a2ui-rs, stockfish-rs — because a
11+
# consumer path-dep'ing both ndarray and lance-graph-contract otherwise sees two
12+
# different MSRVs. ndarray was once the last sibling still declaring 1.95.
813
#
914
# The channel here and `Cargo.toml`'s `rust-version` must move TOGETHER. They
1015
# were out of step between the 1.95 → 1.97.1 channel bump and 2026-08-05: this
11-
# file said 1.97.1 while the manifest still declared 1.95, and the comment below
12-
# still described the 1.95 rationale. A stale comment on a version pin is how the
13-
# next reader learns the wrong number.
16+
# file named one version while the manifest declared another.
17+
#
18+
# Bump log (append one line per bump):
19+
# 1.95 → 1.97.1 stack alignment (2026-08-05); the 1.95 bump had introduced
20+
# `clippy::manual_checked_ops`, fixed in `impl_owned_array.rs`
21+
# 1.97.1 → 1.98.1 current stable (1.98.0 2026-08-20, 1.98.1 2026-09-01);
22+
# workspace-wide sweep. The 1.98 delta measured across the
23+
# stack is ONE lint, `clippy::chunks_exact_to_as_chunks`
24+
# (new, default-on STYLE group) — zero sites in this repo.
1425
#
15-
# (Historical: the 1.95 bump introduced `clippy::manual_checked_ops`, which fired
16-
# on `impl_owned_array.rs::into_scalar` and was fixed in that same commit.)
1726
# Never auto-track `stable` — bump explicitly when a future version is
1827
# reviewed and the workspace clippy passes clean.
1928
components = ["clippy", "rustfmt"]

‎src/backend/kernels_avx512.rs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,13 @@ pub fn scal_f64(alpha: f64, x: &mut [f64]) {
173173
#[cfg(target_arch = "x86_64")]
174174
#[target_feature(enable = "avx512f")]
175175
pub fn asum_f32(x: &[f32]) -> f32 {
176+
let (chunks, remainder) = x.as_chunks::<16>();
176177
let mut acc = F32x16::splat(0.0);
177-
for chunk in x.chunks_exact(16) {
178+
for chunk in chunks {
178179
acc += F32x16::from_slice(chunk).abs();
179180
}
180181
let mut sum = acc.reduce_sum();
181-
for &v in x.chunks_exact(16).remainder() {
182+
for &v in remainder {
182183
sum += v.abs();
183184
}
184185
sum
@@ -190,12 +191,13 @@ pub fn asum_f32(x: &[f32]) -> f32 {
190191
#[cfg(target_arch = "x86_64")]
191192
#[target_feature(enable = "avx512f")]
192193
pub fn asum_f64(x: &[f64]) -> f64 {
194+
let (chunks, remainder) = x.as_chunks::<8>();
193195
let mut acc = F64x8::splat(0.0);
194-
for chunk in x.chunks_exact(8) {
196+
for chunk in chunks {
195197
acc += F64x8::from_slice(chunk).abs();
196198
}
197199
let mut sum = acc.reduce_sum();
198-
for &v in x.chunks_exact(8).remainder() {
200+
for &v in remainder {
199201
sum += v.abs();
200202
}
201203
sum

‎src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
clippy::deref_addrof,
2020
clippy::manual_map, // is not an error
2121
clippy::while_let_on_iterator, // is not an error
22-
clippy::from_iter_instead_of_collect, // using from_iter is good style
2322
clippy::incompatible_msrv, // false positive PointerExt::offset
2423
)]
2524
#![doc(test(attr(deny(warnings))))]

‎src/simd_ops.rs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,12 @@ pub fn bf16_tile_gemm_16x16(a_bf16: &[u16], b_bf16: &[u16], c: &mut [f32], k: us
609609
*slot = b_f32[kk * 16 + j];
610610
}
611611
let mut acc = F32x16::splat(0.0);
612-
for (ra, rb) in a_row.chunks_exact(16).zip(col.chunks_exact(16)) {
612+
for (ra, rb) in a_row
613+
.as_chunks::<16>()
614+
.0
615+
.iter()
616+
.zip(col.as_chunks::<16>().0)
617+
{
613618
acc = F32x16::from_slice(ra).mul_add(F32x16::from_slice(rb), acc);
614619
}
615620
c[i * 16 + j] += acc.reduce_sum();

0 commit comments

Comments
 (0)