Skip to content

[Metal] Update bindings up to Xcode 27.0 RC1 - #26594

Merged
dalexsoto merged 1 commit into
xcode27.0from
dev/alex/xc27-Metal
Sep 11, 2026
Merged

dalexsoto merged 1 commit into
xcode27.0from
dev/alex/xc27-Metal

Conversation

@dalexsoto

Copy link
Copy Markdown
Member

Summary

Update the remaining Metal bindings for Xcode 27.0 RC1. All 32 diagnostics
in each platform's Metal.todo are resolved (128 total), and the four
completed .todo files are removed.

API Added surface
MTLPixelFormat Twelve three-channel RGB8/RGB16/RGB32 formats
MTLGpuFamily Apple11 = 1011
MTLContentionRelief Automatic, None
MTLForwardProgressUsage Automatic, Weak, SimdGroupParallel
MTLComputePipelineDescriptor, MTL4ComputePipelineDescriptor ForwardProgressUsage, ContentionRelief, OptimizeForPersistentKernel
IMTLComputePipelineState ForwardProgressUsage, GetRecommendedPersistentThreadgroupsPerGrid
IMTLTexture, MTLTextureViewDescriptor MinLod

All additions target iOS, tvOS, macOS, and Mac Catalyst. Introduction
versions come from generated references and native headers: 27.0 except
Apple11, which inherits its enum's availability because Apple supplies
no per-member availability annotation.

The bindings preserve native signedness, NSUInteger/MTLSize signatures,
required protocol semantics, and existing protocol code-generation
settings. IMTLTexture.MinLod is explicitly unsupported in iOS/tvOS
simulators, matching their headers; the two existing descriptor classes
retain their simulator exclusions.

Meaningful XML documentation covers every added public API, including
the texture-buffer-only/no-shader-write restriction for the RGB formats.
Introspection's existing spelling vocabulary gains the legitimate Simd
acronym. No API-diff suppressions, documentation baselines, or unrelated
runtime-test exclusions are added.

Validation

Started with make world on the unchanged checkout and used make world
again for the binding rebuild/install. A transient NuGet audit-feed
failure during installation was resolved by retrying the full command;
auditing was not disabled.

Suite / platform Result
Final clean xtro, all four platforms Passed; all reference bindings regenerated, all classification stamps removed/rebuilt, Sanity check passed
Final clean Cecil 112 passed, 4 standard skips; documentation checks pass without baseline changes
iOS 27.0 introspection 44 passed
tvOS 27.0 introspection 43 passed
macOS introspection 32 passed, 2 ignored
Mac Catalyst introspection 38 checks passed across the full-run prefix and individually completed fixtures; 4 ignored; DefaultCtorAllowed blocked as described below
Final clean app-size tests 16 executed: 14 passed, 2 exceeded the size threshold as described below
Monotouch tests Not applicable: no manual bindings or monotouch-test files changed

Runtime coverage limitation: the host runs macOS 26.6.2 / Mac Catalyst
26.6, so 27.0-only desktop APIs are availability-gated. iOS/tvOS tests ran
on isolated 27.0 simulators; simulator-unsupported APIs remain
unexercised. The full Mac Catalyst run aborts in the existing
CLLocationButton default-constructor check with
__TCC_CRASHING_DUE_TO_PRIVACY_VIOLATION__. All other applicable checks,
including the two other constructor checks, completed separately. No
privacy settings or source exclusions were changed to hide this limit.

App-size result: this RC branch has no committed expected-size files
and normally skips the fixture for preview Xcode. To perform a meaningful
comparison, all 16 cases first built the unchanged base commit
39f54ff90a75ea438c6aed8ba21f00a630b6e1b2, with RC execution explicitly
enabled, and captured a temporary reference. The final clean run compared
against that untouched reference with both baseline-writing switches
unset.

All 14 trimmed/NativeAOT configurations have exactly unchanged app sizes,
and the six preserved-API comparisons are unchanged. Both untrimmed
universal macOS CoreCLR configurations grow by 17,408 bytes, exceeding
the existing 10,240-byte tolerance: the only file-size changes are the
arm64 and x64 copies of Microsoft.macOS.dll, each 8,704 bytes larger
after adding the bindings. No bundle files are added or removed. The
reference expectations were not overwritten or committed; the comparison
results and diffs were preserved locally.

The change was rubber-duck reviewed with GPT-6 Astra and Opus 5 at maximum
reasoning, including native declarations and four-platform generated
interface/wrapper integration.

Bind the remaining Metal APIs reported by the Xcode 27.0 RC1 headers
on iOS, tvOS, macOS, and Mac Catalyst:

- Add the twelve RGB8/RGB16/RGB32 pixel formats and Apple11 GPU family.
- Add the native MTLContentionRelief and MTLForwardProgressUsage enums.
- Expose forward-progress, contention-relief, and persistent-kernel
  options on both compute pipeline descriptor classes.
- Expose compute pipeline forward-progress usage and the recommended
  persistent threadgroup count, together with texture/view minimum LOD.

Match native integer widths, required protocol members, and per-platform
availability. Preserve header-inherited availability for Apple11 and mark
the new texture minimum-LOD member unavailable in iOS/tvOS simulators.
Document the new APIs, including texture-buffer-only RGB format usage.

Recognize the SIMD acronym in introspection's spelling dictionary without
changing the managed SimdGroupParallel name or skipping any binding tests.
Remove all four Metal.todo files after resolving their 128 diagnostics.

