feat: add {stream,future}.forward canon builtins - #2614
Merged
alexcrichton merged 6 commits intoSep 21, 2026
Merged
Conversation
rvolosatovs
force-pushed
the
feat/stream-forward
branch
from
August 20, 2026 16:23
dcc747d to
863fb55
Compare
stream.forward canon builtinstream.splice canon builtin
rvolosatovs
force-pushed
the
feat/stream-forward
branch
from
August 21, 2026 17:25
61a71e1 to
1db203a
Compare
stream.splice canon builtinstream.{splice,forward} canon builtins
rvolosatovs
force-pushed
the
feat/stream-forward
branch
2 times, most recently
from
August 24, 2026 15:19
8ff9873 to
6ce0ba5
Compare
stream.{splice,forward} canon builtins{stream,future}.forward canon builtins
rvolosatovs
force-pushed
the
feat/stream-forward
branch
2 times, most recently
from
August 25, 2026 16:57
d81e1b4 to
a7a7254
Compare
rvolosatovs
added a commit
to rvolosatovs/wasmtime
that referenced
this pull request
Aug 25, 2026
Pick up `wasmparser`/`wast`/`wasm-encoder` support for the `stream.forward` and `future.forward` canonical built-ins from bytecodealliance/wasm-tools#2614 until that lands upstream.
rvolosatovs
force-pushed
the
feat/stream-forward
branch
from
August 26, 2026 12:05
a7a7254 to
a9127de
Compare
rvolosatovs
force-pushed
the
feat/stream-forward
branch
from
September 21, 2026 17:48
a9127de to
0c28697
Compare
Implement parsing, validation, encoding, and printing support for the
⏩-gated `stream.forward` built-in:
(canon stream.forward $streamT (core func $f))
where `$f` has type `(func (param i32 i32))`, taking a readable stream
end and a writable stream end. `stream.forward` transfers both ends
out of the calling instance and returns immediately with no result, so
it takes neither an `n` parameter nor an `async` immediate. It also
takes no `canonopt`s, since no elements pass through the caller's
linear memory.
The binary encoding uses opcode 0x2e as assigned in the proposed
specification change, and validation gates the built-in behind the
component model async and "more async builtins" features.
Assisted-by: claude:claude-fable-5
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Implement parsing, validation, encoding, and printing support for the
⏩-gated `future.forward` built-in:
(canon future.forward $futureT (core func $f))
where `$f` has type `(func (param i32 i32))`, taking a readable future
end and a writable future end. Exactly like its `stream.forward`
counterpart, `future.forward` transfers both ends out of the calling
instance and returns immediately with no result, so it takes neither
an `async` immediate nor any `canonopt`s, since the value does not
pass through the caller's linear memory.
The binary encoding uses opcode 0x2f as assigned in the proposed
specification change, and validation gates the built-in behind the
component model async and "more async builtins" features.
Assisted-by: claude:claude-fable-5
Recognize the `[stream-forward-N]` and `[future-forward-N]` mangled core import names in `wit-component` and wire them up to the corresponding `canon stream.forward` and `canon future.forward` built-ins when componentizing, following the same `prefixed_payload` pattern as the `drop-readable`/`drop-writable` intrinsics: `forward` takes no `canonopt`s and no `async` immediate, so no shim or memory plumbing is required and the built-in can be materialized directly. Also add `Forward` variants to `wit-parser`'s `StreamIntrinsic` and `FutureIntrinsic` name-mangling helpers so that bindings generators can emit the new intrinsic imports via `Resolve::wasm_import_name`. Assisted-by: claude:claude-fable-5
The `{stream,future}.forward` built-ins have now been merged into the
component model specification (WebAssembly/component-model#717) as
their own ➡️-gated feature rather than as part of the "more async
builtins" feature. Add a matching `cm_forward` flag to `WasmFeatures`,
gate validation of both built-ins on it, and drop the notes describing
them as experimental now that they are part of the spec.
Also re-bless the `print` snapshots for the forward tests, which went
stale after rebasing over the printer change that now emits `(param
...)` for imported core functions.
Assisted-by: claude:claude-fable-5-1
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Pull in the upstream `test/async/forward.wast` test for the
`{stream,future}.forward` built-ins and regenerate the spec test
wrappers and snapshots.
Assisted-by: claude:claude-fable-5-1
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
rvolosatovs
force-pushed
the
feat/stream-forward
branch
from
September 21, 2026 17:54
0c28697 to
9b7a28b
Compare
Dummy modules generated for async exports now import the `[stream-forward-N]` and `[future-forward-N]` intrinsics alongside the other stream/future intrinsics, so the forward name-mangling and encoding paths are exercised by `component embed --dummy`. The affected CLI tests enable `cm-forward` when validating. Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
rvolosatovs
force-pushed
the
feat/stream-forward
branch
from
September 21, 2026 18:03
96706bc to
40c38a9
Compare
rvolosatovs
marked this pull request as ready for review
September 21, 2026 18:58
rvolosatovs
requested review from
alexcrichton
and removed request for
a team
September 21, 2026 18:58
alexcrichton
approved these changes
Sep 21, 2026
Member
|
Thanks! |
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.
Add support for
{stream,future}.forwardbuiltins as specified in WebAssembly/component-model#717