Upgrade to zvec v0.6.0 — FFI + ext migration (closes #170 #171 #172 #173 #174) - #184
Merged
Conversation
added 3 commits
July 30, 2026 18:43
- Update zvec submodule from v0.4.0 to v0.6.0 (commit ec8a78e) - ffi/CMakeLists.txt: libzvec_db.a renamed to libzvec.a (upstream #481) - Add libFastPFOR.a, libsnowball.a (FTS stemmer, #513) and libutf8proc.a (UTF-8 tokenizer, #515) - build_ffi.sh: update pre-flight check libzvec_db.a -> libzvec.a - build_zvec.sh / build_zvec_lib.sh / AGENTS.md: default version v0.4.0 -> v0.6.0 - DiskANN is now built-in (libcore_knn_diskann.a), libaio via dlopen (upstream #532) FFI wrapper (ffi/zvec_ffi.cc) does not yet compile - VectorQuery->SearchQuery migration is tracked by #171-#174. This issue only covers the build/link list.
…172 #173 #174) - Replace removed VectorQuery with SearchQuery; field name, query vector and query params now live on QueryTarget (target_.field_name_, target_.set_vector(), target_.query_params_) - output_fields_ is now std::optional: leave as nullopt (select all) when no output fields requested instead of setting an empty vector, which in v0.6.0 means 'select no fields' (#172) - GroupByVectorQuery: group_topk_ renamed to topk_per_group_; vector, field name and query params moved into target_ (#173) - php-ext: port zvec_collection.cc to the same SearchQuery/QueryTarget layout; update config.m4 link list (libzvec/libzvec_core/libzvec_turbo, FastPFOR/snowball/utf8proc) and build_ext.sh stamp check for v0.6.0 - bug_0002 (GroupByQuery): now fixed upstream in v0.6.0, drop XFAIL - test_extended_query_params: group-by now returns proper groups (2)
- ffi/zvec_ffi.cc: bump embedded version constants v0.4.0 -> v0.6.0 - build_zvec_lib.sh, docker/build-zvec.sh, docs/workflow.md, .github/workflows/*.yml: remaining v0.4.0 -> v0.6.0 references - src/ZVec.php: guard toCStringArray() for empty arrays (defensive, output_fields=[]) - tests/test_query_output_fields_semantics.phpt: regression test for #172 (nullopt = select all) - tests/test_fp64_vectors.phpt, test_query_fp64.phpt: XFAIL comment v0.4.0 -> v0.6.0 (FP64 still unsupported upstream)
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
Upgrade the upstream
alibaba/zvecdependency from v0.4.0 → v0.6.0 and migrate the C++ wrappers (FFI shared library + PHP extension) to the v0.6.0 C++ API. All breaking changes are confined to the C++ layer — the PHP-facing C API inffi/*.his byte-identical andsrc/*.phpis untouched (one defensive guard intoCStringArray), so the public PHP API stays backward compatible.Closes #170, #171, #172, #173, #174, #32.
Commits
8f2e377— bump submodule to v0.6.0 + fix link list (libzvec_db.a→libzvec.a, addlibsnowball.a+libutf8proc.a, DiskANN now built-in / libaio via dlopen)85ad96c— migrateffi/zvec_ffi.ccandphp-ext/zvec_collection.ccto the v0.6.0 query structs0c49c82— completeness: bump embedded version constants v0.4.0→v0.6.0, remaining v0.4.0 refs in workflows/docs, defensivetoCStringArrayguard, regression test for FFI: output_fields became std::optional — empty vector now means 'select no fields' #172Per-issue verification (rigorous, done after the 3rd commit)
zvec/build/.zvec_version= v0.6.0;libzvec.a12.7MB presentlibsnowball.a+libutf8proc.aadded; every referenced.aexists in build (full set compared: 41 produced libs, all refs resolved)libcore_knn_diskann.abuilt-in, no pluginv0.4.0across repo (excl. CHANGELOG/MIGRATION history) → 0 hits in build/docs/workflows;ffi/zvec_ffi.ccversion constants = v0.6.0VectorQuery→SearchQuery+QueryTargetVectorQueryin .cc → onlyVectorQueryHolder(our holder name, wrapsSearchQuery query);target_.field_name_,target_.set_vector(),target_.query_params_everywhereQueryParams::set_type()unusedset_typein ffi/ php-ext/ → 0 hitsnulloptwhen no output fieldsoutput_fields_ = {}/ empty vector assign → 0 hits; setters only touch it when count>0tests/test_query_output_fields_semantics.phpt(added in commit 3) — passesgroup_topk_→topk_per_group_group_topk_→ 0 hits;topk_per_group_usedtarget_test_groupby_query_object.phptpassesRerankin ffi → 0)Build & test results
./build_ffi.sh→ffi/build/libzvec_ffi.dylib(53MB) links clean./php-ext/build_ext.sh→php-ext/modules/zvec.so(32MB) builds & loadsphp -n run-tests.php -q tests/→ 171 passed, 2 XFAIL, 0 failed (175 total)Side effects
--XFAIL--removedtest_extended_query_paramsexpectation: 1 group → 2 groups (v0.6.0 returns even/odd correctly)Out of scope (separate issues, v0.6.0 milestone)
New v0.6.0 features not included — only the migration: #176 fetch outputFields, #177 random rotation, #178 includeDocId, #179 DiskAnnIndexParams split, #180 FTS, #181 minor v0.5.1 options.
Known non-blocker
Running the suite with the native
zvecextension loaded failstest_vector_query_object.phptonZVecVectorQuery::setTopk()— a pre-existing native-ext feature gap, unrelated to this upgrade. FFI mode (CI path) is green.