Skip to content

Fix cross-assembly COM projections and shared helpers - #1870

Merged
Jevan Saks (jevansaks) merged 16 commits into
mainfrom
jevansaks-external-com-interfaces
Nov 5, 2026
Merged

Jevan Saks (jevansaks) merged 16 commits into
mainfrom
jevansaks-external-com-interfaces

Conversation

@jevansaks

@jevansaks Jevan Saks (jevansaks) commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Fix projections when Windows metadata references COM interfaces defined in a separate WinMD, such as a D3D12 provider. DML_BUFFER_BINDING.Buffer uses the referenced ID3D12Resource with the correct pointer or managed interface shape.

Key changes:

  • Resolve interface classification and COM inheritance using the metadata file that owns each definition.
  • Preserve managed fields in recursive DRED structures and SafeHandle-friendly shared-handle COM overloads across metadata files. Keep backing-type safety checks for handles that cannot fit in IntPtr.
  • Keep factory APIs under Windows.Win32.PInvoke when metadata files share a projection root.
  • Emit shared helpers and inline-array types once, preserving distinct array overloads.
  • Update to published Win32Metadata 71.0.45-preview and use its package-selected Windows/D3D12 baseline for native, marshaled, and COM source-generator regression coverage. No checked-in WinMDs or local SDK reproduction tooling are added.

Input selection supplies exactly one D3D12 provider. There is no per-type occlusion or name-based replacement logic. Agility coverage will use the published SDK package.

Resolve interface definitions and COM ancestry with their owning generator and metadata reader. Add reciprocal metadata fixtures covering native pointers, marshaled arrays, and non-COM ancestry.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Run the SDK COM source generator on GUID-bearing reciprocal fixtures and compile its output. Fix inherited CCW property inspection to use the method-owning metadata reader.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Verify the SDK-generated compilation emits successfully, then normalize only third-party generated trees for the existing cross-platform test formatting assertions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Register compatible replacement types across inputs, forward local and external dependencies, and replace Apis members individually. Cover complete enum upgrades, architecture variants, nested types and real COM/LibraryImport generation in the three supported modes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jevansaks Jevan Saks (jevansaks) changed the title Fix COM interface classification across metadata assemblies Prefer supplemental metadata types and resolve cross-assembly COM interfaces Nov 1, 2026
Emit common SliceAtNull and GeneratedCode attribute once across metadata inputs while preserving distinct per-array ReadOnlyItemRef overloads. Cover both generation orders with authored array fixtures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…overage

Use complete public Windows metadata70.0.11 and a reproducible public Agility1.619.3 fixture. Exercise real DXGI/D3D/DirectML requests in native, marshaled and actual COM-source-generated modes, both request orders, baseline precedence and target architectures. Remove all ExternalCom/Occlusion fixtures added by this work.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use existing inline-array namespace/name cache keys to select one same-root declaration at emission without changing transactional generation. Cover real D3D11 and D3D12 sampler border arrays in all three modes and both request orders, including retained ReadOnlyItemRef calls.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove type, method and constant winner registration and local-definition forwarding. Keep qualified COM resolution, shared projection roots and helper ownership. Test full public split Windows metadata with one baseline or Agility D3D12 provider, neutral identities, all three projection modes, request/input orders, samplers and failed-generation retry.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jevansaks Jevan Saks (jevansaks) changed the title Prefer supplemental metadata types and resolve cross-assembly COM interfaces Fix cross-assembly COM projections and shared helpers Nov 3, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep cross-assembly regression coverage on the split Windows SDK baseline and defer Agility coverage to the published SDK package.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jevansaks
Jevan Saks (jevansaks) marked this pull request as ready for review November 4, 2026 08:37
Update to Win32Metadata 71.0.45-preview and remove the checked-in Windows/D3D12 pair. Collect and copy package-selected test metadata after provider selection.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Honor AvoidWinmdRootAlias for type definitions as well as references, so inherited IInspectable friendly methods keep Windows HSTRING locals correctly qualified.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jevansaks
Jevan Saks (jevansaks) enabled auto-merge (squash) November 5, 2026 17:12
@jevansaks
Jevan Saks (jevansaks) merged commit fa921cd into main Nov 5, 2026
28 of 36 checks passed
@jevansaks
Jevan Saks (jevansaks) deleted the jevansaks-external-com-interfaces branch November 5, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants