Bug: Collection.group_by_query returns empty results with ID-out-of-range errors (UINT64_MAX)

Aperta
#781 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@JalinWang ci sta già lavorando.

Dal 29/9/2026.

  • #782 di @thlurte — chiusa senza merge
  • #842 di @thlurte — chiusa senza merge
  • #891 di @JalinWang — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug
Description

Zvec version: 0.7.0 (Python 3.14, Linux x86_64)

Collection.group_by_query (introduced in 0.6.0, refactored in 0.7.0) always returns an empty list on real collections, while the C layer floods the log with:

[ERROR doc_filter.cc:104] ID is out or range: id[18446744073709551615] count[668]

18446744073709551615 is UINT64_MAX — it looks like an internal sentinel ID is being fed into doc filtering as a real document ID.

Expected: group_by_query returns up to group_count groups, each with topk_per_group docs, ordered by similarity score. Actual: empty list + the errors above.

I confirmed this on two collections (plain HNSW, COSINE metric; group field is a non-null STRING). Plain coll.query() on the same collections returns correct top-k results, so the index and data are fine.

Steps to Reproduce
1. Install zvec 0.7.0 (pip install zvec==0.7.0)
2. Open an existing collection (e.g. created via zvec API with HNSW + COSINE, a STRING field "model", and a vector field dim 768)
3. Run:


import zvec, os
coll = zvec.open(os.path.join(DB, 'bt_speakers_img2img'), option=zvec.CollectionOption(enable_mmap=1, read_only=1))
first = next(coll.iter_docs())
vec = first.vector('siglip2_embedding')
groups = coll.group_by_query(
    zvec.Query(field_name='siglip2_embedding', vector=vec),
    group_by_field_name='model',
    group_count=3,
    topk_per_group=1,
)
print(len(groups))  # expected 3, actual 0


4. Observe: `len(groups) == 0` and repeated `[ERROR doc_filter.cc:104] ID is out or range: id[18446744073709551615]` lines.
Logs / Stack Trace
[ERROR 2026-09-24 15:19:06 doc_filter.cc:104] ID is out or range: id[18446744073709551615] count[668]
[ERROR 2026-09-24 15:19:06 doc_filter.cc:104] ID is out or range: id[18446744073709551615] count[668]
...

The errors repeat dozens of times (once per candidate group), then group_by_query returns an empty list.
Operating System

Linux (Ubuntu 26.04 / WSL2), x86_64

Build & Runtime Environment

Python 3.14 (project venv), pip install zvec==0.7.0, Linux x86_64 (Ubuntu 26.04 / WSL2), stock wheel (no local build)

Additional Context
  • I've checked git status — no uncommitted submodule changes
  • I built with CMAKE_BUILD_TYPE=Debug
  • This occurs with or without COVERAGE=ON
  • The issue involves Python ↔ C++ integration (pybind11)
Lingua principale
C++
Stelle
16.3k
Fork
1k
Merge medio
2g 10h
PR unite (30g)
32

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di alibaba/zvec

Tutte le issue di alibaba/zvec

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.