From 996f3dc1140abe60dcdf09bfb7b680490bc510a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 08:59:49 +0000 Subject: [PATCH 1/5] Initial plan From dcc90671e1dd242b075b77dacf59473b37efb631 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 09:12:57 +0000 Subject: [PATCH 2/5] Address PR feedback: revert comments and refactor test helper functions Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com> --- .../storage_provider_aligned_file_reader.rs | 13 ++++--------- diskann-providers/src/model/pq/pq_construction.rs | 6 +++--- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs b/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs index 6637fc4a9..29322b0e5 100644 --- a/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs +++ b/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs @@ -59,20 +59,15 @@ mod tests { use super::*; use diskann_providers::common::AlignedBoxWithSlice; - fn test_index_path() -> String { - "/disk_index_misc/disk_index_siftsmall_learn_256pts_R4_L50_A1.2_aligned_reader_test.index" - .to_string() - } - - fn test_index_os_path() -> std::path::PathBuf { + fn test_index_path() -> std::path::PathBuf { test_data_root().join( "disk_index_misc/disk_index_siftsmall_learn_256pts_R4_L50_A1.2_aligned_reader_test.index", ) } fn setup_reader() -> StorageProviderAlignedFileReader { - let storage_provider = VirtualStorageProvider::new_overlay(test_data_root()); - StorageProviderAlignedFileReader::new(&storage_provider, &test_index_path()).unwrap() + let storage_provider = VirtualStorageProvider::new_overlay("/"); + StorageProviderAlignedFileReader::new(&storage_provider, &test_index_path().to_string_lossy()).unwrap() } #[test] @@ -107,7 +102,7 @@ mod tests { assert!(result.is_ok()); // Assert that the actual data is correct. - let mut file = File::open(test_index_os_path()).unwrap(); + let mut file = File::open(test_index_path()).unwrap(); for current_read in aligned_reads { let offset = current_read.offset(); let mut expected = vec![0; current_read.aligned_buf().len()]; diff --git a/diskann-providers/src/model/pq/pq_construction.rs b/diskann-providers/src/model/pq/pq_construction.rs index 07f503e25..cbaf478e6 100644 --- a/diskann-providers/src/model/pq/pq_construction.rs +++ b/diskann-providers/src/model/pq/pq_construction.rs @@ -1427,7 +1427,7 @@ mod pq_test { #[case] make_zero_mean: bool, #[case] num_pq_chunks: usize, ) { - // Creates a new filesystem using an in-memory layer over workspace data. + // Creates a new filesystem using a read/write MemoryFS with PhysicalFS as a fall-back read-only filesystem. let workspace_root = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) .parent() .unwrap() @@ -1678,7 +1678,7 @@ mod pq_test { #[test] fn pq_end_to_end_validation_with_codebook_test() { - // Creates a new filesystem using an in-memory layer over workspace data. + // Creates a new filesystem using a read/write MemoryFS with PhysicalFS as a fall-back read-only filesystem. let workspace_root = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) .parent() .unwrap() @@ -1784,7 +1784,7 @@ mod pq_test { #[case] distance_function: String, #[case] num_pq_chunks: usize, ) { - // Creates a new filesystem using an in-memory layer over workspace data. + // Creates a new filesystem using a read/write MemoryFS with PhysicalFS as a fall-back read-only filesystem. let workspace_root = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")) .parent() .unwrap() From 27ad31f3a7308bde7ecf7b6a240f049cab91c8fa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 09:28:40 +0000 Subject: [PATCH 3/5] Revert test_index_path() to return String and remove .to_string_lossy() Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com> --- .../storage_provider_aligned_file_reader.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs b/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs index 29322b0e5..6637fc4a9 100644 --- a/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs +++ b/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs @@ -59,15 +59,20 @@ mod tests { use super::*; use diskann_providers::common::AlignedBoxWithSlice; - fn test_index_path() -> std::path::PathBuf { + fn test_index_path() -> String { + "/disk_index_misc/disk_index_siftsmall_learn_256pts_R4_L50_A1.2_aligned_reader_test.index" + .to_string() + } + + fn test_index_os_path() -> std::path::PathBuf { test_data_root().join( "disk_index_misc/disk_index_siftsmall_learn_256pts_R4_L50_A1.2_aligned_reader_test.index", ) } fn setup_reader() -> StorageProviderAlignedFileReader { - let storage_provider = VirtualStorageProvider::new_overlay("/"); - StorageProviderAlignedFileReader::new(&storage_provider, &test_index_path().to_string_lossy()).unwrap() + let storage_provider = VirtualStorageProvider::new_overlay(test_data_root()); + StorageProviderAlignedFileReader::new(&storage_provider, &test_index_path()).unwrap() } #[test] @@ -102,7 +107,7 @@ mod tests { assert!(result.is_ok()); // Assert that the actual data is correct. - let mut file = File::open(test_index_path()).unwrap(); + let mut file = File::open(test_index_os_path()).unwrap(); for current_read in aligned_reads { let offset = current_read.offset(); let mut expected = vec![0; current_read.aligned_buf().len()]; From 90934ad605d4a039e7aa886d47200eef83ed2c59 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 09:37:01 +0000 Subject: [PATCH 4/5] Remove test_index_os_path() and use test_index_path() instead Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com> --- .../storage_provider_aligned_file_reader.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs b/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs index 6637fc4a9..1e79f3fb5 100644 --- a/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs +++ b/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs @@ -59,12 +59,7 @@ mod tests { use super::*; use diskann_providers::common::AlignedBoxWithSlice; - fn test_index_path() -> String { - "/disk_index_misc/disk_index_siftsmall_learn_256pts_R4_L50_A1.2_aligned_reader_test.index" - .to_string() - } - - fn test_index_os_path() -> std::path::PathBuf { + fn test_index_path() -> std::path::PathBuf { test_data_root().join( "disk_index_misc/disk_index_siftsmall_learn_256pts_R4_L50_A1.2_aligned_reader_test.index", ) @@ -72,7 +67,7 @@ mod tests { fn setup_reader() -> StorageProviderAlignedFileReader { let storage_provider = VirtualStorageProvider::new_overlay(test_data_root()); - StorageProviderAlignedFileReader::new(&storage_provider, &test_index_path()).unwrap() + StorageProviderAlignedFileReader::new(&storage_provider, "/disk_index_misc/disk_index_siftsmall_learn_256pts_R4_L50_A1.2_aligned_reader_test.index").unwrap() } #[test] @@ -107,7 +102,7 @@ mod tests { assert!(result.is_ok()); // Assert that the actual data is correct. - let mut file = File::open(test_index_os_path()).unwrap(); + let mut file = File::open(test_index_path()).unwrap(); for current_read in aligned_reads { let offset = current_read.offset(); let mut expected = vec![0; current_read.aligned_buf().len()]; From 26697ce2fcf4d47d151b25c60d8f6f10fe5b744e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 09:46:13 +0000 Subject: [PATCH 5/5] Revert commit 90934ad Co-authored-by: arrayka <1551741+arrayka@users.noreply.github.com> --- .../storage_provider_aligned_file_reader.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs b/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs index 1e79f3fb5..6637fc4a9 100644 --- a/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs +++ b/diskann-disk/src/utils/aligned_file_reader/storage_provider_aligned_file_reader.rs @@ -59,7 +59,12 @@ mod tests { use super::*; use diskann_providers::common::AlignedBoxWithSlice; - fn test_index_path() -> std::path::PathBuf { + fn test_index_path() -> String { + "/disk_index_misc/disk_index_siftsmall_learn_256pts_R4_L50_A1.2_aligned_reader_test.index" + .to_string() + } + + fn test_index_os_path() -> std::path::PathBuf { test_data_root().join( "disk_index_misc/disk_index_siftsmall_learn_256pts_R4_L50_A1.2_aligned_reader_test.index", ) @@ -67,7 +72,7 @@ mod tests { fn setup_reader() -> StorageProviderAlignedFileReader { let storage_provider = VirtualStorageProvider::new_overlay(test_data_root()); - StorageProviderAlignedFileReader::new(&storage_provider, "/disk_index_misc/disk_index_siftsmall_learn_256pts_R4_L50_A1.2_aligned_reader_test.index").unwrap() + StorageProviderAlignedFileReader::new(&storage_provider, &test_index_path()).unwrap() } #[test] @@ -102,7 +107,7 @@ mod tests { assert!(result.is_ok()); // Assert that the actual data is correct. - let mut file = File::open(test_index_path()).unwrap(); + let mut file = File::open(test_index_os_path()).unwrap(); for current_read in aligned_reads { let offset = current_read.offset(); let mut expected = vec![0; current_read.aligned_buf().len()];