Skip to content

fix: correct Vamana/RaBitQ query params in queryVector() (closes #193) - #196

Merged
s2x merged 4 commits into
mainfrom
fix/issue-193-vamana-rabitq-query-params
Aug 8, 2026
Merged

fix: correct Vamana/RaBitQ query params in queryVector() (closes #193)#196
s2x merged 4 commits into
mainfrom
fix/issue-193-vamana-rabitq-query-params

Conversation

@s2x

@s2x s2x commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #193

ZVecVectorQuery::setVamanaParams() and setHnswRabitqParams() both created an HnswQueryParams object, so queryVector() on Vamana/RaBitQ indexes was always rejected by the engine (query params type does not match the index type of vector field). The legacy query() path was unaffected.

Changes

  • FFI (ffi/zvec_ffi.cc/.h, ffi/zvec_ffi_php.h): add zvec_vector_query_set_vamana_ef_search() (VamanaQueryParams) and zvec_vector_query_set_hnsw_rabitq_ef() (HnswRabitqQueryParams), mirroring apply_query_params
  • PHP (src/ZVecVectorQuery.php): rewire setVamanaParams() / setHnswRabitqParams() to the new FFI setters — no signature changes, BC-safe
  • Tests: test_vector_query_vamana_params.phpt (positive + negative check), test_vector_query_rabitq_params.phpt (SKIPIF Linux x86_64, RaBitQ platform limitation)
  • Docs: docs/helpers/faq.md entry, CHANGELOG.md

Testing

  • Builds locally (FFI: ./build_ffi.sh, symbols verified via nm)
  • All .phpt tests pass: 176 passed, 2 skipped, 2 expected-fail (fp64 XFAIL), 0 failed
  • Legacy test_vector_query_object.php passes
  • No test database leftovers

Code Review

  • Passed subagent code review (no critical/major/minor issues)
  • All review comments addressed

Piotr Hałas added 2 commits August 8, 2026 18:55
ZVecVectorQuery::setVamanaParams() and setHnswRabitqParams() both created
an HnswQueryParams object, so queryVector() on Vamana/RaBitQ indexes was
always rejected by the engine. Add dedicated FFI setters constructing
the correct subtypes (VamanaQueryParams / HnswRabitqQueryParams), wire
the PHP setters to them, and add regression tests (RaBitQ guarded for
Linux x86_64).
@s2x s2x self-assigned this Aug 8, 2026
@s2x
s2x merged commit 64ce716 into main Aug 8, 2026
3 checks passed
@s2x
s2x deleted the fix/issue-193-vamana-rabitq-query-params branch August 8, 2026 17:06
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.

queryVector(): setVamanaParams()/setHnswRabitqParams() create HnswQueryParams — engine rejects query

1 participant