Skip to content
Merged
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
2 changes: 1 addition & 1 deletion diskann-benchmark-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description.workspace = true
authors.workspace = true
repository.workspace = true
license.workspace = true
edition.workspace = true
edition = "2024"

[dependencies]
anyhow = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion diskann-benchmark-runner/dev/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! Development CLI for exercising the benchmark runner with its test registry.

use clap::Parser;
use diskann_benchmark_runner::{output, test, App, Registry};
use diskann_benchmark_runner::{App, Registry, output, test};

fn main() -> anyhow::Result<()> {
// Parse the command line options.
Expand Down
4 changes: 2 additions & 2 deletions diskann-benchmark-runner/src/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use serde::{Deserialize, Serialize};

use crate::{internal::visibility::Visibility, Checkpoint, Input, Output};
use crate::{Checkpoint, Input, Output, internal::visibility::Visibility};

///////////////
// Benchmark //
Expand Down Expand Up @@ -328,7 +328,7 @@ pub(crate) struct FailureScore(pub(crate) u32);
pub(crate) mod internal {
use super::*;

use crate::{input::internal::Any, Features};
use crate::{Features, input::internal::Any};

use anyhow::Context;
use thiserror::Error;
Expand Down
2 changes: 1 addition & 1 deletion diskann-benchmark-runner/src/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl Kind {
mod tests {
use super::*;

use std::fs::{create_dir, File};
use std::fs::{File, create_dir};

#[test]
fn test_constructor() {
Expand Down
6 changes: 1 addition & 5 deletions diskann-benchmark-runner/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ impl From<&'static str> for Features {
impl std::fmt::Display for Features {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
fn feature(plural: bool) -> &'static str {
if plural {
"features"
} else {
"feature"
}
if plural { "features" } else { "feature" }
}

match &self.0 {
Expand Down
2 changes: 1 addition & 1 deletion diskann-benchmark-runner/src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl std::fmt::Display for InputFile {

#[cfg(test)]
mod tests {
use std::fs::{create_dir, File};
use std::fs::{File, create_dir};

use super::*;

Expand Down
2 changes: 1 addition & 1 deletion diskann-benchmark-runner/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT license.
*/

use crate::{internal::visibility::Visibility, Checker};
use crate::{Checker, internal::visibility::Visibility};

/// Inputs to [`Benchmarks`](crate::Benchmark).
///
Expand Down
5 changes: 3 additions & 2 deletions diskann-benchmark-runner/src/internal/regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ use serde::{Deserialize, Serialize};
use serde_json::Value;

use crate::{
benchmark::{internal::CheckedPassFail, PassFail},
Checker,
benchmark::{PassFail, internal::CheckedPassFail},
input::internal::Any,
internal::load_from_disk,
jobs, registry, result, Checker,
jobs, registry, result,
};

////////////
Expand Down
10 changes: 6 additions & 4 deletions diskann-benchmark-runner/src/internal/visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ mod tests {
fn test_is_available() {
let features = Features::new("some-feature");
assert!(Visibility::Available.is_available());
assert!(!Visibility::Gated {
features: &features
}
.is_available());
assert!(
!Visibility::Gated {
features: &features
}
.is_available()
);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion diskann-benchmark-runner/src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::path::{Path, PathBuf};
use anyhow::Context;
use serde::{Deserialize, Serialize};

use crate::{checker::Checker, input, Registry};
use crate::{Registry, checker::Checker, input};

#[derive(Debug)]
pub(crate) struct Jobs {
Expand Down
8 changes: 4 additions & 4 deletions diskann-benchmark-runner/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* Licensed under the MIT license.
*/

use std::collections::{hash_map::Entry, HashMap};
use std::collections::{HashMap, hash_map::Entry};

use thiserror::Error;

use crate::{
benchmark::{self, internal::AnnotatedMatch, Benchmark, MatchContext, Regression, Score},
Checkpoint, Features, Input, Output,
benchmark::{self, Benchmark, MatchContext, Regression, Score, internal::AnnotatedMatch},
input,
internal::visibility::Visibility,
Checkpoint, Features, Input, Output,
};

/// A collection of registered inputs and benchmarks.
Expand Down Expand Up @@ -609,7 +609,7 @@ pub(crate) struct RegisteredTolerance<'a> {
mod tests {
use super::*;

use crate::{input, Checker};
use crate::{Checker, input};

macro_rules! input {
($T:ident, $tag:literal) => {
Expand Down
2 changes: 1 addition & 1 deletion diskann-benchmark-runner/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use std::path::Path;

use serde::{ser::SerializeSeq, Deserialize, Serialize, Serializer};
use serde::{Deserialize, Serialize, Serializer, ser::SerializeSeq};

/// A helper to generate incremental snapshots of data while a benchmark is progressing.
///
Expand Down
2 changes: 1 addition & 1 deletion diskann-benchmark-runner/src/test/dim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use std::io::Write;
use serde::{Deserialize, Serialize};

use crate::{
benchmark::{MatchContext, PassFail, Regression, Score},
Benchmark, Checker, Checkpoint, Input, Output,
benchmark::{MatchContext, PassFail, Regression, Score},
};

///////////
Expand Down
2 changes: 1 addition & 1 deletion diskann-benchmark-runner/src/test/gated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::io::Write;
use serde::{Deserialize, Serialize};

use crate::{
benchmark::MatchContext, benchmark::Score, Benchmark, Checker, Checkpoint, Input, Output,
Benchmark, Checker, Checkpoint, Input, Output, benchmark::MatchContext, benchmark::Score,
};

use super::{dim::DimInput, typed::TypeInput};
Expand Down
2 changes: 1 addition & 1 deletion diskann-benchmark-runner/src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use std::collections::HashSet;

use crate::{registry, Features};
use crate::{Features, registry};

mod dim;
mod gated;
Expand Down
2 changes: 1 addition & 1 deletion diskann-benchmark-runner/src/test/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use std::io::Write;
use serde::{Deserialize, Serialize};

use crate::{
Benchmark, Checker, Checkpoint, Input, Output,
benchmark::{MatchContext, PassFail, Regression, Score},
utils::datatype::{AsDataType, DataType},
Benchmark, Checker, Checkpoint, Input, Output,
};

///////////
Expand Down
8 changes: 4 additions & 4 deletions diskann-benchmark-runner/src/ux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ pub fn strip_backtrace(s: String) -> String {
in_stacktrace = true;

// Remove a previous empty line (if any).
if let Some(previous) = lines.last() {
if previous.is_empty() {
lines.pop();
}
if let Some(previous) = lines.last()
&& previous.is_empty()
{
lines.pop();
}
} else {
lines.push(line);
Expand Down
Loading