Skip to content

WebGPU backend aborts the process when one draw op exceeds the device max buffer size #25330

Open

Description

@MartinZikmund

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.

  1. Build SamplesApp for net11.0-desktop with the WebGPU backend and run it with UNO_WEBGPU=1.
  2. Remove the [BackendCondition(ConditionMode.Exclude, RuntimeTestBackends.WebGpu)] line from When_Bounded_Layout_Ends_Large_Story_Is_Released in src/Uno.UI.RuntimeTests/Microsoft/UI/Xaml/Controls/Given_RichEditBox.PerformanceReview.skia.cs.
  3. Run only that test (UITEST_RUNTIME_TESTS_FILTER = base64 of Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls.Given_RichEditBox.When_Bounded_Layout_Ends_Large_Story_Is_Released, then dotnet 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.PackVerts starts a new arena chunk at MaxArenaBytes (64 MB), but only between ops: if (arena.Count > 0 && ... > MaxArenaBytes). One op bigger than that still lands whole in a single chunk.
  • RealizeOwnedVertices then calls wgpuDeviceCreateBuffer with the chunk size and never compares it with the device's maxBufferSize.
  • WebGpuInit requests 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 and wgpuQueueSubmit panics inside wgpu-native.
  • Side note: arena.Count * sizeof(float) is an int multiplication, 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

  1. added
    kind/bug
    platform/linux 🐧
    triage/untriaged
    area/skia ✏️
    difficulty/medium 🤔
    platform/desktop 🖥️
    7.1
    on Oct 12, 2026
  2. removed
    7.1
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/skia ✏️area/skia/composition ✏️area/skia/stability ✏️difficulty/medium 🤔kind/bugplatform/desktop 🖥️platform/linux 🐧triage/untriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions