Skip to content

Require deterministic Android native symbol identity - #4843

Merged
mattleibow merged 1 commit into
mainfrom
mattleibow-android-symbol-id
Aug 21, 2026
Merged

mattleibow merged 1 commit into
mainfrom
mattleibow-android-symbol-id

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Description

Emit deterministic SHA-1 GNU build IDs for the Android SkiaSharp and HarfBuzzSharp native libraries. After splitting debug symbols, the Android build now requires the stripped module and .so.dbg file to retain the same nonempty build ID and requires .gnu_debuglink to name the matching symbol file. This gives symbol tooling a stable identity for resolving split Android debug artifacts.

Related issues

None.

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 — build-only native symbol metadata enforcement; no public API or runtime behavior changes.

Testing

  • dotnet cake native/android/build.cake --target=Default --configuration=Release --arch=arm64 --ndk="$HOME/Library/Android/sdk/ndk/29.0.14206865" source-built both Android libraries and passed the new post-strip checks.
    • libSkiaSharp.so and libSkiaSharp.so.dbg: matching build ID eedaeb4a564e6d4a0d8ab0c6c2d273f5de5d84d2; debug link libSkiaSharp.so.dbg.
    • libHarfBuzzSharp.so and libHarfBuzzSharp.so.dbg: matching build ID adbfa4ee04450149c06c855117eba2dd6c76771c; debug link libHarfBuzzSharp.so.dbg.
  • Independently verified both identity pairs and debug-link names with the NDK llvm-readelf.
  • dotnet cake --target=externals-macos --arch=arm64 passed to produce host natives from source.
  • dotnet test tests/SkiaSharp.Tests.Console.slnx -p:TargetFramework=net10.0 -p:TargetFrameworks=net10.0 passed 6,142 tests across all hosts; one unrelated existing macOS ganesh-gl/DiagonalLines visual-golden comparison failed. CI will provide the authoritative artifact and test validation.

No focused unit test was added because the behavior is exercised and enforced directly by the Android source-build symbol extraction step.

Checklist

  • Tests added or updated (not added; build-time enforcement and source-build validation are described above)
  • Changes above lists all public API and behavioral changes (or "None.")
  • New/changed public API? N/A
  • Native change? Android linker/symbol metadata only; no Skia/C API change, generated binding change, or companion mono/skia PR required

Emit SHA-1 GNU build IDs for both Android native libraries and verify that stripped modules retain matching split-debug identities and valid debug links.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 70ef3c77-9d05-43ad-afbe-297dabd3f05f
@github-actions

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

PowerShell / Windows:

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

Step 2 — Add the local NuGet source

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

@github-actions

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

Copy link
Copy Markdown
Contributor

📊 SkiaSharp benchmarks — PR #4843

⭐ 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 — 🔴 62 slower · 🟢 3 faster

  • 🔴 MatrixOpsBenchmark.Invert(Count: 4096) · macOS · 65.14 µs → 113.25 µs (+74%)
  • 🔴 RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) · Linux · 76.38 µs → 105.92 µs (+39%)
  • 🔴 MatrixMapPointsBenchmark.MapPoints(Points: 256) · Linux · 169.1 ns → 233.9 ns (+38%)
  • 🔴 MatrixMapPointsBenchmark.MapPoint(Points: 256) · Linux · 3.88 µs → 5.16 µs (+33%)
  • 🔴 MatrixMapPointsBenchmark.MapPoint(Points: 4096) · Linux · 62.44 µs → 81.76 µs (+31%)
  • …and 60 more (see details below)
Full per-OS benchmark deltas

Linux

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

Benchmark baseline this PR Δ
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 76.38 µs 105.92 µs 🔴 +39%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 169.1 ns 233.9 ns 🔴 +38%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 3.88 µs 5.16 µs 🔴 +33%
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 62.44 µs 81.76 µs 🔴 +31%
MatrixMapPointsBenchmark.MapVector(Points: 256) 9.11 µs 11.90 µs 🔴 +31%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 9.71 µs 12.66 µs 🔴 +30%
MatrixOpsBenchmark.Invert(Count: 4096) 115.26 µs 148.82 µs 🔴 +29%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 6.27 ms 8.10 ms 🔴 +29%
ColorParseBenchmark.Parse(Iterations: 1000) 59.56 µs 76.86 µs 🔴 +29%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 1.08 ms 1.40 ms 🔴 +29%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 11.73 µs 15.13 µs 🔴 +29%
CanvasDrawBenchmark.Draw(Shapes: 64) 3.39 ms 4.37 ms 🔴 +29%
RuntimeEffectShaderBenchmark.DrawFrame 2.35 ms 3.03 ms 🔴 +29%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 2048) 2.22 ms 2.85 ms 🔴 +29%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 571.77 µs 735.88 µs 🔴 +29%
ColorMathBenchmark.PreMultiply(Colors: 4096) 11.26 µs 14.49 µs 🔴 +29%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 289.29 µs 372.10 µs 🔴 +29%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 1.60 ms 2.06 ms 🔴 +29%
MatrixMapPointsBenchmark.MapRect(Points: 4096) 156.91 µs 201.61 µs 🔴 +28%
PathBoundsBenchmark.TightBounds(Points: 1024) 8.73 µs 11.21 µs 🔴 +28%
SceneRenderBenchmark.RenderFrame(Complexity: 1) 3.20 ms 4.10 ms 🔴 +28%
CanvasDrawBenchmark.Draw(Shapes: 512) 27.22 ms 34.85 ms 🔴 +28%
SceneRenderBenchmark.RenderFrame(Complexity: 4) 14.83 ms 18.98 ms 🔴 +28%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 189.57 µs 242.02 µs 🔴 +28%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 1.98 µs 2.53 µs 🔴 +28%
…and 9 more

Windows

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

Benchmark baseline this PR Δ
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 100.02 µs 129.51 µs 🔴 +29%
PathBoundsBenchmark.TightBounds(Points: 1024) 15.77 µs 20.23 µs 🔴 +28%
PathBoundsBenchmark.TightBounds(Points: 64) 1.49 µs 1.91 µs 🔴 +28%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 162.9 ns 207.8 ns 🔴 +28%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 8.78 µs 10.81 µs 🔴 +23%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 249.01 µs 301.61 µs 🔴 +21%
MatrixMapPointsBenchmark.MapRect(Points: 256) 7.27 µs 8.69 µs 🔴 +20%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 140.55 µs 167.96 µs 🔴 +20%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 121.42 µs 138.44 µs 🔴 +14%
MatrixOpsBenchmark.Concat(Count: 4096) 228.24 µs 256.85 µs 🔴 +13%
ColorParseBenchmark.Parse(Iterations: 1000) 74.77 µs 84.04 µs 🔴 +12%
MatrixMapPointsBenchmark.MapVector(Points: 256) 8.12 µs 9.08 µs 🔴 +12%
MatrixMapPointsBenchmark.MapRect(Points: 4096) 115.78 µs 129.32 µs 🔴 +12%
CanvasDrawBenchmark.Draw(Shapes: 512) 21.07 ms 22.95 ms 🔴 +9%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 2.23 µs 2.39 µs 🔴 +7%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 12.23 µs 11.50 µs 🟢 -6%

macOS

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

Benchmark baseline this PR Δ
MatrixOpsBenchmark.Invert(Count: 4096) 65.14 µs 113.25 µs 🔴 +74%
PathBoundsBenchmark.TightBounds(Points: 64) 844.3 ns 1.10 µs 🔴 +30%
CanvasDrawBenchmark.Draw(Shapes: 64) 1.40 ms 1.76 ms 🔴 +26%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 142.00 µs 178.87 µs 🔴 +26%
MatrixOpsBenchmark.Concat(Count: 4096) 112.96 µs 140.07 µs 🔴 +24%
PathBoundsBenchmark.TightBounds(Points: 1024) 8.02 µs 9.64 µs 🔴 +20%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 66.90 µs 79.21 µs 🔴 +18%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 130.6 ns 152.3 ns 🔴 +17%
SceneRenderBenchmark.RenderFrame(Complexity: 1) 1.18 ms 1.30 ms 🔴 +10%
CanvasDrawBenchmark.Draw(Shapes: 512) 11.19 ms 12.28 ms 🔴 +10%
ColorMathBenchmark.ToColorF(Colors: 4096) 4.90 µs 5.35 µs 🔴 +9%
SceneRenderBenchmark.RenderFrame(Complexity: 4) 5.39 ms 5.78 ms 🔴 +7%
RuntimeEffectShaderBenchmark.DrawFrame 508.40 µs 544.16 µs 🔴 +7%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 191.27 µs 203.64 µs 🔴 +6%
MatrixMapPointsBenchmark.MapRect(Points: 256) 3.02 µs 3.19 µs 🔴 +6%

📈 Full interactive perf-dashboard & run details →

@mattleibow
mattleibow merged commit f7c6cad into main Aug 21, 2026
83 of 86 checks passed
@mattleibow
mattleibow deleted the mattleibow-android-symbol-id branch August 21, 2026 19:36
@github-actions

Copy link
Copy Markdown
Contributor

📦 Artifact size report

Packages from this PR (build 1562895) vs the latest nightly baseline 4.152.0-nightly.38 (observed 2026-08-21).

Total .nupkg size: 569.3 MB → 568.8 MB (−530.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.0 MB 108.3 MB 🟢 −677.6 KB -0.6%
HarfBuzzSharp.NativeAssets.Win32 20.7 MB 20.8 MB 🔴 +69.6 KB +0.3%
SkiaSharp.NativeAssets.WebAssembly 69.7 MB 69.7 MB 🔴 +58.3 KB +0.1%

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

Per-file changes

HarfBuzzSharp.NativeAssets.Win32

File Size
runtimes/win-x86/native/libHarfBuzzSharp.pdb 22.0 MB → 22.2 MB (🔴 +264.0 KB)
runtimes/win-arm64/native/libHarfBuzzSharp.pdb 22.3 MB → 22.5 MB (🔴 +184.0 KB)

SkiaSharp.NativeAssets.WinUI

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

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

@github-actions github-actions Bot added this to the 4.152.0-rc.1 milestone Sep 7, 2026
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.

2 participants