Skip to content

Conversation

@lukewagner
Copy link
Member

As discussed in #395. This simplifies the implementation (avoiding likely subtle incompatibilities) and helps developers catch and understand bugs while maintaining determinism. In context, the overhead of the extra branch should be negligible.

…, instead of per-resource-type-per-instance

Resolves #395
@sunfishcode
Copy link
Member

It helps that this isn't exposed in the public interface of components, so if in the future we decide we want different behavior, we could have options.

@lukewagner lukewagner merged commit a64b04e into main Dec 11, 2024
2 checks passed
@lukewagner lukewagner deleted the single-table branch December 11, 2024 16:27
alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request Apr 30, 2025
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.
github-merge-queue bot pushed a commit to bytecodealliance/wasmtime that referenced this pull request Apr 30, 2025
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.
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.

4 participants