Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a9c5b50
This is a lot of work.
Jun 6, 2026
5ecae48
Checkpoint.
Jun 10, 2026
1a367cb
Checkpoint.
Jun 10, 2026
3203d32
More stuff.
Jun 11, 2026
6ab25c0
Checkopint.
Jun 12, 2026
f60cfe1
Checkpoint.
Jun 12, 2026
8782b6b
Checkpoint.
Jun 13, 2026
ab22b90
Checkpoint.
Jun 13, 2026
b3a2a2a
ID translation.
Jun 13, 2026
1f9f20e
Streaming works (kinda).
Jun 14, 2026
c4e20b3
Checkpoint.
Jun 17, 2026
2f03e0d
Getting closer.
Jun 17, 2026
89209ef
Checkpoint.
Jun 17, 2026
70f03b9
Reorganize.
Jun 18, 2026
02cb059
Fix up compile errors.
Jun 18, 2026
340d3a5
Checkpoint.
Jun 19, 2026
135e743
Checkpoing before vibes.
Jun 22, 2026
690d1de
Checkpoint.
Jun 23, 2026
969156c
Checkpoint.
Jun 23, 2026
a1b2319
Checkpoint.
Jun 23, 2026
b52d9aa
Checkpoint.
Jun 24, 2026
5efb805
More progress.
Jun 24, 2026
d5a24f4
Unit testing is almost there ...
Jun 24, 2026
b822031
The end is in sight.
Jun 25, 2026
e030eec
Checkpoint.
Jun 25, 2026
6170d3b
Test coverage looking good.
Jun 26, 2026
f1d6dfd
Clippy!.
Jun 26, 2026
2d022db
Clippy!
Jun 26, 2026
239d36e
Merge remote-tracking branch 'origin/main' into mhildebr/inmem2
Jun 26, 2026
366aee2
We're getting there!
Jun 26, 2026
03ac022
Checkpoint.
Jun 26, 2026
4207c1d
Move machines.
Jun 29, 2026
23e386a
Checkpoint.
Jul 1, 2026
af57bb6
Minor tweaks.
Jul 1, 2026
b91419b
Add RFC.
Jul 2, 2026
9d5f143
Upload RFC.
Jul 2, 2026
9a10379
Restore stress tests.
Jul 2, 2026
5971698
Merge remote-tracking branch 'origin/main' into mhildebr/inmem2
Jul 2, 2026
f1a7121
More cleanups.
Jul 2, 2026
b3a00b7
Add tests for `KeyValue`.
Jul 2, 2026
ab92dae
Tests for KeyValue.
Jul 2, 2026
159bea8
Merge remote-tracking branch 'origin/main' into mhildebr/inmem2
Jul 2, 2026
3b59cf1
Cleanup and reduce false-sharing in stress test.
Jul 2, 2026
2678f36
Fix-up Cargo.toml
Jul 2, 2026
db9d1b9
Make compatible with Aarch64.
Jul 2, 2026
43d3fcf
Not syncing with git?
Jul 2, 2026
ce7a321
Remove extra whitespace.
Jul 2, 2026
a4ee3b2
Typos.
hildebrandmw Jul 3, 2026
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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
CARGO_TERM_COLOR: always
# The features we want to explicitly test. For example, the `flatbuffers-build` feature
# of `diskann-quantization` requires additional setup and so must not be included by default.
DISKANN_FEATURES: "virtual_storage,spherical-quantization,product-quantization,tracing,experimental_diversity_search,disk-index,flatbuffers,linalg,codegen"
DISKANN_FEATURES: "virtual_storage,spherical-quantization,product-quantization,tracing,experimental_diversity_search,disk-index,flatbuffers,linalg,codegen,integration-test,inmem2"

