Stateful urwasm#1
Merged
Merged
Conversation
dozreg-toplud
commented
Mar 23, 2025
- Adds two more sets of allocation functions to allocate code pages and linear memory buffer separately;
- Adds a suspension stack: a callstack for operators/function calls in wasm3 and function calls in the hosting environment;
- Adds resume routine to resolve suspended/blocked computation;
- Adds pointer rewrite routine for m3 structs to allow persistent storage of the suspended module state
3 tasks
pkova
added a commit
to urbit/vere
that referenced
this pull request
Jul 17, 2025
Depends on urbit/wasm3#1 Adds stateful jet for `++run:wasm-lia`: - Defines two sets of allocators for m3 structs and codepages; - Updates `_reduce_monad` to enable computation suspension; - Adds `_get_state` to load wasm3 state from persistent cache table; - Adds `_move_state` to store wasm3 state in persistent cache table with the new key and remove an entry with the old key; - updates `u3we_lia_run` version due to return type change in urbit/urbit#7128; Misc: builtins for `c3_d`, motes TODO: - [x] optimizations: - [x] arena on a slab to prevent copying data one more time; - [x] smarter m3 struct realloc (currently wastes memory since wasm3 uses realloc to grow dynamic arrays);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.