Repository navigation
ci(ios): Add an iOS WebGPU runtime test lane - #25664
Conversation
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
45c3328 to
7c6fbe3
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241077 found UI Test snapshots differences: Details
|
|
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241195 found UI Test snapshots differences: Details
|
b39120d to
f7a3bfd
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241216 found UI Test snapshots differences: Details
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
e7690e1 to
943582d
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
943582d to
e2142da
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
3965d0f to
86264bf
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
86264bf to
ca16c47
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241258 found UI Test snapshots differences: Details
|
|
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
…oint Past its first call, Invalidate from another thread only finds a post already pending, so the workers spun with no GC safe point. CoreCLR on the iOS simulator could not suspend them, and the first GC on the UI thread hung the app for good (When_Invalidated_From_Background_Thread under WebGPU, which allocates on the UI thread meanwhile). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…heck The collapsed and immediate renders take different GPU paths. On CI's Intel Mac GPU under iOS WebGPU one pixel came out a level apart, which the cached replay cannot be expected to avoid. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
An arena stamp's ops carry clip uniforms built from the replay's inverse transform: finv's linear part, each clip entry's per-pixel step and the rect clip's units per pixel. The site-uniform fast path reused an idle stamp's ops untouched at a new placement without checking that the scale and rotation still matched, so a RenderTargetBitmap at 2x could draw with the 1x stamp left by the screen and get soft, half-covered edges. That reuse, and the in-place patch, now require the same linear part; anything else rewrites the clip uniforms. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
macOS ticked the WebGPU context from the native draw, on the main thread, so every present waited there for a drawable: nextDrawable can block for a second, and while frames kept coming (an animation, a scroll) the dispatcher never reached its idle queue. The macOS desktop WebGPU lane spent minutes per test in WaitForIdle and timed out; stack captures had the main thread in wgpuSurfaceGetCurrentTexture each time. WebGPU now uses the paced render thread Skia-on-Metal already uses. That thread retries a frame that did not reach the screen, so the swap chain reports it, and re-blits a frame it dropped instead of waiting for the next change. wgpu-native's Occluded status was read as Lost, which reconfigured the surface every frame of a hidden window; it is now its own status, and a hidden window is not retried. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
WebGPU's present calls into AppKit and Core Animation from the render thread (wgpu reads the layer's delegate view and its window to check occlusion), and that thread had no autorelease pool. Each frame left an autoreleased reference to the window's MTKView behind, drained only when the thread exits during window close; the view's last release could then land there and deallocate it off the main thread, which crashed the macOS desktop WebGPU lane later in the main thread's pool drain. Each frame now runs in its own pool: the view's retain count stays flat (3) over 1,500 frames instead of climbing by one every 30. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
WaitTrackerLogs treated 100 ms without a new log line as the end of the motion. On the software-rendered WebGPU lanes a frame can take longer than that, so it returned mid-inertia: When_MouseWheel and the TryUpdatePositionWithAdditionalVelocity tests then saw too few ValuesChanged lines or a position short of the resting one, on master's WASM and Android WebGPU lanes in every build. Every motion these tests start ends in IdleStateEntered, so wait for that line instead, failing with the logs after 10 seconds. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A notch clamped at the end moves for 125 ms. AssertOnWheelCurve needs two frames inside the motion to compare their implied start times, which the Android WebGPU emulator cannot render that fast. Report the test as inconclusive when even the shortest observed frame is longer than half the motion, rather than failing it. Lanes that can sample the curve still require two frames on it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
8255f64 to
de389f4
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
The retained path and the command-list fallback take different GPU paths. On the iOS simulator's Metal on Intel (the xcode-27 CI agents) that rounds a few pixels by one level: 3 to 9 pixels off by 1 in recent runs, while Apple-silicon simulators match exactly. The picture-collapsing check next to it already allows this one level for the same reason. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
When_Window_Resized grew a window that can already fill a small screen, and left its dialog open as a back-button listener, which made Given_Flyout.BackButtonIntegration fail after it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241771 found UI Test snapshots differences: Details
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Xiaoy312
left a comment
There was a problem hiding this comment.
A few follow-ups, none blocking. Inline comments cover the code. The PR description has fallen behind the branch:
- It says this is stacked on #25663, which is merged, and its commits are no longer in this branch.
- "Still red: WASM WebGPU ... The fix is #25714": #25714 is merged and WASM WebGPU 0-11 are green on this build.
- The last five commits aren't described: the tracker idle wait (51fb95b), the ScrollView curve guard (de389f4), the retained-fallback tolerance (ae735b2), the on-demand ListView guard (1438c36) and the ContentDialog shrink/hide (51a9b51).
- Section 3 lists
When_Retained_Fallback_Renders_Identicallyas fixed by the clip change, but ae735b2 also gives ittolerance: 1. - The runtime-tests checkbox is unchecked, though this adds two
Given_Bordertests.
|
The build 241836 found UI Test snapshots differences: Details
|
fix(webgpu): Follow-ups from the #25664 review
GitHub Issue: related to #25657 (no runtime coverage caught it)
PR Type:
🏗️ Build or CI related changes
What changed? 🚀
The macOS desktop WebGPU lane is green (see 9 and 10); the remaining red lanes fail on master too (end of 10).
Stacked on #25663 (its two fix commits come first here). Review the commits after it.
1. SamplesApp links iOS WebGPU through the package wiring. #25657 shipped because nothing in the repo used the package's
_UnoWebGpuLinkIosNative. The iOS head linked wgpu-native with its ownnm-based target inwgpu-native.targets, which exported the functions correctly.Uno.WinUI.Composition.WebGpu.targets, as the WASM head already does._ProvisionWgpuNativeIoslays the library out per RID like the package does (ios-rid/<rid>/libwgpu_native.a), andUnoWebGpuIosLibDirpoints there.nmcheck of that list against the archive (from fix(webgpu): Export the wgpu functions from iOS apps #25663) still runs for both.2. iOS WebGPU runtime test lane.
.azure-devops-tests-ios.ymltakesrenderer,variant(job and artifact names),appEnvironmentandcondition, like the Android template. The Skia lane keeps its job and artifact names..azure-devops-tests-ios-runner.ymlpassesappEnvironmentto the run script asUNO_TEST_APP_ENVIRONMENT, and takes an optional job condition.ios-uitest-run.shexports eachKEY=VALUEasSIMCTL_CHILD_KEY=VALUE, whichsimctl launchhands to the app. Checked under macOS's bash 3.2 with the script'sset -uandIFS.UNO_WEBGPU=1 UNO_WEBGPU_LOG=warn), reusing the Skia lane's app build. On pull requests it runs only whenWebGpuTestsRequired, as Android's WebGPU lane does.3. WebGPU: rect-clip edges sized in device pixels. The first local iOS WebGPU run failed
Given_Border.Border_LinearGradientandWhen_Clip_And_CornerRadius, which pass on Skia with the same app. Cause: the shader's plain rect clip (clipCovMapped,ctrl.y) measured its edge distance in the recording's units, so above 1x its anti-aliasing ramp spread over several device pixels. At 2x, a pixel on the render target's own edge got 75% coverage (alphaBF) instead of 100%. The clip entries already divide by their units per pixel (k.x); the rect clip now does the same per axis, fromfinv(size.xy, unused until now). Its fully-covered inner box moves one device pixel inside instead of one unit.UNO_DISPLAY_SCALE_OVERRIDE=2: the same two failures with the same messages; they pass at 1x and on Skia at 2x.Given_ContainerVisual.When_PictureCollapsing_Produces_Identical_OutputandWhen_Retained_Fallback_Renders_Identically. Nothing new fails, and all 16 remaining also fail on Skia at 2x (input and hit-testing under the forced scale).Given_Border.When_Rendered_At_Twice_The_Scale_Then_Clipped_Edges_Stay_Sharprenders aRenderTargetBitmapat twice the size, so it covers this on 1x CI too. It fails without the fix (pixel (0,200) alphaBF), and passes with it and on Skia.4. CI: gated lanes read the test scope correctly. Every job condition that gates a lane on the scope (WebGPU on Android, iOS and desktop; Linux screenshots) used the stage-level output syntax,
stageDependencies.Setup.outputs[...], which is always empty at job level. So these lanes were skipped on every pull request. They now readstageDependencies.Setup.DetermineScope.outputs['SetScope.<Var>']. That is why the macOS desktop WebGPU lane now runs here (see 9).5. WebGPU: an arena entry's stamps and sites are freed only once. Atlas eviction released entries whose last holder had already freed them, so their stamps and site bind groups were released twice. On iOS that corrupted the heap: a SIGSEGV in
BindGroupRelease, or a "stall" that was really CoreCLR looping on a fault in native code.ReleaseFinalnow runs once per entry.6. Intel iOS simulator GPU fault (shard 1): fixed on master. The hosted
macOS-26agents are Intel Macs. Shard 1 died withSimMetalHost: fatal error while executing a Metal Simulator workloadright afterWhen_Loaded_Large_Story_Local_Key_Edit_Stays_Range_Based. That test's story has one huge misspelled word, and its squiggle was a single zigzag across the whole run: millions of edges in one coverage bake, more than the old simulated GPU survives. This PR first carried its own fix; master has since fixed it differently, by drawing a long wave as one small cached chunk, repeated (b7501ec, #25640). That commit was dropped when this PR was rebased, so this lane now runs on master's fix.7. Two test fixes found on the lane.
Given_SKCanvasElement.When_Invalidated_From_Background_Thread: its background loop had no GC safe point, so a suspension for GC on the simulator could hang the process. It now yields each iteration.Given_ContainerVisual.When_PictureCollapsing_Produces_Identical_Output: allows one level of rounding difference.8. WebGPU: a stamp is reused only at the scale it was made for. The macOS desktop WebGPU lane failed
When_Rendered_At_Twice_The_Scale_Then_Clipped_Edges_Stay_Sharpintermittently: the bitmap's left and top edges came out at alpha8Finstead ofFF. An arena stamp's ops carry clip uniforms built from the replay's inverse transform (its linear part, each clip entry's per-pixel step, and the rect clip's units per pixel). The site-uniform fast path reused an idle stamp's ops at a new placement without checking that the scale still matched. So a 2xRenderTargetBitmapcould draw with a 1x stamp the screen had left idle: both the shape and the clip edge got 0.75 coverage, and 0.75 × 0.75 =8F. That reuse, and the in-place patch, now require the same linear part.Given_Border.When_Rendered_At_Another_Scale_Then_Edges_Stay_Sharpmakes it deterministic. The Border sits outside the window, so screen frames never use its stamp. The test renders it at 1x, waits for a frame to be presented, then renders at 3.5x. It failed 4/4 without the fix (alpha69) and passes 4/4 with it, on macOS (M2).Given_Borderpasses in full on WebGPU and Skia.9. macOS desktop WebGPU: frames are presented from the render thread. The lane timed out at 60 minutes, on master too. Animation and scroll tests spent 30 s to 20 min in
WaitForIdle. Stack captures taken during the stalls (with a temporary watchdog, since removed) had the main thread inMacOSWindowHost.MetalDraw→WebGpuSwapChainContext.Present→wgpuSurfaceGetCurrentTextureevery time (18 of 18).allowsNextDrawableTimeout = false, so each present could block the main thread innextDrawable. While frames kept coming, the dispatcher never reached its idle queue.Occludedstatus (0x00030001, a hidden window) is passed through instead of being read asLost, which used to reconfigure the surface on every frame. A hidden window is not retried.10. macOS: an autorelease pool around each render-thread frame. Moving the present exposed a crash. The main thread segfaulted in its autorelease pool drain around tests that open and close windows. With
NSZombieEnabledthe run passed and logged nothing, so the crash came from an object deallocated on the wrong thread, not from an over-release.MTKView, drained only when the thread exits during window close. The view's last release could land there and deallocate it off the main thread.objc_autoreleasePoolPush/Pop).Validation on CI, macOS desktop WebGPU: the lane now passes, in 22 minutes.
Validation on macOS (M2): across 7 frame-timing classes (
Given_CompositionTarget,Given_ScrollViewer,Given_AnimatedVisualPlayer,Given_DoubleAnimation,Given_Border,Given_SystemFocusVisual,Given_RenderTargetBitmap), WebGPU passed 174 tests with 0 failures and Skia passed 174 with 0 failures. The 10 classes that open windows ran 11 times without a crash.Still red, and not from this branch:
Rebased on master, which has since fixed the Android build's JDK check (#25680) and ignores the two iOS accessibility tests that failed on almost every run (9dbe9cf).
Validation so far
Locally, on the #25492 head (macOS 27, Xcode 27.1, iOS 27 simulator), SamplesApp built with this wiring:
libwgpu_native.afrom the package-styleios-ridlayout;NoSymbolStrip=false);adapter='Apple iOS simulator GPU' backend=Metal).Given_Bordergives 26 passed, 2 failed, 1 inconclusive, 1 skipped.Border_LinearGradient,When_Clip_And_CornerRadius) both pass on the Skia build of the same app, after a simulator reboot. They are known WebGPU gaps that fail on master's WebGPU too.iOS runtime tests can be flaky, so each failure on the new lane will be rerun on the Skia build before it is treated as a WebGPU failure. When doing that locally, reboot the simulator first: it keeps the previous launch's
SIMCTL_CHILD_UNO_WEBGPU(CI runs each lane on its own agent).PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code