Skip to content

Project ambiguous COM overloads with explicit stable entry points - #147

Merged
leileizhang (lei9444) merged 4 commits into
feature/com-borrowed-buffersfrom
feature/com-explicit-overloads
Sep 9, 2026
Merged

leileizhang (lei9444) merged 4 commits into
feature/com-borrowed-buffersfrom
feature/com-explicit-overloads

Conversation

@lei9444

Copy link
Copy Markdown
Contributor

Scope (4/4)

  • Keep existing unambiguous COM overload dispatch unchanged.
  • Give previously ambiguous ordinary methods deterministic <camelName>AtSlot<absoluteSlot> entry points, without an ambiguous unsuffixed dispatcher.
  • Preserve native names, slots, ABI signatures, conversions and lifecycle plans. Reject collisions and unsupported synthesized/dynamic groups.
  • Cover exact inherited metadata, buffer overloads, JavaScript routing and TypeScript declarations.

This PR is stacked on #146. The measured result promotes 24 interfaces: 5,721/7,929 complete safe interfaces. Bounded borrowed-copy facades remain separate from full safe-complete counts. Existing WinRT output and runtime semantics remain unchanged. No automatic merge is requested.

Preserve existing arity/shape dispatch for distinguishable groups. Emit stable AtSlot names for previously unsupported ordinary overloads without guessing ABI behavior, retain each validated method plan, reject alias collisions, and update exact coverage evidence.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
Propagate the behavior-preserving target registry through the complete PR stack without expanding supported activation targets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
Preserve the existing explicit-slot overload surface and 5721-interface census while inheriting the reviewed shared COM copy registry and executor from PR 146.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
@lei9444

Copy link
Copy Markdown
Contributor Author

Synced #146 through a normal merge of 01393d8. The parent now uses a shared reviewed contract registry and a plan-driven borrowed-copy executor, including explicit acquisition/finalizer relationships and positional native scalar-unit validation. This PR still adds only the same 24 explicit-slot overload projections; its seven census artifacts remain unchanged at 5,721/7,929. Inherited COM outputs now require manifest v5 / borrowed descriptor v2 and full regeneration. No history rewriting or automatic PR merge was performed.

Inherit the PR 146 lifecycle fix without changing the existing explicit-slot overload surface or supported interface set.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
@lei9444

Copy link
Copy Markdown
Contributor Author

Synced the #146 COM argument-lifecycle fix from 3d3e8c4 by normal merge. Shared admission now covers receiver/argument state, aliases and retained interface-bearing containers, with a final check after native QI/coercion. The generated IMFSample.addBuffer path rejects poisoned carriers without increasing its buffer count. Unbound WinRT bookkeeping and all four public facade files remain compatible. The existing explicit-overload scope is unchanged; neither PR was automatically merged.

@lei9444
leileizhang (lei9444) merged commit c0c0c7b into feature/com-borrowed-buffers Sep 9, 2026
1 check passed
@lei9444
leileizhang (lei9444) deleted the feature/com-explicit-overloads branch September 9, 2026 01:45
leileizhang (lei9444) added a commit that referenced this pull request Sep 9, 2026
* Add guarded COM borrowed-copy transactions

Add metadata-validated owned-copy plans for Audio, WIC BGRA8 and linear
Media Foundation buffers. Observe real successful Audio initialization and
GetService calls, retain canonical identity provenance across aliases, and
finalize native borrows exactly once with thread and poison guards.

Preserve WIC's existing complete surface, keep three copy-only facades out
of complete-interface counts, require full regeneration, and add exact
metadata evidence, native fixtures, live x64/i686 tests and regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Refactor COM borrowed copies into typed execution recipes

Centralize reviewed ABI and lifecycle evidence in a shared contracts crate. Execute typed bindings, bounds, copies and finalizers through one plan-driven runtime while preserving public APIs and supported interfaces.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Guard managed COM arguments before native dispatch

