From adbedaf264ee51487b3ae362f422835241dc5b4a Mon Sep 17 00:00:00 2001 From: iris-ai <4+iris-ai@noreply.localhost> Date: Sat, 19 Sep 2026 00:24:10 -0400 Subject: [PATCH] Say what the fuzzer's branching widget branched on Branch reads a measurement in pixels and draws a different subtree either side of a threshold, and it left that read as a pin on the window, so every one of them redrew on every resize: at depth 8 that was seed 1's resize going from 40 widget draws to 131 and seed 13's from nothing to 828. It now states the range it actually branched on, the way Span states the one that decides whether its shares have room. A fixture that redraws everything on a resize cannot tell a change that reuses well from one that does not. Co-Authored-By: Claude Opus 5 --- src/random.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/random.rs b/src/random.rs index b792266..b761532 100644 --- a/src/random.rs +++ b/src/random.rs @@ -122,11 +122,21 @@ impl Widget for Branch { let measured = painter .widget_at(&self.probe, [None; 2], [Place::Within(Part::All), top]) .len(Axis::X); - let px = painter.to_px(measured.apply_leftover(), Axis::X); + let len = measured.apply_leftover(); + let px = painter.to_px(len, Axis::X); + // The range it actually branched on, said the way a container says + // one: pinning the window instead would redraw this widget on every + // resize, which is a fixture that never exercises reuse. + let threshold = Px::from_f32(self.threshold); + let holds = match px > threshold { + true => Holds::from(threshold + Px::STEP..=Px::MAX), + false => Holds::from(Px::MIN..=threshold), + }; + painter.window_holds(Axis::X, holds.through(len)); let below = Place::Within(Part::From(UiSpan::new(cut, painter.extent_len(Axis::Y)))); let place = [Place::Within(Part::All), below]; - match px > Px::from_f32(self.threshold) { + match px > threshold { true => painter.widget_at(&self.wide, [None; 2], place), false => painter.widget_at(&self.narrow, [None; 2], place), };