Skip to content
Open
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions diskann-benchmark-core/src/streaming/executors/bigann/runbook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl RunBook {

/// Returns a reference to the stages in this runbook.
#[cfg(test)]
pub(super) fn stages(&self) -> &[Stage] {
pub fn stages(&self) -> &[Stage] {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for now this can be left as #[cfg(test)].

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, you're right, this was intermediate state

&self.stages
}

Expand Down Expand Up @@ -393,6 +393,19 @@ impl ScanDirectory {

Ok(Self { directory, files })
}

/// Returns the expected BigANN groundtruth file name for a stage.
///
/// Files follow the `step<stage>.gt<suffix>` naming convention.
pub fn groundtruth_filename(stage: usize, suffix: &str) -> String {
format!("step{}.{}", stage, suffix)
}

/// Returns the expected BigANN groundtruth path for a stage.
pub fn groundtruth_path(&self, stage: usize, suffix: &str) -> PathBuf {
self.directory
.join(Self::groundtruth_filename(stage, suffix))
}
}

impl FindGroundtruth for ScanDirectory {
Expand All @@ -402,7 +415,7 @@ impl FindGroundtruth for ScanDirectory {
///
/// Returns an error if no matching file is found or if multiple matches exist.
fn find_groundtruth(&mut self, stage: usize) -> anyhow::Result<PathBuf> {
let prefix = format!("step{}.gt", stage);
let prefix = Self::groundtruth_filename(stage, "gt");

enum Matches<'a> {
None,
Expand Down Expand Up @@ -437,10 +450,10 @@ impl FindGroundtruth for ScanDirectory {
match matches {
Matches::One(m) => Ok(self.directory.join(m)),
Matches::None => Err(anyhow::anyhow!(
"No groundtruth found for step {} in \"{}\", expected pattern: \"step{}.gt[0-9]*\"",
"No groundtruth found for step {} in \"{}\", expected pattern: \"{}[0-9]*\"",
stage,
self.directory.display(),
stage,
prefix,
)),
Matches::Many(matches) => Err(anyhow::anyhow!(
"Multiple groundtruth files found for step {} in \"{}\": {:?}",
Expand Down
1 change: 1 addition & 0 deletions diskann-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ clap = { workspace = true, features = ["derive"] }
diskann-providers = { workspace = true, default-features = false } # see `linalg/Cargo.toml`
diskann-vector = { workspace = true }
diskann-utils = { workspace = true }
diskann-benchmark-core = { workspace = true, features = ["bigann"] }
bytemuck.workspace = true
Comment thread
magdalendobson marked this conversation as resolved.
num_cpus.workspace = true
rayon.workspace = true
Expand Down
Loading
Loading