Skip to content

fix(wasm): Request a record so the splash is removed - #24260

Merged
MartinZikmund merged 1 commit into
masterfrom
dev/mazi/splash-record-fix
Sep 16, 2026
Merged

MartinZikmund merged 1 commit into
masterfrom
dev/mazi/splash-record-fix

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: closes #23586

PR Type:

🐞 Bugfix

What changed? 🚀

WASM Skia apps intermittently stay on the bootstrap loading screen. The app is fully running — and, as it turns out, fully rendered: hiding the loader on a stuck device reveals a correctly laid out, painted app underneath. Only the splash removal never happens. Tapping the screen recovers it.

WebAssemblyWindowWrapper.ShowCore waits for CompositionTarget.FrameRendered, which is raised from exactly one place — the end of CompositionTarget.Render(), i.e. the record pass. But to trigger it, it called ((IXamlRootHost)host).InvalidateRender(), which only asks for a present. That never sets RenderRequested, and EnqueueRenderCallback only reaches Render() through that flag:

if (_renderedAheadOfTime)
{
    _renderedAheadOfTime = false;
    if (_renderRequestedAfterAheadOfTimePaint) { /* reschedule */ }
    else { /* nothing — no Render(), so no FrameRendered */ }
}
else if (RenderRequested)
{
    RenderRequested = false;
    Render();                 // the only path that raises FrameRendered
}

So when the target has already painted ahead of time — the normal state once the tree has settled, which is exactly where ShowCore's continuation runs after the font preload — the requested tick consumes _renderedAheadOfTime, records nothing, and FrameRendered is never raised. The one-shot subscription waits forever and the loader is never removed. Because PersistBootstrapperLoader() disables the bootstrapper's own removal, there is no timeout or fallback.

This also explains the recovery asymmetry: a tap dirties the tree, which forces a record and fires the event, while a resize whose canvas dimensions are unchanged only produces a present and leaves the app stuck.

The fix routes the request through the API that actually marks the target as needing a record:

((ICompositionTarget)compositionTarget).RequestNewFrame();

All three states in RequestNewFrame converge on a subsequent Render(), so FrameRendered is guaranteed to be raised after the handler subscribes.

Note this is a different defect from the one addressed by #23590 (which re-armed a dropped requestAnimationFrame). That fix was correct as far as it went, but the render pump was not the remaining problem — requestAnimationFrame is verifiably alive and firing in ~3 ms in the stuck state, and the frame had already been produced.

Validation

What is proven. On a physical device (Samsung SM-F966B, Android 16, Edge 151) driven over USB via the
DevTools protocol, a stuck instance was captured and inspected live:

  • requestAnimationFrame firing normally (3 ms), document.visibilityState: visible
  • .NET runtime fully booted, heap at 386 MB; canvas correctly sized at 1080x2082
  • hiding .uno-loader revealed the app fully rendered underneath — correct layout, text and list

So the frame exists and the render pump is healthy; only the splash removal never happens. That rules out
a dropped requestAnimationFrame as the remaining cause and points at the FrameRendered subscription,
which the state machine above shows cannot be guaranteed by InvalidateRender(). The recovery asymmetry
corroborates it: a tap dirties the tree and forces a record (recovers), while a synthetic resize with
unchanged canvas dimensions produces only a present (does not recover).

What is not proven. The hang is rare enough that I could not demonstrate the fix statistically. Using a
harness that reloads the app against a deliberately slowed origin (40 ms per asset) and checks whether
.uno-loader clears, the observed rate was 1 stuck in 32 runs (~3%) before the fix and 0 in 24 runs
after
. At a 3% rate, 0-in-24 would occur ~48% of the time by chance, so the post-fix run is not evidence
of anything on its own. The case for this change rests on the captured stuck instance and the state
machine, not on that comparison.

A deterministic regression test is the right follow-up: it needs a seam to put the target into
_renderedAheadOfTime at the moment the handler subscribes, then assert that FrameRendered is still
raised. Happy to add that here or separately.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable)
    • No automated test: the failure is a startup timing race in the WASM host, reachable only from a real browser boot. Validated with the device harness described above. A deterministic test would need a seam to force the _renderedAheadOfTime state at the moment ShowCore subscribes; happy to add that as a follow-up if wanted.
  • 📚 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!)

Copilot AI lite review requested due to automatic review settings August 28, 2026 08:36
@github-actions github-actions Bot added the platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform label Aug 28, 2026
@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an intermittent Skia WebAssembly startup hang where the bootstrap loader (“splash”) is never removed because WebAssemblyWindowWrapper.ShowCore waits for CompositionTarget.FrameRendered, but the code previously only requested a present (via InvalidateRender) instead of forcing a record pass that actually raises FrameRendered.

Changes:

  • Replace IXamlRootHost.InvalidateRender() with ICompositionTarget.RequestNewFrame() after subscribing to CompositionTarget.FrameRendered.
  • Add the required Uno.UI.Composition import and document why a “record” (not just a “present”) is required to guarantee FrameRendered for splash removal.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@unodevops

Copy link
Copy Markdown
Contributor

