You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
My understanding of ocaml is shaky at best but by my read the current implementation of the binary encoding of a table type is to use the third bit of the prefix byte is used to indicate whether the index type is i64 (where if it's 0 then it's i32, as-is today). This makes sense for memories where the second bit was already claimed for the shared bit by the threads proposal, but I wanted to raise a question here if this is the desired encoding for tables. That means that the second bit in the table type prefix byte is currently unused.
Given the shared-everything-threads proposal it seems like we'll get a shared table type one day so thinking about this I think it might make sense to leave the hole, but I wanted to be sure to flag this and ensure that it was intentional and not accidental (e.g. I can see how it would be easy to just reuse what was already in the interpreter)
I don't think there's any downside to doing this, no. In Wasmtime we don't parse limits in the same way between tables/memories because for so long the encoding of tables/memories has diverged - for example for quite some times memories can be shared or 64-bit but tables can't be. Even with the table64 extension and a hypothetical shared table type the custom-page-sizes proposal still has different parsing of the flags byte which won't ever get mapped to tables.
Basically while the parsing of limits was trivially the same between memories/tables I don't think we should take it as a design guideline that they must match for all future proposals as well. The 64-bit-ness and shared-ness makes sense to match since we might as well, though.
Unless there is a strong reason to do otherwise (like running out of bits), I think it's preferable to keep them in sync. (We have been doing the same for elem/data segments.)
In the shell it should get enabled with -P wasm_memory64 (-P enables prefs). In the browser, about:config it should be javascript.options.wasm_memory64. I believe nightly builds have it enabled by default.
$ /usr/local/google/home/sbc/.jsvu/engines/spidermonkey/spidermonkey -P wasm_memory64
Error: Invalid short option: -P
$ /usr/local/google/home/sbc/.jsvu/engines/spidermonkey/spidermonkey -Pwasm_memory64
Error: Short option followed by junk: -Pwasm_memory64
Activity
Update overview to include table64
Update overview to include table64
Update overview to include table64
dschuff commentedon Apr 24, 2024
Looks good, although I wouldn't consider wabt a blocker for phase 4 if we have support in Binaryen.
Update overview to include table64 (#52)
alexcrichton commentedon May 3, 2024
My understanding of ocaml is shaky at best but by my read the current implementation of the binary encoding of a table type is to use the third bit of the prefix byte is used to indicate whether the index type is i64 (where if it's 0 then it's i32, as-is today). This makes sense for memories where the second bit was already claimed for the
sharedbit by the threads proposal, but I wanted to raise a question here if this is the desired encoding for tables. That means that the second bit in the table type prefix byte is currently unused.Given the shared-everything-threads proposal it seems like we'll get a
sharedtable type one day so thinking about this I think it might make sense to leave the hole, but I wanted to be sure to flag this and ensure that it was intentional and not accidental (e.g. I can see how it would be easy to just reuse what was already in the interpreter)sbc100 commentedon May 3, 2024
Yes, the idea is tie match the flags that we use for memories.
For example, in wabt we have: https://github.com/WebAssembly/wabt/blob/356931a867c7d642bc282fff46a1c95ab0e843f3/include/wabt/binary.h#L24-L29 and these flags are used for both memories and tables. It makes sense to me to re-use these, even though we don't currently have shared tables. Are there downsides to doing this that you are thinking of?
alexcrichton commentedon May 4, 2024
I don't think there's any downside to doing this, no. In Wasmtime we don't parse limits in the same way between tables/memories because for so long the encoding of tables/memories has diverged - for example for quite some times memories can be shared or 64-bit but tables can't be. Even with the table64 extension and a hypothetical shared table type the custom-page-sizes proposal still has different parsing of the flags byte which won't ever get mapped to tables.
Basically while the parsing of limits was trivially the same between memories/tables I don't think we should take it as a design guideline that they must match for all future proposals as well. The 64-bit-ness and shared-ness makes sense to match since we might as well, though.
rossberg commentedon May 4, 2024
Unless there is a strong reason to do otherwise (like running out of bits), I think it's preferable to keep them in sync. (We have been doing the same for elem/data segments.)
[memory64] Add table64 to existing memory64 support
[memory64] Add table64 to existing memory64 support
[memory64] Add table64 to existing memory64 support
[memory64] Add table64 to existing memory64 support
[memory64] Add table64 to existing memory64 support
[memory64] Add table64 to existing memory64 support
10 remaining items
[WebAssembly] Use 64-bit table when targeting wasm64
[WebAssembly] Use 64-bit table when targeting wasm64
Update testsuite and implement table64
Update testsuite and implement table64
Update testsuite and implement table64
Update testsuite and implement table64 (#2418)
[WebAssembly] Use 64-bit table when targeting wasm64
[WebAssembly] Use 64-bit table when targeting wasm64 (#92042)
bvisness commentedon Jul 29, 2024
The SpiderMonkey implementation has landed in Nightly: https://bugzilla.mozilla.org/show_bug.cgi?id=1893643
Aside from the concerns laid out in #68, our implementation is ready for phase 4.
sbc100 commentedon Jul 30, 2024
Fantastic. Thanks for all the work on this. I think #68 is now the only blocker.
sbc100 commentedon Aug 6, 2024
@bvisness is there a command line flag I need to pass to spidermonkey to enable memory64? I'm trying to run some tests in emscripten CI.
eqrion commentedon Aug 6, 2024
In the shell it should get enabled with
-P wasm_memory64(-P enables prefs). In the browser, about:config it should bejavascript.options.wasm_memory64. I believe nightly builds have it enabled by default.sbc100 commentedon Aug 6, 2024
Hmm.. I can't seem to make -P work: