Conversation
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.
berm now compiles a program under wasmtime or, experimentally, under rvtime. Which backend a deploy reaches is read off the image's first four bytes, so one
bermdruns either and nothing has to be declared or configured. wasm is the default; rvtime is behind--features riscv.One ABI, not two
The risk in a second backend is the ABI drifting between them, so the seam is drawn to make that impossible. Every syscall — berm's own and the embedder's — is written once in
crates/berm/src/syscall/mod.rsagainst a four-methodGuesttrait and assembled into one table keyed by the hashed name. rvtime registers one host function per number; wasmtime registers a single import,berm.syscall, and looks the number up in that same table. A backend supplies transport and nothing else.Manifest::from_imagereads the.berm.abisection out of either format through one reader, because#[link_section]emits an ELF section and a wasm custom section under the same name.ABI break
ABI_VERSIONis 1, and an image built against 0 is refused. A tool export now takes nothing and returns nothing, answering throughberm.doneorberm.fail;Bufis gone. The old convention could not survive the move —extern "C" fn() -> Bufcompiles to a hidden out-parameter on wasm32 — and staging the result is how everything else on this wire already travels.Verified
nest, refusal-vs-failure, and depth limiting.bermd: deploy, the tool paths,tick(store and timer syscalls, with wakes firing), the wasmtime code cache, and restore across a restart.berm newandberm new --target riscveach scaffold, build, and pass their own tests.-D warningsfor wasm-only, riscv-only, and both.wasm measures 141 KB image / 31 ms cold compile / 14.5 µs p50, against rvtime's 408 KB / 139 ms / 24.8 µs.
Not verified
The rvtime test suite never completed a run locally. No commit here touches
rvtime/, so CI is the check on that.Note
The branch also carries three earlier commits that were not yet on
main(aa58f61,91cc322,c649b46), so this PR shows eight commits rather than five.