From 7aa39a3dcf08b1e557deb2768dfe9ee18598a2ce Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 10 May 2026 16:33:57 +0000 Subject: [PATCH 1/5] fix(doctests): fix 3 doctest failures breaking CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. crystal_encoder::distill — remove unused import `Role` 2. nibble::nibble_propagate_bfs — remove unused import `nibble_unpack` 3. udf_kernels::udf_sigma_classify — swap band/threshold args in doctest assertions (distance=100 with threshold=1000 → Foveal, not distance=1000 with threshold=100 → Reject) All 3 fail under CI's RUSTFLAGS="-D warnings". Now: 335 doctests pass, 0 fail, 7 ignored. Co-authored-by: AdaWorldAPI --- src/hpc/crystal_encoder.rs | 2 +- src/hpc/nibble.rs | 2 +- src/hpc/udf_kernels.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hpc/crystal_encoder.rs b/src/hpc/crystal_encoder.rs index 818a40aa..26188f9a 100644 --- a/src/hpc/crystal_encoder.rs +++ b/src/hpc/crystal_encoder.rs @@ -354,7 +354,7 @@ fn distillation_loss(student: &mut Node, teacher: &mut Node, lambda: f32) -> f32 /// # Example /// /// ``` -/// use ndarray::hpc::crystal_encoder::{CrystalEncoder, Role, distill}; +/// use ndarray::hpc::crystal_encoder::{CrystalEncoder, distill}; /// use ndarray::hpc::node::Node; /// /// let teacher = Node::random(42); diff --git a/src/hpc/nibble.rs b/src/hpc/nibble.rs index 4eceb246..05659f95 100644 --- a/src/hpc/nibble.rs +++ b/src/hpc/nibble.rs @@ -301,7 +301,7 @@ pub(crate) unsafe fn nibble_above_threshold_avx2(packed: &[u8], threshold: u8) - /// # Examples /// /// ``` -/// use ndarray::hpc::nibble::{nibble_pack, nibble_propagate_bfs, nibble_unpack}; +/// use ndarray::hpc::nibble::{nibble_pack, nibble_propagate_bfs}; /// let mut packed = nibble_pack(&[5, 3, 10, 1, 0, 15, 2, 7]); /// let frontier = nibble_propagate_bfs(&mut packed, 3); /// // After subtracting 3: [2, 0, 7, 0, 0, 12, 0, 4] diff --git a/src/hpc/udf_kernels.rs b/src/hpc/udf_kernels.rs index 30735ffa..b4b19293 100644 --- a/src/hpc/udf_kernels.rs +++ b/src/hpc/udf_kernels.rs @@ -188,8 +188,8 @@ pub fn udf_nars_revision(freq1: u16, conf1: u16, freq2: u16, conf2: u16) -> (u16 /// ``` /// use ndarray::hpc::udf_kernels::udf_sigma_classify; /// -/// assert_eq!(udf_sigma_classify(1000, 100), "exact"); -/// assert_eq!(udf_sigma_classify(1000, 1500), "noise"); +/// assert_eq!(udf_sigma_classify(100, 1000), "exact"); +/// assert_eq!(udf_sigma_classify(1500, 1000), "noise"); /// ``` pub fn udf_sigma_classify(band: u32, threshold: u64) -> &'static str { use super::cascade::Band; From 0594db33ea24f1aad22e580510c3377564f6a83a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 10 May 2026 16:38:32 +0000 Subject: [PATCH 2/5] fix(ci): install thumbv6m target for pinned toolchain in nostd job dtolnay/rust-toolchain installs the target for the matrix toolchain (stable), but rust-toolchain.toml overrides cargo to use 1.94.1 which doesn't have thumbv6m-none-eabi installed. Add explicit rustup target add to ensure the pinned toolchain has the cross-compile target. Co-authored-by: AdaWorldAPI --- .github/workflows/ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a228c181..4cde8895 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -101,6 +101,10 @@ jobs: with: toolchain: ${{ matrix.rust }} targets: ${{ matrix.target }} + # rust-toolchain.toml pins 1.94.1 — install the cross-compile target + # for that toolchain too, since dtolnay/rust-toolchain only installs + # for the matrix value which may differ from the pinned version. + - run: rustup target add ${{ matrix.target }} - name: Tests run: | cargo rustc "--target=${{ matrix.target }}" --no-default-features --features portable-atomic-critical-section From 5f3a43f37202898df051c6c7cafa3cad337ac475 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 13 May 2026 07:26:59 +0000 Subject: [PATCH 3/5] fix(ci): unblock i686 cross-tests + thumbv6m nostd build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two pre-existing latent CI failures surfaced on PR #139 that are NOT introduced by it but block the same merge gate: (1) i686-unknown-linux-gnu cross-tests — duplicate scalar mask types The `impl_float_type!` macro at src/simd.rs:562 already emits `pub struct $mask(pub $mask_prim);` from its `mask_prim` parameter, so calling it with `F32Mask8Scalar` / `F64Mask4Scalar` defines those structs. Lines 768-771 had explicit re-declarations of the same structs ("Unused mask types for AVX2 scalars" comment notwithstanding — the macro had been emitting them since PR #49). On x86_64 the entire scalar module is `#[cfg(not(target_arch = "x86_64"))]` so the duplication is invisible. On i686 (32-bit x86) the cfg matches → both definitions compile → 8 errors: E0428 × 2 (duplicate type names) E0119 × 6 (conflicting Copy / Clone / Debug derive impls) Fix: delete the 4 explicit re-declarations. Macro continues to emit both mask types as before; the scalar module compiles cleanly on i686. (2) thumbv6m-none-eabi nostd build — blake3 transitive dep pulls std `cargo rustc --target=thumbv6m-none-eabi --no-default-features --features portable-atomic-critical-section` failed with: error[E0463]: can't find crate for `std` note: `std` is required by `constant_time_eq` because it does not declare `#![no_std]` Root cause: `blake3` was declared unconditional in Cargo.toml (`blake3 = { version = "1" }`) — pulled into every build including `--no-default-features`. blake3 itself supports no_std but its transitive dep `constant_time_eq` does not declare `#![no_std]`, so the dep tree pulls std unconditionally. The Cargo.toml comment on the `hpc-extras` feature already documents "blake3 hashing" as part of that feature group; fix is to make the declaration match the documented intent: - `blake3 = { version = "1", optional = true }` - Add `dep:blake3` to the `hpc-extras` feature list `hpc-extras` is in `default = ["std", "hpc-extras"]`, so all default builds still get blake3 (zero behavior change). Only `--no-default- features` builds drop it — which is exactly what the thumbv6m nostd job runs. The 8 hpc/* files that use blake3 (plane, seal, merkle_tree, vsa, spo_bundle, crystal_encoder, compression_curves, deepnsm) need no cfg gating — the existing module-level cfg conditions already exclude them from the no_std build. Verification (local, 2026-05-13): - `cargo check --no-default-features --features portable-atomic-critical-section --lib` clean - `cargo clippy --no-deps` (default features) clean - Standard build unaffected (default includes hpc-extras → blake3 still in dep tree) Both fixes are pre-existing latent bugs (simd duplicates since PR #49, blake3 unconditional since the workspace was set up); PR #139 exposes them via the new CI matrix entries (cross-tests + nostd). --- Cargo.lock | 2067 ++------------------------------------------------- Cargo.toml | 11 +- src/simd.rs | 11 +- 3 files changed, 82 insertions(+), 2007 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 23abfa50..06d42421 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,15 +8,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415ed64958754dbe991900f3940677e6a7eefb4d7367afd70d642677b0c7d19d" -[[package]] -name = "addr2line" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" -dependencies = [ - "gimli 0.32.3", -] - [[package]] name = "adler2" version = "2.0.1" @@ -38,15 +29,6 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "anes" version = "0.1.6" @@ -92,54 +74,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -[[package]] -name = "ash" -version = "0.38.0+1.3.281" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" -dependencies = [ - "libloading 0.8.9", -] - -[[package]] -name = "async-channel" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "atomic_float" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628d228f918ac3b82fe590352cc719d30664a0c13ca3a60266fe02c7132d480a" - [[package]] name = "autocfg" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" -[[package]] -name = "backtrace" -version = "0.3.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-link", -] - [[package]] name = "base64" version = "0.21.7" @@ -158,31 +98,6 @@ version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" -[[package]] -name = "bincode" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" -dependencies = [ - "serde", - "unty", -] - -[[package]] -name = "bit-set" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ddef2995421ab6a5c779542c81ee77c115206f4ad9d5a8e05f4ff49716a3dd" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51" - [[package]] name = "bitflags" version = "1.3.2" @@ -257,15 +172,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc119b6761ce8b063102502af49043051f81a9bdf242ae06d12e9ea0d92b727a" -[[package]] -name = "block2" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" -dependencies = [ - "objc2", -] - [[package]] name = "bumpalo" version = "3.20.2" @@ -275,97 +181,6 @@ dependencies = [ "allocator-api2", ] -[[package]] -name = "burn" -version = "0.1.0" -dependencies = [ - "atomic_float", - "blas-src", - "burn-backend", - "burn-ir", - "burn-std", - "bytemuck", - "bytes", - "const-random", - "itertools 0.14.0", - "libm", - "macerator", - "matrixmultiply", - "ndarray", - "num-traits", - "openblas-src", - "paste", - "rand 0.10.0", - "rayon", - "seq-macro", - "serde", -] - -[[package]] -name = "burn-backend" -version = "0.21.0-pre.2" -source = "git+https://github.com/tracel-ai/burn.git?rev=ed72d2b#ed72d2b125a364aff18aed2a53396c128e01cb42" -dependencies = [ - "burn-std", - "bytemuck", - "cubecl", - "derive-new", - "enumset", - "hashbrown 0.16.1", - "num-traits", - "portable-atomic-util", - "rand 0.10.0", - "rand_distr 0.6.0", - "serde", - "spin", - "thiserror", -] - -[[package]] -name = "burn-ir" -version = "0.21.0-pre.2" -source = "git+https://github.com/tracel-ai/burn.git?rev=ed72d2b#ed72d2b125a364aff18aed2a53396c128e01cb42" -dependencies = [ - "burn-backend", - "hashbrown 0.16.1", - "serde", -] - -[[package]] -name = "burn-std" -version = "0.21.0-pre.2" -source = "git+https://github.com/tracel-ai/burn.git?rev=ed72d2b#ed72d2b125a364aff18aed2a53396c128e01cb42" -dependencies = [ - "bytemuck", - "bytes", - "cubecl-common", - "cubecl-zspace", - "half", - "num-traits", - "serde", - "smallvec", -] - -[[package]] -name = "bytemuck" -version = "1.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "byteorder" version = "1.5.0" @@ -377,9 +192,6 @@ name = "bytes" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" -dependencies = [ - "portable-atomic", -] [[package]] name = "cast" @@ -412,23 +224,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "chacha20" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" -dependencies = [ - "cfg-if", - "cpufeatures", - "rand_core 0.10.0", -] - [[package]] name = "ciborium" version = "0.2.2" @@ -490,61 +285,12 @@ dependencies = [ "cc", ] -[[package]] -name = "codespan-reporting" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681" -dependencies = [ - "serde", - "termcolor", - "unicode-width", -] - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "const-random" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" -dependencies = [ - "const-random-macro", -] - -[[package]] -name = "const-random-macro" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" -dependencies = [ - "getrandom 0.2.17", - "once_cell", - "tiny-keccak", -] - [[package]] name = "constant_time_eq" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" -[[package]] -name = "convert_case" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "core-foundation" version = "0.10.1" @@ -599,11 +345,11 @@ dependencies = [ "cranelift-control", "cranelift-entity", "cranelift-isle", - "gimli 0.31.1", + "gimli", "hashbrown 0.14.5", "log", "regalloc2", - "rustc-hash 2.1.2", + "rustc-hash", "serde", "smallvec", "target-lexicon", @@ -794,591 +540,81 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] -name = "cubecl" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" -dependencies = [ - "cubecl-core", - "cubecl-cuda", - "cubecl-ir", - "cubecl-runtime", - "cubecl-wgpu", - "half", -] +name = "defmac" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5592fca31e96d8a748d03080b58be78c5383617aa4bd89e69f30607d8769891" [[package]] -name = "cubecl-common" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" +name = "der" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fd89660b2dc699704064e59e9dba0147b903e85319429e131620d022be411b" dependencies = [ - "backtrace", - "bincode", - "bytemuck", - "bytes", - "cfg-if", - "cfg_aliases", - "derive-new", - "derive_more", - "dirs", - "embassy-futures", - "embassy-time", - "float4", - "float8", - "futures-lite", - "half", - "hashbrown 0.16.1", - "log", - "num-traits", - "oneshot", - "parking_lot", - "portable-atomic", - "portable-atomic-util", - "rand 0.10.0", - "sanitize-filename", - "serde", - "serde_bytes", - "serde_json", - "spin", - "tynm", - "wasm-bindgen-futures", - "web-time", - "xxhash-rust", + "pem-rfc7468", + "zeroize", ] [[package]] -name = "cubecl-core" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" dependencies = [ - "bitflags 2.11.0", - "bytemuck", - "cubecl-common", - "cubecl-ir", - "cubecl-macros", - "cubecl-runtime", - "cubecl-zspace", - "derive-new", - "derive_more", - "enumset", - "float-ord", - "half", - "hashbrown 0.16.1", - "log", - "num-traits", - "paste", - "serde", - "serde_json", - "variadics_please", + "dirs-sys", ] [[package]] -name = "cubecl-cpp" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" dependencies = [ - "bytemuck", - "cubecl-common", - "cubecl-core", - "cubecl-opt", - "cubecl-runtime", - "derive-new", - "half", - "itertools 0.14.0", - "log", + "libc", + "option-ext", + "redox_users", + "windows-sys 0.61.2", ] [[package]] -name = "cubecl-cuda" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" -dependencies = [ - "bytemuck", - "cubecl-common", - "cubecl-core", - "cubecl-cpp", - "cubecl-runtime", - "cudarc", - "derive-new", - "half", - "log", - "serde", -] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] -name = "cubecl-ir" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" -dependencies = [ - "cubecl-common", - "cubecl-macros-internal", - "derive-new", - "derive_more", - "enumset", - "float-ord", - "fnv", - "foldhash 0.2.0", - "half", - "hashbrown 0.16.1", - "num-traits", - "portable-atomic", - "serde", - "variadics_please", -] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] -name = "cubecl-macros" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ - "cubecl-common", - "darling 0.23.0", - "derive-new", - "ident_case", - "inflections", - "prettyplease", - "proc-macro2", - "quote", - "syn", + "libc", + "windows-sys 0.61.2", ] [[package]] -name = "cubecl-macros-internal" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" -dependencies = [ - "darling 0.23.0", - "proc-macro2", - "quote", - "syn", -] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] -name = "cubecl-opt" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" -dependencies = [ - "cubecl-common", - "cubecl-core", - "cubecl-ir", - "float-ord", - "log", - "num", - "petgraph", - "smallvec", - "stable-vec", - "type-map", -] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] -name = "cubecl-runtime" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" -dependencies = [ - "async-channel", - "bytemuck", - "cfg-if", - "cfg_aliases", - "cubecl-common", - "cubecl-ir", - "cubecl-zspace", - "derive-new", - "derive_more", - "dirs", - "enumset", - "hashbrown 0.16.1", - "log", - "md5", - "serde", - "serde_json", - "spin", - "thiserror", - "toml", - "variadics_please", - "wasm-bindgen-futures", - "web-time", -] - -[[package]] -name = "cubecl-wgpu" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" -dependencies = [ - "async-channel", - "bytemuck", - "cfg-if", - "cfg_aliases", - "cubecl-common", - "cubecl-core", - "cubecl-ir", - "cubecl-runtime", - "derive-new", - "derive_more", - "half", - "hashbrown 0.16.1", - "log", - "sanitize-filename", - "wgpu", -] - -[[package]] -name = "cubecl-zspace" -version = "0.10.0-pre.2" -source = "git+https://github.com/tracel-ai/cubecl?rev=5b831a3cfac3eca0065fe0dbf57cddf5946d1586#5b831a3cfac3eca0065fe0dbf57cddf5946d1586" -dependencies = [ - "derive-new", - "serde", - "smallvec", -] - -[[package]] -name = "cudarc" -version = "0.19.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f071cd6a7b5d51607df76aa2d426aaabc7a74bc6bdb885b8afa63a880572ad9b" -dependencies = [ - "libloading 0.9.0", -] - -[[package]] -name = "darling" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" -dependencies = [ - "darling_core 0.20.11", - "darling_macro 0.20.11", -] - -[[package]] -name = "darling" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" -dependencies = [ - "darling_core 0.21.3", - "darling_macro 0.21.3", -] - -[[package]] -name = "darling" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" -dependencies = [ - "darling_core 0.23.0", - "darling_macro 0.23.0", -] - -[[package]] -name = "darling_core" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_core" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "darling_core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" -dependencies = [ - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.20.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" -dependencies = [ - "darling_core 0.20.11", - "quote", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" -dependencies = [ - "darling_core 0.21.3", - "quote", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" -dependencies = [ - "darling_core 0.23.0", - "quote", - "syn", -] - -[[package]] -name = "defmac" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5592fca31e96d8a748d03080b58be78c5383617aa4bd89e69f30607d8769891" - -[[package]] -name = "der" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fd89660b2dc699704064e59e9dba0147b903e85319429e131620d022be411b" -dependencies = [ - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "derive-new" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cdc8d50f426189eef89dac62fabfa0abb27d5cc008f25bf4156a0203325becc" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "derive_more" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn", - "unicode-xid", -] - -[[package]] -name = "dirs" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.61.2", -] - -[[package]] -name = "dispatch2" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" -dependencies = [ - "bitflags 2.11.0", - "objc2", -] - -[[package]] -name = "dlib" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8ecd87370524b461f8557c119c405552c396ed91fc0a8eec68679eab26f94a" -dependencies = [ - "libloading 0.8.9", -] - -[[package]] -name = "document-features" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" -dependencies = [ - "litrs", -] - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "embassy-futures" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc2d050bdc5c21e0862a89256ed8029ae6c290a93aecefc73084b3002cdebb01" - -[[package]] -name = "embassy-time" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "592b0c143ec626e821d4d90da51a2bd91d559d6c442b7c74a47d368c9e23d97a" -dependencies = [ - "cfg-if", - "critical-section", - "document-features", - "embassy-time-driver", - "embedded-hal 0.2.7", - "embedded-hal 1.0.0", - "embedded-hal-async", - "futures-core", -] - -[[package]] -name = "embassy-time-driver" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee71af1b3a0deaa53eaf2d39252f83504c853646e472400b763060389b9fcc9" -dependencies = [ - "document-features", -] - -[[package]] -name = "embedded-hal" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" -dependencies = [ - "nb 0.1.3", - "void", -] - -[[package]] -name = "embedded-hal" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" - -[[package]] -name = "embedded-hal-async" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" -dependencies = [ - "embedded-hal 1.0.0", -] - -[[package]] -name = "enumset" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b07a8dfbbbfc0064c0a6bdf9edcf966de6b1c33ce344bdeca3b41615452634" -dependencies = [ - "enumset_derive", - "serde", -] - -[[package]] -name = "enumset_derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43e744e4ea338060faee68ed933e46e722fb7f3617e722a5772d7e856d8b3ce" -dependencies = [ - "darling 0.21.3", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "event-listener" -version = "5.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" -dependencies = [ - "event-listener", - "pin-project-lite", -] - -[[package]] -name = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - -[[package]] -name = "filetime" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" +name = "filetime" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" dependencies = [ "cfg-if", "libc", @@ -1391,12 +627,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" -[[package]] -name = "fixedbitset" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" - [[package]] name = "flate2" version = "1.1.9" @@ -1407,45 +637,12 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "float-ord" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce81f49ae8a0482e4c55ea62ebbd7e5a686af544c00b9d090bba3ff9be97b3d" - -[[package]] -name = "float4" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a5404bf31d22893d61cf24d4dda149d8e6b2ff07601c3cb3be651031f61a4ed" - -[[package]] -name = "float8" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d1f04709a8ac06e8e8042875a3c466cc4832d3c1a18dbcb9dba3c6e83046bc" -dependencies = [ - "half", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - [[package]] name = "foldhash" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" -[[package]] -name = "foldhash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" - [[package]] name = "foreign-types" version = "0.3.2" @@ -1462,46 +659,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] -name = "futures-core" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" - -[[package]] -name = "futures-io" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" - -[[package]] -name = "futures-lite" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "futures-task" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" - -[[package]] -name = "futures-util" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +name = "fractal" +version = "0.1.0" dependencies = [ - "futures-core", - "futures-task", - "pin-project-lite", - "slab", + "criterion", + "libm", ] [[package]] @@ -1552,89 +714,14 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.32.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" - -[[package]] -name = "gl_generator" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" -dependencies = [ - "khronos_api", - "log", - "xml-rs", -] - -[[package]] -name = "glow" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29038e1c483364cc6bb3cf78feee1816002e127c331a1eec55a4d202b9e1adb5" -dependencies = [ - "js-sys", - "slotmap", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "glutin_wgl_sys" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" -dependencies = [ - "gl_generator", -] - -[[package]] -name = "gpu-allocator" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795" -dependencies = [ - "ash", - "hashbrown 0.16.1", - "log", - "presser", - "thiserror", - "windows", -] - -[[package]] -name = "gpu-descriptor" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca" -dependencies = [ - "bitflags 2.11.0", - "gpu-descriptor-types", - "hashbrown 0.15.5", -] - -[[package]] -name = "gpu-descriptor-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" -dependencies = [ - "bitflags 2.11.0", -] - [[package]] name = "half" version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" dependencies = [ - "bytemuck", "cfg-if", "crunchy", - "num-traits", - "serde", "zerocopy", ] @@ -1650,7 +737,7 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "foldhash 0.1.5", + "foldhash", ] [[package]] @@ -1658,13 +745,6 @@ name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash 0.2.0", - "serde", - "serde_core", -] [[package]] name = "heck" @@ -1678,12 +758,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" -[[package]] -name = "hexf-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" - [[package]] name = "http" version = "1.4.0" @@ -1706,12 +780,6 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "indexmap" version = "2.13.0" @@ -1724,12 +792,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "inflections" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" - [[package]] name = "is-terminal" version = "0.4.17" @@ -1759,78 +821,22 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" -[[package]] -name = "jni-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" -dependencies = [ - "jni-sys 0.4.1", -] - -[[package]] -name = "jni-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" -dependencies = [ - "jni-sys-macros", -] - -[[package]] -name = "jni-sys-macros" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "js-sys" version = "0.3.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc4c90f45aa2e6eacbe8645f77fdea542ac97a494bcd117a67df9ff4d611f995" dependencies = [ - "cfg-if", - "futures-util", "once_cell", "wasm-bindgen", ] -[[package]] -name = "khronos-egl" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" -dependencies = [ - "libc", - "libloading 0.8.9", - "pkg-config", -] - -[[package]] -name = "khronos_api" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" - [[package]] name = "leb128fmt" version = "0.1.0" @@ -1843,26 +849,6 @@ version = "0.2.183" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" -[[package]] -name = "libloading" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" -dependencies = [ - "cfg-if", - "windows-link", -] - -[[package]] -name = "libloading" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60" -dependencies = [ - "cfg-if", - "windows-link", -] - [[package]] name = "libm" version = "0.2.16" @@ -1878,7 +864,7 @@ dependencies = [ "bitflags 2.11.0", "libc", "plain", - "redox_syscall 0.7.3", + "redox_syscall", ] [[package]] @@ -1887,55 +873,12 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" -[[package]] -name = "litrs" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" - -[[package]] -name = "lock_api" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" -dependencies = [ - "scopeguard", -] - [[package]] name = "log" version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" -[[package]] -name = "macerator" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e6046277c48f8a44bd6cfae65a1a261cab6622fb6d4a003f5597e4e4f4a661" -dependencies = [ - "bytemuck", - "cfg_aliases", - "half", - "macerator-macros", - "moddef", - "num-traits", - "paste", - "rustc_version", -] - -[[package]] -name = "macerator-macros" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ee1819976b67f4d782390c55a75c13401c7a988517f7f8e60a33484dc2e00a" -dependencies = [ - "darling 0.20.11", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "mach2" version = "0.4.3" @@ -1958,12 +901,6 @@ dependencies = [ "thread-tree", ] -[[package]] -name = "md5" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae960838283323069879657ca3de837e9f7bbb4c7bf6ea7f1b290d5e9476d2e0" - [[package]] name = "memchr" version = "2.8.0" @@ -1980,38 +917,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "moddef" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0b3262dc837d2513fe2ef31ff8461352ef932dcca31ba0c0abe33547cf6b9b" - -[[package]] -name = "naga" -version = "29.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2630921705b9b01dcdd0b6864b9562ca3c1951eecd0f0c4f5f04f61e412647" -dependencies = [ - "arrayvec", - "bit-set", - "bitflags 2.11.0", - "cfg-if", - "cfg_aliases", - "codespan-reporting", - "half", - "hashbrown 0.16.1", - "hexf-parse", - "indexmap", - "libm", - "log", - "num-traits", - "once_cell", - "rustc-hash 1.1.0", - "spirv", - "thiserror", - "unicode-ident", -] - [[package]] name = "native-tls" version = "0.2.18" @@ -2026,23 +931,8 @@ dependencies = [ "schannel", "security-framework", "security-framework-sys", - "tempfile", -] - -[[package]] -name = "nb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" -dependencies = [ - "nb 1.1.0", -] - -[[package]] -name = "nb" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + "tempfile", +] [[package]] name = "ndarray" @@ -2056,7 +946,9 @@ dependencies = [ "cranelift-jit", "cranelift-module", "criterion", + "critical-section", "defmac", + "fractal", "itertools 0.13.0", "libc", "matrixmultiply", @@ -2065,7 +957,6 @@ dependencies = [ "num-integer", "num-traits", "p64", - "phyllotactic-manifold", "portable-atomic", "portable-atomic-util", "quickcheck", @@ -2091,19 +982,10 @@ dependencies = [ "ndarray", "quickcheck", "rand 0.9.2", - "rand_distr 0.5.1", + "rand_distr", "rand_isaac", ] -[[package]] -name = "ndk-sys" -version = "0.6.0+11769913" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" -dependencies = [ - "jni-sys 0.3.1", -] - [[package]] name = "netlib-src" version = "0.8.0" @@ -2113,39 +995,6 @@ dependencies = [ "cmake", ] -[[package]] -name = "nom" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" -dependencies = [ - "memchr", -] - -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - [[package]] name = "num-complex" version = "0.4.6" @@ -2164,28 +1013,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -2218,78 +1045,7 @@ dependencies = [ "num-traits", "openblas-src", "rand 0.9.2", - "rand_distr 0.5.1", -] - -[[package]] -name = "objc2" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" -dependencies = [ - "objc2-encode", -] - -[[package]] -name = "objc2-core-foundation" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" -dependencies = [ - "bitflags 2.11.0", - "dispatch2", - "objc2", -] - -[[package]] -name = "objc2-encode" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" - -[[package]] -name = "objc2-foundation" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" -dependencies = [ - "bitflags 2.11.0", - "objc2", - "objc2-core-foundation", -] - -[[package]] -name = "objc2-metal" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0125f776a10d00af4152d74616409f0d4a2053a6f57fa5b7d6aa2854ac04794" -dependencies = [ - "bitflags 2.11.0", - "block2", - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-quartz-core" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" -dependencies = [ - "bitflags 2.11.0", - "objc2", - "objc2-core-foundation", - "objc2-foundation", - "objc2-metal", -] - -[[package]] -name = "object" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" -dependencies = [ - "memchr", + "rand_distr", ] [[package]] @@ -2298,12 +1054,6 @@ version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" -[[package]] -name = "oneshot" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe21416a02c693fb9f980befcb230ecc70b0b3d1cc4abf88b9675c4c1457f0c" - [[package]] name = "oorandom" version = "11.1.5" @@ -2386,50 +1136,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "ordered-float" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7d950ca161dc355eaf28f82b11345ed76c6e1f6eb1f4f4479e0323b9e2fbd0e" -dependencies = [ - "num-traits", -] - [[package]] name = "p64" version = "0.1.0" dependencies = [ "criterion", - "phyllotactic-manifold", -] - -[[package]] -name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - -[[package]] -name = "parking_lot" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.5.18", - "smallvec", - "windows-link", + "fractal", ] [[package]] @@ -2453,31 +1165,6 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" -[[package]] -name = "petgraph" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" -dependencies = [ - "fixedbitset", - "hashbrown 0.15.5", - "indexmap", - "serde", -] - -[[package]] -name = "phyllotactic-manifold" -version = "0.1.0" -dependencies = [ - "criterion", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" - [[package]] name = "pkg-config" version = "0.3.32" @@ -2525,7 +1212,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" dependencies = [ "critical-section", - "serde", ] [[package]] @@ -2546,12 +1232,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "presser" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" - [[package]] name = "prettyplease" version = "0.2.37" @@ -2571,12 +1251,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "profiling" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773" - [[package]] name = "quickcheck" version = "1.1.0" @@ -2623,7 +1297,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" dependencies = [ - "chacha20", "getrandom 0.4.2", "rand_core 0.10.0", ] @@ -2663,16 +1336,6 @@ dependencies = [ "rand 0.9.2", ] -[[package]] -name = "rand_distr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d431c2703ccf129de4d45253c03f49ebb22b97d6ad79ee3ecfc7e3f4862c1d8" -dependencies = [ - "num-traits", - "rand 0.10.0", -] - [[package]] name = "rand_isaac" version = "0.4.0" @@ -2682,30 +1345,6 @@ dependencies = [ "rand_core 0.9.5", ] -[[package]] -name = "range-alloc" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08" - -[[package]] -name = "raw-window-handle" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" - -[[package]] -name = "raw-window-metal" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40d213455a5f1dc59214213c7330e074ddf8114c9a42411eb890c767357ce135" -dependencies = [ - "objc2", - "objc2-core-foundation", - "objc2-foundation", - "objc2-quartz-core", -] - [[package]] name = "rawpointer" version = "0.2.1" @@ -2732,15 +1371,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags 2.11.0", -] - [[package]] name = "redox_syscall" version = "0.7.3" @@ -2771,7 +1401,7 @@ dependencies = [ "bumpalo", "hashbrown 0.15.5", "log", - "rustc-hash 2.1.2", + "rustc-hash", "smallvec", ] @@ -2816,12 +1446,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "renderdoc-sys" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" - [[package]] name = "rmp" version = "0.8.13" @@ -2856,33 +1480,12 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "rustc-demangle" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hash" version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - [[package]] name = "rustix" version = "1.1.4" @@ -2920,15 +1523,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "sanitize-filename" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc984f4f9ceb736a7bb755c3e3bd17dc56370af2600c9780dcc48c66453da34d" -dependencies = [ - "regex", -] - [[package]] name = "schannel" version = "0.1.29" @@ -2938,12 +1532,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "security-framework" version = "3.7.0" @@ -2973,12 +1561,6 @@ version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" -[[package]] -name = "seq-macro" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" - [[package]] name = "serde" version = "1.0.228" @@ -2989,16 +1571,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde_bytes" -version = "0.11.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" -dependencies = [ - "serde", - "serde_core", -] - [[package]] name = "serde_core" version = "1.0.228" @@ -3032,15 +1604,6 @@ dependencies = [ "zmij", ] -[[package]] -name = "serde_spanned" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876ac351060d4f882bb1032b6369eb0aef79ad9df1ea8bc404874d8cc3d0cd98" -dependencies = [ - "serde_core", -] - [[package]] name = "serialization-tests" version = "0.1.0" @@ -3065,72 +1628,17 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - -[[package]] -name = "slotmap" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" -dependencies = [ - "version_check", -] - [[package]] name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" -dependencies = [ - "serde", -] - -[[package]] -name = "spin" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" -dependencies = [ - "lock_api", - "portable-atomic", -] - -[[package]] -name = "spirv" -version = "0.4.0+sdk-1.4.341.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9571ea910ebd84c86af4b3ed27f9dbdc6ad06f17c5f96146b2b671e2976744f" -dependencies = [ - "bitflags 2.11.0", -] - -[[package]] -name = "stable-vec" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dac7bc0f7d0d44329b200020effbc25a534d89fa142af95e3ddf76113412a5e" - -[[package]] -name = "stable_deref_trait" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] -name = "strsim" -version = "0.11.1" +name = "stable_deref_trait" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "syn" @@ -3173,15 +1681,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" version = "2.0.18" @@ -3211,15 +1710,6 @@ dependencies = [ "crossbeam-channel", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "tinytemplate" version = "1.2.1" @@ -3230,93 +1720,18 @@ dependencies = [ "serde_json", ] -[[package]] -name = "toml" -version = "1.1.0+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8195ca05e4eb728f4ba94f3e3291661320af739c4e43779cbdfae82ab239fcc" -dependencies = [ - "indexmap", - "serde_core", - "serde_spanned", - "toml_datetime", - "toml_parser", - "toml_writer", - "winnow", -] - -[[package]] -name = "toml_datetime" -version = "1.1.0+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97251a7c317e03ad83774a8752a7e81fb6067740609f75ea2b585b569a59198f" -dependencies = [ - "serde_core", -] - -[[package]] -name = "toml_parser" -version = "1.1.0+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2334f11ee363607eb04df9b8fc8a13ca1715a72ba8662a26ac285c98aabb4011" -dependencies = [ - "winnow", -] - -[[package]] -name = "toml_writer" -version = "1.1.0+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d282ade6016312faf3e41e57ebbba0c073e4056dab1232ab1cb624199648f8ed" - -[[package]] -name = "tynm" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21cdb0fc8f85c98b1ec812bc4cd69faf6c0fa2fc17d44ea3c2cdd38dc08e999" -dependencies = [ - "nom", -] - -[[package]] -name = "type-map" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb30dbbd9036155e74adad6812e9898d03ec374946234fbcebd5dfc7b9187b90" -dependencies = [ - "rustc-hash 2.1.2", -] - [[package]] name = "unicode-ident" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" -[[package]] -name = "unicode-segmentation" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" - -[[package]] -name = "unicode-width" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" - [[package]] name = "unicode-xid" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "unty" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" - [[package]] name = "ureq" version = "3.3.0" @@ -3352,35 +1767,12 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" -[[package]] -name = "variadics_please" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41b6d82be61465f97d42bd1d15bf20f3b0a3a0905018f38f9d6f6962055b0b5c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - [[package]] name = "walkdir" version = "2.5.0" @@ -3428,16 +1820,6 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d1faf851e778dfa54db7cd438b70758eba9755cb47403f3496edd7c8fc212f0" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "wasm-bindgen-macro" version = "0.2.115" @@ -3516,18 +1898,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "wayland-sys" -version = "0.31.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374f6b70e8e0d6bf9461a32988fd553b59ff630964924dad6e4a4eb6bd538d17" -dependencies = [ - "dlib", - "log", - "once_cell", - "pkg-config", -] - [[package]] name = "web-sys" version = "0.3.92" @@ -3538,16 +1908,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "webpki-root-certs" version = "1.0.6" @@ -3557,173 +1917,6 @@ dependencies = [ "rustls-pki-types", ] -[[package]] -name = "wgpu" -version = "29.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c239a9a747bbd379590985bac952c2e53cb19873f7072b3370c6a6a8e06837" -dependencies = [ - "arrayvec", - "bitflags 2.11.0", - "bytemuck", - "cfg-if", - "cfg_aliases", - "document-features", - "hashbrown 0.16.1", - "js-sys", - "log", - "naga", - "parking_lot", - "portable-atomic", - "profiling", - "raw-window-handle", - "smallvec", - "static_assertions", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "wgpu-core", - "wgpu-hal", - "wgpu-types", -] - -[[package]] -name = "wgpu-core" -version = "29.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e80ac6cf1895df6342f87d975162108f9d98772a0d74bc404ab7304ac29469e" -dependencies = [ - "arrayvec", - "bit-set", - "bit-vec", - "bitflags 2.11.0", - "bytemuck", - "cfg_aliases", - "document-features", - "hashbrown 0.16.1", - "indexmap", - "log", - "naga", - "once_cell", - "parking_lot", - "portable-atomic", - "profiling", - "raw-window-handle", - "rustc-hash 1.1.0", - "smallvec", - "thiserror", - "wgpu-core-deps-apple", - "wgpu-core-deps-emscripten", - "wgpu-core-deps-windows-linux-android", - "wgpu-hal", - "wgpu-naga-bridge", - "wgpu-types", -] - -[[package]] -name = "wgpu-core-deps-apple" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43acd053312501689cd92a01a9638d37f3e41a5fd9534875efa8917ee2d11ac0" -dependencies = [ - "wgpu-hal", -] - -[[package]] -name = "wgpu-core-deps-emscripten" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef043bf135cc68b6f667c55ff4e345ce2b5924d75bad36a47921b0287ca4b24a" -dependencies = [ - "wgpu-hal", -] - -[[package]] -name = "wgpu-core-deps-windows-linux-android" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "725d5c006a8c02967b6d93ef04f6537ec4593313e330cfe86d9d3f946eb90f28" -dependencies = [ - "wgpu-hal", -] - -[[package]] -name = "wgpu-hal" -version = "29.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89a47aef47636562f3937285af4c44b4b5b404b46577471411cc5313a921da7e" -dependencies = [ - "android_system_properties", - "arrayvec", - "ash", - "bit-set", - "bitflags 2.11.0", - "block2", - "bytemuck", - "cfg-if", - "cfg_aliases", - "glow", - "glutin_wgl_sys", - "gpu-allocator", - "gpu-descriptor", - "hashbrown 0.16.1", - "js-sys", - "khronos-egl", - "libc", - "libloading 0.8.9", - "log", - "naga", - "ndk-sys", - "objc2", - "objc2-core-foundation", - "objc2-foundation", - "objc2-metal", - "objc2-quartz-core", - "once_cell", - "ordered-float", - "parking_lot", - "portable-atomic", - "portable-atomic-util", - "profiling", - "range-alloc", - "raw-window-handle", - "raw-window-metal", - "renderdoc-sys", - "smallvec", - "thiserror", - "wasm-bindgen", - "wayland-sys", - "web-sys", - "wgpu-naga-bridge", - "wgpu-types", - "windows", - "windows-core", -] - -[[package]] -name = "wgpu-naga-bridge" -version = "29.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4684f4410da0cf95a4cb63bb5edaac022461dedb6adf0b64d0d9b5f6890d51" -dependencies = [ - "naga", - "wgpu-types", -] - -[[package]] -name = "wgpu-types" -version = "29.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2675540fb1a5cfa5ef122d3d5f390e2c75711a0b946410f2d6ac3a0f77d1f6" -dependencies = [ - "bitflags 2.11.0", - "bytemuck", - "js-sys", - "log", - "raw-window-handle", - "web-sys", -] - [[package]] name = "winapi-util" version = "0.1.11" @@ -3733,107 +1926,12 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "windows" -version = "0.62.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" -dependencies = [ - "windows-collections", - "windows-core", - "windows-future", - "windows-numerics", -] - -[[package]] -name = "windows-collections" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" -dependencies = [ - "windows-core", -] - -[[package]] -name = "windows-core" -version = "0.62.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link", - "windows-result", - "windows-strings", -] - -[[package]] -name = "windows-future" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" -dependencies = [ - "windows-core", - "windows-link", - "windows-threading", -] - -[[package]] -name = "windows-implement" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows-interface" -version = "0.59.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-numerics" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" -dependencies = [ - "windows-core", - "windows-link", -] - -[[package]] -name = "windows-result" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-strings" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" -dependencies = [ - "windows-link", -] - [[package]] name = "windows-sys" version = "0.52.0" @@ -3877,15 +1975,6 @@ dependencies = [ "windows_x86_64_msvc", ] -[[package]] -name = "windows-threading" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" -dependencies = [ - "windows-link", -] - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -3934,12 +2023,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" - [[package]] name = "wit-bindgen" version = "0.51.0" @@ -4038,18 +2121,6 @@ dependencies = [ "rustix", ] -[[package]] -name = "xml-rs" -version = "0.8.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" - -[[package]] -name = "xxhash-rust" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" - [[package]] name = "zerocopy" version = "0.8.48" diff --git a/Cargo.toml b/Cargo.toml index 43ca7658..29811f17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,8 +52,13 @@ libc = { version = "0.2.82", optional = true } matrixmultiply = { version = "0.3.2", default-features = false, features=["cgemm"] } -# blake3 — always available (integrity hashing in plane/seal/merkle_tree). -blake3 = { version = "1" } +# blake3 — gated behind `hpc-extras` (integrity hashing in +# plane/seal/merkle_tree/vsa/spo_bundle/crystal_encoder/compression_curves/ +# deepnsm). Optional + opt-in because the transitive dep `constant_time_eq` +# does not declare `#![no_std]`, so unconditionally including blake3 breaks +# the `thumbv6m-none-eabi --no-default-features` nostd build with +# `error[E0463]: can't find crate for std`. +blake3 = { version = "1", optional = true } # p64 + fractal — specialized convergence / manifold math. Gated behind # `hpc-extras` since they pull in a dep tree burn-ndarray doesn't need. @@ -146,7 +151,7 @@ rayon = ["dep:rayon", "std"] # These pull in a non-trivial dependency tree; downstream crates such as # burn-ndarray that only need the core array layer can disable this with # `default-features = false` (and re-enable `std` explicitly if needed). -hpc-extras = ["std", "dep:p64", "dep:fractal", "fractal/std"] +hpc-extras = ["std", "dep:p64", "dep:fractal", "fractal/std", "dep:blake3"] matrixmultiply-threading = ["matrixmultiply/threading"] diff --git a/src/simd.rs b/src/simd.rs index eb75bfa0..4a824c83 100644 --- a/src/simd.rs +++ b/src/simd.rs @@ -760,15 +760,14 @@ pub(crate) mod scalar { impl_float_type!(F64x8, f64, 8, F64Mask8, u8); // 256-bit AVX2 float types + // The macro `impl_float_type!` already emits `pub struct $mask(pub $mask_prim);`, + // so calling it with `F32Mask8Scalar` / `F64Mask4Scalar` defines those mask + // structs. The previous explicit re-declaration below was a duplicate that + // tripped E0428 + 6× E0119 on i686-unknown-linux-gnu (where this scalar + // module compiles — `#[cfg(not(target_arch = "x86_64"))]`). impl_float_type!(F32x8, f32, 8, F32Mask8Scalar, u8); impl_float_type!(F64x4, f64, 4, F64Mask4Scalar, u8); - // Unused mask types for AVX2 scalars (not exported, just needed by macro) - #[derive(Copy, Clone, Debug)] - pub struct F32Mask8Scalar(pub u8); - #[derive(Copy, Clone, Debug)] - pub struct F64Mask4Scalar(pub u8); - // 512-bit integer types impl_int_type!(U8x64, u8, 64, 0u8); impl_int_type!(I32x16, i32, 16, 0i32); From 6245c00e3ef15ed6d50768da4641e6503a7575bd Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 13 May 2026 07:55:22 +0000 Subject: [PATCH 4/5] fix(ci): gate AMX modules behind x86_64 + scope nostd build to -p ndarray + rustfmt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three additional CI failures surfaced by PR #141 (all pre-existing latent issues, none caused by the original migration): (1) s390x-unknown-linux-gnu cross-tests — x86-only inline asm leaks `src/hpc/amx_matmul.rs` + `src/hpc/bf16_tile_gemm.rs` (its wrapper) + `src/simd_amx.rs` all use `asm!` with `rcx` / `rax` register names. AMX is an Intel-only ISA (Sapphire Rapids+); the registers don't exist on s390x / aarch64 / wasm32 / etc. and the asm parser rejects them at compile time. Fix: gate all three module declarations behind `#[cfg(target_arch = "x86_64")]`. On x86_64 CI runners (most) they compile normally and runtime gating via `amx_available()` already prevents execution on CPUs without AMX. On non-x86 targets they're skipped entirely. External consumer audit clean — only `bf16_tile_gemm` uses `amx_matmul`, and only `amx_matmul` uses `simd_amx`. No cascade gating needed. (2) thumbv6m-none-eabi nostd — criterion dev-dep tree leaks into workspace cross-build CI runs `cargo rustc --target=thumbv6m-none-eabi --no-default-features --features portable-atomic-critical-section` from the workspace root. Without `-p ndarray` scoping, cargo evaluates the whole workspace's dep graph (including dev-deps from ndarray-rand / serialization-tests / numeric-tests). The bench migration in PR #140 added `criterion 0.5` as a dev-dep; criterion transitively pulls `serde_core` (which doesn't declare `#![no_std]`) and `getrandom` (which has its own no_std-incompatible paths) into the dep tree. The library `ndarray` itself builds cleanly on thumbv6m no-default- features (verified: `cargo check -p ndarray --target=thumbv6m-none-eabi --no-default-features --features portable-atomic-critical-section` is clean). The CI command just needs scoping. Fix: add `-p ndarray` to the cargo rustc invocation in the nostd CI job so dev-dep evaluation is limited to the library's own deps. (3) cargo fmt --all --check failures Bench files migrated to criterion in PR #140 used the workspace's prior-style "brace on next line" formatting (`fn foo(c: &mut Criterion) \n{`). Stable rustfmt 1.94.1 (pinned per CLAUDE.md) wants "brace on same line" (`fn foo(c: &mut Criterion) {`). Plus single-statement closures inlined. Fix: run `cargo fmt --all` (no manual changes needed). 13 bench files + examples/life.rs touched with mechanical formatting changes only; no semantic changes. Verification (local, 2026-05-13): - `cargo clippy --no-deps` (default) → clean - `cargo check --no-default-features --features portable-atomic-critical-section --lib` → clean - `cargo rustc -p ndarray --target=thumbv6m-none-eabi --no-default-features --features portable-atomic-critical-section` → clean (CI command as updated) - `cargo fmt --all --check` → clean Pre-existing latent bugs (amx asm registers since the module was added, criterion dev-dep regression introduced by PR #140 itself); fixes land on the same PR series that exposed them. --- .github/workflows/ci.yaml | 7 +- benches/append.rs | 12 +- benches/bench1.rs | 530 ++++++++++------------------------ benches/chunks.rs | 24 +- benches/construct.rs | 16 +- benches/gemv_gemm.rs | 18 +- benches/higher-order.rs | 33 +-- benches/iter.rs | 142 +++------ benches/par_rayon.rs | 70 ++--- benches/reserve.rs | 6 +- benches/to_shape.rs | 47 +-- benches/zip.rs | 46 +-- examples/life.rs | 5 +- ndarray-rand/benches/bench.rs | 9 +- src/hpc/mod.rs | 7 + src/lib.rs | 4 + 16 files changed, 290 insertions(+), 686 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4cde8895..ccac38f0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -107,7 +107,12 @@ jobs: - run: rustup target add ${{ matrix.target }} - name: Tests run: | - cargo rustc "--target=${{ matrix.target }}" --no-default-features --features portable-atomic-critical-section + # Scope to `-p ndarray` so workspace dev-deps (criterion → serde_core + # → getrandom) don't get evaluated against the no_std target. The + # library itself builds cleanly under no_std + portable-atomic- + # critical-section; only its dev-dependency tree pulls std-requiring + # crates that have no business existing in the nostd build. + cargo rustc -p ndarray "--target=${{ matrix.target }}" --no-default-features --features portable-atomic-critical-section tests: runs-on: ubuntu-latest diff --git a/benches/append.rs b/benches/append.rs index aecb60cf..d93e0080 100644 --- a/benches/append.rs +++ b/benches/append.rs @@ -4,26 +4,20 @@ use ndarray::prelude::*; fn select_axis0(c: &mut Criterion) { let a = Array::::zeros((256, 256)); let selectable = vec![0, 1, 2, 0, 1, 3, 0, 4, 16, 32, 128, 147, 149, 220, 221, 255, 221, 0, 1]; - c.bench_function("select_axis0", |b| { - b.iter(|| black_box(&a).select(Axis(0), black_box(&selectable))) - }); + c.bench_function("select_axis0", |b| b.iter(|| black_box(&a).select(Axis(0), black_box(&selectable)))); } fn select_axis1(c: &mut Criterion) { let a = Array::::zeros((256, 256)); let selectable = vec![0, 1, 2, 0, 1, 3, 0, 4, 16, 32, 128, 147, 149, 220, 221, 255, 221, 0, 1]; - c.bench_function("select_axis1", |b| { - b.iter(|| black_box(&a).select(Axis(1), black_box(&selectable))) - }); + c.bench_function("select_axis1", |b| b.iter(|| black_box(&a).select(Axis(1), black_box(&selectable)))); } fn select_1d(c: &mut Criterion) { let a = Array::::zeros(1024); let mut selectable = (0..a.len()).step_by(17).collect::>(); selectable.extend(selectable.clone().iter().rev()); - c.bench_function("select_1d", |b| { - b.iter(|| black_box(&a).select(Axis(0), black_box(&selectable))) - }); + c.bench_function("select_1d", |b| b.iter(|| black_box(&a).select(Axis(0), black_box(&selectable)))); } criterion_group!(benches, select_axis0, select_axis1, select_1d); diff --git a/benches/bench1.rs b/benches/bench1.rs index e06676d5..2e6c74dd 100644 --- a/benches/bench1.rs +++ b/benches/bench1.rs @@ -2,7 +2,9 @@ // indexing. Clippy can't see through the macro and reads `1..-1` as a // plain (empty) Rust range; the actual semantics are correct. #![allow(unused_imports)] -#![allow(clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::reversed_empty_ranges)] +#![allow( + clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::reversed_empty_ranges +)] use std::mem::MaybeUninit; @@ -12,8 +14,7 @@ use ndarray::{Array, Array1, Array2, Axis, Ix, Zip}; use ndarray::{Array3, Array4, ShapeBuilder}; use ndarray::{Ix1, Ix2, Ix3, Ix5, IxDyn}; -fn iter_sum_1d_regular(c: &mut Criterion) -{ +fn iter_sum_1d_regular(c: &mut Criterion) { let a = Array::::zeros(64 * 64); let a = black_box(a); c.bench_function("iter_sum_1d_regular", |bn| { @@ -27,8 +28,7 @@ fn iter_sum_1d_regular(c: &mut Criterion) }); } -fn iter_sum_1d_raw(c: &mut Criterion) -{ +fn iter_sum_1d_raw(c: &mut Criterion) { let a = Array::::zeros(64 * 64); let a = black_box(a); c.bench_function("iter_sum_1d_raw", |bn| { @@ -42,8 +42,7 @@ fn iter_sum_1d_raw(c: &mut Criterion) }); } -fn iter_sum_2d_regular(c: &mut Criterion) -{ +fn iter_sum_2d_regular(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let a = black_box(a); c.bench_function("iter_sum_2d_regular", |bn| { @@ -57,8 +56,7 @@ fn iter_sum_2d_regular(c: &mut Criterion) }); } -fn iter_sum_2d_by_row(c: &mut Criterion) -{ +fn iter_sum_2d_by_row(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let a = black_box(a); c.bench_function("iter_sum_2d_by_row", |bn| { @@ -74,8 +72,7 @@ fn iter_sum_2d_by_row(c: &mut Criterion) }); } -fn iter_sum_2d_raw(c: &mut Criterion) -{ +fn iter_sum_2d_raw(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let a = black_box(a); c.bench_function("iter_sum_2d_raw", |bn| { @@ -89,8 +86,7 @@ fn iter_sum_2d_raw(c: &mut Criterion) }); } -fn iter_sum_2d_cutout(c: &mut Criterion) -{ +fn iter_sum_2d_cutout(c: &mut Criterion) { let a = Array::::zeros((66, 66)); let av = a.slice(s![1..-1, 1..-1]); let a = black_box(av); @@ -105,8 +101,7 @@ fn iter_sum_2d_cutout(c: &mut Criterion) }); } -fn iter_sum_2d_cutout_by_row(c: &mut Criterion) -{ +fn iter_sum_2d_cutout_by_row(c: &mut Criterion) { let a = Array::::zeros((66, 66)); let av = a.slice(s![1..-1, 1..-1]); let a = black_box(av); @@ -123,8 +118,7 @@ fn iter_sum_2d_cutout_by_row(c: &mut Criterion) }); } -fn iter_sum_2d_cutout_outer_iter(c: &mut Criterion) -{ +fn iter_sum_2d_cutout_outer_iter(c: &mut Criterion) { let a = Array::::zeros((66, 66)); let av = a.slice(s![1..-1, 1..-1]); let a = black_box(av); @@ -141,8 +135,7 @@ fn iter_sum_2d_cutout_outer_iter(c: &mut Criterion) }); } -fn iter_sum_2d_transpose_regular(c: &mut Criterion) -{ +fn iter_sum_2d_transpose_regular(c: &mut Criterion) { let mut a = Array::::zeros((64, 64)); a.swap_axes(0, 1); let a = black_box(a); @@ -157,8 +150,7 @@ fn iter_sum_2d_transpose_regular(c: &mut Criterion) }); } -fn iter_sum_2d_transpose_by_row(c: &mut Criterion) -{ +fn iter_sum_2d_transpose_by_row(c: &mut Criterion) { let mut a = Array::::zeros((64, 64)); a.swap_axes(0, 1); let a = black_box(a); @@ -175,96 +167,75 @@ fn iter_sum_2d_transpose_by_row(c: &mut Criterion) }); } -fn sum_2d_regular(c: &mut Criterion) -{ +fn sum_2d_regular(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let a = black_box(a); c.bench_function("sum_2d_regular", |bn| bn.iter(|| a.sum())); } -fn sum_2d_cutout(c: &mut Criterion) -{ +fn sum_2d_cutout(c: &mut Criterion) { let a = Array::::zeros((66, 66)); let av = a.slice(s![1..-1, 1..-1]); let a = black_box(av); c.bench_function("sum_2d_cutout", |bn| bn.iter(|| a.sum())); } -fn sum_2d_float(c: &mut Criterion) -{ +fn sum_2d_float(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let a = black_box(a.view()); c.bench_function("sum_2d_float", |bn| bn.iter(|| a.sum())); } -fn sum_2d_float_cutout(c: &mut Criterion) -{ +fn sum_2d_float_cutout(c: &mut Criterion) { let a = Array::::zeros((66, 66)); let av = a.slice(s![1..-1, 1..-1]); let a = black_box(av); c.bench_function("sum_2d_float_cutout", |bn| bn.iter(|| a.sum())); } -fn sum_2d_float_t_cutout(c: &mut Criterion) -{ +fn sum_2d_float_t_cutout(c: &mut Criterion) { let a = Array::::zeros((66, 66)); let av = a.slice(s![1..-1, 1..-1]).reversed_axes(); let a = black_box(av); c.bench_function("sum_2d_float_t_cutout", |bn| bn.iter(|| a.sum())); } -fn fold_sum_i32_2d_regular(c: &mut Criterion) -{ +fn fold_sum_i32_2d_regular(c: &mut Criterion) { let a = Array::::zeros((64, 64)); - c.bench_function("fold_sum_i32_2d_regular", |bn| { - bn.iter(|| a.fold(0, |acc, &x| acc + x)) - }); + c.bench_function("fold_sum_i32_2d_regular", |bn| bn.iter(|| a.fold(0, |acc, &x| acc + x))); } -fn fold_sum_i32_2d_cutout(c: &mut Criterion) -{ +fn fold_sum_i32_2d_cutout(c: &mut Criterion) { let a = Array::::zeros((66, 66)); let av = a.slice(s![1..-1, 1..-1]); let a = black_box(av); - c.bench_function("fold_sum_i32_2d_cutout", |bn| { - bn.iter(|| a.fold(0, |acc, &x| acc + x)) - }); + c.bench_function("fold_sum_i32_2d_cutout", |bn| bn.iter(|| a.fold(0, |acc, &x| acc + x))); } -fn fold_sum_i32_2d_stride(c: &mut Criterion) -{ +fn fold_sum_i32_2d_stride(c: &mut Criterion) { let a = Array::::zeros((64, 128)); let av = a.slice(s![.., ..;2]); let a = black_box(av); - c.bench_function("fold_sum_i32_2d_stride", |bn| { - bn.iter(|| a.fold(0, |acc, &x| acc + x)) - }); + c.bench_function("fold_sum_i32_2d_stride", |bn| bn.iter(|| a.fold(0, |acc, &x| acc + x))); } -fn fold_sum_i32_2d_transpose(c: &mut Criterion) -{ +fn fold_sum_i32_2d_transpose(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let a = a.t(); - c.bench_function("fold_sum_i32_2d_transpose", |bn| { - bn.iter(|| a.fold(0, |acc, &x| acc + x)) - }); + c.bench_function("fold_sum_i32_2d_transpose", |bn| bn.iter(|| a.fold(0, |acc, &x| acc + x))); } -fn fold_sum_i32_2d_cutout_transpose(c: &mut Criterion) -{ +fn fold_sum_i32_2d_cutout_transpose(c: &mut Criterion) { let a = Array::::zeros((66, 66)); let mut av = a.slice(s![1..-1, 1..-1]); av.swap_axes(0, 1); let a = black_box(av); - c.bench_function("fold_sum_i32_2d_cutout_transpose", |bn| { - bn.iter(|| a.fold(0, |acc, &x| acc + x)) - }); + c.bench_function("fold_sum_i32_2d_cutout_transpose", |bn| bn.iter(|| a.fold(0, |acc, &x| acc + x))); } const ADD2DSZ: usize = 64; -fn add_2d_regular(c: &mut Criterion) -{ +fn add_2d_regular(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ)); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); let bv = b.view(); @@ -275,8 +246,7 @@ fn add_2d_regular(c: &mut Criterion) }); } -fn add_2d_zip(c: &mut Criterion) -{ +fn add_2d_zip(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ)); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); c.bench_function("add_2d_zip", |bn| { @@ -286,15 +256,13 @@ fn add_2d_zip(c: &mut Criterion) }); } -fn add_2d_alloc_plus(c: &mut Criterion) -{ +fn add_2d_alloc_plus(c: &mut Criterion) { let a = Array::::zeros((ADD2DSZ, ADD2DSZ)); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); c.bench_function("add_2d_alloc_plus", |bn| bn.iter(|| &a + &b)); } -fn add_2d_alloc_zip_uninit(c: &mut Criterion) -{ +fn add_2d_alloc_zip_uninit(c: &mut Criterion) { let a = Array::::zeros((ADD2DSZ, ADD2DSZ)); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); c.bench_function("add_2d_alloc_zip_uninit", |bn| { @@ -308,49 +276,33 @@ fn add_2d_alloc_zip_uninit(c: &mut Criterion) }); } -fn add_2d_alloc_zip_collect(c: &mut Criterion) -{ +fn add_2d_alloc_zip_collect(c: &mut Criterion) { let a = Array::::zeros((ADD2DSZ, ADD2DSZ)); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); - c.bench_function("add_2d_alloc_zip_collect", |bn| { - bn.iter(|| Zip::from(&a).and(&b).map_collect(|&x, &y| x + y)) - }); + c.bench_function("add_2d_alloc_zip_collect", |bn| bn.iter(|| Zip::from(&a).and(&b).map_collect(|&x, &y| x + y))); } -fn vec_string_collect(c: &mut Criterion) -{ +fn vec_string_collect(c: &mut Criterion) { let v = vec![""; 10240]; - c.bench_function("vec_string_collect", |bn| { - bn.iter(|| v.iter().map(|s| s.to_owned()).collect::>()) - }); + c.bench_function("vec_string_collect", |bn| bn.iter(|| v.iter().map(|s| s.to_owned()).collect::>())); } -fn array_string_collect(c: &mut Criterion) -{ +fn array_string_collect(c: &mut Criterion) { let v = Array::from(vec![""; 10240]); - c.bench_function("array_string_collect", |bn| { - bn.iter(|| Zip::from(&v).map_collect(|s| s.to_owned())) - }); + c.bench_function("array_string_collect", |bn| bn.iter(|| Zip::from(&v).map_collect(|s| s.to_owned()))); } -fn vec_f64_collect(c: &mut Criterion) -{ +fn vec_f64_collect(c: &mut Criterion) { let v = vec![1.; 10240]; - c.bench_function("vec_f64_collect", |bn| { - bn.iter(|| v.iter().map(|s| s + 1.).collect::>()) - }); + c.bench_function("vec_f64_collect", |bn| bn.iter(|| v.iter().map(|s| s + 1.).collect::>())); } -fn array_f64_collect(c: &mut Criterion) -{ +fn array_f64_collect(c: &mut Criterion) { let v = Array::from(vec![1.; 10240]); - c.bench_function("array_f64_collect", |bn| { - bn.iter(|| Zip::from(&v).map_collect(|s| s + 1.)) - }); + c.bench_function("array_f64_collect", |bn| bn.iter(|| Zip::from(&v).map_collect(|s| s + 1.))); } -fn add_2d_assign_ops(c: &mut Criterion) -{ +fn add_2d_assign_ops(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ)); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); let bv = b.view(); @@ -363,8 +315,7 @@ fn add_2d_assign_ops(c: &mut Criterion) }); } -fn add_2d_cutout(c: &mut Criterion) -{ +fn add_2d_cutout(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ + 2, ADD2DSZ + 2)); let mut acut = a.slice_mut(s![1..-1, 1..-1]); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); @@ -376,8 +327,7 @@ fn add_2d_cutout(c: &mut Criterion) }); } -fn add_2d_zip_cutout(c: &mut Criterion) -{ +fn add_2d_zip_cutout(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ + 2, ADD2DSZ + 2)); let mut acut = a.slice_mut(s![1..-1, 1..-1]); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); @@ -389,8 +339,7 @@ fn add_2d_zip_cutout(c: &mut Criterion) } #[allow(clippy::identity_op)] -fn add_2d_cutouts_by_4(c: &mut Criterion) -{ +fn add_2d_cutouts_by_4(c: &mut Criterion) { let mut a = Array::::zeros((64 * 1, 64 * 1)); let b = Array::::zeros((64 * 1, 64 * 1)); let chunksz = (4, 4); @@ -404,8 +353,7 @@ fn add_2d_cutouts_by_4(c: &mut Criterion) } #[allow(clippy::identity_op)] -fn add_2d_cutouts_by_16(c: &mut Criterion) -{ +fn add_2d_cutouts_by_16(c: &mut Criterion) { let mut a = Array::::zeros((64 * 1, 64 * 1)); let b = Array::::zeros((64 * 1, 64 * 1)); let chunksz = (16, 16); @@ -419,8 +367,7 @@ fn add_2d_cutouts_by_16(c: &mut Criterion) } #[allow(clippy::identity_op)] -fn add_2d_cutouts_by_32(c: &mut Criterion) -{ +fn add_2d_cutouts_by_32(c: &mut Criterion) { let mut a = Array::::zeros((64 * 1, 64 * 1)); let b = Array::::zeros((64 * 1, 64 * 1)); let chunksz = (32, 32); @@ -433,8 +380,7 @@ fn add_2d_cutouts_by_32(c: &mut Criterion) }); } -fn add_2d_broadcast_1_to_2(c: &mut Criterion) -{ +fn add_2d_broadcast_1_to_2(c: &mut Criterion) { let mut a = Array2::::zeros((ADD2DSZ, ADD2DSZ)); let b = Array1::::zeros(ADD2DSZ); let bv = b.view(); @@ -445,8 +391,7 @@ fn add_2d_broadcast_1_to_2(c: &mut Criterion) }); } -fn add_2d_broadcast_0_to_2(c: &mut Criterion) -{ +fn add_2d_broadcast_0_to_2(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ)); let b = Array::::zeros(()); let bv = b.view(); @@ -457,56 +402,48 @@ fn add_2d_broadcast_0_to_2(c: &mut Criterion) }); } -fn scalar_toowned(c: &mut Criterion) -{ +fn scalar_toowned(c: &mut Criterion) { let a = Array::::zeros((64, 64)); c.bench_function("scalar_toowned", |bn| bn.iter(|| a.to_owned())); } -fn scalar_add_1(c: &mut Criterion) -{ +fn scalar_add_1(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let n = 1.; c.bench_function("scalar_add_1", |bn| bn.iter(|| &a + n)); } -fn scalar_add_2(c: &mut Criterion) -{ +fn scalar_add_2(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let n = 1.; c.bench_function("scalar_add_2", |bn| bn.iter(|| n + &a)); } -fn scalar_add_strided_1(c: &mut Criterion) -{ +fn scalar_add_strided_1(c: &mut Criterion) { let a = Array::from_shape_fn((64, 64 * 2), |(i, j)| (i * 64 + j) as f32).slice_move(s![.., ..;2]); let n = 1.; c.bench_function("scalar_add_strided_1", |bn| bn.iter(|| &a + n)); } -fn scalar_add_strided_2(c: &mut Criterion) -{ +fn scalar_add_strided_2(c: &mut Criterion) { let a = Array::from_shape_fn((64, 64 * 2), |(i, j)| (i * 64 + j) as f32).slice_move(s![.., ..;2]); let n = 1.; c.bench_function("scalar_add_strided_2", |bn| bn.iter(|| n + &a)); } -fn scalar_sub_1(c: &mut Criterion) -{ +fn scalar_sub_1(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let n = 1.; c.bench_function("scalar_sub_1", |bn| bn.iter(|| &a - n)); } -fn scalar_sub_2(c: &mut Criterion) -{ +fn scalar_sub_2(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let n = 1.; c.bench_function("scalar_sub_2", |bn| bn.iter(|| n - &a)); } -fn add_2d_0_to_2_iadd_scalar(c: &mut Criterion) -{ +fn add_2d_0_to_2_iadd_scalar(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ)); let n = black_box(0); c.bench_function("add_2d_0_to_2_iadd_scalar", |bn| { @@ -516,8 +453,7 @@ fn add_2d_0_to_2_iadd_scalar(c: &mut Criterion) }); } -fn add_2d_strided(c: &mut Criterion) -{ +fn add_2d_strided(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ * 2)); let mut a = a.slice_mut(s![.., ..;2]); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); @@ -529,8 +465,7 @@ fn add_2d_strided(c: &mut Criterion) }); } -fn add_2d_regular_dyn(c: &mut Criterion) -{ +fn add_2d_regular_dyn(c: &mut Criterion) { let mut a = Array::::zeros(&[ADD2DSZ, ADD2DSZ][..]); let b = Array::::zeros(&[ADD2DSZ, ADD2DSZ][..]); let bv = b.view(); @@ -541,8 +476,7 @@ fn add_2d_regular_dyn(c: &mut Criterion) }); } -fn add_2d_strided_dyn(c: &mut Criterion) -{ +fn add_2d_strided_dyn(c: &mut Criterion) { let mut a = Array::::zeros(&[ADD2DSZ, ADD2DSZ * 2][..]); let mut a = a.slice_mut(s![.., ..;2]); let b = Array::::zeros(&[ADD2DSZ, ADD2DSZ][..]); @@ -554,8 +488,7 @@ fn add_2d_strided_dyn(c: &mut Criterion) }); } -fn add_2d_zip_strided(c: &mut Criterion) -{ +fn add_2d_zip_strided(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ * 2)); let mut a = a.slice_mut(s![.., ..;2]); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); @@ -566,8 +499,7 @@ fn add_2d_zip_strided(c: &mut Criterion) }); } -fn add_2d_one_transposed(c: &mut Criterion) -{ +fn add_2d_one_transposed(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ)); a.swap_axes(0, 1); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); @@ -578,8 +510,7 @@ fn add_2d_one_transposed(c: &mut Criterion) }); } -fn add_2d_zip_one_transposed(c: &mut Criterion) -{ +fn add_2d_zip_one_transposed(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ)); a.swap_axes(0, 1); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); @@ -590,8 +521,7 @@ fn add_2d_zip_one_transposed(c: &mut Criterion) }); } -fn add_2d_both_transposed(c: &mut Criterion) -{ +fn add_2d_both_transposed(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ)); a.swap_axes(0, 1); let mut b = Array::::zeros((ADD2DSZ, ADD2DSZ)); @@ -603,8 +533,7 @@ fn add_2d_both_transposed(c: &mut Criterion) }); } -fn add_2d_zip_both_transposed(c: &mut Criterion) -{ +fn add_2d_zip_both_transposed(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ)); a.swap_axes(0, 1); let mut b = Array::::zeros((ADD2DSZ, ADD2DSZ)); @@ -616,8 +545,7 @@ fn add_2d_zip_both_transposed(c: &mut Criterion) }); } -fn add_2d_f32_regular(c: &mut Criterion) -{ +fn add_2d_f32_regular(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ)); let b = Array::::zeros((ADD2DSZ, ADD2DSZ)); let bv = b.view(); @@ -630,8 +558,7 @@ fn add_2d_f32_regular(c: &mut Criterion) const ADD3DSZ: usize = 16; -fn add_3d_strided(c: &mut Criterion) -{ +fn add_3d_strided(c: &mut Criterion) { let mut a = Array::::zeros((ADD3DSZ, ADD3DSZ, ADD3DSZ * 2)); let mut a = a.slice_mut(s![.., .., ..;2]); let b = Array::::zeros(a.dim()); @@ -643,8 +570,7 @@ fn add_3d_strided(c: &mut Criterion) }); } -fn add_3d_strided_dyn(c: &mut Criterion) -{ +fn add_3d_strided_dyn(c: &mut Criterion) { let mut a = Array::::zeros(&[ADD3DSZ, ADD3DSZ, ADD3DSZ * 2][..]); let mut a = a.slice_mut(s![.., .., ..;2]); let b = Array::::zeros(a.dim()); @@ -658,8 +584,7 @@ fn add_3d_strided_dyn(c: &mut Criterion) const ADD1D_SIZE: usize = 64 * 64; -fn add_1d_regular(c: &mut Criterion) -{ +fn add_1d_regular(c: &mut Criterion) { let mut a = Array::::zeros(ADD1D_SIZE); let b = Array::::zeros(a.dim()); c.bench_function("add_1d_regular", |bn| { @@ -669,8 +594,7 @@ fn add_1d_regular(c: &mut Criterion) }); } -fn add_1d_strided(c: &mut Criterion) -{ +fn add_1d_strided(c: &mut Criterion) { let mut a = Array::::zeros(ADD1D_SIZE * 2); let mut av = a.slice_mut(s![..;2]); let b = Array::::zeros(av.dim()); @@ -681,8 +605,7 @@ fn add_1d_strided(c: &mut Criterion) }); } -fn iadd_scalar_2d_regular(c: &mut Criterion) -{ +fn iadd_scalar_2d_regular(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ)); c.bench_function("iadd_scalar_2d_regular", |bn| { bn.iter(|| { @@ -691,8 +614,7 @@ fn iadd_scalar_2d_regular(c: &mut Criterion) }); } -fn iadd_scalar_2d_strided(c: &mut Criterion) -{ +fn iadd_scalar_2d_strided(c: &mut Criterion) { let mut a = Array::::zeros((ADD2DSZ, ADD2DSZ * 2)); let mut a = a.slice_mut(s![.., ..;2]); c.bench_function("iadd_scalar_2d_strided", |bn| { @@ -702,8 +624,7 @@ fn iadd_scalar_2d_strided(c: &mut Criterion) }); } -fn iadd_scalar_2d_regular_dyn(c: &mut Criterion) -{ +fn iadd_scalar_2d_regular_dyn(c: &mut Criterion) { let mut a = Array::::zeros(vec![ADD2DSZ, ADD2DSZ]); c.bench_function("iadd_scalar_2d_regular_dyn", |bn| { bn.iter(|| { @@ -712,8 +633,7 @@ fn iadd_scalar_2d_regular_dyn(c: &mut Criterion) }); } -fn iadd_scalar_2d_strided_dyn(c: &mut Criterion) -{ +fn iadd_scalar_2d_strided_dyn(c: &mut Criterion) { let mut a = Array::::zeros(vec![ADD2DSZ, ADD2DSZ * 2]); let mut a = a.slice_mut(s![.., ..;2]); c.bench_function("iadd_scalar_2d_strided_dyn", |bn| { @@ -723,8 +643,7 @@ fn iadd_scalar_2d_strided_dyn(c: &mut Criterion) }); } -fn scaled_add_2d_f32_regular(c: &mut Criterion) -{ +fn scaled_add_2d_f32_regular(c: &mut Criterion) { let mut av = Array::::zeros((ADD2DSZ, ADD2DSZ)); let bv = Array::::zeros((ADD2DSZ, ADD2DSZ)); let scalar = std::f32::consts::PI; @@ -735,16 +654,14 @@ fn scaled_add_2d_f32_regular(c: &mut Criterion) }); } -fn assign_scalar_2d_corder(c: &mut Criterion) -{ +fn assign_scalar_2d_corder(c: &mut Criterion) { let a = Array::zeros((ADD2DSZ, ADD2DSZ)); let mut a = black_box(a); let s = 3.; c.bench_function("assign_scalar_2d_corder", |bn| bn.iter(|| a.fill(s))); } -fn assign_scalar_2d_cutout(c: &mut Criterion) -{ +fn assign_scalar_2d_cutout(c: &mut Criterion) { let mut a = Array::zeros((66, 66)); let a = a.slice_mut(s![1..-1, 1..-1]); let mut a = black_box(a); @@ -752,8 +669,7 @@ fn assign_scalar_2d_cutout(c: &mut Criterion) c.bench_function("assign_scalar_2d_cutout", |bn| bn.iter(|| a.fill(s))); } -fn assign_scalar_2d_forder(c: &mut Criterion) -{ +fn assign_scalar_2d_forder(c: &mut Criterion) { let mut a = Array::zeros((ADD2DSZ, ADD2DSZ)); a.swap_axes(0, 1); let mut a = black_box(a); @@ -761,31 +677,27 @@ fn assign_scalar_2d_forder(c: &mut Criterion) c.bench_function("assign_scalar_2d_forder", |bn| bn.iter(|| a.fill(s))); } -fn assign_zero_2d_corder(c: &mut Criterion) -{ +fn assign_zero_2d_corder(c: &mut Criterion) { let a = Array::zeros((ADD2DSZ, ADD2DSZ)); let mut a = black_box(a); c.bench_function("assign_zero_2d_corder", |bn| bn.iter(|| a.fill(0.))); } -fn assign_zero_2d_cutout(c: &mut Criterion) -{ +fn assign_zero_2d_cutout(c: &mut Criterion) { let mut a = Array::zeros((66, 66)); let a = a.slice_mut(s![1..-1, 1..-1]); let mut a = black_box(a); c.bench_function("assign_zero_2d_cutout", |bn| bn.iter(|| a.fill(0.))); } -fn assign_zero_2d_forder(c: &mut Criterion) -{ +fn assign_zero_2d_forder(c: &mut Criterion) { let mut a = Array::zeros((ADD2DSZ, ADD2DSZ)); a.swap_axes(0, 1); let mut a = black_box(a); c.bench_function("assign_zero_2d_forder", |bn| bn.iter(|| a.fill(0.))); } -fn bench_iter_diag(c: &mut Criterion) -{ +fn bench_iter_diag(c: &mut Criterion) { let a = Array::::zeros((1024, 1024)); c.bench_function("bench_iter_diag", |bn| { bn.iter(|| { @@ -796,8 +708,7 @@ fn bench_iter_diag(c: &mut Criterion) }); } -fn bench_row_iter(c: &mut Criterion) -{ +fn bench_row_iter(c: &mut Criterion) { let a = Array::::zeros((1024, 1024)); let it = a.row(17); c.bench_function("bench_row_iter", |bn| { @@ -809,8 +720,7 @@ fn bench_row_iter(c: &mut Criterion) }); } -fn bench_col_iter(c: &mut Criterion) -{ +fn bench_col_iter(c: &mut Criterion) { let a = Array::::zeros((1024, 1024)); let it = a.column(17); c.bench_function("bench_col_iter", |bn| { @@ -883,8 +793,7 @@ mat_mul! {mat_mul_i32, i32, (m127, 127, 127, 127) } -fn create_iter_4d(c: &mut Criterion) -{ +fn create_iter_4d(c: &mut Criterion) { let mut a = Array::from_elem((4, 5, 3, 2), 1.0); a.swap_axes(0, 1); a.swap_axes(2, 1); @@ -893,92 +802,79 @@ fn create_iter_4d(c: &mut Criterion) c.bench_function("create_iter_4d", |bn| bn.iter(|| v.into_iter())); } -fn bench_to_owned_n(c: &mut Criterion) -{ +fn bench_to_owned_n(c: &mut Criterion) { let a = Array::::zeros((32, 32)); c.bench_function("bench_to_owned_n", |bn| bn.iter(|| a.to_owned())); } -fn bench_to_owned_t(c: &mut Criterion) -{ +fn bench_to_owned_t(c: &mut Criterion) { let mut a = Array::::zeros((32, 32)); a.swap_axes(0, 1); c.bench_function("bench_to_owned_t", |bn| bn.iter(|| a.to_owned())); } -fn bench_to_owned_strided(c: &mut Criterion) -{ +fn bench_to_owned_strided(c: &mut Criterion) { let a = Array::::zeros((32, 64)); let a = a.slice(s![.., ..;2]); c.bench_function("bench_to_owned_strided", |bn| bn.iter(|| a.to_owned())); } -fn equality_i32(c: &mut Criterion) -{ +fn equality_i32(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let b = Array::::zeros((64, 64)); c.bench_function("equality_i32", |bn| bn.iter(|| a == b)); } -fn equality_f32(c: &mut Criterion) -{ +fn equality_f32(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let b = Array::::zeros((64, 64)); c.bench_function("equality_f32", |bn| bn.iter(|| a == b)); } -fn equality_f32_mixorder(c: &mut Criterion) -{ +fn equality_f32_mixorder(c: &mut Criterion) { let a = Array::::zeros((64, 64)); let b = Array::::zeros((64, 64).f()); c.bench_function("equality_f32_mixorder", |bn| bn.iter(|| a == b)); } -fn dot_f32_16(c: &mut Criterion) -{ +fn dot_f32_16(c: &mut Criterion) { let a = Array::::zeros(16); let b = Array::::zeros(16); c.bench_function("dot_f32_16", |bn| bn.iter(|| a.dot(&b))); } -fn dot_f32_20(c: &mut Criterion) -{ +fn dot_f32_20(c: &mut Criterion) { let a = Array::::zeros(20); let b = Array::::zeros(20); c.bench_function("dot_f32_20", |bn| bn.iter(|| a.dot(&b))); } -fn dot_f32_32(c: &mut Criterion) -{ +fn dot_f32_32(c: &mut Criterion) { let a = Array::::zeros(32); let b = Array::::zeros(32); c.bench_function("dot_f32_32", |bn| bn.iter(|| a.dot(&b))); } -fn dot_f32_256(c: &mut Criterion) -{ +fn dot_f32_256(c: &mut Criterion) { let a = Array::::zeros(256); let b = Array::::zeros(256); c.bench_function("dot_f32_256", |bn| bn.iter(|| a.dot(&b))); } -fn dot_f32_1024(c: &mut Criterion) -{ +fn dot_f32_1024(c: &mut Criterion) { let av = Array::::zeros(1024); let bv = Array::::zeros(1024); c.bench_function("dot_f32_1024", |bn| bn.iter(|| av.dot(&bv))); } -fn dot_f32_10e6(c: &mut Criterion) -{ +fn dot_f32_10e6(c: &mut Criterion) { let n = 1_000_000; let av = Array::::zeros(n); let bv = Array::::zeros(n); c.bench_function("dot_f32_10e6", |bn| bn.iter(|| av.dot(&bv))); } -fn dot_extended(c: &mut Criterion) -{ +fn dot_extended(c: &mut Criterion) { let m = 10; let n = 33; let k = 10; @@ -1001,8 +897,7 @@ fn dot_extended(c: &mut Criterion) const MEAN_SUM_N: usize = 127; #[cfg(feature = "std")] -fn range_mat(m: Ix, n: Ix) -> Array2 -{ +fn range_mat(m: Ix, n: Ix) -> Array2 { assert!(m * n != 0); Array::linspace(0.0..=(m * n - 1) as f32, m * n) .into_shape_with_order((m, n)) @@ -1010,101 +905,78 @@ fn range_mat(m: Ix, n: Ix) -> Array2 } #[cfg(feature = "std")] -fn mean_axis0(c: &mut Criterion) -{ +fn mean_axis0(c: &mut Criterion) { let a = range_mat(MEAN_SUM_N, MEAN_SUM_N); c.bench_function("mean_axis0", |bn| bn.iter(|| a.mean_axis(Axis(0)))); } #[cfg(feature = "std")] -fn mean_axis1(c: &mut Criterion) -{ +fn mean_axis1(c: &mut Criterion) { let a = range_mat(MEAN_SUM_N, MEAN_SUM_N); c.bench_function("mean_axis1", |bn| bn.iter(|| a.mean_axis(Axis(1)))); } #[cfg(feature = "std")] -fn sum_axis0(c: &mut Criterion) -{ +fn sum_axis0(c: &mut Criterion) { let a = range_mat(MEAN_SUM_N, MEAN_SUM_N); c.bench_function("sum_axis0", |bn| bn.iter(|| a.sum_axis(Axis(0)))); } #[cfg(feature = "std")] -fn sum_axis1(c: &mut Criterion) -{ +fn sum_axis1(c: &mut Criterion) { let a = range_mat(MEAN_SUM_N, MEAN_SUM_N); c.bench_function("sum_axis1", |bn| bn.iter(|| a.sum_axis(Axis(1)))); } -fn into_dimensionality_ix1_ok(c: &mut Criterion) -{ +fn into_dimensionality_ix1_ok(c: &mut Criterion) { let a = Array::::zeros(Ix1(10)); let a = a.view(); - c.bench_function("into_dimensionality_ix1_ok", |bn| { - bn.iter(|| a.into_dimensionality::()) - }); + c.bench_function("into_dimensionality_ix1_ok", |bn| bn.iter(|| a.into_dimensionality::())); } -fn into_dimensionality_ix3_ok(c: &mut Criterion) -{ +fn into_dimensionality_ix3_ok(c: &mut Criterion) { let a = Array::::zeros(Ix3(10, 10, 10)); let a = a.view(); - c.bench_function("into_dimensionality_ix3_ok", |bn| { - bn.iter(|| a.into_dimensionality::()) - }); + c.bench_function("into_dimensionality_ix3_ok", |bn| bn.iter(|| a.into_dimensionality::())); } -fn into_dimensionality_ix3_err(c: &mut Criterion) -{ +fn into_dimensionality_ix3_err(c: &mut Criterion) { let a = Array::::zeros(Ix3(10, 10, 10)); let a = a.view(); - c.bench_function("into_dimensionality_ix3_err", |bn| { - bn.iter(|| a.into_dimensionality::()) - }); + c.bench_function("into_dimensionality_ix3_err", |bn| bn.iter(|| a.into_dimensionality::())); } -fn into_dimensionality_dyn_to_ix3(c: &mut Criterion) -{ +fn into_dimensionality_dyn_to_ix3(c: &mut Criterion) { let a = Array::::zeros(IxDyn(&[10, 10, 10])); let a = a.view(); - c.bench_function("into_dimensionality_dyn_to_ix3", |bn| { - bn.iter(|| a.clone().into_dimensionality::()) - }); + c.bench_function("into_dimensionality_dyn_to_ix3", |bn| bn.iter(|| a.clone().into_dimensionality::())); } -fn into_dimensionality_dyn_to_dyn(c: &mut Criterion) -{ +fn into_dimensionality_dyn_to_dyn(c: &mut Criterion) { let a = Array::::zeros(IxDyn(&[10, 10, 10])); let a = a.view(); - c.bench_function("into_dimensionality_dyn_to_dyn", |bn| { - bn.iter(|| a.clone().into_dimensionality::()) - }); + c.bench_function("into_dimensionality_dyn_to_dyn", |bn| bn.iter(|| a.clone().into_dimensionality::())); } -fn into_dyn_ix3(c: &mut Criterion) -{ +fn into_dyn_ix3(c: &mut Criterion) { let a = Array::::zeros(Ix3(10, 10, 10)); let a = a.view(); c.bench_function("into_dyn_ix3", |bn| bn.iter(|| a.into_dyn())); } -fn into_dyn_ix5(c: &mut Criterion) -{ +fn into_dyn_ix5(c: &mut Criterion) { let a = Array::::zeros(Ix5(2, 2, 2, 2, 2)); let a = a.view(); c.bench_function("into_dyn_ix5", |bn| bn.iter(|| a.into_dyn())); } -fn into_dyn_dyn(c: &mut Criterion) -{ +fn into_dyn_dyn(c: &mut Criterion) { let a = Array::::zeros(IxDyn(&[10, 10, 10])); let a = a.view(); c.bench_function("into_dyn_dyn", |bn| bn.iter(|| a.clone().into_dyn())); } -fn broadcast_same_dim(c: &mut Criterion) -{ +fn broadcast_same_dim(c: &mut Criterion) { let s = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; let s = Array4::from_shape_vec((2, 2, 3, 2), s.to_vec()).unwrap(); let a = s.slice(s![.., ..;-1, ..;2, ..]); @@ -1112,8 +984,7 @@ fn broadcast_same_dim(c: &mut Criterion) c.bench_function("broadcast_same_dim", |bn| bn.iter(|| &a + &b)); } -fn broadcast_one_side(c: &mut Criterion) -{ +fn broadcast_one_side(c: &mut Criterion) { let s = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; let s2 = [1, 2, 3, 4, 5, 6]; let a = Array4::from_shape_vec((4, 1, 3, 2), s.to_vec()).unwrap(); @@ -1122,178 +993,69 @@ fn broadcast_one_side(c: &mut Criterion) } criterion_group!( - iter_benches, - iter_sum_1d_regular, - iter_sum_1d_raw, - iter_sum_2d_regular, - iter_sum_2d_by_row, - iter_sum_2d_raw, - iter_sum_2d_cutout, - iter_sum_2d_cutout_by_row, - iter_sum_2d_cutout_outer_iter, - iter_sum_2d_transpose_regular, + iter_benches, iter_sum_1d_regular, iter_sum_1d_raw, iter_sum_2d_regular, iter_sum_2d_by_row, iter_sum_2d_raw, + iter_sum_2d_cutout, iter_sum_2d_cutout_by_row, iter_sum_2d_cutout_outer_iter, iter_sum_2d_transpose_regular, iter_sum_2d_transpose_by_row, ); criterion_group!( - sum_benches, - sum_2d_regular, - sum_2d_cutout, - sum_2d_float, - sum_2d_float_cutout, - sum_2d_float_t_cutout, - fold_sum_i32_2d_regular, - fold_sum_i32_2d_cutout, - fold_sum_i32_2d_stride, - fold_sum_i32_2d_transpose, + sum_benches, sum_2d_regular, sum_2d_cutout, sum_2d_float, sum_2d_float_cutout, sum_2d_float_t_cutout, + fold_sum_i32_2d_regular, fold_sum_i32_2d_cutout, fold_sum_i32_2d_stride, fold_sum_i32_2d_transpose, fold_sum_i32_2d_cutout_transpose, ); criterion_group!( - add_benches, - add_2d_regular, - add_2d_zip, - add_2d_alloc_plus, - add_2d_alloc_zip_uninit, - add_2d_alloc_zip_collect, - vec_string_collect, - array_string_collect, - vec_f64_collect, - array_f64_collect, - add_2d_assign_ops, - add_2d_cutout, - add_2d_zip_cutout, - add_2d_cutouts_by_4, - add_2d_cutouts_by_16, - add_2d_cutouts_by_32, - add_2d_broadcast_1_to_2, + add_benches, add_2d_regular, add_2d_zip, add_2d_alloc_plus, add_2d_alloc_zip_uninit, add_2d_alloc_zip_collect, + vec_string_collect, array_string_collect, vec_f64_collect, array_f64_collect, add_2d_assign_ops, add_2d_cutout, + add_2d_zip_cutout, add_2d_cutouts_by_4, add_2d_cutouts_by_16, add_2d_cutouts_by_32, add_2d_broadcast_1_to_2, add_2d_broadcast_0_to_2, ); criterion_group!( - scalar_benches, - scalar_toowned, - scalar_add_1, - scalar_add_2, - scalar_add_strided_1, - scalar_add_strided_2, - scalar_sub_1, - scalar_sub_2, - add_2d_0_to_2_iadd_scalar, + scalar_benches, scalar_toowned, scalar_add_1, scalar_add_2, scalar_add_strided_1, scalar_add_strided_2, + scalar_sub_1, scalar_sub_2, add_2d_0_to_2_iadd_scalar, ); criterion_group!( - add_strided_benches, - add_2d_strided, - add_2d_regular_dyn, - add_2d_strided_dyn, - add_2d_zip_strided, - add_2d_one_transposed, - add_2d_zip_one_transposed, - add_2d_both_transposed, - add_2d_zip_both_transposed, - add_2d_f32_regular, - add_3d_strided, - add_3d_strided_dyn, - add_1d_regular, - add_1d_strided, + add_strided_benches, add_2d_strided, add_2d_regular_dyn, add_2d_strided_dyn, add_2d_zip_strided, + add_2d_one_transposed, add_2d_zip_one_transposed, add_2d_both_transposed, add_2d_zip_both_transposed, + add_2d_f32_regular, add_3d_strided, add_3d_strided_dyn, add_1d_regular, add_1d_strided, ); criterion_group!( - iadd_scalar_benches, - iadd_scalar_2d_regular, - iadd_scalar_2d_strided, - iadd_scalar_2d_regular_dyn, - iadd_scalar_2d_strided_dyn, - scaled_add_2d_f32_regular, - assign_scalar_2d_corder, - assign_scalar_2d_cutout, - assign_scalar_2d_forder, - assign_zero_2d_corder, - assign_zero_2d_cutout, - assign_zero_2d_forder, + iadd_scalar_benches, iadd_scalar_2d_regular, iadd_scalar_2d_strided, iadd_scalar_2d_regular_dyn, + iadd_scalar_2d_strided_dyn, scaled_add_2d_f32_regular, assign_scalar_2d_corder, assign_scalar_2d_cutout, + assign_scalar_2d_forder, assign_zero_2d_corder, assign_zero_2d_cutout, assign_zero_2d_forder, ); criterion_group!( - iter_misc_benches, - bench_iter_diag, - bench_row_iter, - bench_col_iter, - create_iter_4d, - bench_to_owned_n, - bench_to_owned_t, - bench_to_owned_strided, - equality_i32, - equality_f32, - equality_f32_mixorder, + iter_misc_benches, bench_iter_diag, bench_row_iter, bench_col_iter, create_iter_4d, bench_to_owned_n, + bench_to_owned_t, bench_to_owned_strided, equality_i32, equality_f32, equality_f32_mixorder, ); criterion_group!( - dot_benches, - dot_f32_16, - dot_f32_20, - dot_f32_32, - dot_f32_256, - dot_f32_1024, - dot_f32_10e6, - dot_extended, + dot_benches, dot_f32_16, dot_f32_20, dot_f32_32, dot_f32_256, dot_f32_1024, dot_f32_10e6, dot_extended, ); criterion_group!( - dimensionality_benches, - into_dimensionality_ix1_ok, - into_dimensionality_ix3_ok, - into_dimensionality_ix3_err, - into_dimensionality_dyn_to_ix3, - into_dimensionality_dyn_to_dyn, - into_dyn_ix3, - into_dyn_ix5, - into_dyn_dyn, - broadcast_same_dim, - broadcast_one_side, + dimensionality_benches, into_dimensionality_ix1_ok, into_dimensionality_ix3_ok, into_dimensionality_ix3_err, + into_dimensionality_dyn_to_ix3, into_dimensionality_dyn_to_dyn, into_dyn_ix3, into_dyn_ix5, into_dyn_dyn, + broadcast_same_dim, broadcast_one_side, ); -criterion_group!( - matmul_benches, - mat_mul_f32::group, - mat_mul_f64::group, - mat_mul_i32::group, -); +criterion_group!(matmul_benches, mat_mul_f32::group, mat_mul_f64::group, mat_mul_i32::group,); #[cfg(feature = "std")] -criterion_group!( - std_benches, - mean_axis0, - mean_axis1, - sum_axis0, - sum_axis1, -); +criterion_group!(std_benches, mean_axis0, mean_axis1, sum_axis0, sum_axis1,); #[cfg(feature = "std")] criterion_main!( - iter_benches, - sum_benches, - add_benches, - scalar_benches, - add_strided_benches, - iadd_scalar_benches, - iter_misc_benches, - dot_benches, - dimensionality_benches, - matmul_benches, - std_benches, + iter_benches, sum_benches, add_benches, scalar_benches, add_strided_benches, iadd_scalar_benches, + iter_misc_benches, dot_benches, dimensionality_benches, matmul_benches, std_benches, ); #[cfg(not(feature = "std"))] criterion_main!( - iter_benches, - sum_benches, - add_benches, - scalar_benches, - add_strided_benches, - iadd_scalar_benches, - iter_misc_benches, - dot_benches, - dimensionality_benches, - matmul_benches, + iter_benches, sum_benches, add_benches, scalar_benches, add_strided_benches, iadd_scalar_benches, + iter_misc_benches, dot_benches, dimensionality_benches, matmul_benches, ); diff --git a/benches/chunks.rs b/benches/chunks.rs index 702727c9..b95f15f7 100644 --- a/benches/chunks.rs +++ b/benches/chunks.rs @@ -2,8 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; use ndarray::prelude::*; use ndarray::NdProducer; -fn chunk2x2_iter_sum(c: &mut Criterion) -{ +fn chunk2x2_iter_sum(c: &mut Criterion) { let a = Array::::zeros((256, 256)); let chunksz = (2, 2); let mut sum = Array::zeros(a.exact_chunks(chunksz).raw_dim()); @@ -16,8 +15,7 @@ fn chunk2x2_iter_sum(c: &mut Criterion) }); } -fn chunk2x2_sum(c: &mut Criterion) -{ +fn chunk2x2_sum(c: &mut Criterion) { let a = Array::::zeros((256, 256)); let chunksz = (2, 2); let mut sum = Array::zeros(a.exact_chunks(chunksz).raw_dim()); @@ -30,8 +28,7 @@ fn chunk2x2_sum(c: &mut Criterion) }); } -fn chunk2x2_sum_get1(c: &mut Criterion) -{ +fn chunk2x2_sum_get1(c: &mut Criterion) { let a = Array::::zeros((256, 256)); let chunksz = (2, 2); let mut sum = Array::::zeros(a.exact_chunks(chunksz).raw_dim()); @@ -47,8 +44,7 @@ fn chunk2x2_sum_get1(c: &mut Criterion) }); } -fn chunk2x2_sum_uget1(c: &mut Criterion) -{ +fn chunk2x2_sum_uget1(c: &mut Criterion) { let a = Array::::zeros((256, 256)); let chunksz = (2, 2); let mut sum = Array::::zeros(a.exact_chunks(chunksz).raw_dim()); @@ -67,8 +63,7 @@ fn chunk2x2_sum_uget1(c: &mut Criterion) } #[allow(clippy::identity_op)] -fn chunk2x2_sum_get2(c: &mut Criterion) -{ +fn chunk2x2_sum_get2(c: &mut Criterion) { let a = Array::::zeros((256, 256)); let chunksz = (2, 2); let mut sum = Array::::zeros(a.exact_chunks(chunksz).raw_dim()); @@ -87,12 +82,5 @@ fn chunk2x2_sum_get2(c: &mut Criterion) }); } -criterion_group!( - benches, - chunk2x2_iter_sum, - chunk2x2_sum, - chunk2x2_sum_get1, - chunk2x2_sum_uget1, - chunk2x2_sum_get2 -); +criterion_group!(benches, chunk2x2_iter_sum, chunk2x2_sum, chunk2x2_sum_get1, chunk2x2_sum_uget1, chunk2x2_sum_get2); criterion_main!(benches); diff --git a/benches/construct.rs b/benches/construct.rs index 3cc53650..a6715c0f 100644 --- a/benches/construct.rs +++ b/benches/construct.rs @@ -4,15 +4,11 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion}; use ndarray::prelude::*; fn default_f64(c: &mut Criterion) { - c.bench_function("default_f64", |b| { - b.iter(|| Array::::default(black_box((128, 128)))) - }); + c.bench_function("default_f64", |b| b.iter(|| Array::::default(black_box((128, 128))))); } fn zeros_f64(c: &mut Criterion) { - c.bench_function("zeros_f64", |b| { - b.iter(|| Array::::zeros(black_box((128, 128)))) - }); + c.bench_function("zeros_f64", |b| b.iter(|| Array::::zeros(black_box((128, 128))))); } #[cfg(feature = "std")] @@ -20,9 +16,7 @@ fn map_regular(c: &mut Criterion) { let a = Array::linspace(0.0..=127.0, 128) .into_shape_with_order((8, 16)) .unwrap(); - c.bench_function("map_regular", |b| { - b.iter(|| black_box(&a).map(|&x| 2. * x)) - }); + c.bench_function("map_regular", |b| b.iter(|| black_box(&a).map(|&x| 2. * x))); } #[cfg(feature = "std")] @@ -31,9 +25,7 @@ fn map_stride(c: &mut Criterion) { .into_shape_with_order((8, 32)) .unwrap(); let av = a.slice(s![.., ..;2]); - c.bench_function("map_stride", |b| { - b.iter(|| black_box(&av).map(|&x| 2. * x)) - }); + c.bench_function("map_stride", |b| b.iter(|| black_box(&av).map(|&x| 2. * x))); } #[cfg(feature = "std")] diff --git a/benches/gemv_gemm.rs b/benches/gemv_gemm.rs index 4b7bc19c..6490ff7d 100644 --- a/benches/gemv_gemm.rs +++ b/benches/gemv_gemm.rs @@ -10,8 +10,7 @@ use ndarray::linalg::general_mat_mul; use ndarray::linalg::general_mat_vec_mul; use ndarray::LinalgScalar; -fn gemv_64_64c(c: &mut Criterion) -{ +fn gemv_64_64c(c: &mut Criterion) { let a = Array::zeros((64, 64)); let (m, n) = a.dim(); let x = Array::zeros(n); @@ -23,8 +22,7 @@ fn gemv_64_64c(c: &mut Criterion) }); } -fn gemv_64_64f(c: &mut Criterion) -{ +fn gemv_64_64f(c: &mut Criterion) { let a = Array::zeros((64, 64).f()); let (m, n) = a.dim(); let x = Array::zeros(n); @@ -36,8 +34,7 @@ fn gemv_64_64f(c: &mut Criterion) }); } -fn gemv_64_32(c: &mut Criterion) -{ +fn gemv_64_32(c: &mut Criterion) { let a = Array::zeros((64, 32)); let (m, n) = a.dim(); let x = Array::zeros(n); @@ -49,18 +46,17 @@ fn gemv_64_32(c: &mut Criterion) }); } -fn cgemm_100(c: &mut Criterion) -{ +fn cgemm_100(c: &mut Criterion) { cgemm_bench::("cgemm_100", 100, c); } -fn zgemm_100(c: &mut Criterion) -{ +fn zgemm_100(c: &mut Criterion) { cgemm_bench::("zgemm_100", 100, c); } fn cgemm_bench(name: &str, size: usize, c: &mut Criterion) -where A: LinalgScalar + Float +where + A: LinalgScalar + Float, { let (m, k, n) = (size, size, size); let a = Array::, _>::zeros((m, k)); diff --git a/benches/higher-order.rs b/benches/higher-order.rs index 09bbcbc3..9d37210c 100644 --- a/benches/higher-order.rs +++ b/benches/higher-order.rs @@ -8,8 +8,7 @@ const X: usize = 64; const Y: usize = 16; #[cfg(feature = "std")] -fn map_regular(c: &mut Criterion) -{ +fn map_regular(c: &mut Criterion) { let a = Array::linspace(0.0..=127.0, N) .into_shape_with_order((X, Y)) .unwrap(); @@ -18,14 +17,12 @@ fn map_regular(c: &mut Criterion) }); } -pub fn double_array(mut a: ArrayViewMut2<'_, f64>) -{ +pub fn double_array(mut a: ArrayViewMut2<'_, f64>) { a *= 2.0; } #[cfg(feature = "std")] -fn map_stride_double_f64(c: &mut Criterion) -{ +fn map_stride_double_f64(c: &mut Criterion) { let mut a = Array::linspace(0.0..=127.0, N * 2) .into_shape_with_order([X, Y * 2]) .unwrap(); @@ -38,8 +35,7 @@ fn map_stride_double_f64(c: &mut Criterion) } #[cfg(feature = "std")] -fn map_stride_f64(c: &mut Criterion) -{ +fn map_stride_f64(c: &mut Criterion) { let a = Array::linspace(0.0..=127.0, N * 2) .into_shape_with_order([X, Y * 2]) .unwrap(); @@ -50,8 +46,7 @@ fn map_stride_f64(c: &mut Criterion) } #[cfg(feature = "std")] -fn map_stride_u32(c: &mut Criterion) -{ +fn map_stride_u32(c: &mut Criterion) { let a = Array::linspace(0.0..=127.0, N * 2) .into_shape_with_order([X, Y * 2]) .unwrap(); @@ -63,8 +58,7 @@ fn map_stride_u32(c: &mut Criterion) } #[cfg(feature = "std")] -fn fold_axis(c: &mut Criterion) -{ +fn fold_axis(c: &mut Criterion) { let a = Array::linspace(0.0..=127.0, N * 2) .into_shape_with_order([X, Y * 2]) .unwrap(); @@ -76,8 +70,7 @@ fn fold_axis(c: &mut Criterion) const MA: usize = 64; const MASZ: usize = MA * MA; -fn map_axis_0(c: &mut Criterion) -{ +fn map_axis_0(c: &mut Criterion) { let a = Array::from_iter(0..MASZ as i32) .into_shape_with_order([MA, MA]) .unwrap(); @@ -86,8 +79,7 @@ fn map_axis_0(c: &mut Criterion) }); } -fn map_axis_1(c: &mut Criterion) -{ +fn map_axis_1(c: &mut Criterion) { let a = Array::from_iter(0..MASZ as i32) .into_shape_with_order([MA, MA]) .unwrap(); @@ -98,14 +90,7 @@ fn map_axis_1(c: &mut Criterion) #[cfg(feature = "std")] criterion_group!( - benches, - map_regular, - map_stride_double_f64, - map_stride_f64, - map_stride_u32, - fold_axis, - map_axis_0, - map_axis_1 + benches, map_regular, map_stride_double_f64, map_stride_f64, map_stride_u32, fold_axis, map_axis_0, map_axis_1 ); #[cfg(not(feature = "std"))] criterion_group!(benches, map_axis_0, map_axis_1); diff --git a/benches/iter.rs b/benches/iter.rs index 6e782002..4226c88b 100644 --- a/benches/iter.rs +++ b/benches/iter.rs @@ -2,7 +2,9 @@ // indexing where `-1` means "from end". Clippy can't see through the macro // and reads `1..-1` as a plain (empty) Rust range; the actual semantics are // correct. -#![allow(clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::reversed_empty_ranges)] +#![allow( + clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::reversed_empty_ranges +)] use criterion::{black_box, criterion_group, criterion_main, Criterion}; use rawpointer::PointerExt; @@ -11,88 +13,71 @@ use ndarray::prelude::*; use ndarray::Slice; use ndarray::{FoldWhile, Zip}; -fn iter_sum_2d_regular(c: &mut Criterion) -{ +fn iter_sum_2d_regular(c: &mut Criterion) { let a = Array::::zeros((64, 64)); c.bench_function("iter_sum_2d_regular", |b| b.iter(|| a.iter().sum::())); } -fn iter_sum_2d_cutout(c: &mut Criterion) -{ +fn iter_sum_2d_cutout(c: &mut Criterion) { let a = Array::::zeros((66, 66)); let av = a.slice(s![1..-1, 1..-1]); let a = av; c.bench_function("iter_sum_2d_cutout", |b| b.iter(|| a.iter().sum::())); } -fn iter_all_2d_cutout(c: &mut Criterion) -{ +fn iter_all_2d_cutout(c: &mut Criterion) { let a = Array::::zeros((66, 66)); let av = a.slice(s![1..-1, 1..-1]); let a = av; c.bench_function("iter_all_2d_cutout", |b| b.iter(|| a.iter().all(|&x| x >= 0))); } -fn iter_sum_2d_transpose(c: &mut Criterion) -{ +fn iter_sum_2d_transpose(c: &mut Criterion) { let a = Array::::zeros((66, 66)); let a = a.t(); c.bench_function("iter_sum_2d_transpose", |b| b.iter(|| a.iter().sum::())); } #[cfg(feature = "std")] -fn iter_filter_sum_2d_u32(c: &mut Criterion) -{ +fn iter_filter_sum_2d_u32(c: &mut Criterion) { let a = Array::linspace(0.0..=1.0, 256) .into_shape_with_order((16, 16)) .unwrap(); let b = a.mapv(|x| (x * 100.) as u32); - c.bench_function("iter_filter_sum_2d_u32", |bn| { - bn.iter(|| b.iter().filter(|&&x| x < 75).sum::()) - }); + c.bench_function("iter_filter_sum_2d_u32", |bn| bn.iter(|| b.iter().filter(|&&x| x < 75).sum::())); } #[cfg(feature = "std")] -fn iter_filter_sum_2d_f32(c: &mut Criterion) -{ +fn iter_filter_sum_2d_f32(c: &mut Criterion) { let a = Array::linspace(0.0..=1.0, 256) .into_shape_with_order((16, 16)) .unwrap(); let b = a * 100.; - c.bench_function("iter_filter_sum_2d_f32", |bn| { - bn.iter(|| b.iter().filter(|&&x| x < 75.).sum::()) - }); + c.bench_function("iter_filter_sum_2d_f32", |bn| bn.iter(|| b.iter().filter(|&&x| x < 75.).sum::())); } #[cfg(feature = "std")] -fn iter_filter_sum_2d_stride_u32(c: &mut Criterion) -{ +fn iter_filter_sum_2d_stride_u32(c: &mut Criterion) { let a = Array::linspace(0.0..=1.0, 256) .into_shape_with_order((16, 16)) .unwrap(); let b = a.mapv(|x| (x * 100.) as u32); let b = b.slice(s![.., ..;2]); - c.bench_function("iter_filter_sum_2d_stride_u32", |bn| { - bn.iter(|| b.iter().filter(|&&x| x < 75).sum::()) - }); + c.bench_function("iter_filter_sum_2d_stride_u32", |bn| bn.iter(|| b.iter().filter(|&&x| x < 75).sum::())); } #[cfg(feature = "std")] -fn iter_filter_sum_2d_stride_f32(c: &mut Criterion) -{ +fn iter_filter_sum_2d_stride_f32(c: &mut Criterion) { let a = Array::linspace(0.0..=1.0, 256) .into_shape_with_order((16, 16)) .unwrap(); let b = a * 100.; let b = b.slice(s![.., ..;2]); - c.bench_function("iter_filter_sum_2d_stride_f32", |bn| { - bn.iter(|| b.iter().filter(|&&x| x < 75.).sum::()) - }); + c.bench_function("iter_filter_sum_2d_stride_f32", |bn| bn.iter(|| b.iter().filter(|&&x| x < 75.).sum::())); } #[cfg(feature = "std")] -fn iter_rev_step_by_contiguous(c: &mut Criterion) -{ +fn iter_rev_step_by_contiguous(c: &mut Criterion) { let a = Array::linspace(0.0..=1.0, 512); c.bench_function("iter_rev_step_by_contiguous", |bn| { bn.iter(|| { @@ -104,8 +89,7 @@ fn iter_rev_step_by_contiguous(c: &mut Criterion) } #[cfg(feature = "std")] -fn iter_rev_step_by_discontiguous(c: &mut Criterion) -{ +fn iter_rev_step_by_discontiguous(c: &mut Criterion) { let mut a = Array::linspace(0.0..=1.0, 1024); a.slice_axis_inplace(Axis(0), Slice::new(0, None, 2)); c.bench_function("iter_rev_step_by_discontiguous", |bn| { @@ -119,8 +103,7 @@ fn iter_rev_step_by_discontiguous(c: &mut Criterion) const ZIPSZ: usize = 10_000; -fn sum_3_std_zip1(c: &mut Criterion) -{ +fn sum_3_std_zip1(c: &mut Criterion) { let a = vec![1; ZIPSZ]; let b = vec![1; ZIPSZ]; let c_vec = vec![1; ZIPSZ]; @@ -133,8 +116,7 @@ fn sum_3_std_zip1(c: &mut Criterion) }); } -fn sum_3_std_zip2(c: &mut Criterion) -{ +fn sum_3_std_zip2(c: &mut Criterion) { let a = vec![1; ZIPSZ]; let b = vec![1; ZIPSZ]; let c_vec = vec![1; ZIPSZ]; @@ -148,8 +130,7 @@ fn sum_3_std_zip2(c: &mut Criterion) }); } -fn sum_3_std_zip3(c: &mut Criterion) -{ +fn sum_3_std_zip3(c: &mut Criterion) { let a = vec![1; ZIPSZ]; let b = vec![1; ZIPSZ]; let c_vec = vec![1; ZIPSZ]; @@ -164,8 +145,7 @@ fn sum_3_std_zip3(c: &mut Criterion) }); } -fn vector_sum_3_std_zip(c: &mut Criterion) -{ +fn vector_sum_3_std_zip(c: &mut Criterion) { let a = vec![1.; ZIPSZ]; let b = vec![1.; ZIPSZ]; let mut c_vec = vec![1.; ZIPSZ]; @@ -178,8 +158,7 @@ fn vector_sum_3_std_zip(c: &mut Criterion) }); } -fn sum_3_azip(c: &mut Criterion) -{ +fn sum_3_azip(c: &mut Criterion) { let a = vec![1; ZIPSZ]; let b = vec![1; ZIPSZ]; let c_vec = vec![1; ZIPSZ]; @@ -194,8 +173,7 @@ fn sum_3_azip(c: &mut Criterion) }); } -fn sum_3_azip_fold(c: &mut Criterion) -{ +fn sum_3_azip_fold(c: &mut Criterion) { let a = vec![1; ZIPSZ]; let b = vec![1; ZIPSZ]; let c_vec = vec![1; ZIPSZ]; @@ -210,8 +188,7 @@ fn sum_3_azip_fold(c: &mut Criterion) }); } -fn vector_sum_3_azip(c: &mut Criterion) -{ +fn vector_sum_3_azip(c: &mut Criterion) { let a = vec![1.; ZIPSZ]; let b = vec![1.; ZIPSZ]; let mut c_vec = vec![1.; ZIPSZ]; @@ -224,8 +201,7 @@ fn vector_sum_3_azip(c: &mut Criterion) }); } -fn vector_sum3_unchecked(a: &[f64], b: &[f64], c: &mut [f64]) -{ +fn vector_sum3_unchecked(a: &[f64], b: &[f64], c: &mut [f64]) { for i in 0..c.len() { unsafe { *c.get_unchecked_mut(i) += *a.get_unchecked(i) + *b.get_unchecked(i); @@ -233,8 +209,7 @@ fn vector_sum3_unchecked(a: &[f64], b: &[f64], c: &mut [f64]) } } -fn vector_sum_3_zip_unchecked(c: &mut Criterion) -{ +fn vector_sum_3_zip_unchecked(c: &mut Criterion) { let a = vec![1.; ZIPSZ]; let b = vec![1.; ZIPSZ]; let mut c_vec = vec![1.; ZIPSZ]; @@ -245,8 +220,7 @@ fn vector_sum_3_zip_unchecked(c: &mut Criterion) }); } -fn vector_sum_3_zip_unchecked_manual(c: &mut Criterion) -{ +fn vector_sum_3_zip_unchecked_manual(c: &mut Criterion) { let a = vec![1.; ZIPSZ]; let b = vec![1.; ZIPSZ]; let mut c_vec = vec![1.; ZIPSZ]; @@ -267,8 +241,7 @@ fn vector_sum_3_zip_unchecked_manual(c: &mut Criterion) const ISZ: usize = 16; const I2DSZ: usize = 64; -fn indexed_iter_1d_ix1(c: &mut Criterion) -{ +fn indexed_iter_1d_ix1(c: &mut Criterion) { let mut a = Array::::zeros(I2DSZ * I2DSZ); for (i, elt) in a.indexed_iter_mut() { *elt = i as _; @@ -283,8 +256,7 @@ fn indexed_iter_1d_ix1(c: &mut Criterion) }); } -fn indexed_zip_1d_ix1(c: &mut Criterion) -{ +fn indexed_zip_1d_ix1(c: &mut Criterion) { let mut a = Array::::zeros(I2DSZ * I2DSZ); for (i, elt) in a.indexed_iter_mut() { *elt = i as _; @@ -299,8 +271,7 @@ fn indexed_zip_1d_ix1(c: &mut Criterion) }); } -fn indexed_iter_2d_ix2(c: &mut Criterion) -{ +fn indexed_iter_2d_ix2(c: &mut Criterion) { let mut a = Array::::zeros((I2DSZ, I2DSZ)); for ((i, j), elt) in a.indexed_iter_mut() { *elt = (i + 100 * j) as _; @@ -315,8 +286,7 @@ fn indexed_iter_2d_ix2(c: &mut Criterion) }); } -fn indexed_zip_2d_ix2(c: &mut Criterion) -{ +fn indexed_zip_2d_ix2(c: &mut Criterion) { let mut a = Array::::zeros((I2DSZ, I2DSZ)); for ((i, j), elt) in a.indexed_iter_mut() { *elt = (i + 100 * j) as _; @@ -331,8 +301,7 @@ fn indexed_zip_2d_ix2(c: &mut Criterion) }); } -fn indexed_iter_3d_ix3(c: &mut Criterion) -{ +fn indexed_iter_3d_ix3(c: &mut Criterion) { let mut a = Array::::zeros((ISZ, ISZ, ISZ)); for ((i, j, k), elt) in a.indexed_iter_mut() { *elt = (i + 100 * j + 10000 * k) as _; @@ -347,8 +316,7 @@ fn indexed_iter_3d_ix3(c: &mut Criterion) }); } -fn indexed_zip_3d_ix3(c: &mut Criterion) -{ +fn indexed_zip_3d_ix3(c: &mut Criterion) { let mut a = Array::::zeros((ISZ, ISZ, ISZ)); for ((i, j, k), elt) in a.indexed_iter_mut() { *elt = (i + 100 * j + 10000 * k) as _; @@ -363,8 +331,7 @@ fn indexed_zip_3d_ix3(c: &mut Criterion) }); } -fn indexed_iter_3d_dyn(c: &mut Criterion) -{ +fn indexed_iter_3d_dyn(c: &mut Criterion) { let mut a = Array::::zeros((ISZ, ISZ, ISZ)); for ((i, j, k), elt) in a.indexed_iter_mut() { *elt = (i + 100 * j + 10000 * k) as _; @@ -380,32 +347,24 @@ fn indexed_iter_3d_dyn(c: &mut Criterion) }); } -fn iter_sum_1d_strided_fold(c: &mut Criterion) -{ +fn iter_sum_1d_strided_fold(c: &mut Criterion) { let mut a = Array::::ones(10240); a.slice_axis_inplace(Axis(0), Slice::new(0, None, 2)); c.bench_function("iter_sum_1d_strided_fold", |bn| bn.iter(|| a.iter().sum::())); } -fn iter_sum_1d_strided_rfold(c: &mut Criterion) -{ +fn iter_sum_1d_strided_rfold(c: &mut Criterion) { let mut a = Array::::ones(10240); a.slice_axis_inplace(Axis(0), Slice::new(0, None, 2)); - c.bench_function("iter_sum_1d_strided_rfold", |bn| { - bn.iter(|| a.iter().rfold(0, |acc, &x| acc + x)) - }); + c.bench_function("iter_sum_1d_strided_rfold", |bn| bn.iter(|| a.iter().rfold(0, |acc, &x| acc + x))); } -fn iter_axis_iter_sum(c: &mut Criterion) -{ +fn iter_axis_iter_sum(c: &mut Criterion) { let a = Array::::zeros((64, 64)); - c.bench_function("iter_axis_iter_sum", |bn| { - bn.iter(|| a.axis_iter(Axis(0)).map(|plane| plane.sum()).sum::()) - }); + c.bench_function("iter_axis_iter_sum", |bn| bn.iter(|| a.axis_iter(Axis(0)).map(|plane| plane.sum()).sum::())); } -fn iter_axis_chunks_1_iter_sum(c: &mut Criterion) -{ +fn iter_axis_chunks_1_iter_sum(c: &mut Criterion) { let a = Array::::zeros((64, 64)); c.bench_function("iter_axis_chunks_1_iter_sum", |bn| { bn.iter(|| { @@ -416,8 +375,7 @@ fn iter_axis_chunks_1_iter_sum(c: &mut Criterion) }); } -fn iter_axis_chunks_5_iter_sum(c: &mut Criterion) -{ +fn iter_axis_chunks_5_iter_sum(c: &mut Criterion) { let a = Array::::zeros((64, 64)); c.bench_function("iter_axis_chunks_5_iter_sum", |bn| { bn.iter(|| { @@ -428,22 +386,19 @@ fn iter_axis_chunks_5_iter_sum(c: &mut Criterion) }); } -pub fn zip_mut_with(data: &Array3, out: &mut Array3) -{ +pub fn zip_mut_with(data: &Array3, out: &mut Array3) { out.zip_mut_with(data, |o, &i| { *o = i; }); } -fn zip_mut_with_cc(c: &mut Criterion) -{ +fn zip_mut_with_cc(c: &mut Criterion) { let data: Array3 = Array3::zeros((ISZ, ISZ, ISZ)); let mut out = Array3::zeros(data.dim()); c.bench_function("zip_mut_with_cc", |b| b.iter(|| zip_mut_with(&data, &mut out))); } -fn zip_mut_with_ff(c: &mut Criterion) -{ +fn zip_mut_with_ff(c: &mut Criterion) { let data: Array3 = Array3::zeros((ISZ, ISZ, ISZ).f()); let mut out = Array3::zeros(data.dim().f()); c.bench_function("zip_mut_with_ff", |b| b.iter(|| zip_mut_with(&data, &mut out))); @@ -451,13 +406,8 @@ fn zip_mut_with_ff(c: &mut Criterion) #[cfg(feature = "std")] criterion_group!( - benches_std, - iter_filter_sum_2d_u32, - iter_filter_sum_2d_f32, - iter_filter_sum_2d_stride_u32, - iter_filter_sum_2d_stride_f32, - iter_rev_step_by_contiguous, - iter_rev_step_by_discontiguous, + benches_std, iter_filter_sum_2d_u32, iter_filter_sum_2d_f32, iter_filter_sum_2d_stride_u32, + iter_filter_sum_2d_stride_f32, iter_rev_step_by_contiguous, iter_rev_step_by_discontiguous, ); criterion_group!( diff --git a/benches/par_rayon.rs b/benches/par_rayon.rs index 857660ee..33146c8d 100644 --- a/benches/par_rayon.rs +++ b/benches/par_rayon.rs @@ -8,16 +8,14 @@ use ndarray::Zip; const EXP_N: usize = 256; const ADDN: usize = 512; -fn set_threads() -{ +fn set_threads() { // Consider setting a fixed number of threads here, for example to avoid // oversubscribing on hyperthreaded cores. // let n = 4; // let _ = rayon::ThreadPoolBuilder::new().num_threads(n).build_global(); } -fn map_exp_regular(c: &mut Criterion) -{ +fn map_exp_regular(c: &mut Criterion) { let mut a = Array2::::zeros((EXP_N, EXP_N)); a.swap_axes(0, 1); c.bench_function("map_exp_regular", |b| { @@ -27,8 +25,7 @@ fn map_exp_regular(c: &mut Criterion) }); } -fn rayon_exp_regular(c: &mut Criterion) -{ +fn rayon_exp_regular(c: &mut Criterion) { set_threads(); let mut a = Array2::::zeros((EXP_N, EXP_N)); a.swap_axes(0, 1); @@ -42,20 +39,17 @@ fn rayon_exp_regular(c: &mut Criterion) const FASTEXP: usize = EXP_N; #[inline] -fn fastexp(x: f64) -> f64 -{ +fn fastexp(x: f64) -> f64 { let x = 1. + x / 1024.; x.powi(1024) } -fn map_fastexp_regular(c: &mut Criterion) -{ +fn map_fastexp_regular(c: &mut Criterion) { let mut a = Array2::::zeros((FASTEXP, FASTEXP)); c.bench_function("map_fastexp_regular", |b| b.iter(|| a.mapv_inplace(fastexp))); } -fn rayon_fastexp_regular(c: &mut Criterion) -{ +fn rayon_fastexp_regular(c: &mut Criterion) { set_threads(); let mut a = Array2::::zeros((FASTEXP, FASTEXP)); c.bench_function("rayon_fastexp_regular", |b| { @@ -65,15 +59,13 @@ fn rayon_fastexp_regular(c: &mut Criterion) }); } -fn map_fastexp_cut(c: &mut Criterion) -{ +fn map_fastexp_cut(c: &mut Criterion) { let mut a = Array2::::zeros((FASTEXP, FASTEXP)); let mut a = a.slice_mut(s![.., ..-1]); c.bench_function("map_fastexp_cut", |b| b.iter(|| a.mapv_inplace(fastexp))); } -fn rayon_fastexp_cut(c: &mut Criterion) -{ +fn rayon_fastexp_cut(c: &mut Criterion) { set_threads(); let mut a = Array2::::zeros((FASTEXP, FASTEXP)); let mut a = a.slice_mut(s![.., ..-1]); @@ -84,8 +76,7 @@ fn rayon_fastexp_cut(c: &mut Criterion) }); } -fn map_fastexp_by_axis(c: &mut Criterion) -{ +fn map_fastexp_by_axis(c: &mut Criterion) { let mut a = Array2::::zeros((FASTEXP, FASTEXP)); c.bench_function("map_fastexp_by_axis", |b| { b.iter(|| { @@ -96,8 +87,7 @@ fn map_fastexp_by_axis(c: &mut Criterion) }); } -fn rayon_fastexp_by_axis(c: &mut Criterion) -{ +fn rayon_fastexp_by_axis(c: &mut Criterion) { set_threads(); let mut a = Array2::::zeros((FASTEXP, FASTEXP)); c.bench_function("rayon_fastexp_by_axis", |b| { @@ -109,8 +99,7 @@ fn rayon_fastexp_by_axis(c: &mut Criterion) }); } -fn rayon_fastexp_zip(c: &mut Criterion) -{ +fn rayon_fastexp_zip(c: &mut Criterion) { set_threads(); let mut a = Array2::::zeros((FASTEXP, FASTEXP)); c.bench_function("rayon_fastexp_zip", |b| { @@ -122,8 +111,7 @@ fn rayon_fastexp_zip(c: &mut Criterion) }); } -fn add(c: &mut Criterion) -{ +fn add(c: &mut Criterion) { let mut a = Array2::::zeros((ADDN, ADDN)); let b_arr = Array2::::zeros((ADDN, ADDN)); let c_arr = Array2::::zeros((ADDN, ADDN)); @@ -137,8 +125,7 @@ fn add(c: &mut Criterion) }); } -fn rayon_add(c: &mut Criterion) -{ +fn rayon_add(c: &mut Criterion) { set_threads(); let mut a = Array2::::zeros((ADDN, ADDN)); let b_arr = Array2::::zeros((ADDN, ADDN)); @@ -156,32 +143,28 @@ fn rayon_add(c: &mut Criterion) const COLL_STRING_N: usize = 64; const COLL_F64_N: usize = 128; -fn vec_string_collect(c: &mut Criterion) -{ +fn vec_string_collect(c: &mut Criterion) { let v = vec![""; COLL_STRING_N * COLL_STRING_N]; c.bench_function("vec_string_collect", |b| { b.iter(|| v.iter().map(|s| s.to_owned()).collect::>()); }); } -fn array_string_collect(c: &mut Criterion) -{ +fn array_string_collect(c: &mut Criterion) { let v = Array::from_elem((COLL_STRING_N, COLL_STRING_N), ""); c.bench_function("array_string_collect", |b| { b.iter(|| Zip::from(&v).par_map_collect(|s| s.to_owned())); }); } -fn vec_f64_collect(c: &mut Criterion) -{ +fn vec_f64_collect(c: &mut Criterion) { let v = vec![1.; COLL_F64_N * COLL_F64_N]; c.bench_function("vec_f64_collect", |b| { b.iter(|| v.iter().map(|s| s + 1.).collect::>()); }); } -fn array_f64_collect(c: &mut Criterion) -{ +fn array_f64_collect(c: &mut Criterion) { let v = Array::from_elem((COLL_F64_N, COLL_F64_N), 1.); c.bench_function("array_f64_collect", |b| { b.iter(|| Zip::from(&v).par_map_collect(|s| s + 1.)); @@ -189,21 +172,8 @@ fn array_f64_collect(c: &mut Criterion) } criterion_group!( - benches, - map_exp_regular, - rayon_exp_regular, - map_fastexp_regular, - rayon_fastexp_regular, - map_fastexp_cut, - rayon_fastexp_cut, - map_fastexp_by_axis, - rayon_fastexp_by_axis, - rayon_fastexp_zip, - add, - rayon_add, - vec_string_collect, - array_string_collect, - vec_f64_collect, - array_f64_collect + benches, map_exp_regular, rayon_exp_regular, map_fastexp_regular, rayon_fastexp_regular, map_fastexp_cut, + rayon_fastexp_cut, map_fastexp_by_axis, rayon_fastexp_by_axis, rayon_fastexp_zip, add, rayon_add, + vec_string_collect, array_string_collect, vec_f64_collect, array_f64_collect ); criterion_main!(benches); diff --git a/benches/reserve.rs b/benches/reserve.rs index 791bbefa..46a770c1 100644 --- a/benches/reserve.rs +++ b/benches/reserve.rs @@ -1,8 +1,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; use ndarray::prelude::*; -fn push_reserve(c: &mut Criterion) -{ +fn push_reserve(c: &mut Criterion) { let ones: Array = array![1f32]; c.bench_function("push_reserve", |b| { b.iter(|| { @@ -15,8 +14,7 @@ fn push_reserve(c: &mut Criterion) }); } -fn push_no_reserve(c: &mut Criterion) -{ +fn push_no_reserve(c: &mut Criterion) { let ones: Array = array![1f32]; c.bench_function("push_no_reserve", |b| { b.iter(|| { diff --git a/benches/to_shape.rs b/benches/to_shape.rs index fcf2d927..ad9f5515 100644 --- a/benches/to_shape.rs +++ b/benches/to_shape.rs @@ -2,8 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; use ndarray::prelude::*; use ndarray::Order; -fn to_shape2_1(c: &mut Criterion) -{ +fn to_shape2_1(c: &mut Criterion) { let a = Array::::zeros((4, 5)); let view = a.view(); c.bench_function("to_shape2_1", |b| { @@ -11,8 +10,7 @@ fn to_shape2_1(c: &mut Criterion) }); } -fn to_shape2_2_same(c: &mut Criterion) -{ +fn to_shape2_2_same(c: &mut Criterion) { let a = Array::::zeros((4, 5)); let view = a.view(); c.bench_function("to_shape2_2_same", |b| { @@ -20,8 +18,7 @@ fn to_shape2_2_same(c: &mut Criterion) }); } -fn to_shape2_2_flip(c: &mut Criterion) -{ +fn to_shape2_2_flip(c: &mut Criterion) { let a = Array::::zeros((4, 5)); let view = a.view(); c.bench_function("to_shape2_2_flip", |b| { @@ -29,8 +26,7 @@ fn to_shape2_2_flip(c: &mut Criterion) }); } -fn to_shape2_3(c: &mut Criterion) -{ +fn to_shape2_3(c: &mut Criterion) { let a = Array::::zeros((4, 5)); let view = a.view(); c.bench_function("to_shape2_3", |b| { @@ -38,8 +34,7 @@ fn to_shape2_3(c: &mut Criterion) }); } -fn to_shape3_1(c: &mut Criterion) -{ +fn to_shape3_1(c: &mut Criterion) { let a = Array::::zeros((3, 4, 5)); let view = a.view(); c.bench_function("to_shape3_1", |b| { @@ -47,8 +42,7 @@ fn to_shape3_1(c: &mut Criterion) }); } -fn to_shape3_2_order(c: &mut Criterion) -{ +fn to_shape3_2_order(c: &mut Criterion) { let a = Array::::zeros((3, 4, 5)); let view = a.view(); c.bench_function("to_shape3_2_order", |b| { @@ -56,8 +50,7 @@ fn to_shape3_2_order(c: &mut Criterion) }); } -fn to_shape3_2_outoforder(c: &mut Criterion) -{ +fn to_shape3_2_outoforder(c: &mut Criterion) { let a = Array::::zeros((3, 4, 5)); let view = a.view(); c.bench_function("to_shape3_2_outoforder", |b| { @@ -65,8 +58,7 @@ fn to_shape3_2_outoforder(c: &mut Criterion) }); } -fn to_shape3_3c(c: &mut Criterion) -{ +fn to_shape3_3c(c: &mut Criterion) { let a = Array::::zeros((3, 4, 5)); let view = a.view(); c.bench_function("to_shape3_3c", |b| { @@ -74,8 +66,7 @@ fn to_shape3_3c(c: &mut Criterion) }); } -fn to_shape3_3f(c: &mut Criterion) -{ +fn to_shape3_3f(c: &mut Criterion) { let a = Array::::zeros((3, 4, 5).f()); let view = a.view(); c.bench_function("to_shape3_3f", |b| { @@ -83,8 +74,7 @@ fn to_shape3_3f(c: &mut Criterion) }); } -fn to_shape3_4c(c: &mut Criterion) -{ +fn to_shape3_4c(c: &mut Criterion) { let a = Array::::zeros((3, 4, 5)); let view = a.view(); c.bench_function("to_shape3_4c", |b| { @@ -92,8 +82,7 @@ fn to_shape3_4c(c: &mut Criterion) }); } -fn to_shape3_4f(c: &mut Criterion) -{ +fn to_shape3_4f(c: &mut Criterion) { let a = Array::::zeros((3, 4, 5).f()); let view = a.view(); c.bench_function("to_shape3_4f", |b| { @@ -102,17 +91,7 @@ fn to_shape3_4f(c: &mut Criterion) } criterion_group!( - benches, - to_shape2_1, - to_shape2_2_same, - to_shape2_2_flip, - to_shape2_3, - to_shape3_1, - to_shape3_2_order, - to_shape3_2_outoforder, - to_shape3_3c, - to_shape3_3f, - to_shape3_4c, - to_shape3_4f + benches, to_shape2_1, to_shape2_2_same, to_shape2_2_flip, to_shape2_3, to_shape3_1, to_shape3_2_order, + to_shape3_2_outoforder, to_shape3_3c, to_shape3_3f, to_shape3_4c, to_shape3_4f ); criterion_main!(benches); diff --git a/benches/zip.rs b/benches/zip.rs index 66246842..e482c0e7 100644 --- a/benches/zip.rs +++ b/benches/zip.rs @@ -31,8 +31,7 @@ where z22.for_each(f); } -pub fn zip_indexed(data: &Array3, out: &mut Array3) -{ +pub fn zip_indexed(data: &Array3, out: &mut Array3) { Zip::indexed(data).and(out).for_each(|idx, &i, o| { let _ = black_box(idx); *o = i; @@ -42,50 +41,43 @@ pub fn zip_indexed(data: &Array3, out: &mut Array3) // array size in benchmarks const SZ3: (usize, usize, usize) = (100, 110, 100); -fn zip_cc(c: &mut Criterion) -{ +fn zip_cc(c: &mut Criterion) { let data: Array3 = Array3::zeros(SZ3); let mut out = Array3::zeros(data.dim()); c.bench_function("zip_cc", |b| b.iter(|| zip_copy(&data, &mut out))); } -fn zip_cf(c: &mut Criterion) -{ +fn zip_cf(c: &mut Criterion) { let data: Array3 = Array3::zeros(SZ3); let mut out = Array3::zeros(data.dim().f()); c.bench_function("zip_cf", |b| b.iter(|| zip_copy(&data, &mut out))); } -fn zip_fc(c: &mut Criterion) -{ +fn zip_fc(c: &mut Criterion) { let data: Array3 = Array3::zeros(SZ3.f()); let mut out = Array3::zeros(data.dim()); c.bench_function("zip_fc", |b| b.iter(|| zip_copy(&data, &mut out))); } -fn zip_ff(c: &mut Criterion) -{ +fn zip_ff(c: &mut Criterion) { let data: Array3 = Array3::zeros(SZ3.f()); let mut out = Array3::zeros(data.dim().f()); c.bench_function("zip_ff", |b| b.iter(|| zip_copy(&data, &mut out))); } -fn zip_indexed_cc(c: &mut Criterion) -{ +fn zip_indexed_cc(c: &mut Criterion) { let data: Array3 = Array3::zeros(SZ3); let mut out = Array3::zeros(data.dim()); c.bench_function("zip_indexed_cc", |b| b.iter(|| zip_indexed(&data, &mut out))); } -fn zip_indexed_ff(c: &mut Criterion) -{ +fn zip_indexed_ff(c: &mut Criterion) { let data: Array3 = Array3::zeros(SZ3.f()); let mut out = Array3::zeros(data.dim().f()); c.bench_function("zip_indexed_ff", |b| b.iter(|| zip_indexed(&data, &mut out))); } -fn slice_zip_cc(c: &mut Criterion) -{ +fn slice_zip_cc(c: &mut Criterion) { let data: Array3 = Array3::zeros(SZ3); let mut out = Array3::zeros(data.dim()); let data = data.slice(s![1.., 1.., 1..]); @@ -93,8 +85,7 @@ fn slice_zip_cc(c: &mut Criterion) c.bench_function("slice_zip_cc", |b| b.iter(|| zip_copy(&data, &mut out))); } -fn slice_zip_ff(c: &mut Criterion) -{ +fn slice_zip_ff(c: &mut Criterion) { let data: Array3 = Array3::zeros(SZ3.f()); let mut out = Array3::zeros(data.dim().f()); let data = data.slice(s![1.., 1.., 1..]); @@ -102,8 +93,7 @@ fn slice_zip_ff(c: &mut Criterion) c.bench_function("slice_zip_ff", |b| b.iter(|| zip_copy(&data, &mut out))); } -fn slice_split_zip_cc(c: &mut Criterion) -{ +fn slice_split_zip_cc(c: &mut Criterion) { let data: Array3 = Array3::zeros(SZ3); let mut out = Array3::zeros(data.dim()); let data = data.slice(s![1.., 1.., 1..]); @@ -111,8 +101,7 @@ fn slice_split_zip_cc(c: &mut Criterion) c.bench_function("slice_split_zip_cc", |b| b.iter(|| zip_copy_split(&data, &mut out))); } -fn slice_split_zip_ff(c: &mut Criterion) -{ +fn slice_split_zip_ff(c: &mut Criterion) { let data: Array3 = Array3::zeros(SZ3.f()); let mut out = Array3::zeros(data.dim().f()); let data = data.slice(s![1.., 1.., 1..]); @@ -121,16 +110,7 @@ fn slice_split_zip_ff(c: &mut Criterion) } criterion_group!( - benches, - zip_cc, - zip_cf, - zip_fc, - zip_ff, - zip_indexed_cc, - zip_indexed_ff, - slice_zip_cc, - slice_zip_ff, - slice_split_zip_cc, - slice_split_zip_ff + benches, zip_cc, zip_cf, zip_fc, zip_ff, zip_indexed_cc, zip_indexed_ff, slice_zip_cc, slice_zip_ff, + slice_split_zip_cc, slice_split_zip_ff ); criterion_main!(benches); diff --git a/examples/life.rs b/examples/life.rs index 0c043190..50666d30 100644 --- a/examples/life.rs +++ b/examples/life.rs @@ -3,10 +3,7 @@ // reads `1..-1` as a plain (empty) Rust range; the actual semantics are // correct. #![allow( - clippy::many_single_char_names, - clippy::deref_addrof, - clippy::unreadable_literal, - clippy::reversed_empty_ranges + clippy::many_single_char_names, clippy::deref_addrof, clippy::unreadable_literal, clippy::reversed_empty_ranges )] use ndarray::prelude::*; diff --git a/ndarray-rand/benches/bench.rs b/ndarray-rand/benches/bench.rs index 4d8e9370..5d60a8bb 100644 --- a/ndarray-rand/benches/bench.rs +++ b/ndarray-rand/benches/bench.rs @@ -4,24 +4,21 @@ use ndarray_rand::RandomExt; use rand_distr::Normal; use rand_distr::Uniform; -fn uniform_f32(c: &mut Criterion) -{ +fn uniform_f32(c: &mut Criterion) { let m = 100; c.bench_function("uniform_f32", |b| { b.iter(|| Array::random((m, m), Uniform::new(-1f32, 1.).unwrap())); }); } -fn norm_f32(c: &mut Criterion) -{ +fn norm_f32(c: &mut Criterion) { let m = 100; c.bench_function("norm_f32", |b| { b.iter(|| Array::random((m, m), Normal::new(0f32, 1.).unwrap())); }); } -fn norm_f64(c: &mut Criterion) -{ +fn norm_f64(c: &mut Criterion) { let m = 100; c.bench_function("norm_f64", |b| { b.iter(|| Array::random((m, m), Normal::new(0f64, 1.).unwrap())); diff --git a/src/hpc/mod.rs b/src/hpc/mod.rs index 05dbf184..a862ab2e 100644 --- a/src/hpc/mod.rs +++ b/src/hpc/mod.rs @@ -48,8 +48,15 @@ pub mod node; pub mod cascade; #[allow(missing_docs)] pub mod heel_f64x8; +// AMX is an x86_64-only ISA (Intel Sapphire Rapids+); both modules use +// `asm!` with `rcx`/`rax` register names that don't exist on other +// architectures (rejected at parse time on s390x / aarch64 / wasm32). +// `bf16_tile_gemm` is the safe wrapper around `amx_matmul`, so it inherits +// the same gate. +#[cfg(target_arch = "x86_64")] #[allow(missing_docs)] pub mod amx_matmul; +#[cfg(target_arch = "x86_64")] pub mod bf16_tile_gemm; #[allow(missing_docs)] pub mod bf16_truth; diff --git a/src/lib.rs b/src/lib.rs index 10f8a967..db94e9c4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -242,6 +242,10 @@ pub mod simd_avx2; #[cfg(feature = "std")] #[allow(clippy::all, missing_docs, dead_code, unused_variables, unused_imports)] +// AMX is an x86_64-only ISA (Intel Sapphire Rapids+); the module uses +// `asm!` with `rcx`/`rax` register names that don't exist on other +// architectures (rejected at parse time on s390x / aarch64 / wasm32). +#[cfg(target_arch = "x86_64")] pub mod simd_amx; #[cfg(feature = "std")] From 59e56ce8eb59cc35a4bb1894c207111283564ced Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 13 May 2026 08:02:08 +0000 Subject: [PATCH 5/5] fix(ci): allow dead_code on Tier enums for non-x86_64 cross-builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit i686-unknown-linux-gnu cross-tests (which run under -D warnings) failed: error: variants `Avx512` and `Avx2` are never constructed --> src/backend/native.rs:17:5 = note: `-D dead-code` implied by `-D warnings` Two `enum Tier { Avx512, Avx2, ..., Scalar }` definitions exist, one in `src/backend/native.rs` and one in `src/simd.rs`. Both `detect_tier()` blocks gate the AVX-detection paths behind `#[cfg(target_arch = "x86_64")]`; the NEON-detection (simd.rs only) is gated behind `#[cfg(target_arch = "aarch64")]`. On i686 / wasm32 / etc., none of those gates match → only `Scalar` is ever constructed → dead-code lint fires on the other variants. Fix: `#[allow(dead_code)]` on both Tier enums. The variants ARE needed on x86_64 and aarch64 builds (the cfg blocks produce them via runtime feature detection); they just don't reach instantiation under the i686 target_arch. The src/simd.rs fix is preemptive — only src/backend/native.rs was flagged in the CI error, but src/simd.rs has 4 non-Scalar variants (Avx512, Avx2, NeonDotProd, Neon) that would trigger the same lint under -D warnings on i686. Both fixed in one commit. Verification: - `cargo clippy --no-deps` (default x86_64) → clean (the variants ARE constructed via `is_x86_feature_detected!("avx512f")`) - `RUSTFLAGS="-D dead_code" cargo check --lib --features ...` → clean --- src/backend/native.rs | 6 ++++++ src/simd.rs | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/backend/native.rs b/src/backend/native.rs index 102180d1..56123970 100644 --- a/src/backend/native.rs +++ b/src/backend/native.rs @@ -12,6 +12,12 @@ use std::sync::LazyLock; // ─── Tier detection: happens ONCE, at first access ───────────────── +// On non-x86_64 targets (e.g. i686 / aarch64 / s390x cross-tests) only the +// `Scalar` variant is ever constructed — the AVX detection block below is +// gated `#[cfg(target_arch = "x86_64")]`. Without `dead_code` allowance the +// `-D warnings` build fails on i686 with `variants Avx512 and Avx2 are +// never constructed`. +#[allow(dead_code)] #[derive(Clone, Copy, PartialEq)] enum Tier { Avx512, diff --git a/src/simd.rs b/src/simd.rs index 4a824c83..7a6398a0 100644 --- a/src/simd.rs +++ b/src/simd.rs @@ -8,6 +8,11 @@ #[cfg(feature = "std")] use std::sync::LazyLock; +// On i686 / wasm32 / etc. only the `Scalar` variant is constructed — +// `detect_tier()`'s feature-detection blocks are `target_arch = "x86_64"` +// or `"aarch64"` gated, both false on i686. Without `dead_code` allowance +// the `-D warnings` build fails with `variants ... are never constructed`. +#[allow(dead_code)] #[derive(Clone, Copy, PartialEq, Debug)] #[repr(u8)] enum Tier {