Repository navigation
fix(webgpu): Skip glyph batches outside the replay clip - #25640
Merged
ramezgerges merged 3 commits intoOct 26, 2026
Merged
ramezgerges merged 3 commits into
ramezgerges merged 3 commits into
Conversation
A same-colour glyph run was batched into one atlas draw however long it was, and nothing compared an op's extent with its clip: a 128K-glyph line in a 480 px viewport drew all 133K quads against the scissor, a frame lavapipe needed a minute for. Batches now stop at 256 quads and carry their extent, and a replay drops the ones that land wholly outside its site's clip. The cached op list is untouched, so a scroll brings them back. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A misspelled word's wave was one path across the whole word: a 128K-character word made a 1M px path of 18.7M edges, baked into a mask on every frame. A wave longer than two chunks is now drawn as repeats of one 40-period chunk through DrawPaths, so backends see one small cached shape and can cull it per chunk. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
They failed because the large-story test before them left a frame that held the render thread for up to a minute. Fixes unoplatform#25600 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
The build 240811 found UI Test snapshots differences: Details
|
1 of 5 tasks
Contributor
|
|
Xiaoy312
approved these changes
Oct 26, 2026
ramezgerges
enabled auto-merge
October 26, 2026 16:03
ajpinedam
approved these changes
Oct 26, 2026
Contributor
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
1 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue: closes #25600
PR Type:
🐞 Bugfix
What changed? 🚀
The three
Given_RichEditBoxtests in #25600 failed together because the test before them,When_Loaded_Large_Story_Local_Key_Edit_Stays_Range_Based, puts 128K characters on one unwrapped line in a 480 pxRichEditBox. On the WebGPU lanes, lavapipe needed 16-60 s to render that frame. The X11 render thread waited for it inPresent()(wgpuDevicePoll), so the following tests got no frames: their scroll animations never ticked andWaitForRenderedColortimed out.The frame was that expensive for two reasons:
atlas=try133434,culled=0/0).DrawOp.Extent, cull-only, separate from the occlusionBounds).AppendSitedrops ops that land wholly outside the site's clip, per frame. The cached op list is untouched, so a scroll brings them back.DrawPaths. Every chunk after the first starts and ends on the same crest, so they share one small, cached geometry, and their round caps overlap into the round join the single path had.The
BackendConditionskips added for #25600 are removed.Validation
Runtime, in an Ubuntu 24.04 container matching the CI Linux WebGPU lane (lavapipe, 4 cores,
-p:CI_Build=true):Given_RichEditBoxon WebGPUGiven_RichEditBox+Given_TextBoxon SkiaStats for the large-story frame after the fix:
clipCulled=511batches dropped, no mask fills (big0). The remaining cost is about 0.3 s of CPU op building when the long line re-records.Full suite (WebGPU, same container), against a baseline build of master: 10,562 tests, failures 76 -> 73, the three tests above are the only change, and no new failures, in two runs. These runs also carried the fix for a separate pre-existing race (two windows presenting at once corrupted the factory's main-surface cache), which crashed the suite at the multi-window tests without it; that fix will come as its own PR.
Not yet done: an A/B on a text-heavy sample. Batches capped at 256 should merge back into one draw at encode (they are adjacent in the recording's vertex buffer), but that is unmeasured.
PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code