Validation includes make world, final clean xtro and Cecil runs, and
introspection on all four platforms. The Mac Catalyst default-constructor
test is blocked by the host's CLLocationButton TCC privacy abort; remaining
checks pass. The independent unchanged-build app-size comparison passes
14/16 cases; both untrimmed universal macOS cases grow by 17,408 bytes from
the two updated binding-assembly copies. No thresholds, expected-size
baselines, API-diff suppressions, or unrelated runtime skips are changed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 693751e1-f3b2-452e-9ddc-da53aa1cd711
Copilot AI lite review requested due to automatic review settings September 11, 2026 02:16
@dalexsoto dalexsoto added this to the xcode27 milestone Sep 11, 2026

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.

🟡 Changes recommended

The unresolved Apple11 availability issue and app-size gate exceedance must be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates Metal bindings for Xcode 27.0 RC1 across iOS, tvOS, macOS, and Mac Catalyst.

Changes:

  • Adds new Metal formats, enums, pipeline APIs, and texture properties.
  • Updates introspection support for Simd.
  • Removes four completed platform diagnostics files.
File summaries
File Summary Review notes
tests/xtro-sharpie/api-annotations-dotnet/tvOS-Metal.todo Removes resolved diagnostics. —
tests/xtro-sharpie/api-annotations-dotnet/macOS-Metal.todo Removes resolved diagnostics. —
tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Metal.todo Removes resolved diagnostics. —
tests/xtro-sharpie/api-annotations-dotnet/iOS-Metal.todo Removes resolved diagnostics. —
tests/introspection/ApiTypoTest.cs Recognizes the Simd acronym. —
src/Metal/MTLEnums.cs Adds Xcode 27 Metal enum values and types. Add explicit 27.0 availability attributes for Apple11 (moderate, 2 votes). The 17,408-byte untrimmed macOS app-size increase exceeds the 10,240-byte tolerance and requires resolution (critical, 1 vote).
src/metal.cs Adds pipeline, texture, and texture-view bindings. —
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread src/Metal/MTLEnums.cs
Comment on lines +437 to +441
/// <summary>A three-channel, 8-bit-per-channel normalized unsigned integer RGB format for texture buffers without shader-write usage.</summary>
[Mac (27, 0), iOS (27, 0), MacCatalyst (27, 0), TV (27, 0)]
RGB8Unorm = 45,
/// <summary>A three-channel, 8-bit-per-channel normalized signed integer RGB format for texture buffers without shader-write usage.</summary>
[Mac (27, 0), iOS (27, 0), MacCatalyst (27, 0), TV (27, 0)]
Comment thread src/Metal/MTLEnums.cs
[Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0), TV (26, 0)]
Apple10 = 1010,
/// <summary>The Apple11 GPU family.</summary>
Apple11 = 1011,
@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: ac7dbba6b071840c5662d1ff7011da3b9059fd98 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@jonathanpeppers jonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

⚠️ Needs Changes — No additional code-level findings beyond the existing inline threads; I avoided duplicating them.

The required xamarin-macios-sim-pr-tests check is not green. Azure build 15287821 currently reports both macOS 26 monotouch-test runs failing with connection timeouts (69 failures per architecture), while the binding-relevant build, API-diff, introspection, Cecil, and xtro jobs pass; the iOS linker job is still pending. The timeout pattern appears unrelated to this Metal-only diff, but the required check must be rerun or otherwise cleared before merge.

The new selectors, native integer widths, enum values, simulator exclusions, and completed xtro expectations are internally consistent, and the PR provides unusually thorough four-platform validation and app-size accounting.

@jonathanpeppers jonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✅ LGTM — Approved after reassessing the macOS 26 Tahoe failures as unrelated infrastructure/environment fallout.

The existing Apple11 availability thread is non-blocking: the native header has no per-member availability annotation, and this matches the repository's existing Apple8 precedent. The measured untrimmed assembly growth is also an expected, fully accounted consequence of adding this public binding surface; RC app-size baselines are intentionally absent, while all trimmed/NativeAOT cases and preserved-API comparisons are unchanged.

The binding-relevant build, API-diff, introspection, Cecil, and xtro validation is green. I found no unresolved substantive code or API issue and am not duplicating the existing inline comments.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #ac7dbba] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 1 tests failed, 194 tests passed.

Failures

❌ Tests on macOS Tahoe (26) tests [attempt 2]

1 tests failed, 4 tests passed.

Failed tests

  • macOS/osx-x64 monotouch-test: Failed (exit code 1)
    • [FAIL] TestCancel : Connection timed out.
    • [FAIL] TestEndpointProperty : Connection timed out.
    • [FAIL] TestForceCancel : Connection timed out.
    • ... and 66 more failures
  • macOS/osx-arm64 monotouch-test: Failed (exit code 1)
    • [FAIL] TestCancel : Connection timed out.
    • [FAIL] TestEndpointProperty : Connection timed out.
    • [FAIL] TestForceCancel : Connection timed out.
    • ... and 66 more failures

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. 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 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. [attempt 3] 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 (iOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 21 tests passed. 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 Golden Gate (27): Tests skipped, incorrect beta version. Html Report (VSDrops) Download

Linux Build Verification

✅ Linux build succeeded

Pipeline on Agent
Hash: ac7dbba6b071840c5662d1ff7011da3b9059fd98 [PR build]

@dalexsoto
dalexsoto merged commit 471676e into xcode27.0 Sep 11, 2026
54 of 56 checks passed
@dalexsoto
dalexsoto deleted the dev/alex/xc27-Metal branch September 11, 2026 17:06
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.

4 participants