Skip to content

Inline filtering for vector sets#1890

Merged
kevin-montrose merged 8 commits into
mainfrom
push-zyqmnwkmszpk
Jun 24, 2026
Merged

Inline filtering for vector sets#1890
kevin-montrose merged 8 commits into
mainfrom
push-zyqmnwkmszpk

Conversation

@metajack

Copy link
Copy Markdown
Contributor

Based on Haiyang's original two queue work, this rebased onto the quantization branch and modifies it for the new inline filtering with adaptive L.

@metajack metajack force-pushed the push-zyqmnwkmszpk branch from c42adbb to 64a83a7 Compare June 22, 2026 14:50
@metajack metajack force-pushed the push-zyqmnwkmszpk branch from 64a83a7 to 56d244c Compare June 22, 2026 21:04
@metajack metajack marked this pull request as ready for review June 23, 2026 20:34
Copilot AI review requested due to automatic review settings June 23, 2026 20:34

Copilot AI 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.

Pull request overview

This PR updates Garnet’s vector set similarity search (VSIM) to support inline filtering via a DiskANN → C# callback (instead of relying on over-retrieval + post-filtering), and updates the public docs/tests around filtering and FILTER-EF.

Changes:

  • Adds an unmanaged inline-filter callback wiring from DiskANN (Rust) into Garnet (C#) and threads per-query compiled filter state via [ThreadStatic].
  • Changes FILTER-EF semantics/limits (default 16, range [4, 256]) and updates validation + tests accordingly.
  • Introduces a documented binary attribute encoding/extraction path intended to accelerate filter evaluation, and adds a new design doc describing the end-to-end approach.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
website/docs/dev/filtered-search-design.md New end-to-end design doc for filtered vector search and inline filtering.
website/docs/commands/vector-sets.md Updates VSIM option docs for FILTER-EF and inline filtering behavior.
test/standalone/Garnet.test.vectorset/RespVectorSetTests.cs Adds/updates VSIM filter validation tests and new “bad filter” cases.
test/standalone/Garnet.test.extensions/DiskANN/DiskANNServiceTests.cs Updates DiskANN index creation tests for the new callback parameter.
libs/server/Resp/Vector/VectorManager.Migration.cs Passes the new inline filter callback when recreating indexes.
libs/server/Resp/Vector/VectorManager.Locking.cs Passes the new inline filter callback when creating/recreating indexes.
libs/server/Resp/Vector/VectorManager.Filter.cs Adds thread-static inline filter state + candidate evaluation logic.
libs/server/Resp/Vector/VectorManager.cs Switches VSIM paths toward inline filtering setup and bitmap sizing helper.
libs/server/Resp/Vector/VectorManager.Callbacks.cs Adds the unmanaged callback entrypoint to call into filter evaluation.
libs/server/Resp/Vector/VectorFilterExpression.cs Simplifies ExprProgram by removing redundant length fields.
libs/server/Resp/Vector/RespServerSessionVectors.cs Updates FILTER-EF parsing/validation defaults and bounds.
libs/server/Resp/Vector/ExprRunner.cs Iterates using program.Instructions.Length instead of removed program.Length.
libs/server/Resp/Vector/DiskANNService.cs Extends create/recreate index P/Invoke signature to include filter callback.
libs/server/Resp/Vector/AttributeExtractor.cs Adds binary attribute conversion/extraction APIs and minor JSON parsing cleanup.
Directory.Packages.props Bumps diskann-garnet package version.

Comment thread libs/server/Resp/Vector/VectorManager.cs
Comment thread libs/server/Resp/Vector/VectorManager.cs
Comment thread libs/server/Resp/Vector/VectorManager.Filter.cs
Comment thread libs/server/Resp/Vector/AttributeExtractor.cs
Comment thread libs/server/Resp/Vector/AttributeExtractor.cs
Comment thread website/docs/dev/filtered-search-design.md Outdated
Comment thread website/docs/dev/filtered-search-design.md Outdated
Comment thread libs/server/Resp/Vector/VectorManager.cs
Comment thread website/docs/commands/vector-sets.md Outdated
@metajack metajack force-pushed the push-zyqmnwkmszpk branch from 49f0836 to 4392922 Compare June 23, 2026 21:17
@metajack metajack force-pushed the push-zyqmnwkmszpk branch from 4392922 to f024774 Compare June 23, 2026 21:35
@kevin-montrose kevin-montrose merged commit 19ecbf5 into main Jun 24, 2026
299 of 301 checks passed
@kevin-montrose kevin-montrose deleted the push-zyqmnwkmszpk branch June 24, 2026 15:41
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.

3 participants