Skip to content

Conversation

@leon-thomm
Copy link
Collaborator

This PR adds a Wasmtime backend using Wasmtime for function isolation. The backend has two flavors:

  • One which directly runs Wasm binaries on the Wasmtime VM, activated with feature flag dandelion-wasmtime-jit
  • One using Wasmtime pre-compilation, activated with feature flag dandelion-wasmtime-precomp

leon-thomm and others added 30 commits November 6, 2023 20:44
This is currently unable to retrieve outputs after function execution. I will have to rework a part of the memory model.
wasm backend finally works on matmul now.

Fixed a few bugs I had introduced in input writing and context base offsets.
I tested on wasm backend, not on cheri
The wasm memory is still of fixed size, but we can now provide our own buffer for it, which can be on the heap as well. This is optional, and can be toggled easily.
...when using heap for wasm memory.
removes heapless wasm memory initialization as announced in #13 (comment)
and fixing a bug in memory read
@tom-kuchler
Copy link
Collaborator

tom-kuchler commented Feb 22, 2024

Also should add the new features to the workflow so they will be tested on updates (need to resolve the merge conflicts for the workflow to run as I understand)

@leon-thomm
Copy link
Collaborator Author

  • added wasmtime-precomp feature to dispatcher
  • removed prints from build.rs
  • cfg gated Elf config
  • moved context loading into Wasmime engine file
  • removed old WasmtimeContext
  • added Wasm size check to WasmtimeContext, and made it always round up to next page
    • one might want to do something similar for the Wasm backend

@leon-thomm
Copy link
Collaborator Author

leon-thomm commented Feb 25, 2024

The dispatcher domain tests need a rework soon. For the Wasmtime backend, some of them fail because we now round up the context size (and they check whether reading or writing contexts OOB fails). Others fail because they try to use freestanding contexts, which will panic in the WasmtimeContext (must be loaded with a function config first).

tom-kuchler and others added 4 commits February 27, 2024 13:16
Contexts are allowed to allocate a larger amount of memory than they were asked for. This specifically is a requirement for the Wasm backends, where the Wasm standard dictates the Wasm memory to be a multiple of the Wasm page size (64Kib), so we need to round up to the next multiple. This mainly adapts the OOB tests to take the actual context size into account.
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 this pull request may close these issues.

4 participants