← Back to Pull requests

GraphSearcher: create the visited marker once per searcher and handle scored neighbors in searchOneLayer #810

Closed
unknown closed this pull request without merging on Nov 25, 2026 20:49 UTC
View on GitHub
unknown unknown commented on Nov 20, 2026 21:40 UTC
Author

Fixes #809.

What

  • The visited::add marker passed to processNeighbors is created once per searcher instead of once per expanded node.

  • The per-neighbor work ran in a callback that processNeighbors called for each neighbor, so it was fast only when the JIT inlined that callback, which depends on compile order.

  • #796 already creates that callback once per layer search, which removed its allocation, but the work stayed inside it.

  • Now the view only appends each neighbor and its score to a per-searcher NodesUnsorted, and searchOneLayer handles them in its own loop.
  • No API changes. A TODO on View.processNeighbors describes the longer-term API: views would fill the caller's buffer directly, removing the separate batch buffers.

    Results

    In-memory vectors, exact scoring, colbert 1M (128 dimensions), GNR (48 cores), JVM pinned to 4 cores, 4 threads, beam 40, never-seen queries, 3 fresh JVMs each in rotating order:

    | | main QPS | this PR QPS | main p50 | this PR p50 | bytes/query |
    |---|---|---|---|---|---|
    | JDK 22 | 26,144 / 26,432 / 26,324 | 30,778 / 30,676 / 30,803 (+17%) | 0.149–0.152 ms | 0.128–0.129 ms | 2,151 → 648 |
    | JDK 25 | 27,016 / 26,801 / 26,878 | 31,251 / 29,629 / 30,977 (+14%) | 0.147–0.148 ms | 0.127–0.130 ms | 2,151 → 480–880 |

    Across 14 1M datasets (25 to 3,072 dimensions) on GNR (48 cores) and Ice Lake (8 cores), JDK 25 and 22, Panama and native: in-memory search is faster, from about +35% at 25 dimensions to level at 3,072; on-disk exact search is level within run-to-run spread.

    BenchYAML, ada002-1M (1,536 dimensions), on-disk index with NVQ rerank, Ice Lake (32 cores), JDK 25: search QPS and build time are level for fused ASH (2-bit) and non-fused PQ; recall is unchanged. Search results are identical to main on every path.

    Tests

    New TestWideExpansions: a fully connected graph where one expansion scores 299 neighbors, more than the buffer's initial size. jvector-base and jvector-tests pass on JDK 25 and 22.

    Diff: 254 lines (+190 / -64) across 3 files Reviewer: MarkWolters Review duration: 7148m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 254 lines diff across 3 files
    0.39
    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.332
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #810"
    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: 39.1% (MEDIUM) · Higher = larger blast radius
    39.1%
    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.4% · Safe to merge
    15.4%