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

Evaluate and adopt wasmi v0.32+ (register machine) #1313

Open
jayz22 opened this issue Jan 5, 2024 · 2 comments · Fixed by #1466
Open

Evaluate and adopt wasmi v0.32+ (register machine) #1313

jayz22 opened this issue Jan 5, 2024 · 2 comments · Fixed by #1466
Assignees

Comments

@jayz22
Copy link
Contributor

jayz22 commented Jan 5, 2024

Wasmi recently released v0.32.0-beta.0 which contains new major features:

  • the new register-machine bytecode based executor
  • lazy Wasm function compilation.
  • unchecked Wasm compilation.

This issue tracks the experimentation to use the new version in soroban-env, and accessing the performance impacts of various compilation/validation modes.

@jayz22
Copy link
Contributor Author

jayz22 commented Jan 5, 2024

I've pushed a new branch https://github.com/jayz22/wasmi/tree/parity-v32-beta containing necessary change to adapt stellar/wasmi into it.

Here is the experimental soroban-env branch https://github.com/jayz22/rs-soroban-env/tree/explore-wasmi using it.

github-merge-queue bot pushed a commit that referenced this issue Mar 26, 2024
This is a sketch of the first step in the plan for addressing #1292 and
eventually #827 and #1313, namely:

- add a bunch of cost types that decompose the current "worst case" VM
instantiation cost type
  - continue to charge the worst case on initial contract upload
- _store_ the decomposed cost-type inputs in the ledger, since we can
observe them after the initial upload parse
- _use_ those decomposed cost-type inputs when doing runtime
instantiation
  - add a module cache
  - populate the module cache with all modules on host startup
  - use cached modules during instantiation

This PR has accompanying changes in XDR and wasmi:

  - stellar/stellar-xdr#177
  - stellar/rs-stellar-xdr#346

Remaining to do:

  - [x] determine what the correct set of decomposed cost types even is
  - [ ] ~add more code to wasmi to enable observing more inputs~
- [x] add cost-type runners / calibrations for all the decomposed
cost-types
  - [x] protocol-gate this new behaviour
- [x] make the linker-loop do less work to match the tighter cost model
(i.e. complete #1292)
- [x] possibly _duplicate_ the set of cost types added here, so we have
a cached and uncached version of each, and implement a solution to #827
- [ ] possibly decompose the set sufficiently to model what will happen
when we take wasmi 0.32 and enable lazy translation (i.e. complete
#1313)
github-merge-queue bot pushed a commit that referenced this issue Sep 24, 2024
@graydon graydon changed the title Evaluate wasmi v0.32 Evaluate and adopt wasmi v0.32+ (register machine) Oct 8, 2024
@graydon graydon reopened this Oct 8, 2024
@graydon
Copy link
Contributor

graydon commented Oct 8, 2024

This was backed out before protocol 22. Will try again in subsequent protocols.

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

Successfully merging a pull request may close this issue.

3 participants
@graydon @jayz22 and others