NodeQueue.rerank: handle topK == 0 #812
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 212 lines diff across 2 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.321
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #812"
general
weight: 0.35
MarkWolters
Fixes #811.
What
NodeQueue.rerankno longer tries to evict from the reranked queue whentopK == 0. The eviction branch is nowelse if (topK > 0 && exactScores[i] > reranked.topScore()), so withtopK == 0every candidate falls through to the existingelseand goes to the unused pile, and the method returnsFloat.POSITIVE_INFINITYas it already does when fewer thantopKresults were reranked.Previously, with an empty
rerankedqueue,topScore()andtopNode()read a stale heap slot and the followingapproximateScoresById.get(evictedNode)returned null, which threw while unboxing.Results
2,000 x 64-d Gaussian vectors, 200 queries, a fresh
GraphSearchereach,search(ssp, 0, 10, NEGATIVE_INFINITY, 0.0f, Bits.ALL):| |
main| this branch ||---|---|---|
| EUCLIDEAN, DOT_PRODUCT, COSINE; reranker only, and PQ + reranker | NPE in 200 / 200 each | 0 / 200 each, empty result |
The reproducer in #811 throws on
mainand printstopK=0 rerankK=10: 0 resultson this branch.Tests
TestNodeQueue.testRerankWithZeroTopKLeavesEverythingUnusedcallsrerank(0, ...)on a queue of five candidates and asserts that nothing is reranked, all five end up in the unused pile and the return value isPOSITIVE_INFINITY. It fails on the previous condition with the sameNullPointerExceptionand passes with this change (checked by restoring the original condition).Also run and passing:
TestNodeQueue,TestVectorGraph,GraphIndexBuilderTest,TestDeletions,TestLowCardinalityFiltering,OnHeapGraphIndexTest,TestOnDiskGraphIndex,TestFusedGraphIndex(69 tests, 2 skipped as before). I did not run the full suite or the native module.