Stream: git-wasmtime

Topic: wasmtime / PR #10701 Collapse resource tables to be per-i...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2025 at 21:13):

alexcrichton requested fitzgen for a review on PR #10701.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2025 at 21:13):

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:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2025 at 21:13):

alexcrichton requested wasmtime-core-reviewers for a review on PR #10701.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2025 at 21:13):

alexcrichton commented on PR #10701:

cc @dicej

view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2025 at 21:15):

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/poll and 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.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2025 at 22:09):

fitzgen submitted PR review:

LGTM!

view this post on Zulip Wasmtime GitHub notifications bot (Apr 30 2025 at 22:30):

alexcrichton merged PR #10701.


Last updated: Dec 06 2025 at 07:03 UTC