Skip to content

Conversation

@yurydelendik
Copy link
Contributor

@yurydelendik yurydelendik commented Nov 25, 2025

Allows exact function imports such as:

 (import "" "" (func (exact (type $f))))
 (import "" "" (func (exact (type $f) (param) (result))))

The patch adds FuncExact to external kind and uses heap type reference (instead of index) in the entity function references field. I tried to match changes to the overview explanations in the Exact Function Imports sections.

I need help with:

  • component changes: is it make sense to have the similar change there too?
  • wasm-smith or wasm-mutate changes

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit wary to match the spec exactly here in AST-representation where I would predict that idiomatically in Rust it'd be nicer to have Thing::{Func,FuncExact}(u32) as opposed to Thing::Func(ThingType { id: u32, exact: bool }). Did you try that already though and find that it was unworkable? If not, mind trying that out?

As for components/wasm-smith/wasm-encoder, where possible it's nice to keep things working but if major surgery or refactorings are required feel free to return an error and/or panic in those situations. I can take a look at any particular location in review and see if anything can't be semi-easily-handled or if it needs to do something else.

@yurydelendik
Copy link
Contributor Author

in Rust it'd be nicer to have Thing::{Func,FuncExact}(u32) as opposed to Thing::Func(ThingType { id: u32, exact: bool }). Did you try that already though and find that it was unworkable? If not, mind trying that out?

Yep, I can try that.

@alexcrichton
Copy link
Member

Nice that looks like it worked out well to me at least, with green CI should be good to go 👍

@yurydelendik yurydelendik force-pushed the cust-desc-exact branch 2 times, most recently from be0f680 to 1033764 Compare November 26, 2025 20:45
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Judging by WebAssembly/testsuite#146 it looks like some instruction names may be getting an update too? (fine to land after this of course)

@yurydelendik yurydelendik marked this pull request as ready for review November 26, 2025 21:06
@yurydelendik yurydelendik requested a review from a team as a code owner November 26, 2025 21:06
@yurydelendik yurydelendik requested review from dicej and removed request for a team November 26, 2025 21:06
@yurydelendik
Copy link
Contributor Author

Judging by WebAssembly/testsuite#146 it looks like some instruction names may be getting an update too? (fine to land after this of course)

Yes, this is my next item. The newest update to the proposal will rollback some code around struct.new validation and adds struct.new_desc

@alexcrichton alexcrichton added this pull request to the merge queue Nov 26, 2025
Merged via the queue into bytecodealliance:main with commit adcfce7 Nov 26, 2025
34 checks passed
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