Skip to content

linux: Fix piecewise clip dropping fractional box edges - #3005

Open
huacnlee wants to merge 1 commit into
mainfrom
agent/T-10958-decor-clip-flake
Open

huacnlee wants to merge 1 commit into
mainfrom
agent/T-10958-decor-clip-flake

Conversation

@huacnlee

Copy link
Copy Markdown
Member

Fixes the intermittent decor::tests::piecewise_continuous_clip_matches_the_path_mask failure on the Linux check (seen on #2960, #2968, #2989, #2993 and main).

Cause

append_clipped drew the middle/top/bottom bands with plain rectangle clips that ran to the box's outer edges. When the view sits off device pixels (the test's scale 2, origin (0.5, 0.25) case puts the bottom edge at device y = 360.5), the GL renderer turns the rect clip into a whole-pixel scissor and drops the half-covered row that the path mask keeps. A debug run on CI showed exactly that: the whole bottom row was [0,0,0,0] against [18,0,135,153] expected. It is intermittent because CI's xvfb setup does not always end up on the same GSK renderer.

This is a real rendering bug, not only a test tolerance issue: such views lost their last row/column of antialiased edge.

Fix

The plain bands now stop at the last whole device pixel inside the box; the thin strip beyond it (under one device pixel) is masked with the path, like the corners. Pixel-aligned views get no extra pieces, so the common case costs nothing more.

Verification

  • cargo test -p nsh-platform-linux --lib decor passes with GSK_RENDERER=gl, vulkan and cairo locally (GTK newer than CI's 4.14, where the failure did not reproduce before the fix either); CI on this PR is the real check.
  • cargo clippy -p nsh-platform-linux --all-targets -D warnings clean.
  • No benchmark run; the change only adds pieces for views off device pixels.

🤖 Generated with Claude Code

🤖 Noop (rust-maintainer) · AI agent acting for @huacnlee

Rectangle clips on edges off device pixels are cut to whole pixels by the
GL renderer, dropping the partially covered row the path mask keeps. This
made piecewise_continuous_clip_matches_the_path_mask fail on CI (scale 2,
origin 0.25: the whole bottom row was empty).

Agent: rust-maintainer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@huacnlee

Copy link
Copy Markdown
Member Author

The Linux check, including the affected clip test, passed. The remaining failure is GPUI Gallery’s typing a long line completes in one host step: its host request reached the 30-second deadline. The same failure appears on #2997 and #2952.

On current main 1ea7e525b, the exact test passes in a real Linux GPUI window under Xvfb in 7.5 seconds; the GPUI tests::windows unit test also passes locally. This does not establish the CI timeout’s cause. I restarted only the failed GPUI Gallery job once to check whether it persists: https://github.com/longbridge/nsh/actions/runs/45253405488 .

🤖 Noop (rust-maintainer) · AI agent acting for @huacnlee

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant