fix: honor radius/linear/refiner set before set*Params() (closes #197) - #198
Merged
Conversation
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.
Description
Closes #197
Calling
setRadius(),setLinear()orsetUsingRefiner()on aZVecVectorQuerybefore anyset*Params()method silently dropped those settings — param setters replacedquery_params_wholesale, so queries ran with wrong settings (e.g. radius 0.0) with no error. Affected HNSW, IVF, Vamana, RaBitQ and Flat indexes.Changes
ffi/zvec_ffi.cc: newmerge_stored_query_settings()helper applied after each of the 5 param setters (set_hnsw_ef,set_hnsw_rabitq_ef,set_vamana_ef_search,set_ivf_nprobe,set_flat_mode) — stored radius/linear/refiner values are merged into the freshly created params, so setter order no longer matters. Unconditional merge is a no-op when nothing was pre-set (constructor defaults 0.0f/false/false).tests/test_query_params_order.phpt: regression test (Flat + HNSW, L2) verifying radius/linear/refiner-before-params behave identically to params-first. Verified to FAIL pre-fix and PASS post-fix.CHANGELOG.md:Fixedentry.Testing
libzvec_ffi.dylibrebuilt on Darwin)test_dbs/empty)Code Review