Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b1313a4
refactor: add quantizer and distance
richyreachy Jun 29, 2026
45d9b54
fix: add turo quantizer
richyreachy Jun 30, 2026
e82d73f
refactor: add quantizer
richyreachy Jun 30, 2026
829f53e
refactor: update meta
richyreachy Jun 30, 2026
f084630
refactor: update meta
richyreachy Jun 30, 2026
c3c4ca3
refactor: add fp32 quantizer
richyreachy Jun 30, 2026
ec4ea1f
refactor: add quantizer
richyreachy Jun 30, 2026
e36f0c5
refactor: quantizer
richyreachy Jun 30, 2026
c1cdd0b
refactor: add scalar
richyreachy Jun 30, 2026
628982d
fix: fix cosine
richyreachy Jul 1, 2026
de33220
fix: add quantizer
richyreachy Jul 1, 2026
49780f8
fix: fix quantizer
richyreachy Jul 1, 2026
b1d4849
fix: remove unused var
richyreachy Jul 2, 2026
f0fdf5d
fix: header
richyreachy Jul 2, 2026
0c4cec6
fix: header
richyreachy Jul 2, 2026
73f5bc3
fix: header
richyreachy Jul 2, 2026
89843dd
add preprocessor
zzlin237 Jul 2, 2026
437a754
fix: fix symbol
richyreachy Jul 2, 2026
e16cda5
add untest
zzlin237 Jul 2, 2026
22b87d8
Merge remote-tracking branch 'origin/refactor/turbo_quantizer' into r…
zzlin237 Jul 2, 2026
f3a6782
remove extra doc
zzlin237 Jul 2, 2026
81d8eb5
tmp
zzlin237 Jul 2, 2026
f9b43f1
tmp
zzlin237 Jul 3, 2026
fc7efd8
tmp
zzlin237 Jul 3, 2026
642b8bf
Merge remote-tracking branch 'upstream/main' into refactor/turbo_prep…
zzlin237 Jul 3, 2026
79a08eb
style: fix clang-format issues from upstream merge
zzlin237 Jul 3, 2026
78ace2b
style: fix clang-format issues in turbo module
zzlin237 Jul 3, 2026
54c9b05
Merge branch 'refactor/turbo_preprocessor' into refactor/turbo_pq
zzlin237 Jul 3, 2026
b80bc4d
fix: LNK1120
zzlin237 Jul 3, 2026
71b33df
Merge remote-tracking branch 'origin/refactor/turbo_preprocessor' int…
zzlin237 Jul 3, 2026
6ae749c
tmp
zzlin237 Jul 3, 2026
281fdb4
Rename to conform to the style guide
zzlin237 Jul 3, 2026
10cbe03
Rename to conform to the style guide
zzlin237 Jul 3, 2026
39aa1ee
Merge branch 'refactor/turbo_preprocessor' of https://github.com/zzli…
zzlin237 Jul 3, 2026
8734866
pq_int8
zzlin237 Jul 3, 2026
74e9f93
tmp
zzlin237 Jul 3, 2026
c2026cb
Merge branch 'main' into refactor/turbo_quantizer
richyreachy Jul 3, 2026
7c5d299
tmp
zzlin237 Jul 6, 2026
8ecdd17
uniform func sign
zzlin237 Jul 6, 2026
f1a838e
support ip/cosine
zzlin237 Jul 6, 2026
58ea18c
support ip/cosine
zzlin237 Jul 6, 2026
cb66180
Merge branch 'main' into refactor/turbo_quantizer
richyreachy Jul 6, 2026
3122b17
set upper
zzlin237 Jul 6, 2026
64595d1
norm match
zzlin237 Jul 6, 2026
17e5a0d
rollback
zzlin237 Jul 6, 2026
3e8abad
add int4
zzlin237 Jul 7, 2026
cca2f45
Merge remote-tracking branch 'upstream/main' into refactor/turbo_pq
zzlin237 Jul 7, 2026
a621398
Merge remote-tracking branch 'richyreachy/refactor/turbo_quantizer' i…
zzlin237 Jul 7, 2026
5b23f09
clang-format
zzlin237 Jul 7, 2026
06da5d7
debug
zzlin237 Jul 7, 2026
abc7a4b
remove train to create int fht
zzlin237 Jul 7, 2026
05a4f4f
Merge remote-tracking branch 'upstream/main' into refactor/turbo_pq
zzlin237 Jul 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ allure-*
!build_android.sh
!build_ios.sh

# congfig
# config
doc/
config/
examples/python/
examples/c_api/
logs/
logs/
5 changes: 4 additions & 1 deletion examples/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ if(NOT DEFINED HOST_BUILD_DIR)
endif()

