Repository navigation
Description
Current behavior 🐛
On the Skia Desktop WebGPU backend, a single draw op whose vertex data is larger than the device's maxBufferSize (wgpu default: 256 MB) is uploaded as one over-limit vertex buffer. wgpu reports a validation error, the later queue submit panics, and the whole process aborts with no results file written. A CI run of the Desktop Linux WebGPU runtime tests died like this:
[webgpu] uncaptured error (Validation): In wgpuDeviceCreateBuffer
Buffer size 856904560 is greater than the maximum buffer size (268435456)
... In wgpuQueueSubmitForIndex: BindGroup with '' label is invalid
thread '<unnamed>' panicked at src/lib.rs:605:5
fatal runtime error: failed to initiate panic, error 5, aborting
Aborted (core dumped)
Trigger in that run: Given_RichEditBox.When_Bounded_Layout_Ends_Large_Story_Is_Released (a 2 MiB single-line NoWrap story, i.e. one ~2M-glyph run at roughly 408 bytes of vertex data per glyph). That test is currently excluded on WebGPU with [BackendCondition(ConditionMode.Exclude, RuntimeTestBackends.WebGpu)], so the gap is hidden in CI.
Expected behavior 🎯
An oversized draw degrades (is split into several ops, culled, or skipped) instead of killing the app. Skia and WinUI do not abort on a very long text run.
How to reproduce it (as minimally and precisely as possible) 🔬
Reproduced only from the CI log above; see the note at the end of this section.
- Build
SamplesAppfornet11.0-desktopwith the WebGPU backend and run it withUNO_WEBGPU=1. - Remove the
[BackendCondition(ConditionMode.Exclude, RuntimeTestBackends.WebGpu)]line fromWhen_Bounded_Layout_Ends_Large_Story_Is_Releasedinsrc/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Controls/Given_RichEditBox.PerformanceReview.skia.cs. - Run only that test (
UITEST_RUNTIME_TESTS_FILTER= base64 ofUno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls.Given_RichEditBox.When_Bounded_Layout_Ends_Large_Story_Is_Released, thendotnet SamplesApp.dll --runtime-tests=test-results.xml).
Minimal app-level equivalent: a RichEditBox (or a huge NoWrap TextBlock) holding a single line of about 2 million characters.
Verification status. On master 0599dada9e9 on Windows 11 (Vulkan, NVIDIA RTX 4000 Ada) the test passed and no chunk above 8 MB was uploaded, so this exact trigger did not hit the limit there. The over-limit upload was observed on the Linux CI leg only. The missing size check itself is confirmed by code inspection (below), not by a local runtime repro.
Workaround 🛠️
Avoid single very long glyph runs (roughly 650k+ glyphs in one run), or use the Skia backend. The runtime test is excluded on WebGPU.
Works on UWP/WinUI
Yes (not applicable to the WebGPU backend; WinUI does not crash on long text).
Renderer 🎨
- Skia
Affected platforms 📱💻🖥️
Skia Desktop with the WebGPU backend (UNO_WEBGPU=1); seen on Linux. Likely any WebGPU host that uses Uno.UI.Composition.WebGpu.
Uno.Sdk version (and other relevant versions) 📦
master @ 0599dada9e9 (net11.0, Uno.UI.Composition.WebGpu)
IDE version 🧑💻
N/A (command line)
Anything else we need to know? 💬
Root cause (code inspection, permalinks at 0599dada9e9):
WebGpuFrame.PackVertsstarts a new arena chunk atMaxArenaBytes(64 MB), but only between ops:if (arena.Count > 0 && ... > MaxArenaBytes). One op bigger than that still lands whole in a single chunk.RealizeOwnedVerticesthen callswgpuDeviceCreateBufferwith the chunk size and never compares it with the device'smaxBufferSize.WebGpuInitrequests the device without required limits, so the 256 MB default applies. The uncaptured-error callback is non-fatal, but the invalid buffer later invalidates the bind group andwgpuQueueSubmitpanics inside wgpu-native.- Side note:
arena.Count * sizeof(float)is anintmultiplication, so it would also overflow at 2 GB.
Suggested fix, any of: split a single op's geometry across several chunks (draw it as several ops); cull glyphs outside the clip before tessellation; at minimum, check the size against the device limit and skip the draw instead of submitting an invalid bind group. Once fixed, the BackendCondition exclusion on the test can be removed.
Activity