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

Đang mở
#781 3 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@JalinWang đang làm issue này rồi.

Từ ngày 29/9/2026.

  • #782 của @thlurte — đã đóng, không merge
  • #842 của @thlurte — đã đóng, không merge
  • #891 của @JalinWang — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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)
Ngôn ngữ chính
C++
Star
16.3k
Fork
1k
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
32

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của alibaba/zvec

Tất cả issue của alibaba/zvec

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.