get_filename_component(ZVEC_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
set(ZVEC_INCLUDE_DIR ${ZVEC_ROOT_DIR}/src/include)
# Include both src/include (public headers) and src (internal headers that
# are transitively reachable from public headers, e.g.
# turbo/quantizer/quantizer.h via index_factory.h).
set(ZVEC_INCLUDE_DIR ${ZVEC_ROOT_DIR}/src/include ${ZVEC_ROOT_DIR}/src)
set(ZVEC_LIB_DIR ${ZVEC_ROOT_DIR}/${HOST_BUILD_DIR}/lib)

# Add include and library search paths
Expand Down
2 changes: 1 addition & 1 deletion src/core/algorithm/hnsw_sparse/hnsw_sparse_entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct HnswSparseHeader {

struct SparseData {
public:
SparseData() {};
SparseData(){};

SparseData(uint32_t sparse_count, const uint32_t *sparse_indices,
const void *sparse_vec)
Expand Down
13 changes: 13 additions & 0 deletions src/core/framework/index_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,18 @@ std::vector<std::string> IndexFactory::AllRefiners(void) {
return ailego::Factory<IndexRefiner>::Classes();
}

std::shared_ptr<turbo::Quantizer> IndexFactory::CreateQuantizer(
const std::string &name) {
return ailego::Factory<zvec::turbo::Quantizer>::MakeShared(name.c_str());
}

bool IndexFactory::HasQuantizer(const std::string &name) {
return ailego::Factory<turbo::Quantizer>::Has(name.c_str());
}

std::vector<std::string> IndexFactory::AllQuantizers(void) {
return ailego::Factory<turbo::Quantizer>::Classes();
}

} // namespace core
} // namespace zvec
4 changes: 3 additions & 1 deletion src/core/framework/index_meta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ struct IndexMetaFormatHeader {
uint32_t space_id;
uint32_t attachment_offset;
uint32_t attachment_size;
uint8_t reserved_[4092];
uint32_t extra_meta_size;
uint8_t reserved_[4088];
};

static_assert(sizeof(IndexMetaFormatHeader) % 32 == 0,
Expand All @@ -47,6 +48,7 @@ void IndexMeta::serialize(std::string *out) const {
format.dimension = dimension_;
format.unit_size = unit_size_;
format.space_id = space_id_;
format.extra_meta_size = extra_meta_size_;

if (!metric_name_.empty()) {
ailego::Params item;
Expand Down
4 changes: 2 additions & 2 deletions src/core/utility/visit_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class VisitBloomFilter {
static constexpr int N = 5;
struct Context {
Context()
: mt(std::chrono::system_clock::now().time_since_epoch().count()) {};
: mt(std::chrono::system_clock::now().time_since_epoch().count()){};
VisitFilterHeader h;
std::mt19937 mt;
ailego::BloomFilter<N> *filter{nullptr};
Expand Down Expand Up @@ -367,7 +367,7 @@ class VisitFilter {
ByteMap = VisitByteMap::mode
};

VisitFilter() : mode_(0), ctx_(nullptr) {};
VisitFilter() : mode_(0), ctx_(nullptr){};

inline bool visited(id_t idx) {
PROXIMA_HNSW_VISITFILTER_CALL_IMPL(visited, idx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class InvertedColumnIndexer {
field_(field),
path_(context.db_path_),
ctx_(context),
read_only_(read_only) {};
read_only_(read_only){};

InvertedColumnIndexer(const InvertedColumnIndexer &) = delete;
InvertedColumnIndexer(InvertedColumnIndexer &&) = delete;
Expand Down
2 changes: 1 addition & 1 deletion src/db/index/column/inverted_column/inverted_indexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class InvertedIndexer {
const std::vector<FieldSchema> &fields)
: collection_name_(collection_name),
working_dir_(working_dir),
fields_(fields) {};
fields_(fields){};


virtual ~InvertedIndexer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class InvertedSearchResult
class Filter : public IndexFilter {
public:
explicit Filter(std::shared_ptr<const InvertedSearchResult> result)
: result_(std::move(result)) {};
: result_(std::move(result)){};

bool is_filtered(uint64_t id) const override {
return !result_->contains(id);
Expand Down
2 changes: 1 addition & 1 deletion src/db/index/common/delete_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DeleteStore : public std::enable_shared_from_this<DeleteStore> {
using Ptr = std::shared_ptr<DeleteStore>;

explicit DeleteStore(std::string collection_name)
: collection_name_(std::move(collection_name)) {};
: collection_name_(std::move(collection_name)){};

~DeleteStore() {
LOG_INFO("Closed delete store");
Expand Down
2 changes: 1 addition & 1 deletion src/db/index/common/id_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class IDMap {
using Ptr = std::shared_ptr<IDMap>;

explicit IDMap(std::string collection_name)
: collection_name_(std::move(collection_name)) {};
: collection_name_(std::move(collection_name)){};

~IDMap() {
if (opened_) {
Expand Down
3 changes: 1 addition & 2 deletions src/db/index/common/index_params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ namespace zvec {

std::string InvertIndexParams::to_string() const {
std::ostringstream oss;
oss << "InvertIndexParams{"
<< "enable_range_optimization:"
oss << "InvertIndexParams{" << "enable_range_optimization:"
<< (enable_range_optimization_ ? "true" : "false")
<< ", enable_extended_wildcard:"
<< (enable_extended_wildcard_ ? "true" : "false") << "}";
Expand Down
9 changes: 4 additions & 5 deletions src/db/index/common/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ class BlockMeta {

std::string to_string() const {
std::ostringstream oss;
oss << "BlockMeta{"
<< "id:" << id_ << ",type:" << BlockTypeCodeBook::AsString(type_)
oss << "BlockMeta{" << "id:" << id_
<< ",type:" << BlockTypeCodeBook::AsString(type_)
<< ",min_doc_id:" << min_doc_id_ << ",max_doc_id:" << max_doc_id_
<< ",doc_count:" << doc_count_ << ",columns:[";

Expand Down Expand Up @@ -179,7 +179,7 @@ class SegmentMeta {
using Ptr = std::shared_ptr<SegmentMeta>;

public:
SegmentMeta() {};
SegmentMeta(){};

explicit SegmentMeta(SegmentID id) : id_(id) {}

Expand Down Expand Up @@ -368,8 +368,7 @@ class SegmentMeta {

std::string to_string() const {
std::ostringstream oss;
oss << "SegmentMeta{"
<< "id:" << id_ << ",persisted_blocks:[";
oss << "SegmentMeta{" << "id:" << id_ << ",persisted_blocks:[";

for (size_t i = 0; i < persisted_blocks_.size(); ++i) {
if (i > 0) oss << ",";
Expand Down
6 changes: 2 additions & 4 deletions src/db/index/common/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,7 @@ Status FieldSchema::validate() const {

std::string FieldSchema::to_string() const {
std::ostringstream oss;
oss << "FieldSchema{"
<< "name:'" << name_ << "'"
oss << "FieldSchema{" << "name:'" << name_ << "'"
<< ",data_type:" << DataTypeCodeBook::AsString(data_type_)
<< ",nullable:" << (nullable_ ? "true" : "false")
<< ",dimension:" << dimension_;
Expand Down Expand Up @@ -382,8 +381,7 @@ Status CollectionSchema::validate() const {

std::string CollectionSchema::to_string() const {
std::ostringstream oss;
oss << "CollectionSchema{"
<< "name:'" << name_ << "'"
oss << "CollectionSchema{" << "name:'" << name_ << "'"
<< ",max_doc_count_per_segment:" << max_doc_count_per_segment_
<< ",fields:[";

Expand Down
4 changes: 2 additions & 2 deletions src/db/index/common/stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
namespace zvec {
std::string CollectionStats::to_string() const {
std::ostringstream oss;
oss << "CollectionStats{"
<< "doc_count:" << doc_count << ",index_completeness:{";
oss << "CollectionStats{" << "doc_count:" << doc_count
<< ",index_completeness:{";

size_t i = 0;
for (const auto &pair : index_completeness) {
Expand Down
2 changes: 1 addition & 1 deletion src/db/sqlengine/parser/zvec_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ZVecParser {
using Ptr = std::shared_ptr<ZVecParser>;

ZVecParser() = default;
virtual ~ZVecParser() {};
virtual ~ZVecParser(){};

virtual SQLInfo::Ptr parse(const std::string &query,
bool formatted_tree = false) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/include/zvec/ailego/pattern/closure.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class Callback : public Callback<void> {

protected:
//! Constructor
Callback(void) {};
Callback(void){};
};

/*! Callback Implementation
Expand Down
19 changes: 19 additions & 0 deletions src/include/zvec/core/framework/index_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#pragma once

#include <turbo/quantizer/quantizer.h>
#include <zvec/ailego/pattern/factory.h>
#include <zvec/core/framework/index_builder.h>
#include <zvec/core/framework/index_cluster.h>
Expand Down Expand Up @@ -167,6 +168,16 @@ struct IndexFactory {

//! Retrieve all refiner classes
static std::vector<std::string> AllRefiners(void);

//! Create a quantizer by name
static std::shared_ptr<zvec::turbo::Quantizer> CreateQuantizer(
const std::string &name);

//! Test if the quantizer exists
static bool HasQuantizer(const std::string &name);

//! Retrieve all quantizer classes
static std::vector<std::string> AllQuantizers(void);
};

//! Register Index Metric
Expand Down Expand Up @@ -283,5 +294,13 @@ struct IndexFactory {
#define INDEX_FACTORY_REGISTER_REFINER(__IMPL__, ...) \
INDEX_FACTORY_REGISTER_REFINER_ALIAS(__IMPL__, __IMPL__, ##__VA_ARGS__)

//! Register Quantizer
#define INDEX_FACTORY_REGISTER_QUANTIZER_ALIAS(__NAME__, __IMPL__, ...) \
AILEGO_FACTORY_REGISTER(__NAME__, turbo::Quantizer, __IMPL__, ##__VA_ARGS__)

//! Register Quantizer
#define INDEX_FACTORY_REGISTER_QUANTIZER(__IMPL__, ...) \
INDEX_FACTORY_REGISTER_QUANTIZER_ALIAS(__IMPL__, __IMPL__, ##__VA_ARGS__)

} // namespace core
} // namespace zvec
Loading
Loading