Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
45ddbcf
split saveload PR into two -- core with all the Save[Saveable]/Load[L…
suhasjs Jun 18, 2026
7d29f1c
making copilot review happy
suhasjs Jun 18, 2026
f064610
making copilot review happy
suhasjs Jun 18, 2026
5ca175c
moved up one level since both load/save paths use them
suhasjs Jun 22, 2026
2cd7e6e
removed ContextInner; added new SaveContext, LoadContext traits; save…
suhasjs Jun 22, 2026
6cea251
added file-level tests to improve coverage
suhasjs Jun 22, 2026
14ceecc
Changed SaveContext::write to take Option<&str>. This allows us to wr…
suhasjs Jun 22, 2026
407ff32
gave Reader a new(); added Display and from_str to Version, serde cal…
suhasjs Jun 23, 2026
07f0020
added fallback to None if key does not pass validation in SaveContext…
suhasjs Jun 23, 2026
0c7da43
added a quick short README
suhasjs Jun 23, 2026
3f82e6b
abstracted away Backend --> Writer now stores a dyn WriterInner + add…
suhasjs Jun 24, 2026
6c51b91
added ReaderInner trait to allow trait object inside Reader + doc upd…
suhasjs Jun 24, 2026
db62599
Made Write pub(crate); removed Bytes and its serde path; added explic…
suhasjs Jun 29, 2026
a404c05
cleanup failed save in DiskSaveContext; treat hint as None in MemoryS…
suhasjs Jun 29, 2026
e177357
more test coverage
suhasjs Jun 29, 2026
11cbc89
making cargo fmt happy
suhasjs Jun 29, 2026
d5e4087
updated README; dropped 'patch' from VERSION
suhasjs Jun 30, 2026
89b894f
improved test coverage for disk + memory backends
suhasjs Jun 30, 2026
aaaea47
bugfix NaN + infinity handling (thanks to Jordan)
suhasjs Jun 30, 2026
eb85f26
NaN + inf handling part 2 -- fix test
suhasjs Jun 30, 2026
bf8c318
improve test coverage for number.rs
suhasjs Jun 30, 2026
740e977
make cargo fmt happy
suhasjs Jun 30, 2026
c2e83b1
readme update
suhasjs Jun 30, 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
10 changes: 10 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ members = [
"diskann-benchmark-core",
"diskann-benchmark-simd",
"diskann-benchmark",
"diskann-record",
"diskann-tools",
"vectorset",
"diskann-bftree",
Expand Down Expand Up @@ -66,6 +67,7 @@ diskann-benchmark-runner = { path = "diskann-benchmark-runner", version = "0.54.
diskann-benchmark-core = { path = "diskann-benchmark-core", version = "0.54.0" }
diskann-tools = { path = "diskann-tools", version = "0.54.0" }
diskann-bftree = {path = "diskann-bftree", version = "0.54.0" }
diskann-record = { path = "diskann-record", version = "0.54.0" }

# External dependencies (shared versions)
anyhow = "1.0.98"
Expand Down
24 changes: 24 additions & 0 deletions diskann-record/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "diskann-record"
version.workspace = true
description.workspace = true
authors.workspace = true
repository.workspace = true
license.workspace = true
edition = "2024"

[dependencies]
anyhow.workspace = true
serde = { workspace = true, features = ["derive"], optional = true }
serde_json = { workspace = true, optional = true }

[features]
default = ["disk"]
serde = ["dep:serde"]
disk = ["serde", "dep:serde_json"]

[dev-dependencies]
tempfile.workspace = true

[lints]
workspace = true
19 changes: 19 additions & 0 deletions diskann-record/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# DiskANN Record

This crate provides a small framework for persisting structured Rust values (`struct`, `enum`,
`Option<T>`, `Vec<T>`, and primitives) as a manifest (can be serialized to JSON) plus a set
of side-car binary artifacts, and reloading them later. It is can be used by `diskann`
providers and indexes to implement durable, consistent and backward-compatible checkpoints.

Types describe how they map to a versioned record by implementing the `save::Save` and
`load::Load` traits; the `save_fields!` and `load_fields!` macros handle the
field-by-field plumbing for plain structs. Every record carries a `Version` so loaders
can detect schema changes and either upgrade or fall back through a probing chain.

The goal is to allow crates like `diskann` to checkpoint their state without depending on
Comment thread
suhasjs marked this conversation as resolved.
a particular serialization backend. Currently, this crate implements `Disk` and `Memory` backends
-- `Disk` for persistent storage and `Memory` for in-memory operations.
`Memory` pipes the output of its `SaveContext` directly into the input of its `LoadContext`, so it is not compatible with other backends.
A hypothetical `ObjectStore` backend could be implemented to be compatible with `Disk` backends to support caching and other advanced features.

This crate has minimal dependencies by design.
Loading
Loading