@morning4coffe-dev morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source review: RequestNewFrame is the appropriate dirty-record request for a completion path that waits on FrameRendered; a present-only host invalidation can leave that event unfired. The existing unsubscribe/removal callback remains in place. This browser splash lifecycle has no direct native WinUI source analogue, so I am not claiming a literal WinUI port. No blocking issue found in the changed call, but the current master conflict and failed review check must be handled before merge readiness.

@MartinZikmund
MartinZikmund force-pushed the dev/mazi/splash-record-fix branch from 7d2cb99 to cb8b50a Compare September 15, 2026 10:01
Copilot AI review requested due to automatic review settings September 15, 2026 10:01
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 2m 9s —— View job


Claude's Review

Verdict: Ship — no blocking issues found. This is a minimal, well-justified root-cause fix.

What I verified against the source:

  • CompositionTarget.RenderScheduling.cs's state machine (RequestNewFrame / EnqueueRenderCallback / OnRenderFrameOpportunity) confirms the PR's technical claim: InvalidateRender() only asks the host to present, and when _renderedAheadOfTime is already true, the next EnqueueRenderCallback tick just consumes that flag without calling Render() — so FrameRendered (fired only inside Render()) never raises. ((ICompositionTarget)compositionTarget).RequestNewFrame() correctly handles all three states of that machine and always converges on a Render() call, guaranteeing the subscription in ShowCore is satisfied.
  • The ICompositionTarget cast is valid: Uno.UI.Composition grants InternalsVisibleTo to Uno.UI.Runtime.Skia.WebAssembly.Browser, and the new using Uno.UI.Composition; doesn't orphan the existing using Uno.UI.Hosting; (still needed for XamlRootMap).
  • No merge conflict against current origin/master (the earlier reviewer note about a conflict appears stale — branch is up to date and builds, per the CI staging link in the thread).

Non-blocking observation:

  • No automated regression test, per the PR's own checklist note. I looked for a usable seam: Given_Visual_ArrangePending.cs has a precedent (FrameRequestRecorder : ICompositionTarget) for testing frame-request counts, but nothing currently exposes _renderedAheadOfTime to force the specific race this fix addresses — so the author's assessment that a deterministic test needs a new seam holds up. Worth a follow-up issue if the seam is added later, but not a reason to block this fix given the documented device-level validation.

Cross-cutting note: CompositionTarget.FrameRendered is declared as event Action? (CompositionTarget.Rendering.cs:84), which conflicts with the AGENTS.md rule against event Action/Action<T>. This is pre-existing code untouched by this diff, so it's out of scope here, but flagging in case it's worth a separate cleanup.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Add deterministic regression coverage for the rendered-ahead-of-time scheduling path.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 233744 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2310, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • DisplayInformation.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • ContextRequested.png-dark
    • ContextRequested.png
    • Buttons.png-dark
    • Buttons.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ImageIconPage.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
  • skia-windows-screenshots: 2310 changed over 2408

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png
    • AppBarToggleButtonTest.png-dark
    • ApplicationViewSpanningRectsPage.png-dark
    • AppWindowTitleBar Properties.png-dark
    • Arrange_Performance01.png-dark
    • AutoBorderStretchwithbottommargin.png-dark
    • AutomationPropertiesExtensions_Role.png-dark
    • AutomationProperties_Name.png
    • AutoSuggestBox_Icons.png-dark
    • AutoSuggestBox_Icons.png
    • Basics Pivot Test.png-dark
    • Basics Pivot Test.png
    • BeginTime_MultipleAnimations.png-dark
    • BeginTime_MultipleAnimations.png
    • BitmapIcon_Generic.png-dark
    • BitmapIcon_Generic.png
    • BorderCenteredwithmargins.png-dark
    • BorderCenteredwithmargins.png
    • BorderLeftwithmargins.png-dark
    • BorderLeftwithmargins.png
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Uno_Web.Http.CookieManagerTests
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation

@unodevops

Copy link
Copy Markdown
Contributor

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

ShowCore waits for CompositionTarget.FrameRendered, which is raised only
from the record pass, but asked for it with IXamlRootHost.InvalidateRender
- a present request that never sets RenderRequested. When the target has
already painted ahead of time, the resulting tick records nothing, the
event never fires, and the bootstrap loader stays up forever.

Route the request through ICompositionTarget.RequestNewFrame, whose every
state converges on a Render, so FrameRendered is guaranteed after the
handler subscribes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Up3PthZrnrxxYK2g8NVgWD
Copilot AI review requested due to automatic review settings September 16, 2026 08:04
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/splash-record-fix branch from cb8b50a to 9656bf8 Compare September 16, 2026 08:04
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 59s —— View job


Claude's Review Progress

  • Gather context (diff, AGENTS.md rules)
  • Review changed file against AGENTS.md checklist
  • Post inline findings (none met the bar — see below)
  • Post summary

Verdict: Ship — no blocking issues found

