MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / patch_empty_delta_is_noop

Function patch_empty_delta_is_noop

nodedb-vector/src/delta/compaction.rs:234–249  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232
233 #[test]
234 fn patch_empty_delta_is_noop() {
235 let mut main = HnswIndex::with_seed(3, small_params(), 3);
236 for i in 0u32..3 {
237 main.insert(vec![i as f32, 0.0, 0.0])
238 .expect("insert failed");
239 }
240 let initial_len = main.len();
241
242 let mut delta = DeltaIndex::new(3, 16);
243 let mut patcher = LirePatcher::new(&mut main, &mut delta);
244 let stats = patcher.patch(4, 20).expect("patch failed");
245
246 assert_eq!(stats.patched, 0);
247 assert_eq!(stats.tombstoned_marked, 0);
248 assert_eq!(main.len(), initial_len);
249 }
250}

Callers

nothing calls this directly

Calls 5

small_paramsFunction · 0.85
patchMethod · 0.80
expectMethod · 0.45
insertMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected