Say why a reuse was refused, on every path that refuses one

Three of the eight rejections in `try_reuse` were invisible or half-visible
to the diagnostics: a changed inherited mask counted nothing and traced
nothing, an undrawn record traced without counting, and a changed
region-node choice counted without tracing. The mask one is the rejection
this branch's repair was about, so "why did that redraw?" was exactly the
question the rig could not answer.

Adding a counter meant editing a variant list and a name list at the same
index, which renames every total after a slip and says nothing. The two
lists are one declaration now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
iris-aiandClaude Opus 5 committed 2026-09-20 00:20:23 -04:00
1 parent 713e3e747b
commit 8088a1fa59
2 files changed
+78 -92

No files matched your search

+16 -2
View File
@@ -569,12 +569,18 @@ impl UiRenderState {
};
if !active.drawn {
#[cfg(feature = "layout-diagnostics")]
diag::reuse(id, ReuseOutcome::Undrawn);
{
diag::bump(Counter::ReuseUndrawn);
diag::reuse(id, ReuseOutcome::Undrawn);
}
return false;
}
if active.is_region_node() != info.region_node {
#[cfg(feature = "layout-diagnostics")]
diag::bump(Counter::ReuseWrongNode);
{
diag::bump(Counter::ReuseWrongNode);
diag::reuse(id, ReuseOutcome::WrongNode);
}
return false;
}
// Drawn on another layer: the drawing sits in that layer's list and
@@ -590,7 +596,15 @@ impl UiRenderState {
}
return false;
}
// Its primitives name the mask it inherited, and a masking parent
// that redrew pushed another: keeping them would clip them by one
// nothing updates again.
if active.parent_mask != info.mask {
#[cfg(feature = "layout-diagnostics")]
{
diag::bump(Counter::ReuseWrongMask);
diag::reuse(id, ReuseOutcome::WrongMask);
}
return false;
}
// Drawn somewhere else in the tree: its box is in coordinates it no