I independently traced the fix against CompositionTarget.RenderScheduling.cs:

  • ((IXamlRootHost)host).InvalidateRender() (old code) never touches RenderRequested/_renderedAheadOfTime — it only asks the host to invalidate its native paint. ICompositionTarget.RequestNewFrame() (new code) is the one entry point that manipulates that state machine, and all three branches (!renderedAheadOfTime && !RenderRequested, _renderedAheadOfTime, RenderRequested already true) converge on a subsequent Render() call — the only place FrameRendered is raised (CompositionTarget.RenderScheduling.cs:76-157). The PR's claim holds up by inspection of the actual state machine, not just the PR description.
  • The ICompositionTarget cast compiles: it's declared internal in Uno.UI.Composition (ICompositionTarget.cs:13), and that assembly grants InternalsVisibleTo("Uno.UI.Runtime.Skia.WebAssembly.Browser") (AssemblyInfo.cs:17).
  • The added using Uno.UI.Composition; doesn't orphan using Uno.UI.Hosting; — XamlRootMap (still used at line 159) lives in that namespace.
  • No unused-using, no ambiguity introduced by the new using (the only unqualified Visual usage in the file is a member access, not a type reference).
  • Diff is minimal (7/-1), scoped to the actual defect, tabs/Allman/braces consistent with the surrounding file.

Non-blocking, cross-cutting notes (not new inline comments — already raised in this thread)

  • Test coverage: still no automated regression test, as already flagged by Copilot's inline comment on line 166 and the previous Claude pass. The author's justification (needs a new seam to force _renderedAheadOfTime at subscribe time; validated instead via live device harness with a documented 1-in-32 → 0-in-24 improvement) is reasonable for a rare startup race, but the gap is real — a regression from record-scheduling back to present-only invalidation wouldn't be caught by CI. Worth a tracked follow-up if not added here.
  • CI status: the latest Azure run (233744) failed with a large screenshot-diff set (2310/2408 on skia-windows-screenshots alone). That volume is far too broad to plausibly be caused by a one-line WASM compositor change — looks like an unrelated baseline/infra issue — but it should be confirmed/resolved before merge regardless of this review's verdict.
  • Pre-existing event Action? on CompositionTarget.FrameRendered (flagged in the previous pass) remains out of scope for this diff.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Add a deterministic regression test covering the ahead-of-time render state.

Review details

Suppressed comments (1)

src/Uno.UI.Runtime.Skia.WebAssembly.Browser/UI/Xaml/Window/WebAssemblyWindowWrapper.cs:166

  • This changes a stateful render-scheduling path that is only exercised by the WASM startup race, but there is no regression test for the _renderedAheadOfTime / RequestNewFrame case. The existing Given_CompositionTarget test only covers a normal property invalidation and would pass with the old call, so please add a deterministic WASM-Skia test (or a small seam around the state machine) that subscribes to FrameRendered in the ahead-of-time state and verifies that this request still produces the event and permits splash removal.
							((ICompositionTarget)compositionTarget).RequestNewFrame();
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@unodevops

Copy link
Copy Markdown
Contributor

@morning4coffe-dev morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed exact head 9656bf89223177e3fdc0a8c08b70f79d56102e0e. The force-push was rebase-only and the patch remains correct: subscription precedes RequestNewFrame, scheduler coalescing still produces the required record, and the callback unsubscribes before removing the splash. The previous conflict and review-check blockers are resolved; no blocking code issue found.

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 233980 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2310, wasm: 11

Details
  • skia-linux-screenshots: 57 changed over 2348

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • ContextRequested.png-dark
    • ContextRequested.png
    • DisplayInformation.png-dark
    • DropDownButtonPage.png-dark
    • DropDownButtonPage.png
    • Examples.png-dark
    • Examples.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_CurrentReading.png
    • Gamepad_Enumeration.png-dark
    • Gamepad_Enumeration.png
  • skia-windows-screenshots: 2310 changed over 2408

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AppBar_KeyBoard.png-dark
    • AnimatedIconPage.png-dark
    • ApplicationViewSizing.png
    • AppBarToggleButtonTest.png-dark
    • AppWindowPositionAndSize.png-dark
    • ApplicationViewSpanningRectsPage.png-dark
    • ArcSegment.png-dark
    • AppWindowPositionAndSize.png
    • Attributed_text_Supserscript.png-dark
    • AppXamlDefinedResources.png
    • AutoBorderStretchwithrightmargin.png
    • AuthenticationBroker_Demo.png
    • AutomationProperties_Name.png-dark
    • AutomationPropertiesExtensions_Role.png-dark
    • AutoSuggestBox_BitmapIcon.png
    • AutoSuggestBoxChosenSuggestion.png-dark
    • BackGesture.png-dark
    • AutoSuggestBox_Keyboard.png
    • BackGesture.png
    • AutoSuggestBox_Reason.png-dark
  • wasm: 11 changed over 1076

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • SamplesApp.Wasm.Windows_UI_Xaml_Controls.ListView.ListView_IsSelected
    • UITests.Shared.Microsoft_UI_Xaml_Controls.ExpanderTests.WinUIExpanderPage
    • UITests.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_NavigationProperties
    • SamplesApp.Windows_UI_Xaml_Controls.ListView.ListViewSelectedItems
    • SamplesApp.Microsoft_UI_Xaml_Controls.WebView2Tests.WebView2_EnableDevTools
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Minimal
    • UITests.Shared.Windows_UI_Xaml_Controls.MediaPlayerElement.MediaPlayerElement_Ogg_Extension
    • UITests.Windows_UI_Xaml_Controls.CalendarView.CalendarView_Theming
    • UITests.Windows_UI_Xaml_Media_Animation.ColorAnimation_Background
    • UITests.Uno_Web.Http.CookieManagerTests
    • Uno.UI.Samples.Content.UITests.WebView.WebView_AnchorNavigation

