Repository navigation
[tests] Raise GPU golden outlier allowance to 3% - #5387
Conversation
Context: #5183 Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1638963 Raise GoldenTolerance.Gpu.MaxOutlierFraction from 0.02 to 0.03 while retaining the per-channel tolerance of 12. Update the documented GPU policy; keep raster tolerances, committed goldens and skip policy unchanged. The macOS ganesh-gl/DiagonalLines test consistently differs from its ARM64 reference at 1,832 of 65,536 pixels (2.7954%). The previous 2% allowance admitted 1,310 outliers; 3% admits 1,966. PR #5183 selected the CI capture as the reference while acknowledging the local M3 Pro mismatch. Reproduce the failure locally using the exact native library from CI build 1638963, where the test passed. With that library and the same runtime, selecting Apple Software Renderer locally produces a PNG byte-identical to CI, while Apple M3 Pro reproduces the failure. CI did not record its GL renderer name, so its software-renderer identity remains inferred rather than directly observed. GL tracing identifies the differing input: Ganesh uses an internal four-sample coverage atlas even though the output surface requests no MSAA. The hardware and software sample patterns cover two versus three samples along the diagonal edge, producing gray values of 127 versus 64. The architecture-specific golden lookup is correct; CPU architecture alone does not distinguish these rasterization profiles. Absorb this measured variation through the shared GPU outlier budget rather than raising channel tolerance or replacing the reference again. This deliberately permits more over-tolerance pixels in GPU comparisons; it does not distinguish expected edge differences from unrelated errors. Renderer-specific references would provide finer discrimination. The unfiltered net10.0 console solution passes on the local ARM64 Mac with the new allowance, including DiagonalLines. The core host reports 6,384 passed, 23 skipped and zero failures; the other solution hosts pass. Validation: dotnet test tests/SkiaSharp.Tests.Console.slnx -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0 Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5d2d68a5-8142-4083-9d8f-eb0d093cbbdf
|
📖 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. |
📦 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 -- 5387PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 5387"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-5387/packages --name skiasharp-pr-5387More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-5387 |
📊 SkiaSharp benchmarks — PR #5387⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS
Highlights⏱️ Time — 🔴 50 slower · 🟢 14 faster
Full per-OS benchmark deltasLinux⏱️ Time (vs 🌙 nightly
Windows⏱️ Time (vs 🌙 nightly
macOS⏱️ Time (vs 🌙 nightly
|
Description
Raise the shared GPU golden-image outlier allowance from 2% to 3%, retaining the 12-per-channel tolerance. Update the documented policy. Raster tolerances, committed goldens, GPU skip policy, and production rendering remain unchanged.
The local macOS ARM64 M3 Pro
ganesh-gl/DiagonalLinesoutput differs from the committed ARM64 reference at 1,832/65,536 pixels (2.7954%). The existing budget admits 1,310 outliers; the new budget admits 1,966. This applies to the shared GPU tolerance, not just this scene.The investigation used the exact native library from CI build 1638963, whose macOS
DiagonalLinestest passed. It still reproduced the local failure, ruling out different native/compiler builds as the explanation. On the same local OS and .NET runtime, explicitly selecting Apple Software Renderer produced a PNG byte-identical to CI, whereas the default Apple M3 Pro renderer reproduced the failure. The CI run did not log its GL renderer name, so its software-renderer identity is inferred, not directly captured.GL call tracing showed that Ganesh uses an internal 4× MSAA coverage atlas despite the single-sample output surface. The M3 rotated sample pattern and Apple's software grid cover two versus three samples at a diagonal edge, producing gray values of 127 versus 64. The architecture-specific golden lookup works correctly; CPU architecture does not distinguish those rendering profiles. #5183 selected the CI capture while acknowledging this local mismatch.
This deliberately accepts a larger spatial outlier budget rather than raising channel tolerance or replacing the reference again. It also admits unrelated over-tolerance errors within that budget; renderer-specific references would be more discriminating. Hardware/software mode controls and reference selection are not implemented here.
Related issues
None. Context: #5183.
Required skia PR
None.
Areas affected
binding/)externals/skia/src/c,include/c)Changes
None — no public API or production rendering behavior changes. Test acceptance changes: shared GPU comparisons retain a maximum per-channel delta of 12 but permit 3% rather than 2% of pixels to exceed it. Raster remains
(2, 0.002).Testing
dotnet test tests/SkiaSharp.Tests.Console.slnx -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0on macOS 27.0.1 ARM64 / Apple M3 Pro, .NET 10.0.12, using the exact main-native artifact from CI build 1638963. The core host reported 6,384 passed, 23 skipped, 0 failed, includingDiagonalLines; singleton (1 passed), Gallery (50 passed), Vulkan (4 passed / 21 skipped), and Direct3D (2 passed / 3 skipped) hosts also passed. Existing platform skips were unchanged; no GPU opt-out was added or set.ganesh-gl/DiagonalLinesat 1,832 outliers versus 1,310 allowed.git diff --checkbefore committing.Checklist
Changesabove lists all public API and behavioral changes (or "None.")///documentation and regenerated bindings when applicablemono/skiaPR linked above and bindings regeneratedPublic API and native checklist items are not applicable; neither surface changed.