Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1048 +/- ##
=======================================
Coverage 97.55% 97.55%
=======================================
Files 142 142
Lines 9095 9095
=======================================
Hits 8873 8873
Misses 222 222 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Covers the default: return nullptr; branch in TieredSVSFactory::NewIndex so codecov/patch no longer flags it as a missing line on PR #1048. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e062f68. Configure here.
| def test_manual_tiered_destruction_with_pending_jobs(): | ||
| code = """ |
There was a problem hiding this comment.
Still don't get it... We want to isolate native crashes and hangs in all tests, no? Why does this one have to be a subprocess? looks strange
There was a problem hiding this comment.
Ok for some reason it didn't post it.
So there's no special reason for a subprocess here just over confident ai again. Removed it and kept the test with jobs still pending when we delete the index.
Also added a native SQ8 test to check that the index is actually released and the tracked memory is freed, instead of just checking that it doesn't crash. Passed for FP32/FP16 with zero and positive training thresholds.
| assert len(set(found[0])) == k, found | ||
| assert set(found[0]).issubset(valid_labels), found | ||
| assert np.isfinite(scores).all(), scores | ||
| assert np.all(np.diff(scores[0]) >= 0), scores |
There was a problem hiding this comment.
consider also asserting the sorted order of results
There was a problem hiding this comment.
It was already covered with assert np.all(np.diff(scores[0]) >= 0), but changed the assertion to compare against np.sort so it’s clearer.
| def test_manual_tiered_destruction_with_pending_jobs(): | ||
| code = """ |
There was a problem hiding this comment.
Still don't get it... We want to isolate native crashes and hangs in all tests, no? Why does this one have to be a subprocess? looks strange
eee8e1a to
589f5fa
Compare

Describe the changes in the pull request
Expose SQ8 configuration through the VecSim Python bindings and exercise the tiered HNSW training and migration lifecycle. Targets
main.VecSimQuantType,HNSWParams.quantType, andTieredHNSWParams.QuantNormalizationSetSize.quantization_meantoHNSWIndex,Tiered_HNSWIndex, and genericVecSimIndexwith HNSW parameters. Validate shape, dimension, and finite float32 values; retain the buffer through construction while native code copies it. A positive tiered training threshold takes precedence over the supplied mean.ValueError, including safe tiered HNSW worker-context cleanup.manual_jobsand_run_pending_jobsfor deterministic partial-migration checks. Live batch iterators must be depleted or destroyed before draining jobs.Coverage
Which issues this PR fixes
Implements the VecSim portion of MOD-14959. The ticket remains open for RediSearch integration flows, including
FT.CREATE,FT.INFO, ingestion/query/deletion, and RDB round trips. The remaining checklist is in the ticket.ARM Python-flow CI enablement is separately tracked in MOD-18762.
Main objects this PR modified
src/python_bindings/bindings.cpptests/flow/test_hnsw_tiered.pytests/unit/test_hnsw_sq8.cppBF/SVS-specific constructor hardening and its tests are excluded from this PR and preserved separately for follow-up.
Validation
mainatfcdeb37bas one commit, preserving the reviewed three-file scope. Independent review verified both the original PR changes and new main changes are preserved.update_vectorsflows. Three expected NumPy overflow warnings came from invalid-mean cases.fa9608bffixes the pre-training reference: float64 NumPy rankings can differ from native FP16 accumulation and cosine normalization. All 115 focused Python cases passed on dorer-intel after the fix; independent review passed. The AVX-512 FP16 path requires CI confirmation because dorer-intel lacks that CPU feature.Mark if applicable
Note
Medium Risk
New public Python API for quantization and stricter constructor errors affect index creation paths; tiered lifecycle and async migration are heavily exercised but remain complex.
Overview
Exposes SQ8 quantization through the VecSim Python API and adds broad flow/unit coverage for tiered HNSW training, migration, and search.
Bindings: Adds
VecSimQuantType,HNSWParams.quantType, andTieredHNSWParams.QuantNormalizationSetSize. HNSW and genericVecSimIndex(HNSW-only) accept an optional keyword-onlyquantization_mean(1-D float, length = dim, finite); it is validated and wired into nativequantParamsfor SQ8. Unsupported index parameters now raiseValueErrorinstead of constructing a null native index; tiered creation resets the mock thread pool context on failure.Tiered testing hooks:
Tiered_HNSWIndexgainsmanual_jobsand_run_pending_jobsso tests can step migration deterministically;wait_for_indexdrains the queue in manual mode.Tests: New Python flow tests cover SQ8 type/metric/multi matrices, training thresholds, supplied vs trained means, partial migration queries, deletion before training, and invalid configs. C++ adds pending-job destruction cleanup and tighter concurrent-transition checks for KNN, range, and batch iterators.
Reviewed by Cursor Bugbot for commit 589f5fa. Bugbot is set up for automated code reviews on this repo. Configure here.