Provide a synchronous constructor for non-empty streams
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- wasm
- Área
- backend-api-design
Línea de trabajo
Comienza con la discusión sobre WASI streams enlazada desde el issue, especialmente wit_stream::new() y descriptor.read-via-stream, y después revisa el trabajo referenciado sobre slicing y splicing de streams. El objetivo es determinar e implementar un constructor síncrono que pueda poblar un stream a partir de una list<u8> conocida sin una tarea en segundo plano, y verificar que admita el caso de uso de virtualización de WASI-Virt.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
TL;DR: There is not currently a way to construct a non-empty stream in a synchronous context, making it impossible for a guest component to virtualize several WASI APIs. While planned features like cooperative threads will eventually make it possible to populate a stream by spawning background tasks, I believe that having a straightforward stream constructor that takes a list would be generally useful and hopefully (?) much simpler to implement.
(Apologies if this is not the best repo for this issue, please feel free to move it as appropriate.)
WASI-Virt currently supports WASI versions v0.2.1 and v0.2.3. Both of these are quite old relative the ecosystem; cargo build --target wasm32-wasip2 produces components that depend on WASI v0.2.9. The latest 2.x release is 0.2.12, and the first 0.3.x release landed last month. WASI-Virt also uses exact-match dependency resolution, so while a v0.2.12 export could satisfy a v0.2.3 import in theory, it gets rejected in practice. Functionally, this means that WASI-Virt cannot be used with recent toolchains.
I attempted to enable semver-compatible dependency resolution, but learned that it wouldn't be possible so long as WASI-Virt was using WASI p2. P2's use of resources to represent IO streams always lead to transitive import/export conflicts:
4: world exports
wasi:io/streams@0.2.3but it's also transitively used by an import which means that this is not valid
These conflicts should be obviated by P3's use of stream instead of resources. I set out to test this by making a simple component that would virtualize wasi:filesystem (and nothing else). However, I quickly ran into an issue when trying to implement descriptor.read-via-stream (see #wasi > Creating a `stream` in a sync context).
In short: read-via-stream is synchronous function. A guest implementation can construct a stream reader/writer pair via wit_stream::new(), but the guest cannot (meaningfully) spawn a background task to populate a stream via the writer. Cooperative threads should make this possible when they arrive early next year.
The WASI-Virt use case does not require a sophisticated writer implementation. The bytes that represent a file are known at virtualization time; the file descriptors are backed by a simple Vec<u8>. However, so far as I can tell, there is no way to construct a stream from a list<u8> in a synchronous context.
I know there's a larger design effort happening around slicing and splicing stream; I wonder if there's room for a simple synchronous constructor. (Regrettably, the lack of user generics does mean that you couldn't define a func from-list(list<T>) -> stream<T> in the near term.)
- Lenguaje dominante
- WebAssembly
- Estrellas
- 1.4k
- Forks
- 130
- Merge medio
- 2 d 11 h
- PR fusionados (30 d)
- 14
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de WebAssembly/component-model
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
WebAssembly/component-model#609 · 2 comentarios · 1 reacción ·
-
Specifying lockdown behavior Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
WebAssembly/component-model#727 · 3 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
WebAssembly/component-model#724 · 10 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
WebAssembly/component-model#718 · 1 comentario ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
WebAssembly/component-model#695 · 1 comentario ·
Todos los issues de WebAssembly/component-model
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
use-agent-os/agent-os#3312 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
needs-acceptance wg/data-plane-networking
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
vllm-project/semantic-router#4024 · 1 comentario ·
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
amponce/archive-movie-browser#165 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100