Stream: git-wasmtime

Topic: wasmtime / PR #14921 [DO NOT REVIEW] Support named import...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2026 at 19:19):

jrandolf opened PR #14921 from jrandolf:wasi-nn-named-imports to bytecodealliance:main:

This builds on #14875, so only the last commit is new here.

Components importing wasi:nn interfaces under a label couldn't be linked with wasmtime-wasi-nn. This adds add_named_to_linker for the WIT-based API, following the named-import support in wasmtime-wasi (#14275).

wasmtime-wasi-nn now depends on wasmtime-wasi (it was a dev-dependency) to share its NamedId. That grows its dependency tree from 102 to 166 crates, so I'd appreciate a second opinion on whether that's the right way to share it.

Part of #14858

<details>
<summary>LLM summary of the changes</summary>

API

Implementation

The bindings get named_imports for the four interfaces. Each named method looks up the context for the id and calls the existing implementation. The convert_error conversion of wasi:nn/errors takes the id because of #14875.

Dependency

wasmtime-wasi moves from dev-dependencies to dependencies, for NamedId (a usize newtype) and WasiCtxNamedView (a one-field wrapper). It's used without default features, but its non-optional dependencies such as tokio still come along. Cargo.lock doesn't change.

Interaction with #14873

#14873 changes the signature of the add_named_to_linker lookup. Whichever of the two lands second needs to port this function, which is mechanical.

Test

run_named_imports runs a new guest program that imports wasi:nn/graph under the labels a and b, where each label's registry only has a graph of that name. It needs no ML backend.

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2026 at 19:28):

jrandolf commented on PR #14921:

Closing: nobody needs labelled wasi:nn imports yet, and wasi:nn isn't part of a WASI release. Happy to revisit if someone asks.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2026 at 19:28):

:cross_mark: jrandolf closed without merge PR #14921.


Last updated: Oct 31 2026 at 23:03 UTC