← Back to Pull requests

Precompile common Qt6/std headers in rviz_common #1908

Closed
unknown closed this pull request without merging on Oct 23, 2026 09:39 UTC
View on GitHub
unknown unknown commented on Oct 22, 2026 18:02 UTC
Author

Summary

Follow-up to #1907.

Profiling rviz_common with clang -ftime-trace showed it's even more parsing-dominated: Frontend accounts for ~93% of total compile time (2110.5s ExecuteCompiler / 1961.3s Frontend, summed across 163 TUs), with Qt6 headers (qobject.h, qwidget.h, qstring.h, qmetatype.h, qchar.h, QObject, QString, qicon.h, QWidget, qglobal.h, qvariant.h, ...) dominating cumulative header self-time.

This PR adds a package-local, non-installed src/precompile.hpp and enables target_precompile_headers() on the rviz_common target, behind a new RVIZ_COMMON_ENABLE_PCH option.

Measurements

Clean build of rviz_common only:

| Run | Config | Wall | CPU (user) |
|---|---|---|---|
| A | no PCH | 1m31.7s | 5m34.8s |
| B | PCH | 0m31.9s | 1m41.4s |
| C | no PCH | 2m33.3s | 6m56.6s |
| D | PCH | 0m44.2s | 1m44.7s |

Windows verification

Verified via ci_launcher (ci_windows). Build time for this package: 4m41s with PCH vs a historical no-PCH baseline of ~25.7min median (n=8 recent nightly_win_rel runs) — ~82% reduction, even larger than the Linux results above (consistent with this package's higher parsing-dominated share of total compile time).

Diff: 152 lines (+114 / -38) across 1 files Reviewer: ahcorde Review duration: 936m
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.33) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.33 · 152 lines diff across 1 files
0.33
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.301
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1908"
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: 33.1% (LOW) · Higher = larger blast radius
33.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: 13.1% · Safe to merge
13.1%
Repository