Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ concurrency:
cancel-in-progress: true

env:
# Pass additional arguments to cargo using `--config build.rustflags=["...", "..."]`.
#
# This ensures that we do not overwrite the parameters in `.cargo/config.toml` unnecessarily.
RUST_CONFIG: 'build.rustflags=["-Dwarnings"]'
# Append to target-specific rustflags without replacing `.cargo/config.toml` settings.
RUST_CONFIG: 'target."cfg(all())".rustflags=["-Dwarnings"]'
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always

Expand Down Expand Up @@ -141,6 +139,8 @@ jobs:
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- name: "clippy --workspace --all-targets"
run: cargo clippy --locked --workspace --all-targets --no-deps --config "$RUST_CONFIG" -- -Dwarnings
- name: "clippy --workspace --all-targets --release"
run: cargo clippy --locked --workspace --all-targets --no-deps --release --config "$RUST_CONFIG" -- -Dwarnings

clippy-features:
strategy:
Expand All @@ -157,13 +157,24 @@ jobs:
- name: Install Rust
run: rustup show && rustup component add clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- name: "clippy --workspace --all-targets"
- name: "clippy --workspace --all-targets --all-features"
run: |
set -euxo pipefail
cargo clippy --locked --workspace \
--all-targets \
--all-features \
--no-deps \
--config "$RUST_CONFIG" \
-- -Dwarnings

- name: "clippy --workspace --all-targets --all-features --release"
run: |
set -euxo pipefail
cargo clippy --locked --workspace \
--all-targets \
--all-features \
--no-deps \
--release \
--config "$RUST_CONFIG" \
-- -Dwarnings

Expand Down Expand Up @@ -205,6 +216,13 @@ jobs:
--no-deps \
--config "$RUST_CONFIG" \
-- -Dwarnings
cargo clippy --locked --package "$crate" \
--no-default-features \
--all-targets \
--release \
--no-deps \
--config "$RUST_CONFIG" \
-- -Dwarnings
done

codeql:
Expand All @@ -229,7 +247,7 @@ jobs:
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3

- name: Build workspace
run: cargo build --workspace --locked --profile test
run: cargo build --workspace --locked --profile test --config "$RUST_CONFIG"

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
Expand All @@ -245,9 +263,9 @@ jobs:
run: rustup show
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- name: "workspace docs (including private items)"
run: cargo doc --locked --workspace --no-deps --all-features --document-private-items
run: cargo doc --locked --workspace --no-deps --all-features --document-private-items --config "$RUST_CONFIG"
env:
RUSTDOCFLAGS: -D rustdoc::all
RUSTDOCFLAGS: -Dwarnings -D rustdoc::all

vectorset-fmt:
name: vectorset format check
Expand Down Expand Up @@ -284,6 +302,10 @@ jobs:
run: |
cd vectorset
cargo clippy --locked --all-targets --no-deps --config "$RUST_CONFIG" -- -Dwarnings
- name: "vectorset: clippy --all-targets --release"
run: |
cd vectorset
cargo clippy --locked --all-targets --no-deps --config "$RUST_CONFIG" --release -- -Dwarnings

vectorset-build:
strategy:
Expand All @@ -302,8 +324,8 @@ jobs:
- name: "vectorset: build debug & release"
run: |
cd vectorset
cargo build --locked
cargo build --locked --release
cargo build --locked --config "$RUST_CONFIG"
cargo build --locked --release --config "$RUST_CONFIG"

# Test micro-architecture detection and dispatching.
#
Expand Down Expand Up @@ -428,7 +450,7 @@ jobs:
- name: "SDE Tests (AVX-512)"
run: |
set -euxo pipefail
cargo test --locked \
cargo test --locked --config "$RUST_CONFIG" \
--package diskann-wide \
--package diskann-vector \
--package diskann-quantization \
Expand Down Expand Up @@ -538,7 +560,7 @@ jobs:

- name: Generate miri code coverage
env:
RUSTFLAGS: "--cfg=miri"
RUSTFLAGS: "-Dwarnings --cfg=miri"
run: |
cargo +nightly llvm-cov nextest --locked \
--package diskann-quantization \
Expand Down Expand Up @@ -599,11 +621,11 @@ jobs:

