← Back to Pull requests

Query the entry node's own vector in TestAcceleratedHNSWMultiLayerRoundTrip #2831

Closed
unknown closed this pull request without merging on Oct 13, 2026 23:24 UTC
View on GitHub
unknown unknown commented on Oct 11, 2026 13:21 UTC
Author

TestAcceleratedHNSWMultiLayerRoundTrip.testThreeLevelGraphCanBeReopenedAndSearched queried with vectors[graph.entryNode()] and checked the hit's stored id against the same number. entryNode() is a vector ordinal, which equals the docID in the merged segment, but vectors[] is indexed by insertion id. The two only match while forceMerge(1) keeps documents in insertion order. newIndexWriterConfig() picks a random merge policy, and TieredMergePolicy or MockRandomMergePolicy can reorder documents. The query is then an arbitrary document's vector, and the test effectively asserts that an approximate 1-bit BQ HNSW search at k = ef = 10 finds that document. A miss there is legitimate.

The test now looks up the entry node's stored id, queries with vectors[queryId], and requires hit.doc == entryNode. The assertion stays strict for all three formats.

Supporting analysis (CPU only):

  • A replay of the failing seed picks TieredMergePolicy, which reorders 232 of 256 documents.

  • Under the Lucene102 OSQ quantization of the test's exact 256x129 vectors, each document's own quantized score is strictly the maximum. The smallest margin is 0.39, so this is not a quantization tie.

  • In an emulation of the BQ graph search, an arbitrary target is missed in about 22% of trials, and the entry node's own vector in 0 of 20,000.
  • CI evidence (reproducer #2827; 4 lucene test jobs per run: 2x 13.3.0 rtxpro6000, 12.9.2 rtxpro6000, 12.9.2 l4; each loops this test with -Dtests.iters=100 and random seeds for 45 minutes):

  • Before, run 38142877368 at 37efbf2a: each iteration runs both the original and the fixed query on the same index. Over 39,320 iterations per format, the original query missed 112 times for BQ, 5 for SQ and 0 for float. All of those misses were on the 676 indexes that forceMerge(1) reordered (TieredMergePolicy or MockRandomMergePolicy). There were 0 misses when docID == insertion id. The fixed query missed 0 times. The stress-run seed 73F002E9239F2329 reorders 232/256 docs on the GPU, and the original query missed in 6 of 20 replays.

  • After, run 38149047284 at 81f14dce, which runs this PR's exact test file: 93,300 test iterations (31,100 per format) with 0 failures and 0 errors, and the failing seed passed 20 of 20 replays.
  • Found by the stress run (#2793). Part of #2783.

    Diff: 306 lines (+229 / -77) across 3 files Reviewer: imotov Review duration: 3482m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 306 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.343
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2831"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.2% (MEDIUM) · Higher = larger blast radius
    40.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.9% · Safe to merge
    15.9%
    Repository