Skip to content

fix compatibility of hnsw#624

Merged
inabao merged 5 commits into
mainfrom
fix-compatibility
Apr 30, 2025
Merged

fix compatibility of hnsw#624
inabao merged 5 commits into
mainfrom
fix-compatibility

Conversation

@inabao

@inabao inabao commented Apr 22, 2025

Copy link
Copy Markdown
Collaborator

fixed: #623

@inabao inabao added kind/bug Bug fixes, defects, or unexpected behavior 修复程序错误、缺陷或异常行为 version/0.15 1. Add Attribute Filter 2. Quantization and transformation 1. 新增 Attribute Filter 2. 量化与变换 labels Apr 22, 2025
@inabao inabao self-assigned this Apr 22, 2025
@inabao
inabao requested review from LHT129 and wxyucs as code owners April 22, 2025 06:37
@codecov

codecov Bot commented Apr 22, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 60.00000% with 6 lines in your changes missing coverage. Please review.

❌ Your patch status has failed because the patch coverage (60.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

@@            Coverage Diff             @@
##             main     #624      +/-   ##
==========================================
+ Coverage   91.05%   91.33%   +0.27%     
==========================================
  Files         180      180              
  Lines       10658    10774     +116     
==========================================
+ Hits         9705     9840     +135     
+ Misses        953      934      -19     
Flag Coverage Δ
cpp 91.33% <60.00%> (+0.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
common 93.36% <ø> (+0.08%) ⬆️
datacell 91.99% <100.00%> (+0.39%) ⬆️
index 89.49% <60.00%> (+0.11%) ⬆️
simd 100.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6fcd91...fb2d892. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/algorithm/hnswlib/hnswalg.cpp Outdated
Comment thread src/algorithm/hnswlib/hnswalg.cpp Outdated
auto read_size = sizeof(InnerIdType) + sizeof(size_t);
vsag::Vector<char> buffer(buffer_size, allocator_);
reader.Read(buffer.data(), read_size);
enterpoint_node_ = *(InnerIdType*)(buffer.data() + 0);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ 0 is not need ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread src/algorithm/hnswlib/hnswalg.cpp Outdated
Comment thread src/algorithm/hnswlib/hnswalg.cpp Outdated
Comment thread src/algorithm/hnswlib/hnswalg.cpp Outdated
Comment thread src/algorithm/hnswlib/hnswalg.cpp Outdated
Comment thread src/algorithm/hnswlib/hnswalg.cpp Outdated
Comment thread src/algorithm/hnswlib/hnswalg.cpp Outdated
Comment thread src/algorithm/hnswlib/hnswalg.cpp Outdated
Comment thread src/algorithm/hnswlib/hnswalg.cpp

@wxyucs wxyucs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

inabao added 4 commits April 28, 2025 11:33
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
@inabao
inabao force-pushed the fix-compatibility branch from 4865cdc to 4cfa439 Compare April 28, 2025 03:33
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Apr 28, 2025
Comment thread src/algorithm/hnswlib/hnswalg.cpp
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>

@jiaweizone jiaweizone left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

* Compatibility Logic Flow:
* 1. Try reading newer format (12 bytes)
* 2. If validation fails (M_ != maxM_),
* 3. Read older format (16 bytes) as fallback

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK,in next version we can change to detect file version first

@inabao
inabao merged commit cc3ddbe into main Apr 30, 2025
@inabao
inabao deleted the fix-compatibility branch April 30, 2025 06:25
@wxyucs

wxyucs commented Apr 30, 2025

Copy link
Copy Markdown
Collaborator

@inabao conflict with branch 0.14 and 0.13, cannot cherry-pick, needs to create new pull requests to branch 0.14 (#669) and 0.13

@wxyucs wxyucs mentioned this pull request May 6, 2025
@inabao inabao mentioned this pull request May 6, 2025
LHT129 pushed a commit to LHT129/vsag that referenced this pull request Apr 16, 2026
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
LHT129 pushed a commit that referenced this pull request May 11, 2026
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: LHT129 <tianlan.lht@antgroup.com>
Sia-Sheerland pushed a commit to Sia-Sheerland/vsag that referenced this pull request Jun 26, 2026
Signed-off-by: jinjiabao.jjb <jinjiabao.jjb@antgroup.com>
Signed-off-by: Sia Sheerland <x1075956441x@163.com>

Signed-off-by: Sia Sheerland <x1075956441x@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Bug fixes, defects, or unexpected behavior 修复程序错误、缺陷或异常行为 size/M version/0.15 1. Add Attribute Filter 2. Quantization and transformation 1. 新增 Attribute Filter 2. 量化与变换

Projects

None yet

Development

Successfully merging this pull request may close these issues.

incompatibility between different versions of HNSW

3 participants