relax intra-component stream/future read/write rules#12181
Merged
dicej merged 1 commit intobytecodealliance:mainfrom Dec 19, 2025
Merged
relax intra-component stream/future read/write rules#12181dicej merged 1 commit intobytecodealliance:mainfrom
dicej merged 1 commit intobytecodealliance:mainfrom
Conversation
Per WebAssembly/component-model#580, we now allow intra-component reads and writes for all numeric payloads. While I was implementing this, Alex and I spotted a couple of bugs, which I've fixed here: - We can't treat `bool` and `char` payloads as "flat" (i.e. trivially copy-able) since not all bit patterns are valid for those types. - We weren't enforcing the rules (old or new) for streams with non-"flat" payloads (i.e. the ones that most needed them enforced 🤦) Also, now that WebAssembly/component-model#578 has been merged, I've updated the `tests/component-model` submodule and reduced the list of "expect fail" tests for that directory. Finally, note that the `p3_http_middleware_host_to_host` test is still expected to trap, but now for a different reason. Previously, it trapped because it tried to do an intra-component read/write on a `stream<u8>`. Now that that's allowed, it instead traps when doing an intra-component read/write on a `future<result<option<trailers>, error-code>>`, which is still prohibited. Signed-off-by: Joel Dice <[email protected]>
alexcrichton
approved these changes
Dec 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Per WebAssembly/component-model#580, we now allow intra-component reads and writes for all numeric payloads.
While I was implementing this, Alex and I spotted a couple of bugs, which I've fixed here:
boolandcharpayloads as "flat" (i.e. trivially copy-able) since not all bit patterns are valid for those types.Also, now that WebAssembly/component-model#578 has been merged, I've updated the
tests/component-modelsubmodule and reduced the list of "expect fail" tests for that directory.Finally, note that the
p3_http_middleware_host_to_hosttest is still expected to trap, but now for a different reason. Previously, it trapped because it tried to do an intra-component read/write on astream<u8>. Now that that's allowed, it instead traps when doing an intra-component read/write on afuture<result<option<trailers>, error-code>>, which is still prohibited.