Skip to content

[skia-sync] Restore exact-base native prebuild cache - #4659

Closed
mattleibow wants to merge 2 commits into
mainfrom
mattleibow-restore-skia-sync-prebuild
Closed

[skia-sync] Restore exact-base native prebuild cache#4659
mattleibow wants to merge 2 commits into
mainfrom
mattleibow-restore-skia-sync-prebuild

Conversation

@mattleibow

@mattleibow mattleibow commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

Restore the host-side native prebuild/cache optimization removed by #4657, without reintroducing the mixed-tree failure from run 30932472778.

The workflow materializes the exact resolved parent commit in isolated /tmp/skia-sync-worktree, recursively checks out every submodule gitlink from that tree, and uses that same fixed path for cache restore, the cold base build, the agent's merged-target build, and post-step delivery. GITHUB_WORKSPACE remains the untouched gh-aw checkout, while current main's immutable staged update-skia skill drives product work in the isolated checkout.

The cache has no broad restore prefix. Its key includes the exact parent SHA, exact Skia SHA, runner/image/toolchain fingerprint, platform, and architecture. Phase 04's deterministic helper creates both feature branches at those already-checked-out SHAs, so hydrated dependencies, Ninja objects, and native outputs remain in place. No artifacts are copied across paths and no mutate-then-restore sequence is used.

Related issues

N/A — follow-up to #4573, #4657, and #4660.

Required skia PR

None.

Areas affected

  • Managed API (binding/)
  • Native / C API (externals/skia/src/c, include/c)
  • Generated P/Invoke bindings
  • Native dependency or Skia update (libpng, HarfBuzz, FreeType, zlib, milestone bump, …)
  • Views & integrations (MAUI, Uno, WPF, WinUI, Blazor, …)
  • Rendering output / visual behavior
  • Performance
  • Tests
  • Build, packaging, or CI
  • Documentation or samples

Changes

None — CI-only; no public API or product behavior changes.

Testing

  • bash .github/scripts/skia-sync-checkout-base.test.sh proves an m150 release selection uses release/4.150.x parent metadata, build scripts, exact Skia gitlink, and exact nested submodule gitlink while leaving the gh-aw checkout unchanged. It then runs the actual Phase 04 prepare_branches.py helper and proves cached dependency, Ninja, and native-output markers survive branch creation.
  • python .agents/skills/update-skia/scripts/prepare_branches_test.py passes.
  • bash -n passes for the checkout, prepare, push, and regression scripts.
  • gh aw compile auto-skia-sync --validate completes with 0 errors and 0 warnings.
  • The generated workflow was reviewed to confirm prepare/cache/build ordering, immutable skill staging, the isolated AWF mount, exact cache key, absence of a native restore prefix, and post-step workspace routing.

The write-capable Skia sync workflow was not manually dispatched.

Checklist

  • Tests added or updated (focused shell regression harness)
  • Changes above lists all public API and behavioral changes (None)
  • New/changed public API? N/A — no API changes
  • Native change? N/A — no native source or submodule change

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

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 -- 4659

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4659"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-4659/packages --name skiasharp-pr-4659
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-4659

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

The documentation for this PR has been deployed and is available at:

🔗 View Staging Site
🔗 View Staging Docs
🔗 View Staging Gallery (Blazor)
🔗 View Staging Gallery (Uno Platform)
🔗 View Staging SkiaFiddle

This preview will be updated automatically when you push new commits to this PR.


This comment is automatically updated by the documentation staging workflow.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📊 SkiaSharp benchmarks — PR #4659

this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS

Informational only — this never blocks the PR. 🟢 faster / less allocation · 🔴 slower / more allocation; moves under 5% are hidden as noise.

⏱️ Times are raw BenchmarkDotNet means, and the ⭐ PR and baseline legs run on separate CI runners, so microbenchmarks can swing run-to-run — treat small time deltas as noise. Allocations are deterministic and the reliable signal. The interactive perf-dashboard (linked below) applies smoothing for the trend view.

Highlights

⏱️ Time — 🔴 49 slower · 🟢 21 faster

  • 🟢 BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) · macOS · 576.47 µs → 192.73 µs (-67%)
  • 🟢 MatrixMapPointsBenchmark.MapPoints(Points: 4096) · macOS · 5.14 µs → 2.32 µs (-55%)
  • 🟢 BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) · macOS · 615.85 µs → 281.15 µs (-54%)
  • 🟢 LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) · macOS · 1.64 ms → 851.81 µs (-48%)
  • 🟢 ColorMathBenchmark.PreMultiply(Colors: 4096) · macOS · 19.39 µs → 10.25 µs (-47%)
  • …and 65 more (see details below)
