From 9dfb022a63aa78716e51295f168da7bbddc92a07 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:15:01 +0000 Subject: [PATCH 01/14] Initial plan From 86b8916f748d909ad6865461da9a8727e8565917 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:20:17 +0000 Subject: [PATCH 02/14] Add comprehensive CI workflow for Rust project Co-authored-by: hildebrandmw <24898651+hildebrandmw@users.noreply.github.com> --- .github/workflows/ci.yml | 175 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..cd06beaf2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,175 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT license. + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + +name: CI + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +env: + RUSTFLAGS: -Dwarnings + RUST_BACKTRACE: 1 + # Use the Rust version specified in rust-toolchain.toml + rust_stable: "1.90" + +defaults: + run: + shell: bash + +permissions: + contents: read + +jobs: + # Basic checks that must pass before we kick off more expensive tests. + basics: + name: basic checks + runs-on: ubuntu-latest + needs: + - clippy + - fmt + - docs + steps: + - run: exit 0 + + fmt: + name: format check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust ${{ env.rust_stable }} + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.rust_stable }} + components: rustfmt + - uses: Swatinem/rust-cache@v2 + # Check fmt + - name: "rustfmt --check" + run: | + if ! rustfmt --check --edition 2021 $(git ls-files '*.rs'); then + printf "Please run \`rustfmt --edition 2021 \$(git ls-files '*.rs')\` to fix rustfmt errors.\n" >&2 + exit 1 + fi + + clippy: + name: clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust ${{ env.rust_stable }} + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.rust_stable }} + components: clippy + - uses: Swatinem/rust-cache@v2 + # Run clippy on workspace + - name: "clippy --workspace --all-targets" + run: cargo clippy --workspace --all-targets --no-deps + + docs: + name: docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust ${{ env.rust_stable }} + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.rust_stable }} + - uses: Swatinem/rust-cache@v2 + - name: "doc --workspace --no-deps" + run: cargo doc --workspace --no-deps --document-private-items + env: + RUSTDOCFLAGS: -Dwarnings + + test-workspace: + needs: basics + name: test workspace + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - windows-latest + - ubuntu-latest + - macos-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust ${{ env.rust_stable }} + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.rust_stable }} + - name: Install cargo-nextest + uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest + + - uses: Swatinem/rust-cache@v2 + + - name: test workspace with nextest + run: | + set -euxo pipefail + cargo nextest run --workspace + cargo test --doc --workspace + + coverage: + needs: basics + name: code coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust ${{ env.rust_stable }} + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.rust_stable }} + components: llvm-tools-preview + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@v2 + with: + tool: cargo-llvm-cov + - uses: Swatinem/rust-cache@v2 + + - name: Generate code coverage + run: | + cargo llvm-cov --workspace \ + --package diskann-wide \ + --package diskann-vector \ + --package diskann-quantization \ + --package diskann \ + --package diskann-linalg \ + --package diskann-utils \ + --package diskann-providers \ + --package diskann-disk \ + --lcov --output-path lcov.info + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + files: lcov.info + fail_ci_if_error: false + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + miri: + needs: basics + name: miri diskann-quantization + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust nightly with miri + uses: dtolnay/rust-toolchain@nightly + with: + components: miri + - uses: Swatinem/rust-cache@v2 + + - name: Setup miri + run: cargo miri setup + + - name: Run miri tests on diskann-quantization + run: cargo miri test --package diskann-quantization + env: + MIRIFLAGS: -Zmiri-strict-provenance From e755ed1d321aec9682da675831a61e80bfc45d7c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:21:34 +0000 Subject: [PATCH 03/14] Fix indentation and use cargo fmt instead of rustfmt directly Co-authored-by: hildebrandmw <24898651+hildebrandmw@users.noreply.github.com> --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd06beaf2..2dfeaac8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,10 +50,10 @@ jobs: components: rustfmt - uses: Swatinem/rust-cache@v2 # Check fmt - - name: "rustfmt --check" + - name: "cargo fmt --check" run: | - if ! rustfmt --check --edition 2021 $(git ls-files '*.rs'); then - printf "Please run \`rustfmt --edition 2021 \$(git ls-files '*.rs')\` to fix rustfmt errors.\n" >&2 + if ! cargo fmt --all --check; then + printf "Please run \`cargo fmt --all\` to fix rustfmt errors.\n" >&2 exit 1 fi @@ -102,7 +102,7 @@ jobs: - name: Install Rust ${{ env.rust_stable }} uses: dtolnay/rust-toolchain@stable with: - toolchain: ${{ env.rust_stable }} + toolchain: ${{ env.rust_stable }} - name: Install cargo-nextest uses: taiki-e/install-action@v2 with: From 240338bf10efe0065403577ed1f68ec46511b30b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 19:37:08 +0000 Subject: [PATCH 04/14] Address review feedback: comment out docs, add bf_tree cfg, use miri nextest Co-authored-by: hildebrandmw <24898651+hildebrandmw@users.noreply.github.com> --- .github/workflows/ci.yml | 39 +++++++++++-------- .../provider/async_/table_delete_provider.rs | 4 ++ 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dfeaac8f..2d295bb46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,8 @@ jobs: needs: - clippy - fmt - - docs + # TODO: Re-enable docs check later + # - docs steps: - run: exit 0 @@ -72,20 +73,21 @@ jobs: - name: "clippy --workspace --all-targets" run: cargo clippy --workspace --all-targets --no-deps - docs: - name: docs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust ${{ env.rust_stable }} - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ env.rust_stable }} - - uses: Swatinem/rust-cache@v2 - - name: "doc --workspace --no-deps" - run: cargo doc --workspace --no-deps --document-private-items - env: - RUSTDOCFLAGS: -Dwarnings + # TODO: Re-enable docs check later + # docs: + # name: docs + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Install Rust ${{ env.rust_stable }} + # uses: dtolnay/rust-toolchain@stable + # with: + # toolchain: ${{ env.rust_stable }} + # - uses: Swatinem/rust-cache@v2 + # - name: "doc --workspace --no-deps" + # run: cargo doc --workspace --no-deps --document-private-items + # env: + # RUSTDOCFLAGS: -Dwarnings test-workspace: needs: basics @@ -169,7 +171,12 @@ jobs: - name: Setup miri run: cargo miri setup + - name: Install cargo-nextest + uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest + - name: Run miri tests on diskann-quantization - run: cargo miri test --package diskann-quantization + run: cargo miri nextest run --package diskann-quantization env: MIRIFLAGS: -Zmiri-strict-provenance diff --git a/diskann-providers/src/model/graph/provider/async_/table_delete_provider.rs b/diskann-providers/src/model/graph/provider/async_/table_delete_provider.rs index 64a2985f8..b205e4b67 100644 --- a/diskann-providers/src/model/graph/provider/async_/table_delete_provider.rs +++ b/diskann-providers/src/model/graph/provider/async_/table_delete_provider.rs @@ -69,6 +69,7 @@ impl TableDeleteProviderAsync { } /// Serialize the delete bitmap to bytes (little-endian u32 values) + #[cfg(target_feature = "bf_tree")] pub(crate) fn to_bytes(&self) -> Vec { let mut bytes = Vec::with_capacity(std::mem::size_of_val(self.delete_table.as_slice())); for atomic_val in &self.delete_table { @@ -79,6 +80,7 @@ impl TableDeleteProviderAsync { } /// Create a TableDeleteProviderAsync from serialized bytes + #[cfg(target_feature = "bf_tree")] pub(crate) fn from_bytes(bytes: &[u8], max_size: usize) -> Result { let expected_len = max_size.div_ceil(32); @@ -234,6 +236,7 @@ mod tests { } #[test] + #[cfg(target_feature = "bf_tree")] fn test_save_load_roundtrip() { let original = get_test_delete_table_provider(50, &[0, 5, 20, 34, 48]); let bytes = original.to_bytes(); @@ -246,6 +249,7 @@ mod tests { } #[test] + #[cfg(target_feature = "bf_tree")] fn test_from_bytes_size_mismatch() { // max_size=50 requires ceil(50/32) = 2 u32 values = 8 bytes // Provide wrong number of bytes (e.g., 4 bytes = 1 u32) From f7252d3f2f670d723fd6aa33f507416a0ac264ca Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Thu, 15 Jan 2026 11:45:27 -0800 Subject: [PATCH 05/14] Use the correct `cfg` guard. --- .../model/graph/provider/async_/table_delete_provider.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/diskann-providers/src/model/graph/provider/async_/table_delete_provider.rs b/diskann-providers/src/model/graph/provider/async_/table_delete_provider.rs index b205e4b67..8595f7f1d 100644 --- a/diskann-providers/src/model/graph/provider/async_/table_delete_provider.rs +++ b/diskann-providers/src/model/graph/provider/async_/table_delete_provider.rs @@ -69,7 +69,7 @@ impl TableDeleteProviderAsync { } /// Serialize the delete bitmap to bytes (little-endian u32 values) - #[cfg(target_feature = "bf_tree")] + #[cfg(feature = "bf_tree")] pub(crate) fn to_bytes(&self) -> Vec { let mut bytes = Vec::with_capacity(std::mem::size_of_val(self.delete_table.as_slice())); for atomic_val in &self.delete_table { @@ -80,7 +80,7 @@ impl TableDeleteProviderAsync { } /// Create a TableDeleteProviderAsync from serialized bytes - #[cfg(target_feature = "bf_tree")] + #[cfg(feature = "bf_tree")] pub(crate) fn from_bytes(bytes: &[u8], max_size: usize) -> Result { let expected_len = max_size.div_ceil(32); @@ -236,7 +236,7 @@ mod tests { } #[test] - #[cfg(target_feature = "bf_tree")] + #[cfg(feature = "bf_tree")] fn test_save_load_roundtrip() { let original = get_test_delete_table_provider(50, &[0, 5, 20, 34, 48]); let bytes = original.to_bytes(); @@ -249,7 +249,7 @@ mod tests { } #[test] - #[cfg(target_feature = "bf_tree")] + #[cfg(feature = "bf_tree")] fn test_from_bytes_size_mismatch() { // max_size=50 requires ceil(50/32) = 2 u32 values = 8 bytes // Provide wrong number of bytes (e.g., 4 bytes = 1 u32) From 8843d583ac8dfd02b3c18157cb3c0d9d776d84b4 Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Thu, 15 Jan 2026 11:55:00 -0800 Subject: [PATCH 06/14] Try fixing miri and tests. --- .github/workflows/ci.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d295bb46..6d6bd600b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,7 +98,7 @@ jobs: os: - windows-latest - ubuntu-latest - - macos-latest + steps: - uses: actions/checkout@v4 - name: Install Rust ${{ env.rust_stable }} @@ -137,7 +137,7 @@ jobs: - name: Generate code coverage run: | - cargo llvm-cov --workspace \ + cargo llvm-cov nextest \ --package diskann-wide \ --package diskann-vector \ --package diskann-quantization \ @@ -163,20 +163,18 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Rust nightly with miri - uses: dtolnay/rust-toolchain@nightly + uses: dtolnay/rust-toolchain@stable with: + toolchain: nightly components: miri - - uses: Swatinem/rust-cache@v2 - - - name: Setup miri - run: cargo miri setup - name: Install cargo-nextest uses: taiki-e/install-action@v2 with: tool: cargo-nextest - - name: Run miri tests on diskann-quantization + - uses: Swatinem/rust-cache@v2 + - name: miri run: cargo miri nextest run --package diskann-quantization env: - MIRIFLAGS: -Zmiri-strict-provenance + MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance From 66f6d7473c45ffc442a02791fa17ffb88d2bf209 Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Thu, 15 Jan 2026 12:03:55 -0800 Subject: [PATCH 07/14] More CI edits. --- .github/workflows/ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d6bd600b..fd3efd945 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,12 +129,18 @@ jobs: with: toolchain: ${{ env.rust_stable }} components: llvm-tools-preview + - name: Install cargo-llvm-cov uses: taiki-e/install-action@v2 with: tool: cargo-llvm-cov - - uses: Swatinem/rust-cache@v2 + - name: Install cargo-nextest + uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest + + - uses: Swatinem/rust-cache@v2 - name: Generate code coverage run: | cargo llvm-cov nextest \ @@ -158,7 +164,7 @@ jobs: miri: needs: basics - name: miri diskann-quantization + name: miri-test runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -175,6 +181,6 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: miri - run: cargo miri nextest run --package diskann-quantization + run: cargo +nightly miri nextest run --package diskann-quantization env: MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance From 01f17f6b8f42a37f0057c7c0176bb011fb7366ca Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Thu, 15 Jan 2026 12:16:52 -0800 Subject: [PATCH 08/14] Pull in LFS stored files. --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd3efd945..a5c0177e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,10 +101,14 @@ jobs: steps: - uses: actions/checkout@v4 + with: + lfs: true + - name: Install Rust ${{ env.rust_stable }} uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.rust_stable }} + - name: Install cargo-nextest uses: taiki-e/install-action@v2 with: @@ -124,6 +128,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + lfs: true + - name: Install Rust ${{ env.rust_stable }} uses: dtolnay/rust-toolchain@stable with: @@ -162,25 +169,28 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - miri: - needs: basics - name: miri-test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Rust nightly with miri - uses: dtolnay/rust-toolchain@stable - with: - toolchain: nightly - components: miri + # miri: + # needs: basics + # name: miri-test + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # with: + # lfs: true - - name: Install cargo-nextest - uses: taiki-e/install-action@v2 - with: - tool: cargo-nextest + # - name: Install Rust nightly with miri + # uses: dtolnay/rust-toolchain@stable + # with: + # toolchain: nightly + # components: miri - - uses: Swatinem/rust-cache@v2 - - name: miri - run: cargo +nightly miri nextest run --package diskann-quantization - env: - MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance + # - name: Install cargo-nextest + # uses: taiki-e/install-action@v2 + # with: + # tool: cargo-nextest + + # - uses: Swatinem/rust-cache@v2 + # - name: miri + # run: cargo +nightly miri nextest run --package diskann-quantization + # env: + # MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance From 840d1215a33019c4d5b4eaf6f86cafc3003c3cfd Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Thu, 15 Jan 2026 13:06:10 -0800 Subject: [PATCH 09/14] Try a profile with more optimizations. --- .cargo/nextest.toml | 28 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 6 +++--- Cargo.toml | 7 +++++++ 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 .cargo/nextest.toml diff --git a/.cargo/nextest.toml b/.cargo/nextest.toml new file mode 100644 index 000000000..22b5d6980 --- /dev/null +++ b/.cargo/nextest.toml @@ -0,0 +1,28 @@ +[profile.default] + +# terminate the test run it takes more than 10 minutes. +slow-timeout = { period = "600s", terminate-after = 1 } + +# "retries" defines the number of times a test should be retried. +retries = 3 + +# The number of threads to run tests with. +test-threads = "num-cpus" + +# The number of threads required for each test. +threads-required = 1 + +# Show these test statuses in the output. +status-level = "all" + +# Similar to status-level, show these test statuses at the end of the run. +final-status-level = "flaky" + +# "failure-output" defines when standard output and standard error for failing tests are produced. +failure-output = "immediate" + +# "success-output" controls production of standard output and standard error on success. +success-output = "never" + +# Cancel the test run on the first failure. For CI runs, this should be false. +fail-fast = false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5c0177e3..06d1c91e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,8 +119,8 @@ jobs: - name: test workspace with nextest run: | set -euxo pipefail - cargo nextest run --workspace - cargo test --doc --workspace + cargo nextest run --workspace --cargo-profile ci + cargo test --doc --workspace --cargo-profile ci coverage: needs: basics @@ -150,7 +150,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Generate code coverage run: | - cargo llvm-cov nextest \ + cargo llvm-cov nextest --cargo-profile ci \ --package diskann-wide \ --package diskann-vector \ --package diskann-quantization \ diff --git a/Cargo.toml b/Cargo.toml index 589533d2a..8f4c20aeb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -114,3 +114,10 @@ opt-level = 3 codegen-units = 1 debug = true split-debuginfo = "packed" + +[profile.ci] +inherits = "dev" +opt-level = 1 +debug = true +debug-assertions = true +overflow-checks = true From e8436d1cf787dd2b6893b29654f9d7adbe90e704 Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Thu, 15 Jan 2026 13:18:29 -0800 Subject: [PATCH 10/14] Loosen a test for CI. --- diskann-providers/src/model/pq/distance/dynamic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diskann-providers/src/model/pq/distance/dynamic.rs b/diskann-providers/src/model/pq/distance/dynamic.rs index cb854ff52..108fe0b30 100644 --- a/diskann-providers/src/model/pq/distance/dynamic.rs +++ b/diskann-providers/src/model/pq/distance/dynamic.rs @@ -601,7 +601,7 @@ mod tests { assert_relative_eq!( cosine_normalized.evaluate_similarity(&*code0, &*code1), expected, - max_relative = 2.0e-6, + max_relative = 4.0e-6, ); } } From 38196ad3ad2746651d8824f503b0c6b5631af31c Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Thu, 15 Jan 2026 13:37:17 -0800 Subject: [PATCH 11/14] Fix error bounds for non-AVX2 machines. --- .../src/algorithms/transforms/padding_hadamard.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diskann-quantization/src/algorithms/transforms/padding_hadamard.rs b/diskann-quantization/src/algorithms/transforms/padding_hadamard.rs index 72d8c63fc..ed6d3b27f 100644 --- a/diskann-quantization/src/algorithms/transforms/padding_hadamard.rs +++ b/diskann-quantization/src/algorithms/transforms/padding_hadamard.rs @@ -455,7 +455,7 @@ mod tests { let natural_errors = test_utils::ErrorSetup { norm: test_utils::Check::ulp(4), l2: test_utils::Check::ulp(4), - ip: test_utils::Check::absrel(3.0e-6, 2e-4), + ip: test_utils::Check::absrel(5.0e-6, 2e-4), }; // NOTE: Subsampling introduces high variance in the norm and L2, so our error From 5c82c69897f930e62d5d3d36e156a35b14672e78 Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Thu, 15 Jan 2026 14:05:47 -0800 Subject: [PATCH 12/14] Fix doc tests. --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06d1c91e8..3f2df19a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,7 +120,7 @@ jobs: run: | set -euxo pipefail cargo nextest run --workspace --cargo-profile ci - cargo test --doc --workspace --cargo-profile ci + cargo test --doc --workspace --profile ci coverage: needs: basics @@ -157,7 +157,6 @@ jobs: --package diskann \ --package diskann-linalg \ --package diskann-utils \ - --package diskann-providers \ --package diskann-disk \ --lcov --output-path lcov.info From 63e39538504cf8e7279fc38779b79b17fb83fa4b Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Thu, 15 Jan 2026 14:16:54 -0800 Subject: [PATCH 13/14] Also run CI tests with more features. --- .github/workflows/ci.yml | 90 ++++++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f2df19a2..ccf812649 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,10 +122,16 @@ jobs: cargo nextest run --workspace --cargo-profile ci cargo test --doc --workspace --profile ci - coverage: + test-workspace-features: needs: basics - name: code coverage - runs-on: ubuntu-latest + name: test workspace + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - windows-latest + - ubuntu-latest + steps: - uses: actions/checkout@v4 with: @@ -135,12 +141,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ env.rust_stable }} - components: llvm-tools-preview - - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@v2 - with: - tool: cargo-llvm-cov - name: Install cargo-nextest uses: taiki-e/install-action@v2 @@ -148,25 +148,61 @@ jobs: tool: cargo-nextest - uses: Swatinem/rust-cache@v2 - - name: Generate code coverage + + - name: test workspace with nextest run: | - cargo llvm-cov nextest --cargo-profile ci \ - --package diskann-wide \ - --package diskann-vector \ - --package diskann-quantization \ - --package diskann \ - --package diskann-linalg \ - --package diskann-utils \ - --package diskann-disk \ - --lcov --output-path lcov.info - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - files: lcov.info - fail_ci_if_error: false - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + set -euxo pipefail + cargo nextest run --workspace --cargo-profile ci \ + --features \ + virtual_storage,bf_tree,spherical-quantization,product-quantization,tracing,experimental_diversity_search + + cargo test --doc --workspace --profile ci + + # coverage: + # needs: basics + # name: code coverage + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # with: + # lfs: true + + # - name: Install Rust ${{ env.rust_stable }} + # uses: dtolnay/rust-toolchain@stable + # with: + # toolchain: ${{ env.rust_stable }} + # components: llvm-tools-preview + + # - name: Install cargo-llvm-cov + # uses: taiki-e/install-action@v2 + # with: + # tool: cargo-llvm-cov + + # - name: Install cargo-nextest + # uses: taiki-e/install-action@v2 + # with: + # tool: cargo-nextest + + # - uses: Swatinem/rust-cache@v2 + # - name: Generate code coverage + # run: | + # cargo llvm-cov nextest --cargo-profile ci \ + # --package diskann-wide \ + # --package diskann-vector \ + # --package diskann-quantization \ + # --package diskann \ + # --package diskann-linalg \ + # --package diskann-utils \ + # --package diskann-disk \ + # --lcov --output-path lcov.info + + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v4 + # with: + # files: lcov.info + # fail_ci_if_error: false + # env: + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} # miri: # needs: basics From 753c0c2571fcd7f4488208a5728913dc62a2269c Mon Sep 17 00:00:00 2001 From: Mark Hildebrand Date: Thu, 15 Jan 2026 14:44:11 -0800 Subject: [PATCH 14/14] Address NaN handling issue from a CI machine. --- diskann-wide/src/test_utils/common.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/diskann-wide/src/test_utils/common.rs b/diskann-wide/src/test_utils/common.rs index b566e711f..c8845c410 100644 --- a/diskann-wide/src/test_utils/common.rs +++ b/diskann-wide/src/test_utils/common.rs @@ -124,9 +124,8 @@ impl ScalarTraits for f32 { } fn exact_eq(self, other: Self) -> bool { - // Miri does not seem to handle `total_cmp` correctly when it comes to `NAN`s - so - // we special case this comparison when running with Miri. - #[cfg(miri)] + // NAN handling can be dependent on environment. For testing purposes, we just care + // that NANs are produced. if self.is_nan() && other.is_nan() { return true; }