# Intel SDE version used for baseline and AVX-512 emulation jobs.
SDE_VERSION: "sde-external-10.8.0-2026-03-15-lin"
Expand Down
25 changes: 25 additions & 0 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ members = [
"diskann-disk",
"diskann-label-filter",
"diskann-garnet",
"diskann-inmem",
# Infrastructure
"diskann-benchmark-runner",
"diskann-benchmark-core",
Expand Down Expand Up @@ -60,6 +61,7 @@ diskann-platform = { path = "diskann-platform", version = "0.54.0" }
diskann = { path = "diskann", version = "0.54.0" }
# Providers
diskann-providers = { path = "diskann-providers", default-features = false, version = "0.54.0" }
diskann-inmem = { path = "diskann-inmem", default-features = false, version = "0.54.0" }
diskann-disk = { path = "diskann-disk", version = "0.54.0" }
diskann-label-filter = { path = "diskann-label-filter", version = "0.54.0" }
# Infra
Expand Down Expand Up @@ -120,3 +122,7 @@ opt-level = 1
debug = true
debug-assertions = true
overflow-checks = true

[profile.samply]
inherits = "release"
debug = true
4 changes: 2 additions & 2 deletions diskann-benchmark-runner/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ impl App {
)?;
writeln!(output, "Closest matches:\n")?;
for (i, mismatch) in mismatches.into_iter().enumerate() {
writeln!(output, " {}. \"{}\":", i + 1, mismatch.method(),)?;
writeln!(output, "{}\n", Indent::new(mismatch.reason(), 8),)?;
writeln!(output, " {}. \"{}\":", i + 1, mismatch.method())?;
writeln!(output, "{}\n", Indent::new(mismatch.reason(), 8))?;
}
writeln!(output)?;

Expand Down
6 changes: 6 additions & 0 deletions diskann-benchmark-runner/src/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ impl std::ops::Deref for InputFile {
}
}

impl std::fmt::Display for InputFile {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.display())
}
}

///////////
// Tests //
///////////
Expand Down
218 changes: 218 additions & 0 deletions diskann-benchmark-runner/src/utils/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,135 @@ where
}
}

//////////////
// KeyValue //
//////////////

enum MaybeLazy<'a> {
Lazy(&'a dyn std::fmt::Display),
Eager(String),
}

impl std::fmt::Display for MaybeLazy<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Lazy(lazy) => write!(f, "{}", lazy),
Self::Eager(s) => f.write_str(s),
}
}
}

impl std::fmt::Debug for MaybeLazy<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
struct AsDisplay<'a>(&'a dyn std::fmt::Display);
impl std::fmt::Debug for AsDisplay<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}

match self {
Self::Lazy(o) => {
let as_display = AsDisplay(o);
f.debug_tuple("MaybeLazy::Lazy").field(&as_display).finish()
}
Self::Eager(s) => f.debug_tuple("MaybeLazy::Eager").field(s).finish(),
}
}
}

/// Display a dynamic list of key-value pairs in a YAML-like style.
///
/// Keys are left-aligned and single-line values are aligned into a common column
/// just past the longest key. A value that renders to multiple lines (for example
/// a nested [`KeyValue`] or any other multi-line block) is placed on the lines
/// following its key, indented by two spaces. This keeps nested structures visibly
/// subordinate to their key regardless of whether the value is itself a key-value
/// list or an opaque block.
///
/// # Examples
///
/// ```
/// use diskann_benchmark_runner::utils::fmt::KeyValue;
///
/// let mut kv = KeyValue::new();
/// kv.push("a", &1);
/// kv.push("hello", &"world");
///
/// let expected = "a: 1\nhello: world";
///
/// assert_eq!(kv.to_string(), expected);
/// ```
///
/// Multi-line values are indented beneath their key:
///
/// ```
/// use diskann_benchmark_runner::utils::fmt::KeyValue;
///
/// let mut inner = KeyValue::new();
/// inner.push("x", &1);
/// inner.push("yy", &2);
/// let inner = inner.to_string();
///
/// let mut kv = KeyValue::new();
/// kv.push("name", &"example");
/// kv.push("nested", &inner);
///
/// let expected = "name: example\nnested:\n x: 1\n yy: 2";
///
/// assert_eq!(kv.to_string(), expected);
/// ```
#[derive(Debug, Default)]
pub struct KeyValue<'a> {
kv: Vec<(&'a str, MaybeLazy<'a>)>,
max_key_length: usize,
}

