← Back to Pull requests

[sancov][NFC] Improve -union performance of sancov utility / Add a RawAddrSet typedef (1/3) #238753

Open
mgcarrasco opened this pull request with 14 lines diff across 1 files
View on GitHub
mgcarrasco mgcarrasco commented on Nov 04, 2026 11:36 UTC
Author

These stacked PRs improve the performance of -union for a large number of sancov files. This was tested with sancov files emitted by llc while running the LLVM test suite. These changes reduce the processing time from 548s to 15s for 69,146 files.

The changes are summarised as follows:

  • Use a DenseSet instead of a std::set, so each candidate address just requires a lookup instead of a tree walk. When a sancov is written, it is sorted once so the output remains deterministic.

  • Add a function that appends a sancov file into an address set already in memory. Previously each file was loaded into its own container and then merged into the union, which was inefficient.
  • The stack is a mirror of https://github.com/llvm/llvm-project/pull/234145 which wasn't stacked.

    ---

    This PR typedefs the sancov address set as RawAddrSet. It still uses the same underlying container std::set<uint64_t>. It also drops the explicit keyword from the constructor as requested.

    Assisted-by: Cursor (Grok 4.7)

    Diff: 14 lines (+7 / -7) across 1 files Reviewer: jmmartinez Review duration: 38524m
    All Vouch review confidence checks passed
    Residual risk 0.05 = Change Risk (0.19) × (1 − Review Confidence (0.72)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.19 · 14 lines diff across 1 files
    0.19
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.54 · 1 substantive comment(s)
    0.54
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    71%
    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.162
    Real PR Conversation Timeline
    4 items
    jmmartinez jmmartinez approved these changes on Nov 04, 2026 16:02 UTC
    Approved Reviewer

    Approved these changes.

    vitalybuka vitalybuka commented on Nov 04, 2026 17:29 UTC
    Contributor

    Improve -union performance of sancov utility / Add a RawAddrSet typedef (1/3)- #238753

    This PR just 'using RawAddrSet = std::set<uint64_t>;', so it should be described as that.
    You can mention this this is preparation for #238757.

    vitalybuka vitalybuka approved these changes on Nov 04, 2026 17:30 UTC
    Approved Reviewer

    Approved these changes.

    Reviewers
    Assignees
    mgcarrasco mgcarrasco
    Labels
    risk: low confidence: 71.6% 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: 19.2% (LOW) · Higher = larger blast radius
    19.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: 71.6% · Lower = rushed or shallow review
    71.6%
    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: 5.5% · Safe to merge
    5.5%