JS API: clarify refreshing of buffers
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, wasm
- Ambito
- api, documentation
Direzione di ricerca
Inizia dalla sezione collegata “Grow the memory buffer” della proposta WebAssembly Threads JS API e confrontane la formulazione con il comportamento di più agenti descritto qui. Esamina come vengono rappresentati nella discussione attuale la crescita della memoria condivisa, l’aggiornamento del buffer, la crescita della zero-page e l’identità degli oggetti. Il lavoro è completato quando il testo della specifica definisce esplicitamente il comportamento osservabile rilevante e rimuove l’ambiguità per implementazioni come V8.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Comparing our implementation of this proposal with the spec text, I was surprised to find that the spec for growing a shared memory (https://webassembly.github.io/threads/js-api/index.html#grow-the-memory-buffer) does not at all mention the existence of multiple agents. Since that's a situation that's somewhat tricky to get right, it would be nice for the spec text to be very explicit. I think the text as currently written could be read as "when thread A grows a shared memory, thread B may never realize that this happened", which I guess isn't what was intended.
To illustrate with a concrete example: IIUC, V8 currently refreshes too many buffers. When thread A grows a shared memory, it notifies all other threads referencing the same shared memory that some memory growth has happened (the notification includes no details), and when those threads become aware of that notification, they refresh the array buffers for all shared memories that they know of. Due to the freezing of these buffers, that's unlikely to break any userspace code, but technically it is observable via object identity.
So for both efficiency and spec compliance, I think that implementation should probably be changed to refresh only the buffers associated with the memory that was grown. It is, however, not trivial to identify them by their own length mismatching that of the underlying memory block, because the memory.grow instruction can grow a memory by zero pages. So the obvious fix I have in mind would end up refreshing too few buffers.
To figure out a viable implementation design, it would be nice to have confidence that it actually matches the spec (and hence other implementations), so I would appreciate it if the spec didn't leave as many details to my imagination.
- Lingua principale
- WebAssembly
- Stelle
- 767
- Fork
- 54
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WebAssembly/threads
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
WebAssembly/threads#254 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
WebAssembly/threads#253 · 6 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
WebAssembly/threads#245 · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
WebAssembly/threads#240 ·
-
Branch renaming Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 20/100
WebAssembly/threads#237 ·
Tutte le issue di WebAssembly/threads
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
external-issue to-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
googleapis/google-cloud-swift#1151 ·
-
SqliteSaver.list(filter=...) silently misses nested metadata values containing non-ASCII text Apertaexternal
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
langchain-ai/langgraph#9074 · 1 commento ·
-
documentation specification
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
openai/openai-openapi#584 ·