@unodevops

Copy link
Copy Markdown
Contributor

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

@MartinZikmund
MartinZikmund merged commit d10de92 into master Sep 16, 2026
56 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/splash-record-fix branch September 16, 2026 20:58
@MartinZikmund

Copy link
Copy Markdown
Member Author

@Mergifyio backport servicing/6.8

@mergify

mergify Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

backport servicing/6.8

✅ Backports have been created

Details

mikernet pushed a commit to mikernet/uno that referenced this pull request Oct 10, 2026
Port of unoplatform#24260 (9656bf8), which is on master only: the splash was only removed after a record pass, but only a present was requested, so the app stayed on the loading screen until an interaction triggered a render (unoplatform#23586).
MartinZikmund added a commit that referenced this pull request Oct 13, 2026
…r-24260

fix(wasm): Request a record so the splash is removed (backport #24260)
mattleibow pushed a commit to mono/SkiaSharp that referenced this pull request Oct 15, 2026
Upgrade the Basic Uno sample to SDK 6.8.0-dev.66, which ships the servicing backport of unoplatform/uno#24260. The pinned host could wait forever for a recorded frame while requesting only a present.

Map Uno and its unmirrored desktop dependencies to their publishing feed without allowing SkiaSharp or HarfBuzzSharp consumers to bypass staged artifacts. Cover both repository and generated feed mappings. Review and update only navigation pixels for the newer theme; preserve all canvas/control reference pixels and existing rendering tolerances.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
mattleibow pushed a commit to mono/SkiaSharp that referenced this pull request Oct 15, 2026
Upgrade the Basic Uno sample to SDK 6.8.0-dev.66, which ships the servicing backport of unoplatform/uno#24260. The pinned host could wait forever for a recorded frame while requesting only a present.

Map Uno and its unmirrored desktop dependencies to their publishing feed without allowing SkiaSharp or HarfBuzzSharp consumers to bypass staged artifacts. Cover both repository and generated feed mappings. Review and update only navigation pixels for the newer theme; preserve all canvas/control reference pixels and existing rendering tolerances.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
mattleibow added a commit to mono/SkiaSharp that referenced this pull request Oct 17, 2026
)

