Repository navigation
Stabilize browser screenshots and stable Uno startup in sample CI - #5361
Conversation
📦 Try the packages from this PRWarning Do not run these scripts without first reviewing the code in this PR. Step 1 — Download the packages bash / macOS / Linux: curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 5361PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 5361"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-5361/packages --name skiasharp-pr-5361More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-5361 |
|
📖 Documentation Preview Add the Removing the label removes the preview. While the label is present, each new commit updates it. This comment is automatically updated by the documentation staging workflow. |
📊 SkiaSharp benchmarks — PR #5361⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS
Highlights⏱️ Time — 🔴 13 slower · 🟢 49 faster
Full per-OS benchmark deltasLinux⏱️ Time (vs 🌙 nightly
Windows⏱️ Time (vs 🌙 nightly
macOS⏱️ Time (vs 🌙 nightly
|
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
Disable animations during golden captures so hover-exit transitions cannot race otherwise-ready canvas assertions. Add a frozen-midpoint transition regression that checks the captured pixels, without sleeps or relaxed comparisons. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
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
Keep repository NuGet defaults unchanged so benchmark projects can add their own nightly feed without inheriting a source mapping that excludes it. Verify the exact failed nightly benchmark restore, source SDK resolution, and isolated Uno startup with the sample-local configuration. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
Remove the sample-local NuGet.org config and isolated-consumer feed exception. Require the pinned Uno SDK and its dependencies to be mirrored instead, and cover the mirror-only source and mapping keys. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
Replace the 6.8 preview at the maintainer's request and remove the preview-specific splash-fix claim. Keep mirror-only package sources; validation identifies WebView2Aot 1.5.0 and DirectNAot/DirectNAot.Extensions 1.6.1 as the remaining unmirrored dependencies. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
Reproduced a persistent 60-second splash locally on Uno SDK 6.7.30 with 4x Chromium CPU throttling. Temporarily subscribe to CompositionTarget.Rendering before window activation so startup requests recorded frames, then unsubscribe when Uno removes its loader or the window closes. Bound the subscription with a timer that reports an explicit error on failure. Exercise normal and throttled startup, retain strict golden checks, and verify loader observations stop after startup. Thirty-two workaround cold starts passed, including twenty consecutive 4x starts; a fault-injected persistent observation reported the timeout and detached. No loader removal, tolerance changes, or NuGet.org source exception. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
Cancel or fail the diagnostic if subsequent browser animation frames stop arriving, rather than leaving an async page evaluation unbounded. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
117cce1 to
2ed9fb9
Compare
Remove version-specific startup workaround details and describe package mirror requirements without naming a temporary dependency upgrade. Keep investigation history in the PR and implementation comments. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
Build on #5353's pixel readiness fix without a fixed fault-injection delay. Hold raster initialization until the readiness predicate observes a real transparent pixel, then permit painting and retain the full golden comparison. Release pending routes during failure cleanup. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
Keep the merged CPU pixel-readiness condition, remove the extra delayFirstPaint gate, and opt the normal CPU capture into a bounded asynchronous image-comparison loop. Retry only dimension/pixel mismatches using unchanged tolerances; preserve one-shot validation and surface capture errors, cancellation, corrupt images, and missing references immediately. Do not add reference-capture success bypasses. Cover transient and persistent comparisons, diagnostics, capture deadlines, invalid timeouts, errors and real browser recapture. Keep the sample guide evergreen. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
Remove the separate pixel probe and let the bounded screenshot comparison wait for the complete expected frame. Return on the first matching capture without changing pixel tolerances. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
Remove added CPU throttling and loader-query interception. Retain the normal startup, rendering, navigation, drawing and clear assertions alongside the browser startup workaround. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1
Description
Stabilize browser samples without changing comparison tolerances or adding package-feed exceptions.
SampleImage.Validate(Func<Task<string>>, ...)capture loop. The Blazor CPU test uses one 10-second deadline to wait for the complete expected image, replacing the separate pixel probe. Retry dimension/pixel mismatches only. Missing references, corrupt images, capture/browser errors and cancellation are not retried. Persistent mismatches retain diagnostics and fail. No reference-capture bypass.CompositionTarget.Renderingbefore window activation. Stop after Uno removes its own loader, on window close, or with an explicit error at the 60-second safety limit. This requests recorded frames through the public event; it does not hide/remove the splash. Upstream fix: unoplatform/uno#24260.The stable Uno hang was reproduced locally at 4x Chromium CPU throttling. The workaround passed 32 cold starts, including 20 consecutive 4x starts; observation confirmed cleanup after dismissal and after an injected timeout. Those were investigation checks. The added permanent throttling/query-count tests have been removed;
UnoBrowserSampleRunTests.csnow matches main exactly. Existing startup, rendering, navigation, stroke, and clear checks remain.The Blazor
delayFirstPaintfault-injection case and extra JavaScript interception gate are also removed. The screenshot loop is exercised separately through helper contracts and a real browser mismatch-to-match test. It validates eventual output, not the correctness of every intermediate frame.Nine Uno references contain reviewed navigation-spacing updates for the newer theme: 1556 CPU / 1582 Drawing navigation pixels, with zero changed pixels below row 49. No canvas/control reference pixels, Blazor references, tolerances, or skip policies changed. The sample guide is unchanged from main.
Related issues
Related to #5293 and #5359; follows merged #5353. #5359 remains Node-only and untouched.
Required skia PR
None.
Areas affected
binding/)externals/skia/src/c,include/c)Changes
No public SkiaSharp API or library rendering changes. Browser captures finish CSS transitions; tests can opt into bounded eventual-image comparison. The stable Uno WASM sample records frames through startup and stops after natural splash dismissal. Reviewed reference edits affect Uno navigation only. Existing rendering tolerances, canvas/control reference pixels, and normal Uno sample tests are retained.
Testing
Local macOS ARM64, .NET 10, Playwright 1.55 Chromium, matching staged main-build packages (
preview.0.26514.77).dotnet test tests/SkiaSharp.Tests.Samples/SkiaSharp.Tests.Samples.csproj -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0 -- --filter-class 'SkiaSharp.Tests.Samples.UnoBrowserSampleRunTests' --results-directory /Users/matthew/.copilot/session-state/1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1/files/uno-simplified-results --report-trx— 2 passed after removing extra Uno instrumentation.dotnet test tests/SkiaSharp.Tests.Samples/SkiaSharp.Tests.Samples.csproj -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0 -- --filter-method '*BlazorWebAssemblyCpuSampleRuns*' '*BrowserScreenshotsRetryUntilRendered*' '*ScreenshotComparisonBoundsCaptureTime*' --results-directory /Users/matthew/.copilot/session-state/1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1/files/cpu-ten-second-results --report-trx— 3 passed, including the CPU test with only a 10-second image-readiness loop.dotnet test tests/SkiaSharp.Tests.Samples/SkiaSharp.Tests.Samples.csproj -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0 -- --filter-class 'SkiaSharp.Tests.Samples.SampleInfrastructureTests' --results-directory /Users/matthew/.copilot/session-state/1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1/files/screenshot-loop-final-infrastructure-results --report-trx— 86 passed: transient/persistent pixel and dimension comparisons, strict thresholds, diagnostics, missing/corrupt images, capture errors/cancellation, deadlines, existing infrastructure contracts.dotnet test tests/SkiaSharp.Tests.Samples/SkiaSharp.Tests.Samples.csproj --no-build -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0 -- --filter-method '*BlazorWebAssemblyCpuSampleRuns*' '*BlazorWebAssemblyDrawingSampleDrawsAndClears*' '*BrowserScreenshots*' '*BrowserOperationsReportAllConsoleErrors*' '*BrowserCallbackReportsPageErrors*' --results-directory /Users/matthew/.copilot/session-state/1d3be5b1-5a0b-452c-8a04-703fc4dd1ae1/files/screenshot-loop-browser-results --report-trx— 9 passed before the CPU deadline simplification; CPU was rerun as above.dotnet test tests/SkiaSharp.Tests.Console.slnx -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0— local failure only in the previously observed independentganesh-gl/DiagonalLinesmacOS ARM64 reference mismatch (1832 outliers, 1310 allowed). No native code, skip policy, or that reference changed.git diff --check— passed.The stable workaround previously passed all 121 active checks in build 1637334, including Windows/Linux/macOS sample Host/Build and Docker. That is historical evidence, not validation of this latest screenshot-loop/simplification revision. Fresh CI is pending.
Screenshots (before / after): reviewed Uno navigation spacing
Only the navigation header changes; all CPU scene pixels remain identical.
Checklist
Changesabove lists all public API and behavioral changes (or "None.")///documentation and regenerated bindings when applicablemono/skiaPR linked above and bindings regenerated