Say what each not-cacheable reason means and what to change; explain a low Rust hit rate

Each reason now carries a plain name, meaning, action and a fixable flag (checked
against sccache 0.18.0), shown with its count in the reasons panel, fixable first.
The low-hit-rate problem names the fixable loss and the Rust hash-key inputs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Sonnet 5.5 committed 2026-11-28 17:45:38 -07:00
1 parent 3ede855fbb
commit 0f4df265a5
8 files changed
+498 -52

No files matched your search

+22 -12
View File
@@ -530,12 +530,12 @@ fn table_height(fixed: f32, rows: usize) -> f32 {
/// How tall the row of "Where compiles went", "By language" and "Problems" is:
/// enough for the tallest of the three, and never less than the usual height.
fn triptych_height(view: &View) -> f32 {
fn triptych_height(ui: &egui::Ui, view: &View, panel_width: f32) -> f32 {
use theme::layout as l;
l::TRIPTYCH_HEIGHT
.max(l::WHERE_FIXED_HEIGHT)
.max(table_height(l::LANGUAGES_FIXED_HEIGHT, view.languages.len()))
.max(problems_height(view))
.max(problems_height(ui, view, panel_width))
}
/// How tall "Speed" is.
@@ -549,22 +549,30 @@ fn speed_height(view: &View) -> f32 {
table_height(l::SPEED_FIXED_HEIGHT, 0) + with_histograms as f32 * l::HISTOGRAM_HEIGHT
}
fn problems_height(view: &View) -> f32 {
/// How tall "Problems" is in a panel `panel_width` wide: each problem's title, and its detail
/// wrapped to the panel.
fn problems_height(ui: &egui::Ui, view: &View, panel_width: f32) -> f32 {
use theme::layout as l;
if view.problems.is_empty() {
88.0
} else {
table_height(l::PROBLEMS_FIXED_HEIGHT, 0) + view.problems.len() as f32 * l::PROBLEM_HEIGHT
return 88.0;
}
let inner = panel_width - 2.0 * (theme::space::PANEL_PADDING + 1.0);
let details: f32 = view
.problems
.iter()
.map(|problem| style::galley(ui, theme::small(ui, problem.detail.clone()), true, inner).size().y + 21.0)
.sum();
let gaps = (view.problems.len() - 1) as f32 * (theme::space::BETWEEN_PARTS + theme::space::LINE);
l::PROBLEMS_FIXED_HEIGHT + details + gaps
}
/// How tall the row of "Over time" is when "Speed" and "Why compiles were not
/// cacheable" are stacked beside it: the taller of the two sides.
fn charts_height(view: &View) -> f32 {
fn charts_height(ui: &egui::Ui, view: &View, side_width: f32) -> f32 {
use theme::layout as l;
let stacked = speed_height(view)
+ theme::space::PANEL_GAP
+ where_went::reasons_height(view.not_cached.len());
+ where_went::reasons_height(ui, view, side_width);
l::CHARTS_HEIGHT.max(stacked)
}
@@ -598,14 +606,15 @@ fn page(ui: &mut egui::Ui, view: &View, asked: Range, hidden_languages: &mut Vec
match columns {
3 => {
let [a, b, c] = row(ui, triptych_height(view), &[1, 1, 1]).try_into().expect("three panels");
let third = style::span_width(ui, 3, 1);
let [a, b, c] = row(ui, triptych_height(ui, view, third), &[1, 1, 1]).try_into().expect("three panels");
let (_, a) = style::panel(ui, a, "Where compiles went", |ui| where_went::section(ui, view));
let (_, b) = style::panel(ui, b, "By language", |ui| where_went::languages(ui, view));
let (_, c) = style::panel(ui, c, "Problems", |ui| problems::section(ui, view));
close_row(ui, &[a, b, c]);
// "Over time" over two columns; "Speed" and the reasons stacked in the third, together as tall.
let height = charts_height(view);
let height = charts_height(ui, view, third);
let [wide, side] = row(ui, height, &[2, 1]).try_into().expect("two panels");
let speed = speed_height(view);
let speed_rect = egui::Rect::from_min_max(side.min, egui::pos2(side.right(), side.top() + speed));
@@ -620,7 +629,8 @@ fn page(ui: &mut egui::Ui, view: &View, asked: Range, hidden_languages: &mut Vec
close_row(ui, &[wide, speed, reasons]);
}
2 => {
let reasons = where_went::reasons_height(view.not_cached.len());
let half = style::span_width(ui, 2, 1);
let reasons = where_went::reasons_height(ui, view, half);
let height = l::TRIPTYCH_HEIGHT.max(l::WHERE_FIXED_HEIGHT).max(reasons);
let [a, b] = row(ui, height, &[1, 1]).try_into().expect("two panels");
let (_, a) = style::panel(ui, a, "Where compiles went", |ui| where_went::section(ui, view));
@@ -628,7 +638,7 @@ fn page(ui: &mut egui::Ui, view: &View, asked: Range, hidden_languages: &mut Vec
close_row(ui, &[a, b]);
let height = l::TRIPTYCH_HEIGHT
.max(table_height(l::LANGUAGES_FIXED_HEIGHT, view.languages.len()))
.max(problems_height(view));
.max(problems_height(ui, view, half));
let [a, b] = row(ui, height, &[1, 1]).try_into().expect("two panels");
let (_, a) = style::panel(ui, a, "By language", |ui| where_went::languages(ui, view));
let (_, b) = style::panel(ui, b, "Problems", |ui| problems::section(ui, view));