Skip to content

ci: Run the WASM WebGPU lane on hosted macOS - #25071

Closed
MartinZikmund wants to merge 8 commits into
masterfrom
dev/mazi/wasm-webgpu-macos
Closed

MartinZikmund wants to merge 8 commits into
masterfrom
dev/mazi/wasm-webgpu-macos

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: related to #25069

PR Type:

🏗️ Build or CI related changes

What changed? 🚀

The WASM WebGPU runtime-test lane ran on GPU-less Linux agents, where Chrome only offers its SwiftShader adapter: 2-4 frames per second, multi-second stalls, 12 groups to fit the timeout, and a steady supply of slow-frame flakes. Mesa's lavapipe is no way out there; Chrome kept choosing SwiftShader even with the lavapipe ICD forced.

The hosted macOS agents, however, expose a paravirtual Metal GPU (the desktop macOS WebGPU lane already logs adapter='Apple Paravirtual device' backend=Metal), and Chrome's WebGPU on macOS runs on Metal. This PR moves the lane there:

  • .azure-devops-tests-webassembly.yml: an os parameter; macOS picks the hosted macOS image and skips the xvfb/apt/Chrome install steps (the image ships Chrome).
  • wasm-run-skia-runtime-tests.sh: portable to macOS (python3, BSD base64, core count), launches Chrome directly in the agent's desktop session instead of under xvfb, and logs the display/GPU (system_profiler).
  • WebGPU lane: macOS, no SwiftShader flags, 4 groups instead of 12 for this trial.
  • Fixes the PR gate of every non-Linux WebGPU lane (and the Linux screenshot job). Their job-level conditions read the Setup output with the stage-level path stageDependencies.Setup.outputs['DetermineScope.SetScope.X'], which never resolves inside a job; the job form is stageDependencies.Setup.DetermineScope.outputs['SetScope.X']. Since 80c153d these lanes were skipped on every PR, including ones the scope script flagged (WebGpuTestsRequired requires tests: true, yet all four skipped in build 237860).
  • WebGpuInit.ts logs the adapter Chrome hands out, so each run shows whether it is GPU-backed (fallback=false) or not.

Draft: a trial. To verify on this PR's run before it is ready:

  1. WebGpuInit: adapter … fallback=false (Apple/Metal, not SwiftShader) in the job logs.
  2. The 4 groups finish inside the timeout and are green (or only known flakes); then tune the group count further down.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable)
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features)
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

🤖 Generated with Claude Code

https://claude.ai/code/session_016JuV6BPjWEEXzuX2RUEE3z

MartinZikmund and others added 3 commits October 7, 2026 13:02
Use python3, the BSD-compatible base64 and the macOS core count, and
launch Chrome directly in the agent's desktop session instead of xvfb.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016JuV6BPjWEEXzuX2RUEE3z
Its agents expose a paravirtual Metal GPU; the Linux agents only had
Chrome's SwiftShader, at 2-4 frames per second across 12 groups.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016JuV6BPjWEEXzuX2RUEE3z
@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Oct 7, 2026
MartinZikmund and others added 5 commits October 7, 2026 14:05
A job in another stage reads a Setup output as
stageDependencies.Setup.DetermineScope.outputs['SetScope.X']; the
stage-level path these used never resolved, so the gated WebGPU lanes
and the Linux screenshot job were skipped on every pull request even
when the scope asked for them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016JuV6BPjWEEXzuX2RUEE3z
Chrome on the hosted macOS agents handed the page SwiftShader although
its own services selected the Apple paravirtual Metal device. Log the
adapter under several flag sets, and run the lane with the GPU
blocklist ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016JuV6BPjWEEXzuX2RUEE3z
The adapter probe showed Chrome hands the page the Apple paravirtual
adapter (fallback=false) only once the GPU blocklist is ignored and the
software rasterizer is disabled; otherwise it falls back to SwiftShader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016JuV6BPjWEEXzuX2RUEE3z
The first launch never ran the page within the canary window, and every
relaunch then failed GPU init: killall left the helper processes (GPU
included) alive and the profile was reused. Without the software
fallback that left WebGPU with no adapter. Kill every Chrome process and
give each attempt its own profile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016JuV6BPjWEEXzuX2RUEE3z
A fresh profile was not enough: after a SIGKILL every relaunch still
failed GPU init, while the probe, which lets Chrome shut down, got the
Apple adapter launch after launch. Terminate Chrome and only kill what
is left, and spend the first launch of the step, which never navigates
in time, on a blank page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016JuV6BPjWEEXzuX2RUEE3z
@MartinZikmund

Copy link
Copy Markdown
Member Author

Parked: findings so far

Moving the WASM WebGPU lane to hosted macOS does not work reliably yet. Parking this as a draft; the scope-gate fix it surfaced is split out to #25088.

What works

  • The hosted macOS agents expose Apple Paravirtualized Graphics Device (Metal 2), and the desktop macOS WebGPU lane (wgpu-native) already uses it.
  • Chrome can hand a page that GPU. webgpu-adapter-probe.sh launches Chrome on a tiny page per flag set; across 8 agents:
Flags (all with --enable-unsafe-webgpu) Adapter
none nothing within 30 s on every agent (first launch of the step)
--ignore-gpu-blocklist vendor=apple fallback=false on 2/4 agents (the other two logged nothing within 30 s)
--ignore-gpu-blocklist --disable-software-rasterizer vendor=apple fallback=false on 8/8
--ignore-gpu-blocklist --use-angle=metal adapter=null
--ignore-gpu-blocklist --enable-features=SkiaGraphite vendor=apple fallback=false

Without those flags Chrome treats the paravirtual GPU as blocklisted and gives WebGPU its SwiftShader fallback (build 237869: architecture=swiftshader fallback=true, 40-57 min per group, 48-69 failures per group on 4-core agents).

What breaks

In the actual test step, the app reached the Apple adapter in 1 of 16 groups (237913 group 1; my next push cancelled that run before it finished). Every other launch:

  1. The first Chrome launch of the step never navigates within the 60 s canary window (GPU process healthy, no page console output). Same for the probe's first launch.
  2. Every relaunch then fails GPU init (viz_main_impl.cc: Exiting GPU process due to errors during initialization, x4). With --disable-software-rasterizer there is no fallback, so navigator.gpu.requestAdapter() returns null and the app dies (Unable to create renderer).

Tried, none fixed (2):

  • killing all Chrome processes (helpers included) + a fresh profile per attempt (237930)
  • a warm-up launch on about:blank + SIGTERM before SIGKILL (237964); Chrome ignored SIGTERM for 15 s, so it was still SIGKILLed

Open question: why the probe step relaunches fine (it stops Chrome with SIGTERM between launches) while the test step does not. Next diagnostic, if picked up again: run the probe inside the test step with the exact test flags (--window-size, the throttling flags, --autoplay-policy) to separate "a flag breaks GPU init" from "a SIGKILLed GPU process poisons the paravirtual device for the rest of the session".

Also in this branch (still useful if revived)

  • wasm-run-skia-runtime-tests.sh runs on macOS (python3, BSD base64, no xvfb, system_profiler GPU dump).
  • WebGpuInit.ts logs the adapter (vendor/architecture/fallback), so any lane shows whether it is GPU-backed.

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 237964 has failed on Uno.UI - CI.

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

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants