Repository navigation
fix(webgpu): Address the review of the native-host overhead work - #26698
Open
ramezgerges wants to merge 6 commits into
Open
ramezgerges wants to merge 6 commits into
ramezgerges wants to merge 6 commits into
Conversation
A shared page now holds keyless masks or keyed entries, never both. The cache's 8-page ceiling counted the pages keyless masks opened too, so a clip-heavy UI could leave glyphs and fills with no room and evicting every frame; and short-lived masks used shelf space on pages that long-lived glyphs keep from ever emptying. Addresses review point 1 of unoplatform#26565. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A write that bypasses the arena (1 MiB or more, or not a multiple of 4) first submits the copies pending ahead of it, so an earlier batched write to the same range cannot land after it. - The per-queue lock is held from the flush through the native submit, so another thread's submit cannot run ahead of the copies carrying its data. - Queue references are counted through wgpuDeviceGetQueue, wgpuQueueReference and wgpuQueueRelease: batching ends with the last reference, and its pending writes are submitted rather than dropped. - The file header notes that a failing write now fails the whole upload command buffer. Addresses review points 2 to 4 of unoplatform#26565. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Above 64 KB the buffer pool now uses four size classes per doubling instead of powers of two. A recording holds its vertex buffers for its lifetime, so a 520 KB arena held 1 MB; it now holds 640 KB. Classes still recur, so a returned buffer still serves the next request of its class. Addresses review point 5 of unoplatform#26565. Co-Authored-By: Claude Opus 5.5 <[email protected]>
StandalonePage returned a page or threw mid-frame. It now returns null when no texture can be created (out of GPU memory, or a lost device), and each caller skips the mask: a fill takes no route, a cached clip mask falls back to the per-frame one, a shadow keeps drawing from its shared sheet, and a clip with no mask hides what it clips rather than drawing it unclipped. Addresses review point 8 of unoplatform#26565. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Unit tests for CullOccluded, made internal: a background under another and an op outside the damage are culled, an op reaching into the damage by a fraction is kept, and a full repaint culls only what is fully covered. The four partial-repaint tests fail without the bounded-pass cull. Addresses review point 6 of unoplatform#26565. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Addresses review point 7 of unoplatform#26565. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
1 of 5 tasks
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
The build 248899 found UI Test snapshots differences: Details
|
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: related to #26564
PR Type:
🐞 Bugfix
What changed? 🚀
Follow-up to #26565, addressing the points of its review, one commit each (2 to 4 share one).
wgpuDeviceGetQueue,wgpuQueueReferenceandwgpuQueueRelease: batching ends with the last reference, and its pending writes are submitted rather than dropped.CullOccluded(made internal, withInternalsVisibleToforUno.UI.UnitTests, asUno.UI.Compositiondoes): a background under another and an op outside the damage are culled, an op reaching into the damage by a fraction is kept, and a full repaint culls only what is fully covered.DrawOp's summary is back onDrawOp.The note about a failing write now failing the whole upload command buffer is in the header of
SilkCompat.Uploads.cs.The Skia screenshot differences on #26565 (446 Linux, 501 Windows) were higher than the 203–303 of other PRs at the time. Its branch was a week behind master, which is the likely cause, since those runs use the Skia renderer. This PR's run will show whether that holds.
Validation
Uno.UI.Composition.WebGpuandUno.UI.Composition.WebGpu.Initbuild with analyzers on.Given_WebGpuOcclusionCulltests pass. With the bounded-pass cull from perf(webgpu): Cut per-frame CPU work on native hosts #26565 turned off, the 4 partial-repaint ones fail and the full-repaint one still passes.Given_Path*,Given_Ellipse,Given_Border,Given_TextBlock,Given_AcrylicBrush,Given_UIElement): 776 tests, 775 passed, 0 failed, 1 inconclusive.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code