Skip to content

[POC] Cache NaviX filter decisions across batches - #1114

Draft
lerman25 wants to merge 2 commits into
omer-navix-filtered-batches-pocfrom
omer-navix-filter-cache-poc
Draft

lerman25 wants to merge 2 commits into
omer-navix-filtered-batches-pocfrom
omer-navix-filter-cache-poc

Conversation

@lerman25

Copy link
Copy Markdown
Collaborator

Describe the changes in the pull request

NaviX revisits shared neighbors and currently repeats the NO/MAYBE callback, including document-summary lookups. Cache each HNSW node's decision across batches so the callback runs at most once per node between resets. Exact filtering remains the consumer's responsibility.

The cache allocates one byte per graph node on its first use (~1 MB for a one-million-node graph), uses the iterator allocator, grows safely for newly migrated backend nodes, and is invalidated on reset. Non-NaviX queries do not allocate it. The existing stable index/label/filter-view contract still applies. Filter check/rejection counters count callback evaluations, excluding cache hits.

Stacked on #1113. This draft contains only caching; traversal policy and sparse-query recovery are unchanged. No benchmarks were run and no throughput improvement is claimed.

Which issues this PR fixes

Follow-up to the experimental NaviX POC; does not close an issue.

Main objects this PR modified

  1. HNSW batch iterator: per-query tri-state decision cache and reset invalidation.
  2. NaviX unit tests: callback reuse across batches, reset invalidation, iterator isolation, and newly appended backend nodes.
  3. POC documentation: cache memory/lifetime and counter semantics.

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Validation: focused Debug build and all seven test_navix cases, including the existing timeout/reset and frontend cases. Formatting and git diff --check passed. Benchmarks were intentionally not run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant