clarify canonopt requirements for async lifts #575
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had thought that the spec allowed an async lift to omit the memory canonopt if only the result type (and not the paarameter types) required it, leaving the core function free to call any
task.returnat runtime as long as the type and string encoding matched. Indeed, that's what we implemented inwasm-toolsand Wasmtime.However, it looks like I misremembered, since the spec uses an exact comparison in
LiftOptions.equal. That's good news, because allowing the core function to call any of severaltask.returnfunctions, each with a different memory, makes it hard for the runtime to optimize compositions.So no actual change needed here -- just a clarification. We'll update
wasm-toolsandWasmtimeto match.