Skip to content

[migration] Make upstream Skia synchronization portable - #5005

Open
mattleibow wants to merge 2 commits into
mainfrom
mattleibow-issue-4990-portable-skia-sync
Open

[migration] Make upstream Skia synchronization portable#5005
mattleibow wants to merge 2 commits into
mainfrom
mattleibow-issue-4990-portable-skia-sync

Conversation

@mattleibow

@mattleibow mattleibow commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Description

Makes the upstream/two-repository Skia synchronization path portable for the planned mono to dotnet transfer. A small sync-local parser requires GITHUB_REPOSITORY for the current SkiaSharp repository and derives the paired Skia repository from the exact target branch's .gitmodules, then carries those identities through release-line discovery, ancestry comparison, checkout preparation, manifest reconciliation, guarded pushes, and reciprocal PR creation.

The agentic workflow stages the parser immutably before branch switches, exports explicit handoff values, and authorizes the current and destination SkiaSharp/Skia repositories while retaining explicit google/skia. The generated lock was produced only by strict deterministic compilation. Direct submodule synchronization also stages the parser before checking out a possibly older target branch and validates the matching manifest registration.

No live repository URLs, .gitmodules, cgmanifest.json, gitlinks, native source, publishing, package/site content, Backport, or unrelated agent workflows changed. The transfer cutover remains a coordinated .gitmodules plus matching cgmanifest.json data change.

Related issues

Fixes #4990

Related to #4960

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 — repository synchronization automation only; no public API or application behavior changes.

Testing

  • python3 .github/scripts/tests/skia_sync_identity_test.py -v
  • bash .github/scripts/tests/skia-sync-detect.test.sh — equivalent mono/* and simulated dotnet/* matrices covering no-op/work detection, existing sync branches, milestone bumps, release lines whose .gitmodules differs from the workflow checkout, and compare API failures
  • All .agents/skills/update-skia/scripts/*_test.py suites, including destination manifest selection and immutable staged-parser import
  • python3 -m unittest discover -s .agents/skills/ci-status/scripts/tests -p 'test_*.py' -v
  • python3 scripts/infra/caching/repo-deps.py validate — 4,854 tracked files, zero uncovered
  • gh aw compile auto-skia-sync --strict --validate --shellcheck twice with byte-identical lock SHA-256 6805073c6ac15486f5cb12f0a99fcf51c67c150478f4b83082b77bb638ae12ab
  • Shell syntax, Python byte-compilation, workflow YAML parsing, and git diff --check
  • GitHub comparison against main confirms the PR head is zero commits behind

No native, generated binding, rendering, or platform product code changed, so native/product test suites were not applicable.

Checklist

  • Tests added or updated
  • Changes above lists all public API and behavioral changes (None)
  • New/changed public API? N/A
  • Native change? N/A

@github-actions

github-actions Bot commented Sep 5, 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 -- 5005

PowerShell / Windows:

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

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-5005/packages --name skiasharp-pr-5005
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-5005

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

📊 SkiaSharp benchmarks — PR #5005

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 — 🔴 52 slower · 🟢 36 faster

  • 🔴 RuntimeEffectShaderBenchmark.DrawFrame · Linux · 2.85 ms → 4.97 ms (+74%)
  • 🔴 BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) · macOS · 702.80 µs → 1.18 ms (+67%)
  • 🔴 MatrixMapPointsBenchmark.MapPoints(Points: 256) · macOS · 130.1 ns → 209.1 ns (+61%)
  • 🔴 SceneRenderBenchmark.RenderFrame(Complexity: 4) · Linux · 18.06 ms → 27.19 ms (+51%)
  • 🔴 MatrixMapPointsBenchmark.MapPoints(Points: 4096) · macOS · 1.52 µs → 2.24 µs (+47%)
  • …and 83 more (see details below)

📦 Allocations — 🔴 1 more alloc · 🟢 0 less alloc

  • 🔴 RuntimeEffectShaderBenchmark.DrawFrame · Linux · 683 B → 730 B (+7%)
Full per-OS benchmark deltas

Linux

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

Benchmark baseline this PR Δ
RuntimeEffectShaderBenchmark.DrawFrame 2.85 ms 4.97 ms 🔴 +74%
SceneRenderBenchmark.RenderFrame(Complexity: 4) 18.06 ms 27.19 ms 🔴 +51%
SceneRenderBenchmark.RenderFrame(Complexity: 1) 3.94 ms 5.74 ms 🔴 +46%
ColorMathBenchmark.ToColor(Colors: 4096) 15.40 µs 10.68 µs 🟢 -31%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 11.44 µs 8.01 µs 🟢 -30%
ColorMathBenchmark.PreMultiply(Colors: 4096) 12.85 µs 9.21 µs 🟢 -28%
ColorParseBenchmark.Parse(Iterations: 1000) 76.88 µs 59.67 µs 🟢 -22%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 4.62 µs 3.67 µs 🟢 -20%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 2048) 2.93 ms 2.35 ms 🟢 -20%
MatrixOpsBenchmark.Invert(Count: 4096) 130.69 µs 104.97 µs 🟢 -20%
PathBoundsBenchmark.TightBounds(Points: 64) 1.09 µs 875.2 ns 🟢 -20%
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 71.94 µs 58.37 µs 🟢 -19%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 759.65 µs 623.07 µs 🟢 -18%
PathBoundsBenchmark.TightBounds(Points: 1024) 10.70 µs 8.90 µs 🟢 -17%
MatrixOpsBenchmark.Concat(Count: 4096) 217.63 µs 186.71 µs 🟢 -14%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 256.92 µs 221.02 µs 🟢 -14%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 14.23 µs 12.40 µs 🟢 -13%
CanvasDrawBenchmark.Draw(Shapes: 64) 4.15 ms 4.67 ms 🔴 +13%
CanvasDrawBenchmark.Draw(Shapes: 512) 33.14 ms 37.26 ms 🔴 +12%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 2.81 µs 2.47 µs 🟢 -12%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 223.27 µs 196.64 µs 🟢 -12%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 7.97 ms 7.19 ms 🟢 -10%
MatrixMapPointsBenchmark.MapVector(Points: 256) 10.83 µs 9.86 µs 🟢 -9%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 172.95 µs 157.87 µs 🟢 -9%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 2.06 ms 1.88 ms 🟢 -8%
…and 4 more

📦 Allocations (vs 🌙 nightly 4.152.0-nightly.26454.2)

Benchmark baseline this PR Δ
RuntimeEffectShaderBenchmark.DrawFrame 683 B 730 B 🔴 +7%

Windows

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

Benchmark baseline this PR Δ
MatrixMapPointsBenchmark.MapPoints(Points: 256) 167.1 ns 218.5 ns 🔴 +31%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 97.57 µs 126.90 µs 🔴 +30%
ColorMathBenchmark.ToColor(Colors: 4096) 15.57 µs 11.21 µs 🟢 -28%
RuntimeEffectShaderBenchmark.DrawFrame 1.12 ms 826.14 µs 🟢 -27%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 12.29 µs 9.47 µs 🟢 -23%
ColorMathBenchmark.ToColorF(Colors: 4096) 13.34 µs 15.45 µs 🔴 +16%
ColorMathBenchmark.PreMultiply(Colors: 4096) 13.23 µs 11.20 µs 🟢 -15%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 251.89 µs 287.03 µs 🔴 +14%
MatrixMapPointsBenchmark.MapRect(Points: 256) 7.18 µs 8.02 µs 🔴 +12%
CanvasDrawBenchmark.Draw(Shapes: 64) 2.72 ms 2.45 ms 🟢 -10%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 2.42 µs 2.66 µs 🔴 +10%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) 927.78 µs 837.47 µs 🟢 -10%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 735.95 µs 803.84 µs 🔴 +9%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 122.43 µs 133.55 µs 🔴 +9%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 2048) 2.90 ms 3.16 ms 🔴 +9%
MatrixMapPointsBenchmark.MapVector(Points: 256) 7.54 µs 8.15 µs 🔴 +8%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 245.14 µs 225.35 µs 🟢 -8%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 4.85 µs 4.47 µs 🟢 -8%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 8.64 µs 9.30 µs 🔴 +8%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 337.74 µs 313.39 µs 🟢 -7%
CanvasDrawBenchmark.Draw(Shapes: 512) 21.10 ms 19.72 ms 🟢 -7%
MatrixOpsBenchmark.Concat(Count: 4096) 231.23 µs 216.19 µs 🟢 -7%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 143.69 µs 151.77 µs 🔴 +6%
PathBoundsBenchmark.TightBounds(Points: 64) 1.54 µs 1.62 µs 🔴 +6%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 1.23 ms 1.17 ms 🟢 -5%
…and 1 more

macOS

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

Benchmark baseline this PR Δ
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 702.80 µs 1.18 ms 🔴 +67%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 130.1 ns 209.1 ns 🔴 +61%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 1.52 µs 2.24 µs 🔴 +47%
MatrixMapPointsBenchmark.MapRect(Points: 256) 3.02 µs 4.11 µs 🔴 +36%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 1.44 ms 1.85 ms 🔴 +29%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 213.59 µs 273.17 µs 🔴 +28%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 2048) 2.65 ms 3.34 ms 🔴 +26%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 1.17 µs 1.46 µs 🔴 +25%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 6.11 µs 7.47 µs 🔴 +22%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 5.80 ms 7.05 ms 🔴 +21%
MatrixOpsBenchmark.Concat(Count: 4096) 111.14 µs 133.80 µs 🔴 +20%
MatrixMapPointsBenchmark.MapVector(Points: 256) 2.49 µs 2.99 µs 🔴 +20%
MatrixMapPointsBenchmark.MapRect(Points: 4096) 49.14 µs 58.35 µs 🔴 +19%
PathBoundsBenchmark.TightBounds(Points: 64) 843.5 ns 1.00 µs 🔴 +19%
RuntimeEffectShaderBenchmark.DrawFrame 507.82 µs 602.63 µs 🔴 +19%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) 599.45 µs 708.87 µs 🔴 +18%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 68.18 µs 79.22 µs 🔴 +16%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 97.87 µs 113.32 µs 🔴 +16%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 140.28 µs 161.55 µs 🔴 +15%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 213.75 µs 245.95 µs 🔴 +15%
MatrixOpsBenchmark.Invert(Count: 4096) 65.04 µs 74.30 µs 🔴 +14%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 39.53 µs 44.91 µs 🔴 +14%
PathBoundsBenchmark.TightBounds(Points: 1024) 8.07 µs 9.17 µs 🔴 +14%
SceneRenderBenchmark.RenderFrame(Complexity: 4) 5.39 ms 6.08 ms 🔴 +13%
SceneRenderBenchmark.RenderFrame(Complexity: 1) 1.17 ms 1.32 ms 🔴 +13%
…and 8 more

📈 Full interactive perf-dashboard & run details →

Resolve the current SkiaSharp repository at runtime and the paired Skia repository from .gitmodules across detection, metadata, delivery, and direct submodule synchronization. Preserve guarded dual-repository delivery while validating mono, dotnet, and release-line behavior.

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

Copilot-Session: 8250c1ca-20e4-461e-bad3-9e2864ad57ea
@mattleibow
mattleibow force-pushed the mattleibow-issue-4990-portable-skia-sync branch from e0f85b3 to 63fa4c7 Compare September 5, 2026 17:39
@mattleibow
mattleibow changed the base branch from mattleibow-issue-4986-portable-repository-identity to main September 5, 2026 17:39
Read .gitmodules from the exact parent branch selected for synchronization so supported release lines cannot inherit paired-repository identity from the workflow revision.

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

Copilot-Session: 8250c1ca-20e4-461e-bad3-9e2864ad57ea
@mattleibow

Copy link
Copy Markdown
Collaborator Author

Nightly handoff:

  • Current head/base: 2608fd897ef6b62034b65c670196756ed44c4fa9main (655da2f1a0751420e81282a24e904efcd83bcb75); GitHub compare reports behind_by: 0, two commits ahead.
  • Complete: rebased the [migration] Make upstream Skia synchronization portable #4990-only synchronization slice onto current main; removed every dependency, import, staging path, and reference to the closed repository-identity foundation; added a sync-local parser that requires GITHUB_REPOSITORY and reads paired Skia identity from the exact target branch’s .gitmodules; retained explicit google/skia, ancestry failures, manifest checks, reciprocal complete PR templates, and explicit force-with-lease. PR base/body are updated for main, with no [migration] Add the portable repository identity foundation #4993/stack references.
  • Validation: mono and simulated dotnet detector matrices passed, including release-line .gitmodules differing from the workflow checkout and compare-failure behavior; 3 sync-identity tests, all 19 update-version tests, all update-skia/CI-registry suites, cache coverage (4,854 files, zero uncovered), shell/Python/YAML/diff checks passed; gh-aw 0.88.2 strict validation + shellcheck compiled twice deterministically (6805073c6ac15486f5cb12f0a99fcf51c67c150478f4b83082b77bb638ae12ab). Live PR diff contains no foundation files or references.
  • Remaining next: wait for the newly triggered GitHub/Azure checks to finish. Automation Tooling Tests is already green; broader Pages/benchmark/Azure jobs are still running.
  • Blockers: none.
  • Reviewable: yes.

@github-actions

github-actions Bot commented Sep 5, 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.

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[migration] Make upstream Skia synchronization portable

1 participant