Repository navigation
[Metal] Update bindings up to Xcode 27.0 RC1 - #26594
Conversation
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
There was a problem hiding this comment.
🟡 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
| /// <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)] |
| [Mac (26, 0), iOS (26, 0), MacCatalyst (26, 0), TV (26, 0)] | ||
| Apple10 = 1010, | ||
| /// <summary>The Apple11 GPU family.</summary> | ||
| Apple11 = 1011, |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
jonathanpeppers
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
✅ 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.
🔥 [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
Html Report (VSDrops) Download Successes✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
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.
MTLPixelFormatMTLGpuFamilyApple11 = 1011MTLContentionReliefAutomatic,NoneMTLForwardProgressUsageAutomatic,Weak,SimdGroupParallelMTLComputePipelineDescriptor,MTL4ComputePipelineDescriptorForwardProgressUsage,ContentionRelief,OptimizeForPersistentKernelIMTLComputePipelineStateForwardProgressUsage,GetRecommendedPersistentThreadgroupsPerGridIMTLTexture,MTLTextureViewDescriptorMinLodAll 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 suppliesno per-member availability annotation.
The bindings preserve native signedness,
NSUInteger/MTLSizesignatures,required protocol semantics, and existing protocol code-generation
settings.
IMTLTexture.MinLodis explicitly unsupported in iOS/tvOSsimulators, 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
Simdacronym. No API-diff suppressions, documentation baselines, or unrelated
runtime-test exclusions are added.
Validation
Started with
make worldon the unchanged checkout and usedmake worldagain for the binding rebuild/install. A transient NuGet audit-feed
failure during installation was resolved by retrying the full command;
auditing was not disabled.
Sanity check passedDefaultCtorAllowedblocked as described belowRuntime 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
CLLocationButtondefault-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 explicitlyenabled, 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 largerafter 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.