Stream: git-wasmtime

Topic: wasmtime / PR #3153 Implement the memory64 proposal in Wa...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 05 2021 at 22:12):

alexcrichton opened PR #3153 from memory64 to main:

This commit implements the WebAssembly [memory64 proposal][proposal] in
both Wasmtime and Cranelift. In terms of work done Cranelift ended up
needing very little work here since most of it was already prepared for
64-bit memories at one point or another. Most of the work in Wasmtime is
largely refactoring, changing a bunch of u32 values to something else.

A number of internal and public interfaces are changing as a result of
this commit, for example:

Overall I've tried to minimize the amount of as casts as possible,
using checked try_from and checked arithemtic with either error
handling or explicit unwrap() calls to tell us about bugs in the
future. Most locations have relatively obvious things to do with various
implications on various hosts, and I think they should all be roughly of
the right shape but time will tell. I mostly relied on the compiler
complaining that various types weren't aligned to figure out
type-casting, and I manually audited some of the more obvious locations.
I suspect we have a number of hidden locations that will panic on 32-bit
hosts if 64-bit modules try to run there, but otherwise I think we
should be generally ok (famous last words). In any case I wouldn't want
to enable this by default naturally until we've fuzzed it for some time.

In terms of the actual underlying implementation, no one should expect
memory64 to be all that fast. Right now it's implemented with
"dynamic" heaps which have a few consequences:

The memory64 spec test suite is scheduled to now run on CI, but as with
all the other spec test suites it's really not all that comprehensive.
I've tried adding more tests for basic things as I've had to implement
guards for them, but I wouldn't really consider the testing adequate
from just this PR itself. I did try to take care in one test to actually
allocate a 4gb+ heap and then avoid running that in the pooling
allocator or in emulation because otherwise that may fail or take
excessively long.

[proposal]: https://github.com/WebAssembly/memory64/blob/master/proposals/memory64/Overview.md

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Aug 05 2021 at 22:14):

alexcrichton updated PR #3153 from memory64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 05 2021 at 22:16):

alexcrichton updated PR #3153 from memory64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 05:11):

alexcrichton updated PR #3153 from memory64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 05:23):

alexcrichton updated PR #3153 from memory64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 14:04):

alexcrichton updated PR #3153 from memory64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 14:05):

alexcrichton updated PR #3153 from memory64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 18:40):

alexcrichton updated PR #3153 from memory64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 18:53):

alexcrichton updated PR #3153 from memory64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 19:31):

alexcrichton updated PR #3153 from memory64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 20:44):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 20:44):

cfallin created PR review comment:

A comment here about why we decided not to expand heap_addr to take the u64 would help document our discussion :-)

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 20:44):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 20:44):

cfallin created PR review comment:

Good catch (avoiding wraparound). Could you add a comment re: the saturation here to note this is protecting against offset + access-size overflowing?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 21:00):

alexcrichton updated PR #3153 from memory64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2021 at 21:00):

alexcrichton requested peterhuene for a review on PR #3153.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 11 2021 at 22:29):

peterhuene submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 11 2021 at 22:29):

peterhuene submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 11 2021 at 22:29):

peterhuene created PR review comment:

Same comment as above re: mention of wasm pages.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 11 2021 at 22:29):

peterhuene created PR review comment:

I think this commit is now out of date as it's now taking a size rather than page delta?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2021 at 14:40):

alexcrichton updated PR #3153 from memory64 to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2021 at 14:40):

alexcrichton merged PR #3153.


Last updated: Nov 22 2024 at 16:03 UTC