Skip to content

[skia-sync] Merge upstream Skia main (tip)#4255

Closed
mattleibow wants to merge 1 commit into
mainfrom
skia-sync/main
Closed

[skia-sync] Merge upstream Skia main (tip)#4255
mattleibow wants to merge 1 commit into
mainfrom
skia-sync/main

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Automated bleeding-edge sync from the tip of upstream Skia (google/skia main).

Companion skia PR: mono/skia#267

SkiaSharp side of Skia main tip sync (m150 tip, no version bump)

This PR is the parent-repo half of a bleeding-edge sync from google/skia main. The
companion mono/skia PR (head branch skia-sync/main) carries the actual upstream merge.

Because main is the in-development upstream tip rather than a chrome/m<N> milestone
branch, and CURRENT == TARGET == 150, this is NOT a version bump. The milestone,
soname, and NuGet versions are deliberately left alone. The only parent-repo changes are
cgmanifest.json (commit hash + upstream merge commit) and the externals/skia submodule
pointer.

Parent-repo changes

File Change
externals/skia (submodule pointer) b16789ec3540beaa43e8a71b050d9d328eb68025cd67ad79830bdf6fd7f09f2e5328cf85aa06b10d
cgmanifest.json mono/skia commitHash cd67ad79830bdf6fd7f09f2e5328cf85aa06b10d
cgmanifest.json upstream_merge_commit 14d05ec761901b6e9e9193af8b347ab3a7f6fed0e793ca20f32abea8f96876d33c7ddabd3e5ed2d8

Untouched (intentionally — this is not a milestone bump):

  • scripts/VERSIONS.txt (milestone, soname, NuGet versions)
  • scripts/azure-templates-variables.yml (SKIASHARP_VERSION)
  • cgmanifest.json chrome_milestone (stays at 150) and version (stays at chrome/m150)
  • externals/skia/include/c/sk_types.h (SK_C_INCREMENT stays at 0)

Version files audit

libSkiaSharp     milestone    150     ← unchanged
libSkiaSharp     increment    0       ← unchanged (no new C API exports this sync)
SK_C_INCREMENT   0                    ← unchanged
SK_MILESTONE     150                  ← pinned in submodule (upstream had flipped to 151)
chrome_milestone 150                  ← unchanged
version          chrome/m150          ← unchanged

Binding changes

regenerate-bindings.ps1 ran cleanly. No SkiaApi.generated.cs diff — the C API surface
is byte-for-byte unchanged versus origin/main. (Header-rename churn upstream did not touch
any of the C API entry points; the only adjustment our shim needed was an
#include "include/private/SkTemplates.h" path fix in src/c/sk_font.cpp.)

HarfBuzz generated bindings were reverted as required (HarfBuzz updates are always separate
from Skia milestone updates).

C# wrapper changes

None. No new internal static P/Invoke declarations were generated, so there is nothing to
wrap. ABI surface unchanged.

Breaking change analysis

No breaking changes to the public SkiaSharp surface introduced by this sync.

Behavioural notes for downstream consumers:

  • Upstream AtlasTextOp stride-mismatch handling was tightened from "log + early-return" to
    SkASSERTF_RELEASE. This is internal to the Ganesh text op path; SkiaSharp does not expose
    it directly, and the condition has historically not fired in tests, but a release-mode hit
    would now abort rather than silently skip. Recorded under "items needing human attention".
  • LCD-on-SDF disabling: upstream's 95dbfa24e0 uses
    sk_ieee_float_divide(1.f, getMinScale()) where our pre-merge cherry-pick had
    getMaxScale(). Upstream's form is the authoritative one going forward; visible behaviour
    is equivalent on regular-scale draws and slightly different for extreme-anisotropic-scale
    draws. No SkiaSharp test regressions.

Build & test results (Linux x64)

Step Result
dotnet tool restore
dotnet cake --target=externals-linux --arch=x64 --gnArgs "skia_use_partition_alloc=false" ✅ libSkiaSharp.so + libHarfBuzzSharp.so
pwsh ./utils/generate.ps1 (via regenerate-bindings.ps1) ✅ no API diff
dotnet build binding/SkiaSharp/SkiaSharp.csproj ✅ 0 warnings, 0 errors
dotnet test tests/SkiaSharp.Tests.Console/SkiaSharp.Tests.Console.csproj Passed: 5569 / Skipped: 172 / Failed: 0 (`net10.0

Test output is preserved at /tmp/gh-aw/agent/test-output.txt (uploaded as workflow artifact).

Items needing human attention

  1. Upstream is on milestone 151; SkiaSharp is still on 150. Upstream main's
    SkMilestone.h was flipped from 150 → 151 by chrome-branch-day (commit d30d2a1958).
    The companion mono/skia PR pins it back to 150 inside the submodule so the build's
    internal version check passes. A reviewer should decide whether the next sync should:
    • keep the pin (continuing to track tip without promoting our line); or
    • graduate SkiaSharp to m151 (would touch scripts/VERSIONS.txt, cgmanifest.json
      chrome_milestone/version, soname, and ~30 NuGet version lines, plus drop the
      SkMilestone.h pin in mono/skia). The existing update-versions.ps1 script handles
      all of that automatically when invoked with -Current 150 -Target 151.
  2. skia_use_partition_alloc=false is passed as a CLI gn arg, not baked into
    native/**/build.cake.
    This works (and complies with the workflow rule against
    modifying native build files) but is not durable — the next time someone runs
    dotnet cake --target=externals-linux without that flag, the build will fail because
    partition_alloc.gni is missing from our fork's DEPS. Recommend a follow-up to either
    (a) re-enable partition_alloc in externals/skia/DEPS, or (b) wire
    skia_use_partition_alloc=false into the platform build.cake files once the next
    real milestone bump rolls in.
  3. All in-tree [M150] cherry-picks were upstreamed and dropped by the merge. This is
    the expected outcome of catching up to main, but it does mean any downstream consumers
    carrying additional patches on top of skiasharp should rebase carefully.

Other notes

  • Native build environment was already provisioned (clang, libc++-dev/libc++abi-dev,
    fontconfig, ninja). No host packages were installed during the sync.
  • externals-download was not used at any point during this sync. The shipped native
    binary comes from a fresh source build off the new merge.
  • depot_tools' gclient_paths.py was touched by git-sync-deps (cache artifact); not
    committed.

Created by skia-upstream-sync.

Merge ~291 upstream commits from google/skia main HEAD
(e793ca20f32abea8f96876d33c7ddabd3e5ed2d8) into the mono/skia
skiasharp branch.

This is a bleeding-edge sync from upstream Skia main, not a
chrome/m<N> milestone branch. CURRENT == TARGET == m150, so this
is NOT a version bump — the milestone, soname, and nuget versions
remain unchanged.

Submodule changes (mono/skia skia-sync/main):
- Merge commit a2658b789b with 7 conflicts resolved.
- Post-merge fixup commit cd67ad7983 to pin SkMilestone back to 150
  and update the C API include path for the upstream private/base ->
  private header move.

Parent repo changes:
- cgmanifest.json: bump mono/skia commitHash to cd67ad7983 and set
  upstream_merge_commit to e793ca20f3.
- chrome_milestone remains 150 and version remains chrome/m150.

The upstream main HEAD has flipped to milestone 151 (chrome-branch-day
commit d30d2a1958), but we are not bumping our user-facing milestone
in this tip-mode sync. See the PR summary for the human-attention items
this raises.

All M150-line cherry-picks made it to upstream main and were dropped
by the merge:
- Turn off LCD in SDF slugs (upstream 95dbfa24e0)
- Prevent overflow in StrokeTessellateOp (upstream dcf3ebf072)
- Reject Slugs with perspective creationMatrix (upstream a145861ad1)
- Data Race fix on fStream in SkTypeface_Mac (upstream ba3ee9b265)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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 -- 4255

PowerShell / Windows:

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

Step 2 — Add the local NuGet source

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

mattleibow added a commit that referenced this pull request Jun 26, 2026
Add a main (tip) mode to the Skia upstream sync (#4254)

The auto-skia-sync workflow could only track chrome/m<N> milestone
branches (current/next/latest). There was no way to sync against the
in-development tip of upstream Skia, so we couldn't smoke-test bleeding-
edge API/binding changes ahead of a milestone branch cut.

Add a dispatch-only `main` mode that merges google/skia `main` HEAD into
SkiaSharp `main` / mono/skia `skiasharp`. It is explicitly NOT a version
bump: the target milestone stays equal to main's current milestone (no
soname/nuget/milestone changes), and it uses a distinct head branch so a
tip sync never collides with the `current` milestone sync branch.

Changes:

  * skia-sync-detect.sh: introduce an UPSTREAM_REF concept (the google/skia
    ref we merge *from*) so the gate and prompt aren't hardcoded to
    chrome/m<TARGET>. `mode=main` resolves UPSTREAM_REF=main,
    TARGET=MAIN_MS, HEAD_BRANCH=skia-sync/main; all other modes keep
    chrome/m<TARGET> + skia-sync/m<TARGET>. Release detection stays skipped
    for main (TARGET == MAIN_MS), so current == target. Emit a new
    upstream_ref output and gate on ${UPSTREAM_REF}.
  * auto-skia-sync.md: add `main` to the workflow_dispatch mode options,
    surface upstream_ref as a pre-activation output / in the prompt header /
    in the skia-sync-env.sh heredoc, fetch the resolved upstream ref in
    Phase 1 instead of a hardcoded chrome/m<target>, and document the
    tip/bleeding-edge semantics. Lock recompiled (model + native build setup
    unchanged).
  * skia-sync-push-prs.sh: make PR titles/bodies UPSTREAM_REF-aware
    ("Merge upstream Skia main (tip)" vs the milestone titles), defaulting
    to chrome/m<TARGET> when unset for backward compat.

Validation: `gh aw compile` = 0 errors (claude-opus-4.7 preserved);
shellcheck --severity=style clean on all three scripts; a stubbed detect
smoke test confirms current/next/latest/main/default/--milestone N/empty-
milestone resolve correctly and that mode=main yields upstream_ref=main,
head_branch=skia-sync/main, target == current == main's milestone.

A real dispatched run of the new path (actions/runs/28208236195) gated
PROCEED, merged the main tip (~291 commits, 7 conflicts all resolved),
built and tested green on Linux x64 (5569 passed / 0 failed), and opened
the expected draft PRs #4255 and mono/skia#267.

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mattleibow

Copy link
Copy Markdown
Contributor Author

Closing stale skia-sync validation branch/PR to give the refactored auto-skia-sync workflow a clean slate for a fresh run.

@mattleibow mattleibow closed this Jun 26, 2026
@mattleibow mattleibow deleted the skia-sync/main branch June 26, 2026 20:30
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