Full per-OS benchmark deltas

Linux

⏱️ Time (vs 🌙 nightly 4.152.0-nightly.4)

Benchmark baseline this PR Δ
ColorMathBenchmark.ToColor(Colors: 4096) 15.40 µs 11.67 µs 🟢 -24%
MatrixOpsBenchmark.Invert(Count: 4096) 127.55 µs 149.16 µs 🔴 +17%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 3.13 µs 2.68 µs 🟢 -14%
MatrixMapPointsBenchmark.MapRect(Points: 4096) 176.45 µs 201.99 µs 🔴 +14%
MatrixMapPointsBenchmark.MapRect(Points: 256) 11.06 µs 12.64 µs 🔴 +14%
MatrixOpsBenchmark.Concat(Count: 4096) 216.51 µs 245.91 µs 🔴 +14%
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 71.91 µs 81.68 µs 🔴 +14%
ColorMathBenchmark.PreMultiply(Colors: 4096) 12.86 µs 14.49 µs 🔴 +13%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 4.52 µs 5.07 µs 🔴 +12%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 217.12 µs 241.96 µs 🔴 +11%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 13.61 µs 15.12 µs 🔴 +11%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 11.45 µs 12.67 µs 🔴 +11%
MatrixMapPointsBenchmark.MapVector(Points: 256) 10.84 µs 11.89 µs 🔴 +10%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 174.44 µs 190.42 µs 🔴 +9%
ColorMathBenchmark.ToColorF(Colors: 4096) 13.13 µs 14.04 µs 🔴 +7%
RuntimeEffectShaderBenchmark.DrawFrame 2.85 ms 3.02 ms 🔴 +6%
PathBoundsBenchmark.TightBounds(Points: 1024) 10.77 µs 11.37 µs 🔴 +6%
CanvasDrawBenchmark.Draw(Shapes: 64) 4.16 ms 4.38 ms 🔴 +5%
CanvasDrawBenchmark.Draw(Shapes: 512) 33.13 ms 34.88 ms 🔴 +5%

Windows

⏱️ Time (vs 🌙 nightly 4.152.0-nightly.4)

Benchmark baseline this PR Δ
PathBoundsBenchmark.TightBounds(Points: 1024) 15.43 µs 20.40 µs 🔴 +32%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 97.22 µs 125.39 µs 🔴 +29%
PathBoundsBenchmark.TightBounds(Points: 64) 1.52 µs 1.90 µs 🔴 +25%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 8.59 µs 10.64 µs 🔴 +24%
MatrixMapPointsBenchmark.MapRect(Points: 256) 7.19 µs 8.56 µs 🔴 +19%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 143.29 µs 166.70 µs 🔴 +16%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 249.30 µs 288.33 µs 🔴 +16%
MatrixMapPointsBenchmark.MapVector(Points: 256) 7.58 µs 8.75 µs 🔴 +16%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 123.02 µs 139.85 µs 🔴 +14%
CanvasDrawBenchmark.Draw(Shapes: 512) 21.28 ms 24.11 ms 🔴 +13%
MatrixOpsBenchmark.Concat(Count: 4096) 227.38 µs 254.93 µs 🔴 +12%
ColorParseBenchmark.Parse(Iterations: 1000) 75.06 µs 83.56 µs 🔴 +11%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 166.4 ns 183.8 ns 🔴 +10%
MatrixMapPointsBenchmark.MapRect(Points: 4096) 116.80 µs 128.81 µs 🔴 +10%
CanvasDrawBenchmark.Draw(Shapes: 64) 2.64 ms 2.87 ms 🔴 +8%
ColorMathBenchmark.ToColor(Colors: 4096) 14.57 µs 15.77 µs 🔴 +8%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 248.14 µs 264.87 µs 🔴 +7%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 12.28 µs 11.57 µs 🟢 -6%
MatrixOpsBenchmark.Invert(Count: 4096) 130.15 µs 136.67 µs 🔴 +5%

macOS

⏱️ Time (vs 🌙 nightly 4.152.0-nightly.4)

