← Back to Pull requests

Keep shared objects off the per-neighbor search path #833

Closed
unknown closed this pull request without merging on Nov 25, 2026 01:37 UTC
View on GitHub
unknown unknown commented on Nov 24, 2026 05:49 UTC
Author

With several searchers running at once, some JVMs ran graph search 13–22% slower for their whole lifetime. The cause is false sharing. For every scored neighbor, GraphSearcher read shared objects (Bits.ALL and the no-op score tracker) and wrote its own visitedCount. After heap compaction, one worker's searcher could end up on the same cache line as a shared object. Its writes then kept pulling that line away from the other cores.

searchOneLayer now checks once per layer whether the filter accepts everything and whether the tracker is the no-op one, so the per-neighbor path no longer touches shared objects. Visits are counted in the per-layer processor and added to visitedCount once per layer. Results and visit counts are unchanged.

Results

Setup:

  • GNR (48 cores), JDK 22, cohere-english-v3-1M, fused ASH 2-bit.

  • 8 queued workers pinned to 8 cores.

  • 16 fresh JVMs per arm.

  • Each JVM ran one cold pass of 50k queries on a warm index: the 10k held-out queries plus 4 noisy, renormalized copies.
  • | | Mean QPS | JVMs in slow mode | Mean QPS, other JVMs |
    |---|---|---|---|
    | Before | 112.0k | 4 of 16 (90.6k–101.6k) | 116.6k |
    | After | 115.4k | 0 of 16 | 115.8k |

    Every JVM visited the same number of nodes per query (508.3).

    The slow mode is intermittent and appears less often on current main. These runs therefore compare commit 8863c5aa with and without the change, where it shows up more readily. Among JVMs that did not go slow, the change was about 0.7% lower, which is close to the noise.

    Tests: jvector-tests passes on Ice Lake (8 cores), 131 tests.

    Diff: 199 lines (+149 / -50) across 2 files Reviewer: MarkWolters Review duration: 1187m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.36) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 199 lines diff across 2 files
    0.36
    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%
    56%
    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.317
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #833"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 36.1% (MEDIUM) · Higher = larger blast radius
    36.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: 56.8% · Lower = rushed or shallow review
    56.8%
    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.6% · Safe to merge
    15.6%