Stream: git-wasmtime

Topic: wasmtime / PR #14865 Respect type ascriptions on componen...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 21:59):

jrandolf opened PR #14865 from jrandolf:export-type-ascription to bytecodealliance:main:

Wasmtime ignored the type ascribed to an exported instance, as in (export "a" (instance $i) (instance ...)), and used the type of the definition instead. So exports the ascription hides were still listed in Component::component_type and reachable through get_export_index, and implements/external-id on nested exports came from the definition rather than the ascription. The same thing happened with an instance passed to a nested component whose import declares a narrower type: if the nested component re-exported it, the host saw the caller's instance, extra exports and attributes included.

This views the root component's exports through the types wasmparser validated, which already account for ascriptions and declared import types. record_export now takes an instance's exports, and their attributes, from the instance's type instead of from its definition. The attributes that were carried around next to instance definitions aren't needed anymore, so they're removed.

Some behaviour that embedders can see changes:

Ascriptions that narrow a module export aren't handled.

The first commit is the fix. The second adds a test for the nested component case, which the same change fixes.

Closes #14852
Closes #14853

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 22:36):

jrandolf edited PR #14865.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 22:36):

jrandolf has marked PR #14865 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 22:36):

jrandolf removed the review request for wasmtime-core-reviewers from PR #14865.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 22:36):

jrandolf requested pchickey for a review on PR #14865.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 22:36):

jrandolf requested wasmtime-core-reviewers for a review on PR #14865.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 16:39):

alexcrichton removed the review request for pchickey from PR #14865.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 16:39):

alexcrichton requested alexcrichton for a review on PR #14865.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 16:49):

:memo: alexcrichton submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 16:49):

:speech_balloon: alexcrichton created PR review comment:

I find this comment a bit confusing as it feels like it's kind of only relevant for this particular PR here. Perhaps something like:

For the root component (frame.instance_ty.is_none()) re-ascribe exported instances with whatever type wasmparser recorded for that instance. If the component ascribed the type then it might be a subset of the exports that the instance actually exports.

Additionally, can you add commentary for why only instances are handled here? Other types can also be ascribed, such as types/functions/resources.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 16:49):

:speech_balloon: alexcrichton created PR review comment:

This is pretty generically named/implemented for what's a pretty small slice of functionality -- could this panic! on invalid inputs and/or be renamed to reflect how it's only dealing with instance types?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

:memo: jrandolf submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

:speech_balloon: jrandolf created PR review comment:

Done

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

:memo: jrandolf submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

:speech_balloon: jrandolf created PR review comment:

Done

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

jrandolf updated PR #14865.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 19:05):

jrandolf requested alexcrichton for a review on PR #14865.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 19:56):

:thumbs_up: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 19:56):

alexcrichton added PR #14865 Respect type ascriptions on component exports to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 20:18):

:check: alexcrichton merged PR #14865.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 20:18):

alexcrichton removed PR #14865 Respect type ascriptions on component exports from the merge queue.


Last updated: Oct 31 2026 at 23:03 UTC