Stream: git-wasmtime

Topic: wasmtime / PR #8702 Remove the borrow checking from `wigg...


view this post on Zulip Wasmtime GitHub notifications bot (May 29 2024 at 01:59):

alexcrichton requested elliottt for a review on PR #8702.

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2024 at 01:59):

alexcrichton opened PR #8702 from alexcrichton:wiggle-no-borrow-checking to bytecodealliance:main:

This commit is a refactoring of the wiggle crate which powers the *.witx-based bindings generation of Wasmtime for wasip1 support. Originally wiggle had a full-blown runtime borrow checker which verified that borrows were disjoint when appropriate. In #8277 this was removed in favor of a more coarse "either all shared or all mutable" guarantee. It turns out that this exactly matches what the Rust type system guarantees at compile time as well.

This commit removes all runtime borrow checking in favor of compile-time borrow checking instead. This means that there is no longer the possibility of a runtime error arising from borrowing errors. Current bindings in Wasmtime needed no restructuring to work with this new API.

The source of the refactors here are all in the wiggle crate. Changes include:

These changes were then propagated to the wasmtime-wasi and wasi-common crates in their preview0 and preview1 implementations of WASI. All changes are just general refactors, no functional change is intended here.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2024 at 01:59):

alexcrichton requested wasmtime-core-reviewers for a review on PR #8702.

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2024 at 22:06):

pchickey submitted PR review:

We sure did spend turn a lot of CPU cycles into heat by dynamically checking a property that was statically provable all these years, didnt we

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2024 at 22:06):

pchickey submitted PR review:

We sure did spend turn a lot of CPU cycles into heat by dynamically checking a property that was statically provable all these years, didnt we

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2024 at 22:06):

pchickey created PR review comment:

Wish I had done this years ago

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2024 at 22:06):

pchickey created PR review comment:

Docs TODO

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2024 at 22:33):

alexcrichton updated PR #8702.

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2024 at 22:33):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2024 at 22:33):

alexcrichton created PR review comment:

I should wrap this up in a helper as well since I'm starting to litter this all over the macros I work on...

view this post on Zulip Wasmtime GitHub notifications bot (May 29 2024 at 22:49):

iximeow commented on PR #8702:

to be fair to ourselves, when we thought embedders might provide functions that involve multiple concurrent outstanding borrows it all made a bit more sense :)

view this post on Zulip Wasmtime GitHub notifications bot (May 31 2024 at 14:48):

alexcrichton updated PR #8702.

view this post on Zulip Wasmtime GitHub notifications bot (May 31 2024 at 14:48):

alexcrichton has enabled auto merge for PR #8702.

view this post on Zulip Wasmtime GitHub notifications bot (May 31 2024 at 16:06):

alexcrichton updated PR #8702.

view this post on Zulip Wasmtime GitHub notifications bot (May 31 2024 at 16:06):

alexcrichton has enabled auto merge for PR #8702.

view this post on Zulip Wasmtime GitHub notifications bot (May 31 2024 at 16:56):

acfoltzer commented on PR #8702:

I'm so glad we're able to do this now, thank you!!

view this post on Zulip Wasmtime GitHub notifications bot (May 31 2024 at 17:14):

alexcrichton updated PR #8702.

view this post on Zulip Wasmtime GitHub notifications bot (May 31 2024 at 17:14):

alexcrichton has enabled auto merge for PR #8702.

view this post on Zulip Wasmtime GitHub notifications bot (May 31 2024 at 17:36):

alexcrichton merged PR #8702.


Last updated: Dec 23 2024 at 12:05 UTC