test: compare Cloud tree title columns on the backing-pixel grid

Merged
AU
17d ago
+8-1

CloudTreeCompactLayoutTests "Cloud, locked, local and pending machine titles share the folder icon column" has failed on main since #16004, on the 1x fleet runners. It fails in the sections style at 150%, with title starts [33, 39, 39, 38, 37] against a 1.5pt allowance. The layout didn't move: one title's raster moved by one backing pixel, and the allowance can't absorb that. This is one of the #15488 failures.

Cause

  • Titles sit between pixels. In the sections style at 150%, every machine title is laid out at 6 + 22.5 + 9 = 37.5pt inside its cell (CloudTreeMachineBand, CloudTreeStyle). The CI windows render at 1x (380×620pt screenshots are 380×620px), so each title snaps to one of the two neighbouring pixels.
  • #16004 flipped one snap. It changed the trailing padding from 12 to 8 and the band's trailing inset from 10 to 6. The pending row's hosted content grew from 255 to 263pt, and its title now snaps one pixel left.
  • One pixel was already used. The local-machine row's semibold title crosses the test's 0.2 ink threshold a pixel before the medium titles do: its faint edge pixel is 0.21, theirs 0.18.
  • Together that is 2px. An allowance of 1.5pt, measured in whole pixels, permits 1px at 1x.

Evidence

  • Same runner, before and after. Comparing shard 4's attached screenshots on cmux13s from validation runs 36713362165 (before #16004, passed) and 36732010954 (after, failed): across all 20 cases, the only change in the leading 160 columns is the sections-150 pending title. It is the identical raster shifted exactly 1px left; the icon, the band edges and the vertical position are pixel-identical.
  • Main reproduces it. A main run with #16004 failed with the same numbers (job).
  • It never ran on #16004. #16004's changed-suites job didn't select this test.
  • Not machine-dependent. Before #16004, the 20 screenshots from cmux13s and cmuxs-mac-mini-3 were pixel-identical.

Change

The allowance is rounded to the backing-pixel grid, as iconLabelSpacing in the same file already does ("rather than rejecting a 2px delta against 1.875px").

  • At 1x it allows 2px at 150% and 1px at 75%. 100% and 200% are unchanged.
  • At 2x only 75% changes, from 1px to 2px.

What still fails:

  • A missing band inset: a fixed 6pt, so it fails in every sections case.
  • An unscaled icon slot: at least 2.75pt off at every percent but 100%.
  • An unscaled icon gap: fails at 200% in every style, and at 150% in sections. In compact at 1x it is 2pt off at 150% and 1pt at 75%, which the pixel grid now allows.
  • A column drift: anything past 1pt at 100%, or past 2pt at 150% and 200%.

This changes an assertion's precision, deliberately. The assertion compared ink edges, which are whole pixels, against a fractional-point allowance, so a half-point layout position failed or passed depending on which way the rasterizer rounded.

Verification

Run 36744359319 runs the suite twice, on the validation build (which includes #16004), with this change and against the unmodified bundle as a baseline. It ran on cmux14, a 1x fleet mini. With this change the test passed all 20 cases in both iterations. The unmodified bundle failed the sections case in both iterations, as it does on main. This PR's changed-suites job also passed all 20 cases on the head commit.

Overlaps

  • #15883 reverts #16004's tree changes after its "Revert main catch-up" commit, which would hide this failure rather than fix it.
  • #15998 and #15881 re-land #16004's content and contain no fix for this test.

Changelog

  • none

🤖 Generated with Claude Code