Benchmark baseline this PR Δ
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 576.47 µs 192.73 µs 🟢 -67%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 5.14 µs 2.32 µs 🟢 -55%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 615.85 µs 281.15 µs 🟢 -54%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 1.64 ms 851.81 µs 🟢 -48%
ColorMathBenchmark.PreMultiply(Colors: 4096) 19.39 µs 10.25 µs 🟢 -47%
ColorParseBenchmark.Parse(Iterations: 1000) 154.28 µs 82.03 µs 🟢 -47%
CanvasDrawBenchmark.Draw(Shapes: 512) 25.69 ms 14.09 ms 🟢 -45%
ColorMathBenchmark.ToColor(Colors: 4096) 42.20 µs 23.27 µs 🟢 -45%
ColorMathBenchmark.ToColorF(Colors: 4096) 11.11 µs 6.27 µs 🟢 -44%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 16.07 µs 9.18 µs 🟢 -43%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 3.09 ms 1.79 ms 🟢 -42%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 70.05 µs 99.02 µs 🔴 +41%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 148.5 ns 204.4 ns 🔴 +38%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) 1.07 ms 709.66 µs 🟢 -33%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 10.34 ms 7.09 ms 🟢 -31%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 150.21 µs 195.08 µs 🔴 +30%
MatrixMapPointsBenchmark.MapRect(Points: 256) 5.17 µs 3.84 µs 🟢 -26%
MatrixOpsBenchmark.Concat(Count: 4096) 115.34 µs 144.62 µs 🔴 +25%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 9.92 µs 7.45 µs 🟢 -25%
PathBoundsBenchmark.TightBounds(Points: 64) 889.7 ns 1.10 µs 🔴 +24%
RuntimeEffectShaderBenchmark.DrawFrame 534.03 µs 642.96 µs 🔴 +20%
MatrixOpsBenchmark.Invert(Count: 4096) 68.03 µs 81.82 µs 🔴 +20%
MatrixMapPointsBenchmark.MapRect(Points: 4096) 54.70 µs 65.19 µs 🔴 +19%
CanvasDrawBenchmark.Draw(Shapes: 64) 2.35 ms 1.93 ms 🟢 -18%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 1.04 ms 861.56 µs 🟢 -17%
…and 7 more

📈 Full interactive perf-dashboard & run details →

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📦 Artifact size report

Packages from this PR (build 1541124) vs the latest nightly baseline 4.152.0-nightly.4 (observed 2026-08-05).

Total .nupkg size: 569.8 MB → 569.3 MB (−579.6 KB, -0.1%)

Packages

⚠️ marks growth over 500.0 KB or 2%. Changes under 50.0 KB are treated as noise.

Package baseline this PR Δ Δ%
SkiaSharp.NativeAssets.WinUI 109.1 MB 108.5 MB 🟢 −642.1 KB -0.6%
SkiaSharp.NativeAssets.WebAssembly 69.7 MB 69.7 MB 🔴 +59.6 KB +0.1%

+38 package(s) unchanged (< 50.0 KB).

Per-file changes

SkiaSharp.NativeAssets.WinUI

File Size
runtimes/win-arm64/native/libGLESv2.pdb 64.5 MB → 64.4 MB (🟢 −128.0 KB)
runtimes/win-x86/native/libGLESv2.pdb 67.3 MB → 67.2 MB (🟢 −128.0 KB)
runtimes/win-x64/native/libGLESv2.pdb 66.6 MB → 66.5 MB (🟢 −96.0 KB)

Informational only — this never blocks the PR. Native binaries are labelled by os/arch.

Build and cache the native base in an isolated checkout pinned to the resolved parent commit and its recursive submodule gitlinks. Keep the workflow checkout untouched while the agent and delivery steps reuse the same path-safe Ninja state.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e546dddf-af7c-4a5f-b04f-2709446cc556
@mattleibow
mattleibow force-pushed the mattleibow-restore-skia-sync-prebuild branch from 2c58146 to 28c7802 Compare August 5, 2026 15:13
Keep the gh-aw checkout immutable while directing every product phase, native build, test, and delivery step to the isolated exact-base workspace. Persist the resolved parent SHA for cache-key and branch preparation consumers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e546dddf-af7c-4a5f-b04f-2709446cc556
@mattleibow

Copy link
Copy Markdown
Contributor Author

Closing for now so we can revisit the exact-base native prebuild/cache optimization later. The implementation remains pushed on the PR branch.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant