Skip to content

[MetalPerformanceShaders] Update bindings up to Xcode 27.0 Beta 3 - #26206

Merged
dalexsoto merged 3 commits into
xcode27.0from
dev/alex/xc27-MetalPerformanceShaders
Jul 22, 2026
Merged

[MetalPerformanceShaders] Update bindings up to Xcode 27.0 Beta 3#26206
dalexsoto merged 3 commits into
xcode27.0from
dev/alex/xc27-MetalPerformanceShaders

Conversation

@dalexsoto

Copy link
Copy Markdown
Member

Summary

  • Bind the Xcode 27 low-precision MPSDataType formats.
  • Add the Metal 4 NDArray encode and reshape APIs, including a safe managed dimension-array overload.
  • Add targeted MPSNDArrayIdentity tests and remove the resolved xtro todo files.

Validation

  • make world
  • Clean xtro regeneration/classification: sanity passed
  • Clean cecil run: 112 passed, 4 skipped
  • iOS 27 introspection: 44 passed
  • tvOS 27 introspection: 43 passed
  • macOS introspection: 32 passed, 2 OS-gated
  • Mac Catalyst selector/signature/field/protocol/PInvoke fixtures passed; the full ctor run hit the known unsigned-app TCC crash in CLLocationButton
  • Targeted monotouch tests passed on iOS/tvOS 27 and macOS/Mac Catalyst
  • App size tests: 16 skipped because beta Xcode disables the suite

Add the Xcode 27 MetalPerformanceShaders low-precision data types and Metal 4 NDArray encoding and reshape APIs across all supported Apple platforms.

Add a safe managed wrapper and targeted tests for the dimension-array reshape overload, and remove the resolved xtro todo files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5f43c3ca-a18a-496c-8276-c54876ecb4d7
Copilot AI review requested due to automatic review settings July 21, 2026 00:15
@dalexsoto dalexsoto added this to the xcode27 milestone Jul 21, 2026
@dalexsoto
dalexsoto requested a review from rolfbjarne July 21, 2026 00:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the MetalPerformanceShaders bindings to Xcode 27.0 Beta 3 by adding newly introduced low-precision MPSDataType enum values and new MPS NDArray reshape/encode APIs (including Metal 4 command-encoder entry points), alongside targeted tests and xtro todo cleanups.

Changes:

  • Added Xcode 27 low-precision MPSDataType values (Float4E2M1, Float8E4M3, Float8E5M2, Float8E8M0).
  • Bound new MPS NDArray reshape APIs (CPU reshape + Metal 4 command encoder reshape/encode selectors), plus a managed nuint[] overload for the dimension-pointer variant.
  • Added MPSNDArrayIdentity tests and removed now-resolved xtro .todo files for MetalPerformanceShaders.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/xtro-sharpie/api-annotations-dotnet/tvOS-MetalPerformanceShaders.todo Removed resolved xtro todo entries (file removed).
tests/xtro-sharpie/api-annotations-dotnet/macOS-MetalPerformanceShaders.todo Removed resolved xtro todo entries (file removed).
tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-MetalPerformanceShaders.todo Removed resolved xtro todo entries (file removed).
tests/xtro-sharpie/api-annotations-dotnet/iOS-MetalPerformanceShaders.todo Removed resolved xtro todo entries (file removed).
tests/monotouch-test/MetalPerformanceShaders/MPSNDArrayIdentityTest.cs Added targeted tests for new enum values and NDArray reshape APIs (including Metal 4 encoder path).
src/MetalPerformanceShaders/MPSNDArrayIdentity.cs Added managed nuint[] overload for Metal 4 reshape that forwards to the pointer-based binding.
src/MetalPerformanceShaders/MPSEnums.cs Added new Xcode 27 MPSDataType low-precision formats.
src/metalperformanceshaders.cs Added new binding definitions for Metal 4 NDArray encode/reshape and CPU reshape selector.

Comment on lines +39 to +49
public void ReshapeWithMtl4CommandEncoder (IMTL4ComputeCommandEncoder encoder, MPSNDArray sourceArray, nuint [] dimensionSizes, MPSNDArray destinationArray)
{
if (dimensionSizes is null)
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (dimensionSizes));

unsafe {
fixed (nuint* dimensionsPtr = dimensionSizes) {
_ReshapeWithMtl4CommandEncoder (encoder, sourceArray, (nuint) dimensionSizes.Length, (IntPtr) dimensionsPtr, destinationArray);
}
}
}
@dalexsoto
dalexsoto enabled auto-merge (squash) July 21, 2026 01:42
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run xamarin-macios-sim-pr-tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run xamarin-macios-sim-pr-tests

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Comment thread src/metalperformanceshaders.cs Outdated
Allow SupportedSimulator and UnsupportedSimulator attributes on binding methods and verify their per-platform emission with bgen tests.

Annotate the MetalPerformanceShaders Metal 4 methods and managed reshape wrapper as unavailable on iOS and tvOS simulators.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5f43c3ca-a18a-496c-8276-c54876ecb4d7
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts on this branch.

Co-authored-by: dalexsoto <204671+dalexsoto@users.noreply.github.com>
auto-merge was automatically disabled July 22, 2026 12:10

Head branch was pushed to by a user without write access

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Resolved on d11712b201.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: d11712b201b1c71e823de7f46cb3c7c2ee96b292 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [CI Build #57c4e9e] Prepare .NET Release succeeded ✅

📦 Published NuGet packages (32 packages)

iOS

  • Microsoft.iOS.Ref.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.ios-arm64.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.ios.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.iossimulator-arm64.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.iOS.Runtime.iossimulator-x64.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.iOS.Sdk.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.iOS.Templates.27.0.10343-xcode27.0.nupkg
  • Microsoft.iOS.Windows.Sdk.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.NET.Sdk.iOS.Manifest-10.0.400-preview.0.27.0.10343-xcode27.0.nupkg

MacCatalyst

  • Microsoft.MacCatalyst.Ref.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Sdk.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.MacCatalyst.Templates.27.0.10343-xcode27.0.nupkg
  • Microsoft.NET.Sdk.MacCatalyst.Manifest-10.0.400-preview.0.27.0.10343-xcode27.0.nupkg

macOS

  • Microsoft.macOS.Ref.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.macOS.Runtime.osx-arm64.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.macOS.Runtime.osx-x64.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.macOS.Runtime.osx.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.macOS.Sdk.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.macOS.Templates.27.0.10343-xcode27.0.nupkg
  • Microsoft.NET.Sdk.macOS.Manifest-10.0.400-preview.0.27.0.10343-xcode27.0.nupkg

tvOS

  • Microsoft.NET.Sdk.tvOS.Manifest-10.0.400-preview.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.tvOS.Ref.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvos-arm64.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvos.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-arm64.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-x64.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.tvOS.Sdk.net10.0_27.0.27.0.10343-xcode27.0.nupkg
  • Microsoft.tvOS.Templates.27.0.10343-xcode27.0.nupkg

Other

  • Sharpie.Bind.Tool.27.0.0.343-xcode27.0.nupkg

Pipeline on Agent
Hash: 57c4e9eaf2689065bad8b2d93e8af04706c40c6b [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #d11712b] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 3 tests failed, 192 tests passed.

Failures

❌ monotouch tests (iOS) [attempt 2]

3 tests failed, 16 tests passed.

Failed tests

  • monotouch-test/iOS - simulator/Debug (PrepareAssemblies, inline dlfcn, dont link): LaunchTimedOut
  • monotouch-test/iOS - simulator/Debug (static registrar): TimedOut
  • monotouch-test/iOS - simulator/Release (compat inline dlfcn): TimedOut

Html Report (VSDrops) Download

Successes

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 19 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download
⚠️ Tests on macOS Golden Gate (27): Tests skipped, incorrect beta version. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: d11712b201b1c71e823de7f46cb3c7c2ee96b292 [PR build]

@dalexsoto
dalexsoto merged commit 85f33ed into xcode27.0 Jul 22, 2026
53 of 55 checks passed
@dalexsoto
dalexsoto deleted the dev/alex/xc27-MetalPerformanceShaders branch July 22, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants