← Back to Pull requests

[WIP] Modular C++20 modules #1545

Closed
unknown closed this pull request without merging on May 20, 2026 20:47 UTC
View on GitHub
unknown unknown commented on Mar 15, 2026 01:10 UTC
Author

This picks back work from #953, bringing modular modules support to C++/WinRT.

This has several advantages over PCH:

  • Rebuilds are incremental over a PCH, which rebuilds all or nothing

  • Builds are heavily parralelized, as opposed to a PCH that is single-threaded

  • Inner loop times are drastically reduced from a PCH in my experience

  • The internals are completely unexposed - winrt::impl doesn't even exist when you do import winrt;
  • Currently, this depends on this fix to build: https://developercommunity.visualstudio.com/t/Error-C3779-using-C20-modules-when-for/10879949

    Unfortunately, I have not been able to make it work yet without bringing in the preview MSVC toolchain (which then causes issues with import std;). This issue seems to have finally been fixed, but the above prevents me from fully testing.

    Basic usage of winrt::hstring through import winrt; does work though! (test_cpp20 compiles if this is the only test activated)

    I've also included #1521 because it has some fixes that help modules (removal of definitions from base_includes, which aren't allowed in the global module fragment).

    I'm still posting this as a WIP to let interested people try/look/comment on it.

    Diff: 165 lines (+123 / -42) across 2 files Reviewer: YexuanXiao Review duration: 96216m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.35) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 165 lines diff across 2 files
    0.35
    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.306
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1545"
    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: 35% (MEDIUM) · Higher = larger blast radius
    35%
    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.2% · Safe to merge
    15.2%