Stabilize browser sample captures and stable Uno startup (#5361)

Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1636281
Context: #5353
Context: https://github.com/mono/SkiaSharp/pull/5293/checks?check_run_id=116262705576
Context: unoplatform/uno#24260
Changes: unoplatform/uno@f4d493c...da217df

Handle CSS transitions, eventual image readiness, and Uno splash dismissal
at their respective boundaries rather than relaxing golden comparisons.
Keep the Basic Uno sample on a stable SDK and retain repository mirrors
for dependency resolution.

~~ Finish CSS transitions before screenshot capture ~~

The Windows Blazor drawing test cleared its canvas correctly, but its
cleared-page screenshot differed by 1906 pixels inside the Clear button.
Its hover-exit background transition was still running after the canvas
readiness assertions had passed.

Set ScreenshotAnimations.Disabled in BrowserRunningApp.Screenshot so
Playwright finishes finite CSS transitions during capture. This does not
wait for WASM canvas painting. Retain the drawing pixel assertions and
existing comparison thresholds; no Blazor references change.

Verify the capture behavior with a transition paused halfway: the captured
100x100 swatch must contain its final color, not the intermediate color.

~~ Give eventual image readiness one bounded comparison loop ~~

A visible Blazor CPU canvas can precede its first raster presentation.
The pixel-readiness fix in #5353 addressed that gap, but separate pixel
and image checks give startup different readiness conditions and deadlines.

Add an opt-in SampleImage.Validate capture-delegate overload that returns
the matching image path. Retry dimension and pixel mismatches against the
reviewed reference, using the existing comparison options. Default to a
two-second budget with 100ms polling; the CPU startup test explicitly
allows ten seconds and returns on the first matching capture.

Replace BlazorWebAssemblyCpuSampleRuns(delayFirstPaint), its one-second
module-delay case, and its opaque-pixel probe with a normal startup test
using the complete golden image as its readiness condition. Do not apply
eventual matching globally to drawing or GPU assertions: a matching frame
does not establish that every intermediate frame was correct.

Limit each capture await to the remaining budget and test cancellation.
WaitAsync stops waiting; it does not cancel the underlying capture.
Propagate capture errors and cancellation rather than treating them as
image mismatches. Missing references and corrupt images also fail without
retrying. Preserve one-shot validation and produce the usual diagnostics
when a completed mismatch persists until the deadline.

Exercise transient and persistent mismatches, dimension changes, retained
diagnostics, invalid deadlines, stalled captures, and error propagation.
A browser test captures an incorrect frame followed by the expected frame;
the console-error test verifies browser errors still escape through the
capture loop.

~~ Adopt stable Uno without accepting unrelated image changes ~~

Update the Basic Uno sample from Uno.Sdk 6.6.0-dev.208 to stable 6.7.30,
which selects runtime 6.7.135. Keep repository package sources unchanged:
the required dependencies are supplied through the existing mirrors.
Add a contract test for the artifacts, dotnet-public, and dotnet-eng
source/mapping keys; generated SkiaSharp and HarfBuzzSharp consumers
remain restricted to staged artifacts.

The newer navigation template changes top-navigation spacing. Review and
update the nine Uno references for that layout change: 1556 CPU navigation
pixels and 1582 Drawing navigation pixels per reference. Every pixel below
the 49-pixel navigation header remains unchanged, including scene content,
strokes, the Clear button, and drawing controls. Stable CPU and drawing
tests pass these references without changing their tolerances.

~~ Keep recording until Uno dismisses its startup splash ~~

The Windows Uno failure remained on .uno-loader until startup timed out.
Reproduce the symptom locally on stable 6.7.30 with 4x Chromium CPU
throttling: the loader stays visible for 60 seconds despite an existing
canvas and no browser errors.

Uno subscribes to CompositionTarget.FrameRendered, then requests a
presentation through IXamlRootHost.InvalidateRender. Presentation can
reuse an existing recording without raising the event needed to remove
the splash. The upstream correction requests a new recorded frame, but
that correction is absent from the selected stable runtime.

Add a WebAssembly-only partial App hook before window activation.
Temporarily subscribe to the public CompositionTarget.Rendering event,
whose stable implementation requests recorded frames. Let Uno remove
its own loader, then unsubscribe. Also stop on window close. An
independent non-repeating 60-second dispatcher timer unsubscribes and
reports an explicit error if dismissal never completes. Do not hide the
loader or substitute screenshot retries for application recovery.

The workaround passed 32 local cold starts, including 20 consecutive
4x-throttled starts. Observation confirmed cleanup after natural dismissal.
A fault-injected observer that never reported dismissal triggered the
timeout error and stopped observing. These checks support the workaround,
not a guarantee over every scheduling interleaving.

Retain the existing normal Uno startup, rendering, navigation, drawing,
and clear tests without permanent loader-query instrumentation. Remove
the workaround when the sample adopts a runtime containing the upstream
recorded-frame correction.

The final head passes the Windows, Linux, and macOS sample Host and Build
checks and both sample Docker checks.

Co-authored-by: Matthew Leibowitz <[email protected]>
Co-authored-by: Virgil Ming <[email protected]>
Co-authored-by: Copilot App <[email protected]>
ramezgerges added a commit to ramezgerges/SkiaSharp that referenced this pull request Oct 19, 2026
Every published SkiaSharp.Views.Uno.WinUI is built against Uno.WinUI
5.2 and references the Uno and Uno.UI.Toolkit assemblies, which Uno
Platform 7 renamed to Uno.WinRT and Uno.UI.Extras without forwarders.
On 7.0 the app throws FileNotFoundException from
SkiaSharp.Views.Windows.GlobalStaticResources.Initialize() at startup.

Build the package against Uno.WinUI 7.0, as one plain netX assembly
instead of one per platform:

- the Android, iOS, macOS, Mac Catalyst and WebAssembly variants and
  the uno-runtime packaging split are removed;
- the package targets net10.0 and later plus -windows, since Uno
  Platform 7 does not support net9.0.
- with one implementation left, each view is a single file in the
  project: the shared folder and its .Skia.cs partials are merged.

This drops Uno Platform 5 and 6 support. SKSwapChainPanel stays
unsupported outside Windows App SDK; Uno's SKCanvasElement is the
GPU-backed control there.

The Uno samples move to Uno.Sdk 7.0.0-dev.79 and its conditional XAML
prefixes. Earlier 7.0 SDKs bring a Hot Design build that still
references the pre-7 assemblies. The Gallery also stops declaring
SkiaSharp.Views.WinUI twice, which the 7.0 SDK's package resolver
rejects.

The in-tree samples also exclude the Uno.Sdk's Win32, Android and iOS
SkiaSharp native packages, as they already did the Linux, macOS and
WebAssembly ones, so they load the natives built in the tree instead of
the SDK's older ones.

The samples' Android heads move to Uno.UI.Runtime.Android's
NativeApplication and ApplicationActivity and build their host in
CreateHost, as Uno Platform 7 requires.

SkiaFiddle moves to Uno.Monaco.Editor 7.0.0-dev.3, the first build for
Uno Platform 7; earlier ones depend on a CommunityToolkit build that
references Uno.UI.Toolkit and fail at startup the same way.

The Basic sample drops the WebAssembly splash workaround it carried for
Uno 6.7: Uno 7 requests a recorded frame for the splash itself
(unoplatform/uno#24260).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ramezgerges added a commit to ramezgerges/SkiaSharp that referenced this pull request Oct 21, 2026
Every published SkiaSharp.Views.Uno.WinUI is built against Uno.WinUI
5.2 and references the Uno and Uno.UI.Toolkit assemblies, which Uno
Platform 7 renamed to Uno.WinRT and Uno.UI.Extras without forwarders.
On 7.0 the app throws FileNotFoundException from
SkiaSharp.Views.Windows.GlobalStaticResources.Initialize() at startup.

Build the package against Uno.WinUI 7.0, as one plain netX assembly
instead of one per platform:

- the Android, iOS, macOS, Mac Catalyst and WebAssembly variants and
  the uno-runtime packaging split are removed;
- the package targets net10.0 and later plus -windows, since Uno
  Platform 7 does not support net9.0.
- with one implementation left, each view is a single file in the
  project: the shared folder and its .Skia.cs partials are merged.

This drops Uno Platform 5 and 6 support. SKSwapChainPanel stays
unsupported outside Windows App SDK; Uno's SKCanvasElement is the
GPU-backed control there.

The Uno samples move to Uno.Sdk 7.0.0-dev.79 and its conditional XAML
prefixes. Earlier 7.0 SDKs bring a Hot Design build that still
references the pre-7 assemblies. The Gallery also stops declaring
SkiaSharp.Views.WinUI twice, which the 7.0 SDK's package resolver
rejects.

The in-tree samples also exclude the Uno.Sdk's Win32, Android and iOS
SkiaSharp native packages, as they already did the Linux, macOS and
WebAssembly ones, so they load the natives built in the tree instead of
the SDK's older ones.

The samples' Android heads move to Uno.UI.Runtime.Android's
NativeApplication and ApplicationActivity and build their host in
CreateHost, as Uno Platform 7 requires.

SkiaFiddle moves to Uno.Monaco.Editor 7.0.0-dev.3, the first build for
Uno Platform 7; earlier ones depend on a CommunityToolkit build that
references Uno.UI.Toolkit and fail at startup the same way.

The Basic sample drops the WebAssembly splash workaround it carried for
Uno 6.7: Uno 7 requests a recorded frame for the splash itself
(unoplatform/uno#24260).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
mattleibow pushed a commit to ramezgerges/SkiaSharp that referenced this pull request Oct 22, 2026
Every published SkiaSharp.Views.Uno.WinUI is built against Uno.WinUI
5.2 and references the Uno and Uno.UI.Toolkit assemblies, which Uno
Platform 7 renamed to Uno.WinRT and Uno.UI.Extras without forwarders.
On 7.0 the app throws FileNotFoundException from
SkiaSharp.Views.Windows.GlobalStaticResources.Initialize() at startup.

Build the package against Uno.WinUI 7.0, as one plain netX assembly
instead of one per platform:

- the Android, iOS, macOS, Mac Catalyst and WebAssembly variants and
  the uno-runtime packaging split are removed;
- the package targets net10.0 and later plus -windows, since Uno
  Platform 7 does not support net9.0.
- with one implementation left, each view is a single file in the
  project: the shared folder and its .Skia.cs partials are merged.

This drops Uno Platform 5 and 6 support. SKSwapChainPanel stays
unsupported outside Windows App SDK; Uno's SKCanvasElement is the
GPU-backed control there.

The Uno samples move to Uno.Sdk 7.0.0-dev.79 and its conditional XAML
prefixes. Earlier 7.0 SDKs bring a Hot Design build that still
references the pre-7 assemblies. The Gallery also stops declaring
SkiaSharp.Views.WinUI twice, which the 7.0 SDK's package resolver
rejects.

The in-tree samples also exclude the Uno.Sdk's Win32, Android and iOS
SkiaSharp native packages, as they already did the Linux, macOS and
WebAssembly ones, so they load the natives built in the tree instead of
the SDK's older ones.

The samples' Android heads move to Uno.UI.Runtime.Android's
NativeApplication and ApplicationActivity and build their host in
CreateHost, as Uno Platform 7 requires.

SkiaFiddle moves to Uno.Monaco.Editor 7.0.0-dev.3, the first build for
Uno Platform 7; earlier ones depend on a CommunityToolkit build that
references Uno.UI.Toolkit and fail at startup the same way.

The Basic sample drops the WebAssembly splash workaround it carried for
Uno 6.7: Uno 7 requests a recorded frame for the splash itself
(unoplatform/uno#24260).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ramezgerges added a commit to ramezgerges/SkiaSharp that referenced this pull request Oct 26, 2026
Every published SkiaSharp.Views.Uno.WinUI is built against Uno.WinUI
5.2 and references the Uno and Uno.UI.Toolkit assemblies, which Uno
Platform 7 renamed to Uno.WinRT and Uno.UI.Extras without forwarders.
On 7.0 the app throws FileNotFoundException from
SkiaSharp.Views.Windows.GlobalStaticResources.Initialize() at startup.

Build the package against Uno.WinUI 7.0, as one plain netX assembly
instead of one per platform:

- the Android, iOS, macOS, Mac Catalyst and WebAssembly variants and
  the uno-runtime packaging split are removed;
- the package targets net10.0 and later plus -windows, since Uno
  Platform 7 does not support net9.0.
- with one implementation left, each view is a single file in the
  project: the shared folder and its .Skia.cs partials are merged.

This drops Uno Platform 5 and 6 support. SKSwapChainPanel stays
unsupported outside Windows App SDK; Uno's SKCanvasElement is the
GPU-backed control there.

The Uno samples move to Uno.Sdk 7.0.0-dev.79 and its conditional XAML
prefixes. Earlier 7.0 SDKs bring a Hot Design build that still
references the pre-7 assemblies. The Gallery also stops declaring
SkiaSharp.Views.WinUI twice, which the 7.0 SDK's package resolver
rejects.

The in-tree samples also exclude the Uno.Sdk's Win32, Android and iOS
SkiaSharp native packages, as they already did the Linux, macOS and
WebAssembly ones, so they load the natives built in the tree instead of
the SDK's older ones.

The samples' Android heads move to Uno.UI.Runtime.Android's
NativeApplication and ApplicationActivity and build their host in
CreateHost, as Uno Platform 7 requires.

SkiaFiddle moves to Uno.Monaco.Editor 7.0.0-dev.3, the first build for
Uno Platform 7; earlier ones depend on a CommunityToolkit build that
references Uno.UI.Toolkit and fail at startup the same way.

The Basic sample drops the WebAssembly splash workaround it carried for
Uno 6.7: Uno 7 requests a recorded frame for the splash itself
(unoplatform/uno#24260).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ramezgerges added a commit to ramezgerges/SkiaSharp that referenced this pull request Oct 27, 2026
Every published SkiaSharp.Views.Uno.WinUI is built against Uno.WinUI
5.2 and references the Uno and Uno.UI.Toolkit assemblies, which Uno
Platform 7 renamed to Uno.WinRT and Uno.UI.Extras without forwarders.
On 7.0 the app throws FileNotFoundException from
SkiaSharp.Views.Windows.GlobalStaticResources.Initialize() at startup.

Build the package against Uno.WinUI 7.0, as one plain netX assembly
instead of one per platform:

- the Android, iOS, macOS, Mac Catalyst and WebAssembly variants and
  the uno-runtime packaging split are removed;
- the package targets net10.0 and later plus -windows, since Uno
  Platform 7 does not support net9.0.
- with one implementation left, each view is a single file in the
  project: the shared folder and its .Skia.cs partials are merged.

This drops Uno Platform 5 and 6 support. SKSwapChainPanel stays
unsupported outside Windows App SDK; Uno's SKCanvasElement is the
GPU-backed control there.

The Uno samples move to Uno.Sdk 7.0.0-dev.79 and its conditional XAML
prefixes. Earlier 7.0 SDKs bring a Hot Design build that still
references the pre-7 assemblies. The Gallery also stops declaring
SkiaSharp.Views.WinUI twice, which the 7.0 SDK's package resolver
rejects.

The in-tree samples also exclude the Uno.Sdk's Win32, Android and iOS
SkiaSharp native packages, as they already did the Linux, macOS and
WebAssembly ones, so they load the natives built in the tree instead of
the SDK's older ones.

The samples' Android heads move to Uno.UI.Runtime.Android's
NativeApplication and ApplicationActivity and build their host in
CreateHost, as Uno Platform 7 requires.

SkiaFiddle moves to Uno.Monaco.Editor 7.0.0-dev.3, the first build for
Uno Platform 7; earlier ones depend on a CommunityToolkit build that
references Uno.UI.Toolkit and fail at startup the same way.

The Basic sample drops the WebAssembly splash workaround it carried for
Uno 6.7: Uno 7 requests a recorded frame for the splash itself
(unoplatform/uno#24260).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@agneszitte

Copy link
Copy Markdown
Member

@Mergifyio backport release/stable/6.7

@mergify

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

backport release/stable/6.7

✅ Backports have been created

Details

agneszitte added a commit that referenced this pull request Oct 27, 2026
…6.7/pr-24260

fix(wasm): Request a record so the splash is removed (backport #24260)
mattleibow pushed a commit to mono/SkiaSharp that referenced this pull request Oct 28, 2026
Build SkiaSharp.Views.Uno.WinUI against Uno Platform 7 (#5377)

Fixes: #5174
Context: unoplatform/uno#24260

Rebuild the Uno views package and samples around Uno Platform 7's unified
renderer and .NET 10 baseline. Replace the obsolete per-platform runtime
packaging with one common Uno implementation, preserve existing control usage
with a CPU fallback where Uno exposes no swap chain, and keep generated samples
on the same managed and native product cohort.

~~ Rebuild the package for the Uno 7 assembly model ~~

The base package referenced Uno.WinUI 5.2.175 and the `Uno` and
`Uno.UI.Toolkit` assemblies. Uno 7 renamed those assemblies to `Uno.WinRT` and
`Uno.UI.Extras` without forwarders, so startup failed while initializing
`SkiaSharp.Views.Windows.GlobalStaticResources` before `OnLaunched` ran.

Build the common implementation against Uno.WinUI 7.0.0-dev.2333 and require
net10.0 for the non-Windows assembly. Keep the existing Windows TFMs as package
facades over `SkiaSharp.Views.WinUI`. Remove the Android, iOS, macOS, and
Mac Catalyst platform implementations, plus the separate Skia and WASM runtime
projects, their `uno-runtime` packaging, and the WASM JavaScript bridge. Uno 7
no longer selects those native-renderer variants, and Uno.Sdk now supplies the
platform native assets.

Move the applications to Uno.Sdk 7.0.0-dev.79, its `Skia` feature name, and its
Android `UnoPlatformHost` startup model. Use Uno.Monaco.Editor 7.0.0-dev.3 for
SkiaFiddle. Remove the Basic sample's WASM splash workaround because the merged
upstream fix requests a record and raises the frame notification used to remove
the loader.

~~ Preserve SKSwapChainPanel compatibility without a swap chain ~~

Non-Windows Uno targets no longer expose the swap chain or GPU context used by
the former platform implementations. Make `SKSwapChainPanel` a `Grid` that
hosts `SKXamlCanvas`, reports a null `GRContext`, and raises `PaintSurface` with
the raster surface plus a size-and-format `GRBackendRenderTarget` whose
framebuffer is zero. `SKCanvasElement` remains the GPU-backed choice on Uno;
the WinAppSDK facade continues to use the ANGLE-backed Windows control.

The Uno control now derives from `Grid` instead of `FrameworkElement` and drops
`RaiseOnUnsupported`, which only controlled the previous unsupported-platform
exception. `DrawInBackground` remains unsupported. `EnableRenderLoop` attaches
to `CompositionTarget.Rendering` only while the control is loaded and visible.

Review found re-entry and unload-lifetime hazards in the replacement redraw
path. Keep `Invalidate()` deferred and coalesced so a handler cannot
synchronously re-enter `PaintSurface`, and discard canvas redraws that execute
after the final unload. The latter guard runs before bitmap allocation,
preventing detached work from creating a pinned pixel buffer that no later
unload would release. A subsequent load invalidates again, so reattached
controls still redraw.

~~ Keep generated samples on one product cohort ~~

Uno.Sdk 7 brings HarfBuzzSharp native assets at its own stable version, while
generated samples restore only the staged PR artifact cohort. Add an
unconditional `HarfBuzzSharpVersion` override beside `SkiaSharpVersion`, teach
the sample generator to stamp both product versions, and verify both packages
exist in the generated artifact set. This prevents the previous NU1103 restore
failure.

The generator removes `_UnoPlatformSamples.targets`, so SkiaFiddle previously
had no managed product reference after generation: its native assets could be
stamped at the current version while normal feeds could select an older
managed SkiaSharp. Add direct SkiaSharp and HarfBuzzSharp project references
so the generator emits matching managed package references. Explicitly
reference the Uno views from Gallery because Uno.Sdk 7 no longer supplies
them, while keeping the generated WinUI package reference out of the in-tree
build to avoid a duplicate SDK reference.

~~ Retire the WasmShell native-asset path ~~

Remove the `IsUnoHead` and `UnoRuntimeIdentifier=WebAssembly` branches that fed
static libraries and `WasmShell*` linker items to Uno.Wasm.Bootstrap's former
emcc pipeline. Uno 7 builds WASM through the .NET SDK, which continues to use
the existing `UsingMicrosoftNETSdkWebAssembly` path for SkiaSharp and
HarfBuzzSharp native assets.

Delete `utils/NativeLibraryMiniTest/wasm`, its Uno.Wasm.Bootstrap 2.1 project,
and its bootstrap page. Nothing invoked that utility, while the maintained Uno
samples and browser sample tests exercise the .NET SDK WebAssembly integration.
This intentionally ends compatibility with pre-Uno 7 WasmShell pipelines.

~~ Make the samples usable on phone-sized targets ~~

Uno 7's Android heads render edge to edge, so apply visible-bounds padding on
all sides instead of leaving the Basic drawing toolbar under the navigation bar
and the Gallery header under the status bar. Below 720 pixels, move the
Gallery's controls below the canvas and collapse them vertically so the fixed
290-pixel sidebar does not consume most of a phone-width layout.

Subscribe to Android `BackRequested` only while a sample page is active. Any
subscriber makes Uno consume the native back callback, even when the handler
does not mark it handled, so retaining the subscription on the Gallery root
prevented system back from leaving the application. Use `SKCanvasElement` for
the GPU sample on Uno targets and retain `SKSwapChainPanel` for WinAppSDK.

~~ Keep browser validation strict under Uno 7 ~~

Uno.Wasm.Bootstrap probes the HTTP cache with `only-if-cached`; Chromium reports
a handled miss as the exact console error
`Failed to load resource: net::ERR_CACHE_MISS`. Ignore only that message while
continuing to fail browser tests for other console errors.

Refresh the drawn and cleared Uno references for Linux, macOS, and Windows.
Uno 7 shifted rounded-control antialiasing and the tab indicator enough to
produce about 0.125% differing pixels against the existing 0.075% comparison
budget. The references now capture the settled Uno 7 output without relaxing
comparison policy.

Azure build 1651574 and the current-head GitHub checks passed, including managed
and native builds, NuGet packaging, WASM tests, and sample build and host jobs.

~~ Remove unsupported compatibility branches ~~

Drop `WINDOWS_UWP`, `UAP10_0_10240`, and `NETSTANDARD1_3` conditionals from the
shared binding code. Remove `HAS_UNO`, `HAS_UNO_WINUI`, UWP-namespace, and Uno
visibility branches that existed to compile shared Android, iOS, and macOS
views into the deleted native-renderer projects. The active Android, Apple,
Blazor, Windows, and current managed branches remain in their owning projects.

Remove the deleted runtime projects from solution filters and update package and
.NET-version guidance to describe the Uno 7 package shape, CPU fallback, and
Uno.Sdk-owned WASM native assets.

Co-authored-by: Ramez Ragaa <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Alex Soto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WASM Skia] Apps don't start rending app on mobile ("stays" rendering loading page)

6 participants