{{ message }}
Repository navigation
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
RQ-1 acceptance assertions still expect concrete defaults and will fail when the schema returns the new automatic value.
1 open finding
What changed in this PR
Refactors HNSW rescoring into a shared, configurable limit model across all quantizers.
Changes:
- Adds automatic and disabled rescore-limit semantics.
- Supports bounded rescoring for PQ, BQ, SQ, and RQ.
- Expands configuration, upgrade, and search tests.
| File | Description |
|---|---|
test/acceptance/schema/get_schema_without_client_test.go |
Updates serialized defaults. |
test/acceptance/schema/default_quantization_test.go |
Updates default RQ-8 assertions. |
entities/vectorindex/hnsw/sq_config.go |
Uses shared limit parsing. |
entities/vectorindex/hnsw/rq_config.go |
Refactors RQ defaults and parsing. |
entities/vectorindex/hnsw/rescore_limit.go |
Defines shared limit behavior. |
entities/vectorindex/hnsw/pq_config.go |
Adds PQ rescore configuration. |
entities/vectorindex/hnsw/config.go |
Applies automatic defaults. |
entities/vectorindex/hnsw/config_test.go |
Tests parsing and compatibility. |
entities/vectorindex/hnsw/bq_config.go |
Adds BQ rescore configuration. |
entities/vectorindex/dynamic/config_test.go |
Updates dynamic-index expectations. |
cluster/schema/schema_test.go |
Marks new fields query-safe. |
cluster/schema/rescore_limit_upgrade_test.go |
Tests legacy snapshot restoration. |
cluster/schema/movement_guard.go |
Normalizes new fields. |
adapters/repos/db/vector/hnsw/search.go |
Applies bounded rescoring uniformly. |
adapters/repos/db/vector/hnsw/search_test.go |
Tests rescoring gates and bounds. |
adapters/repos/db/vector/hnsw/rescore_limit_test.go |
Tests real quantizer behavior. |
adapters/repos/db/vector/hnsw/config_update_test.go |
Tests runtime updates. |
adapters/repos/db/vector/dynamic/index_test.go |
Updates compression test configs. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| rescoreLimit, err = jsonRescoreLimit.Int64() | ||
| require.Nil(t, err) | ||
| require.Equal(t, int64(hnsw.DefaultRQRescoreLimit), rescoreLimit) | ||
| require.Equal(t, int64(hnsw.RescoreLimitAuto), rescoreLimit) |
Contributor
There was a problem hiding this comment.
Updated both RQ-1 HNSW assertions to expect RescoreLimitAuto in aa98569.
Co-authored-by: trengrj <2173919+trengrj@users.noreply.github.com>
abdelr
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




What's being changed:
rescoreLimitnow bounds HNSW rescoring tomin(ef, max(k, rescoreLimit))for every quantizer. Previously only SQ and RQ honoured it, and only whenrescoreLimit >= k; otherwise the whole ef was rescored, a 10x jump in object-bucket reads between k=20 and k=21 with default settings. Rescoring is one random disk read per candidate, so this is what made rescore dominate an incident profile on an IOPS-throttled volume.Reads per query, dynamic ef defaults, limit 20:
The contract is now shared by PQ, BQ, SQ and RQ (
entities/vectorindex/hnsw/rescore_limit.go):Automatic resolves to:
Upgrades: existing SQ and RQ collections keep the number in their schema. PQ and BQ collections have no key and land on automatic. Pinned by a RAFT snapshot restore test, a parser test and an index-level test. Schema output for new collections shows -1 where it used to show 20/512.
Also: PQ and BQ
rescoreLimitis classified as a query-time change in the replica move guard.