Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ WASI imports** — so componentization needs no wasip1 adapter.
| `future-user.component.wasm` | [`guests/future-user/wit/world.wit`](guests/future-user/wit/world.wit) | `double-future: async func(f: future<u32>) -> u32` (awaits an imported future); `make-future: async func(x: u32) -> future<u32>` (resolves an exported one) | ~64 KB |
| `future-import.component.wasm` | [`guests/future-import/wit/world.wit`](guests/future-import/wit/world.wit) | Host imports with future-bearing results (amendment A12; the `wasi:sockets@0.3` TCP shapes reduced to `u32`): `next-value: func() -> future<u32>`, `send-sink: func(stream<u8>) -> future<u32>`, `recv-pair: func() -> tuple<stream<u8>, future<u32>>`, driven by `run-next`/`run-send`/`run-recv` exports (`run-send` writes the stream only after the sync import returns — the livelock probe) | ~64 KB |
| `resource-stream.component.wasm` | [`guests/resource-stream/wit/world.wit`](guests/resource-stream/wit/world.wit) | Streams of OWNED HOST RESOURCES (amendment A13; the `wasi:sockets@0.3` TCP `listen` shape): world-level `resource ticket { value: func() -> u32 }`, `tickets: func(count: u32) -> stream<ticket>`, driven by `sum-tickets` (drains; per-element dtors) and `take-then-drop` (abandons the reader mid-stream — the un-taken-element release probe) | ~50 KB |
| `tcp-echo.component.wasm` | [`guests/tcp-echo/wit/world.wit`](guests/tcp-echo/wit/world.wit) | The REAL `wasi:sockets@0.3.0` TCP surface (wit/deps vendored verbatim from upstream): `echo-client` dials/streams/FINs/drains (the wosh client shape); `start-echo-server` binds/listens and serves connections from a detached task, returning `tuple<u16, future<u32>>` — the wasi-shims integration gate (`tests/integration_sockets_test.ts`) drives both over live loopback sockets | ~108 KB |
| `test-suite.component.wasm` | [`guests/test-suite/wit/tests.wit`](guests/test-suite/wit/tests.wit) (vendored verbatim from polymorph-test's `polymorph:test@0.1.0`, TRACK C2-D) | Implements the `suite` world: imports `test-context`, exports `tests` (`all: async func() -> list<test-case>`). Six deterministic cases exercising pass/fail/skip, multi-message diagnostics, and a measurable-time case for budget plumbing — the ct-runner's (`../../ct-runner/`) fixture. | ~61 KB |


Expand Down
4 changes: 2 additions & 2 deletions examples/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ TARGET=wasm32-unknown-unknown
BUILD_DIR=guests/build
export CARGO_TARGET_DIR="$PWD/guests/target"

GUESTS="hello values resources async-probe yield-only context-user backpressure-probe stream-echo stream-pass future-user future-import resource-stream test-suite"
GUESTS="hello values resources async-probe yield-only context-user backpressure-probe stream-echo stream-pass future-user future-import resource-stream tcp-echo test-suite"

# wasm-tools validation features per guest (component-model always on;
# CM 0.3 async guests additionally need the cm-async feature).
features_for() {
case "$1" in
async-probe|yield-only|context-user|backpressure-probe|stream-echo|stream-pass|future-user|future-import|resource-stream|test-suite)
async-probe|yield-only|context-user|backpressure-probe|stream-echo|stream-pass|future-user|future-import|resource-stream|tcp-echo|test-suite)
echo "component-model,cm-async" ;;
*) echo "component-model" ;;
esac
Expand Down
Loading
Loading