- name: Generate baseline LLVM lines
working-directory: baseline
run: cargo llvm-lines --package diskann-benchmark --all-features --release | head -100 | tee ../baseline-llvm-lines.txt
run: cargo llvm-lines --package diskann-benchmark --all-features --release --config "$RUST_CONFIG" | head -100 | tee ../baseline-llvm-lines.txt

- name: Generate current LLVM lines
working-directory: pr
run: cargo llvm-lines --package diskann-benchmark --all-features --release | head -100 | tee ../current-llvm-lines.txt
run: cargo llvm-lines --package diskann-benchmark --all-features --release --config "$RUST_CONFIG" | head -100 | tee ../current-llvm-lines.txt

- name: Compare LLVM lines
run: bash pr/.github/scripts/compare-llvm-lines.sh baseline-llvm-lines.txt current-llvm-lines.txt
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/disk-benchmarks-aa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ concurrency:
cancel-in-progress: true

env:
RUST_CONFIG: 'target."cfg(all())".rustflags=["-Dwarnings"]'
RUST_BACKTRACE: 1
PERF_INPUTS: diskann-benchmark/perf_test_inputs

Expand Down Expand Up @@ -82,26 +83,26 @@ jobs:
# A/A: build once, run twice (identical code — only detecting environment noise)
- name: Build benchmark binary
working-directory: diskann_rust
run: cargo build -p diskann-benchmark --features disk-index --release
run: cargo build -p diskann-benchmark --features disk-index --release --config "$RUST_CONFIG"

- name: Run baseline benchmark
working-directory: diskann_rust
run: |
cargo run -p diskann-benchmark --features disk-index --release -- \
cargo run -p diskann-benchmark --features disk-index --release --config "$RUST_CONFIG" -- \
run --input-file ${{ env.PERF_INPUTS }}/${{ matrix.config }} \
--output-file target/tmp/${{ matrix.dataset }}_baseline.json

- name: Run target benchmark
working-directory: diskann_rust
run: |
cargo run -p diskann-benchmark --features disk-index --release -- \
cargo run -p diskann-benchmark --features disk-index --release --config "$RUST_CONFIG" -- \
run --input-file ${{ env.PERF_INPUTS }}/${{ matrix.config }} \
--output-file target/tmp/${{ matrix.dataset }}_target.json

- name: Validate benchmark results
working-directory: diskann_rust
run: |
cargo run -p diskann-benchmark --features disk-index --release -- \
cargo run -p diskann-benchmark --features disk-index --release --config "$RUST_CONFIG" -- \
check run \
--tolerances ${{ env.PERF_INPUTS }}/disk-index-tolerances.json \
--input-file ${{ env.PERF_INPUTS }}/${{ matrix.config }} \
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/disk-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ concurrency:
cancel-in-progress: true

env:
RUST_CONFIG: 'target."cfg(all())".rustflags=["-Dwarnings"]'
RUST_BACKTRACE: 1
PERF_INPUTS: diskann-benchmark/perf_test_inputs

Expand Down Expand Up @@ -117,21 +118,21 @@ jobs:
- name: Run baseline benchmark
working-directory: baseline
run: |
cargo run -p diskann-benchmark --features disk-index --release -- \
cargo run -p diskann-benchmark --features disk-index --release --config "$RUST_CONFIG" -- \
run --input-file ../diskann_rust/${{ env.PERF_INPUTS }}/${{ matrix.config }} \
--output-file target/tmp/${{ matrix.dataset }}_baseline.json

- name: Run current branch benchmark
working-directory: diskann_rust
run: |
cargo run -p diskann-benchmark --features disk-index --release -- \
cargo run -p diskann-benchmark --features disk-index --release --config "$RUST_CONFIG" -- \
run --input-file ${{ env.PERF_INPUTS }}/${{ matrix.config }} \
--output-file target/tmp/${{ matrix.dataset }}_target.json

- name: Validate benchmark results
working-directory: diskann_rust
run: |
cargo run -p diskann-benchmark --features disk-index --release -- \
cargo run -p diskann-benchmark --features disk-index --release --config "$RUST_CONFIG" -- \
check run \
--tolerances ${{ env.PERF_INPUTS }}/disk-index-tolerances.json \
--input-file ${{ env.PERF_INPUTS }}/${{ matrix.config }} \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
cancel-in-progress: true

env:
RUST_CONFIG: 'build.rustflags=["-Dwarnings"]'
RUST_CONFIG: 'target."cfg(all())".rustflags=["-Dwarnings"]'
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always

Expand Down
Loading