Skip to content

test: cover IVF_HNSW_PQ and IVF_HNSW_FLAT in serializing cache prewarm test - #11629

Merged
Xuanwo merged 1 commit into
lance-format:mainfrom
jzheng106:test/hnsw-serializing-cache
Nov 30, 2026
Merged

Xuanwo merged 1 commit into
lance-format:mainfrom
jzheng106:test/hnsw-serializing-cache

Conversation

@jzheng106

Copy link
Copy Markdown
Collaborator

Closes #6745.

Summary

Most of #6745 had already been done by earlier PRs. This PR adds no new codec or serialization logic. It only extends test coverage to the two IVF+HNSW variants that weren't tested yet.

The issue asked for two things. Both were already on main:

  1. Zero-copy Arrow IPC serde for HNSW cache entries. HNSW partitions go through the generic IVF PartitionEntry<S, Q> codecs in rust/lance/src/index/vector/ivf/partition_serde.rs. Those write the sub-index with write_ipc(index.to_batch()) and read it back through HNSW::load. Since perf: make HNSW cheaper to load #6798, HNSW::load keeps the Arrow batch and serves neighbor lists zero-copy (LoadedHnswGraph). to_batch() hands that batch back unchanged, so a loaded graph round-trips through the cache without being rebuilt.
  2. A test showing that, after prewarm, a serializing backend serves HNSW queries with no IO. test_prewarm_and_query_with_serializing_backend prewarms through SerializingCacheBackend, restarts the backend so only serialized entries survive, queries, checks recall, and asserts read_iops == 0. It already covered IVF_HNSW_SQ and IVF_HNSW_RQ.

Earlier PRs that did the work:

Changes

Adds ivf_hnsw_pq (PartitionEntry<HNSW, ProductQuantizer>) and ivf_hnsw_flat (PartitionEntry<HNSW, FlatQuantizer>) cases to test_prewarm_and_query_with_serializing_backend. Every IVF+HNSW variant is now covered by the prewarm, restart and no-IO check.

Testing

  • cargo test --profile ci -p lance --lib test_prewarm_and_query_with_serializing_backend: all 5 cases pass (ivf_pq, ivf_hnsw_sq, ivf_hnsw_rq, and the new ivf_hnsw_pq and ivf_hnsw_flat) in 1.55s.
  • cargo fmt --all -- --check: clean.
  • cargo clippy --profile ci -p lance --tests --benches -- -D warnings: clean. Clippy was run on the touched crate only, not with --all.

Generated by Claude Code

…m test

The HNSW cache codec requested in lance-format#6745 already exists: HNSW partitions
serialize through the generic IVF partition codecs with zero-copy Arrow
IPC, and the prewarm test asserts no IO for IVF_HNSW_SQ and IVF_HNSW_RQ.
Extend that test to the remaining IVF+HNSW variants.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016RQsSsM41S1EV8chjxfTmo

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added the chore label Nov 29, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

No blocking issues found. Both added HNSW variants pass the existing backend-restart, recall, and zero-read checks locally.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 29, 2026
@Xuanwo
Xuanwo merged commit a7ae8ef into lance-format:main Nov 30, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement CacheCode for HNSW indices

4 participants