Retain shared apartment and lifecycle contexts across interface aliases and supported containers. Recheck receivers and inputs after native coercion, preserve deferred WinRT lifetime behavior, and reject poisoned buffer inputs before IMFSample can retain them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Project ambiguous COM overloads as explicit slot-named methods (#147)

Preserve existing arity/shape dispatch for distinguishable groups. Emit stable AtSlot names for previously unsupported ordinary overloads without guessing ABI behavior, retain each validated method plan, reject alias collisions, and update exact coverage evidence.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
leileizhang (lei9444) added a commit that referenced this pull request Sep 9, 2026
* Add metadata-driven native COM one-shot completion

Generate bounded audio activation promises with validated WinMD contracts,
libffi export/result plans, a native-only FTM signal sink, and owner-local
result collection. Preserve synchronous JS callback thread restrictions.
Cover publication, HRESULTs, ownership, teardown, bounds, and WinRT regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Add guarded COM borrowed-copy transactions for Audio, WIC and MF (#146)

* Add guarded COM borrowed-copy transactions

Add metadata-validated owned-copy plans for Audio, WIC BGRA8 and linear
Media Foundation buffers. Observe real successful Audio initialization and
GetService calls, retain canonical identity provenance across aliases, and
finalize native borrows exactly once with thread and poison guards.

Preserve WIC's existing complete surface, keep three copy-only facades out
of complete-interface counts, require full regeneration, and add exact
metadata evidence, native fixtures, live x64/i686 tests and regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Refactor COM borrowed copies into typed execution recipes

Centralize reviewed ABI and lifecycle evidence in a shared contracts crate. Execute typed bindings, bounds, copies and finalizers through one plan-driven runtime while preserving public APIs and supported interfaces.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Guard managed COM arguments before native dispatch

Retain shared apartment and lifecycle contexts across interface aliases and supported containers. Recheck receivers and inputs after native coercion, preserve deferred WinRT lifetime behavior, and reject poisoned buffer inputs before IMFSample can retain them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Project ambiguous COM overloads as explicit slot-named methods (#147)

Preserve existing arity/shape dispatch for distinguishable groups. Emit stable AtSlot names for previously unsupported ordinary overloads without guessing ABI behavior, retain each validated method plan, reject alias collisions, and update exact coverage evidence.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
leileizhang (lei9444) added a commit that referenced this pull request Sep 9, 2026
* Add safe COM projection and endpoint activation

Provide non-consuming COM projectAs with registered safe descriptors, restricted in-process IMMDevice activation with native NULL parameters, and exact GetId ownership. Preserve the WinRT root and dynamic architecture; require complete COM regeneration with manifest v3.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Move endpoint activation targets into a cited contract registry

Preserve the five existing target IIDs, in-process context, native NULL parameters and owned result contract. Validate named evidence records and lower dynamic-length IID lists without changing generated bindings or coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Add metadata-driven native COM one-shot completion (PR2/4) (#145)

* Add metadata-driven native COM one-shot completion

Generate bounded audio activation promises with validated WinMD contracts,
libffi export/result plans, a native-only FTM signal sink, and owner-local
result collection. Preserve synchronous JS callback thread restrictions.
Cover publication, HRESULTs, ownership, teardown, bounds, and WinRT regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Add guarded COM borrowed-copy transactions for Audio, WIC and MF (#146)

* Add guarded COM borrowed-copy transactions

Add metadata-validated owned-copy plans for Audio, WIC BGRA8 and linear
Media Foundation buffers. Observe real successful Audio initialization and
GetService calls, retain canonical identity provenance across aliases, and
finalize native borrows exactly once with thread and poison guards.

Preserve WIC's existing complete surface, keep three copy-only facades out
of complete-interface counts, require full regeneration, and add exact
metadata evidence, native fixtures, live x64/i686 tests and regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Refactor COM borrowed copies into typed execution recipes

Centralize reviewed ABI and lifecycle evidence in a shared contracts crate. Execute typed bindings, bounds, copies and finalizers through one plan-driven runtime while preserving public APIs and supported interfaces.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Guard managed COM arguments before native dispatch

Retain shared apartment and lifecycle contexts across interface aliases and supported containers. Recheck receivers and inputs after native coercion, preserve deferred WinRT lifetime behavior, and reject poisoned buffer inputs before IMFSample can retain them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Project ambiguous COM overloads as explicit slot-named methods (#147)

Preserve existing arity/shape dispatch for distinguishable groups. Emit stable AtSlot names for previously unsupported ordinary overloads without guessing ABI behavior, retain each validated method plan, reject alias collisions, and update exact coverage evidence.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

* Make COM declaration tests independent of built JS artifacts

Share the isolated COM runtime declaration fixture between overload and sink tests. Keep strict TypeScript and negative assertions while removing the coverage-time dependency on bindings/js/dist.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ef7fa55-eb2a-4360-bd17-05feae50fadb
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.

1 participant