alexcrichton requested fitzgen for a review on PR #10701.
alexcrichton opened PR #10701 from alexcrichton:collapse-resource-tables to bytecodealliance:main:
This commit is an update to how Wasmtime represents and processes resource handles for components. The upstream specification changed in WebAssembly/component-model#427 and while it's been awhile since that change this is Wasmtime catching up to that change. It's expected that these paths are going to get stressed more with component model async and more kinds of handles so this additionally refactors things to leave sort of "holes" where async resources are going to go.
This notably will result in different behavior for guest programs. Previously if there were two resources imported into a guest they could have overlapping indices and now they're going to all have disjoint indices since they're all in the same index space. It's expected that this is will have a minimal, if any, impact on component guests as in theory they're all mostly treating handles as opaque indexes today anyway.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested wasmtime-core-reviewers for a review on PR #10701.
alexcrichton commented on PR #10701:
cc @dicej
alexcrichton commented on PR #10701:
I'll also note that the original motivation for this spec change, https://github.com/WebAssembly/component-model/issues/395, also detailed improved error messages from runtime about mismatches in index types. For example the original issue was importing two versions of
wasi:io/polland accidentally crossing handle indexes between the two. This PR doesn't go so far to attach debugging names to resources so it's known how to inform the users/components what exactly a mismatch was, it only says "expected resource found different resource" effectively. I've left the improvement of error messages to a future PR.
fitzgen submitted PR review:
LGTM!
alexcrichton merged PR #10701.
Last updated: Dec 06 2025 at 07:03 UTC