Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use-case for multi-memory: Less overhead tracking of store calls to facilitate networked rollback #42

Open
kettle11 opened this issue Feb 21, 2023 · 1 comment

Comments

@kettle11
Copy link

kettle11 commented Feb 21, 2023

A project I've been working on (https://github.com/kettle11/tangle) automatically networks WebAssembly without the Wasm needing to do anything and without adding excessive input latency. This works by borrowing a networking concept from games called 'rollback'. Rollback relies on determinism and takes periodic 'snapshots' of the code state to rollback and 'resimulate' if new events arrive from remote users.

At the moment Tangle works be periodically cloning the entire Wasm memory / globals, which works well enough for Wasm programs that use small amounts of memory. This approach scales predictably poorly as memory usage increases.

What would be better is if there were a less overhead way to track calls to store. I attempted calling out to the host whenever a call to store occurs but there was far too much overhead.

Another solution is to have each networked Wasm module declare a chunk of memory that Tangle can use to track calls to store, but this introduces room for user-error and loses much of Tangle's 'it just works' magic.

The ideal solution for Tangle would be able to be able to allocate some sort of global array, or other memory, that could be controlled by Tangle but written to from within the user Wasm program. It looks like the multi-memory extension would be perfect for this!

@tlively
Copy link
Member

tlively commented Feb 21, 2023

Very cool use case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants