Skip to content
Merged
Changes from all commits
Commits
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
25 changes: 20 additions & 5 deletions rust/lance/src/index/vector/ivf/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,14 @@ mod tests {
.collect::<HashSet<_>>();
let recall = row_ids.intersection(&gt).count() as f32 / 100.0;
// 100 can't be exactly expressed as a float, so we need to use a tolerance
assert_ge!(recall, recall_requirement - f32::EPSILON, "{}", recall);
assert_ge!(
recall,
recall_requirement - f32::EPSILON,
"num_rows: {}, intersection: {}, recall: {}",
row_ids.len(),
row_ids.intersection(&gt).count(),
recall
);

// delete so that only one row left, to trigger remap and there must be some empty partitions
let (mut dataset, _) = generate_test_dataset::<T>(test_uri, range).await;
Expand Down Expand Up @@ -1341,7 +1348,9 @@ mod tests {
test_index_multivec(params.clone(), nlist, recall_requirement).await;
}
test_distance_range(Some(params.clone()), nlist).await;
test_remap(params, nlist, recall_requirement).await;
// PQ performs worse on farther vectors, so if we delete the many nearest vectors, the recall will be lower
// lower the recall requirement in remap case for PQ, because it deletes half of the vectors
test_remap(params, nlist, recall_requirement * 0.9).await;
}

#[rstest]
Expand All @@ -1365,7 +1374,9 @@ mod tests {
test_index_multivec(params.clone(), nlist, recall_requirement).await;
}
test_distance_range(Some(params.clone()), nlist).await;
test_remap(params.clone(), nlist, recall_requirement).await;
// PQ performs worse on farther vectors, so if we delete the many nearest vectors, the recall will be lower
// lower the recall requirement in remap case for PQ, because it deletes half of the vectors
test_remap(params.clone(), nlist, recall_requirement * 0.9).await;
test_delete_all_rows(params).await;
}

Expand All @@ -1386,7 +1397,9 @@ mod tests {
if distance_type == DistanceType::Cosine {
test_index_multivec(params.clone(), nlist, recall_requirement).await;
}
test_remap(params, nlist, recall_requirement).await;
// PQ performs worse on farther vectors, so if we delete the many nearest vectors, the recall will be lower
// lower the recall requirement in remap case for PQ, because it deletes half of the vectors
test_remap(params, nlist, recall_requirement * 0.9).await;
}

#[rstest]
Expand Down Expand Up @@ -1507,7 +1520,9 @@ mod tests {
if distance_type == DistanceType::Cosine {
test_index_multivec(params.clone(), nlist, recall_requirement).await;
}
test_remap(params, nlist, recall_requirement).await;
// PQ performs worse on farther vectors, so if we delete the many nearest vectors, the recall will be lower
// lower the recall requirement in remap case for PQ, because it deletes half of the vectors
test_remap(params, nlist, recall_requirement * 0.9).await;
}

#[rstest]
Expand Down
Loading