impl<'a> KeyValue<'a> {
/// Create a new empty [`KeyValue`] formatter.
pub fn new() -> Self {
Self {
kv: Vec::new(),
max_key_length: 0,
}
}

/// Push the key-value pair to `self` for formatting.
pub fn push(&mut self, key: &'a str, value: &'a dyn std::fmt::Display) {
self.max_key_length = self.max_key_length.max(key.len());
self.kv.push((key, MaybeLazy::Lazy(value)))
}

/// Push the key-value pair to `self` for formatting - eagerly formatting `value`.
pub fn push_eager<D>(&mut self, key: &'a str, value: D)
where
D: std::fmt::Display,
{
self.max_key_length = self.max_key_length.max(key.len());
self.kv.push((key, MaybeLazy::Eager(value.to_string())))
}
}

impl std::fmt::Display for KeyValue<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let width = self.max_key_length;
let mut prefix = "";
for (k, v) in self.kv.iter() {
let rendered = v.to_string();
if rendered.contains('\n') {
write!(f, "{}{}:\n{}", prefix, k, Indent::new(&rendered, 2))?
} else {
// Left-align the key and pad so that all single-line values line up in a
// column one space past the longest key's colon.
let pad = (width + 1).saturating_sub(k.len());
write!(f, "{}{}:{:pad$}{rendered}", prefix, k, "")?;
}
prefix = "\n";
}
Ok(())
}
}

///////////
// Tests //
///////////
Expand Down Expand Up @@ -606,4 +735,93 @@ string, , string
.with_pair(" and ");
assert_eq!(d.to_string(), "\"topk\" and \"range\"");
}

//----------//
// KeyValue //
//----------//

// Strip a preceding newline if it exists.
fn process(x: &str) -> &str {
let x = x.strip_prefix('\n').unwrap_or(x);
x.strip_suffix('\n').unwrap_or(x)
}

#[test]
fn test_key_value_empty() {
let kv = KeyValue::new();
assert_eq!(kv.to_string(), "");
}

#[test]
fn test_key_value_single_pair() {
let mut kv = KeyValue::new();
kv.push("a", &1);
assert_eq!(kv.to_string(), "a: 1");
}

#[test]
fn test_key_value_aligns_values() {
let mut kv = KeyValue::new();
kv.push("a", &1);
kv.push("hello", &"world");
let expected = process(
r#"
a: 1
hello: world
"#,
);
assert_eq!(kv.to_string(), expected);
}

#[test]
fn test_key_value_push_eager() {
let mut kv = KeyValue::new();
kv.push_eager("a", 1);
kv.push_eager("hello", "world");

let expected = process(
r#"
a: 1
hello: world
"#,
);

assert_eq!(kv.to_string(), expected);
}

#[test]
fn test_key_value_multiline_value_is_indented() {
let mut inner = KeyValue::new();
inner.push("x", &1);
inner.push("yy", &2);
let inner = inner.to_string();

let mut kv = KeyValue::new();
kv.push("name", &"example");
kv.push("nested", &inner);
kv.push("another line", &1);

let expected = process(
r#"
name: example
nested:
x: 1
yy: 2
another line: 1
"#,
);

assert_eq!(kv.to_string(), expected);
}

#[test]
fn maybe_lazy_debug() {
let x = MaybeLazy::Lazy(&1);
let dbg = format!("{:?}", x);
assert_eq!(dbg, "MaybeLazy::Lazy(1)");

let x = MaybeLazy::Eager("hello".into());
let dbg = format!("{:?}", x);
assert_eq!(dbg, "MaybeLazy::Eager(\"hello\")");
}
}
4 changes: 4 additions & 0 deletions diskann-benchmark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ opentelemetry_sdk = { workspace = true, optional = true }
scopeguard = { version = "1.2", optional = true }
diskann-benchmark-core = { workspace = true, features = ["bigann"] }
itertools.workspace = true
diskann-inmem = { workspace = true, optional = true }

[lints]
clippy.undocumented_unsafe_blocks = "warn"
Expand Down Expand Up @@ -67,6 +68,9 @@ minmax-quantization = []
# Enable multi-vector MaxSim distance benchmarks
multi-vector = []

# Enable inmem 2.0
inmem2 = ["dep:diskann-inmem"]

# Enable bftree backend
bftree = ["dep:diskann-bftree"]

Expand Down
Loading
Loading