bug fix for non-normalized dot product vectors returning no matches and causing assertion to fail if using hierarchy #714
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.32) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.32 · 126 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.290
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #714"
general
weight: 0.35
MarkWolters
This PR resolves issue https://github.com/datastax/jvector/issues/713.
When dot product vsf is used for graph search in conjunction with enabling hierarchy this can result in a failed Assertion when no candidate is found to be sufficiently close to the search vector at the level being searched, in this case where level > 0.
Any candidate whose score is < 0 is silently dropped, never added to approximateResults. If every candidate reachable from the entry point within that hierarchy layer happens to score negative for a given query, approximateResults stays empty and the size() == 1 assert fires.
0.0f is only a valid "accept everything" sentinel for similarity functions that are mathematically bounded to (0, 1] — COSINE and EUCLIDEAN are. DOT_PRODUCT is not bounded unless callers pre-normalize vectors to unit length. VectorDotProductWithLengthTest.testTrueDotproduct (the failing Cassandra unit test that surfaced this issue) deliberately uses non-unit 2D vectors with components in [-100, 100].