Skip to content

Fix MetadataTable method ownership cycles - #173

Merged
leileizhang (lei9444) merged 2 commits into
mainfrom
lei9444-fix-metadata-table-lifetime
Sep 20, 2026
Merged

leileizhang (lei9444) merged 2 commits into
mainfrom
lei9444-fix-metadata-table-lifetime

Conversation

@lei9444

Copy link
Copy Markdown
Contributor

Break the strong ownership cycle between MetadataTable and its registered method parameters. The registry now stores table-local type kinds and shares immutable prepared ABI plans; external method handles bind owning types once and keep the registry usable until their last owner drops. Add lifetime and SDK invocation regressions, including shared-plan reuse and concurrent calls, and update the ownership documentation.

Rust registration contract: TypeHandle::add_method now requires every actual parameter type to belong to the destination MetadataTable. Foreign parameters are rejected before locking or changing the method table, including duplicate registrations. A signature may still be constructed with another table when its actual parameters are local, and zero-parameter signatures remain accepted. Standalone MethodSignature::build calls retain cross-table support; Classic COM ownership and the JavaScript/Python global registries are unchanged.

Store registered WinRT parameter kinds without owning table references and share immutable prepared ABI plans. Bind owning external method handles once at lookup, rejecting foreign parameter owners before registration while preserving standalone signatures.

Add lifetime, SDK invocation, shared-plan and concurrency regressions, and document the same-table registration contract.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bdea384f-3022-47e8-8c74-11fd768c2105
Register the real IPropertyValue scalar, struct, and receive-array signatures through GetInt32Array instead of padding SDK vtable slots with dummy methods.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bdea384f-3022-47e8-8c74-11fd768c2105
@github-actions

Copy link
Copy Markdown

Mixed-language test coverage

Workflow status: ✅ Passed

Layer Lines Functions Branches/regions
Rust, including native .pyd/.node 86.11% 81.25% 85.72% regions
Python aggregate 71.06% n/a 37.9% branches
Python runtime 99.12% n/a 97.37% branches
Generated Python WinRT projections 70.05% n/a 27.07% branches
Generated Python WinRT implementations 72.29% n/a 47.04% branches
JavaScript aggregate 22.14% 25.22% 57.85% branches
JavaScript runtime 44.27% 45.76% 78.99% branches
Generated WinRT projections 22.96% 18.72% 54.88% branches
Generated WinRT implementations 48.66% 59.76% 61.14% branches
Generated Classic COM projections 11.92% 23.97% 54.2% branches

View workflow run and download full HTML/LCOV/XML reports

@lei9444
leileizhang (lei9444) merged commit 19e69ef into main Sep 20, 2026
33 checks passed
@lei9444
leileizhang (lei9444) deleted the lei9444-fix-metadata-table-lifetime branch September 20, 2026 08:24
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