Reimplement fast-path validation of MVP types #1930
Reimplement fast-path validation of MVP types #1930alexcrichton merged 3 commits intobytecodealliance:mainfrom
Conversation
Benchmark the "fast path" in type interning.
This commit fixes an issue from bytecodealliance#1906 which is preventing the upgrade of wasm-tools in Wasmtime. That commit implemented a fast path by skipping a function and reimplementing parts of it internally, but that then caused Wasmtime to panic when other data structures weren't filled out. The intention was that the user-facing interface doesn't change depending on features, so this is an attempt at fixing the mistake in that commit. The fix here is to remove the fast path added and restructure it differently. Instead now the fast and normal paths have much less divergence which should prevent this issue from re-surfacing. This is 15% slower than `main` but it doesn't have the same bug as `main` so for now that may be the best that can be done.
|
cc @Robbepop |
|
@alexcrichton looks reasonable. Can you provide me a link to the Wasmtime issue? It is nicer that you managed to unify both implementations. The 15% slowdown is a bummer. Do you have an idea how to make it faster again? According to my benchmarks |
|
No issue on the wasmtime side, just a failed build. The failure is in this loop which is iterating by rec groups and specifically this one was the failure where the fast path wasn't maintaining the rec group lists. My guess is we could probably skip maintenance of the rec group lists entirely in the fast path, but only if the other paths that read these lists understand that they may be optional and/or not populated. That might require plumbing |
Sounds great and worthwhile! |
This commit fixes an issue from #1906 which is preventing the upgrade of
wasm-tools in Wasmtime. That commit implemented a fast path by skipping
a function and reimplementing parts of it internally, but that then
caused Wasmtime to panic when other data structures weren't filled out.
The intention was that the user-facing interface doesn't change
depending on features, so this is an attempt at fixing the mistake in
that commit.
The fix here is to remove the fast path added and restructure it
differently. Instead now the fast and normal paths have much less
divergence which should prevent this issue from re-surfacing. This is
15% slower than
mainbut it doesn't have the same bug asmainso fornow that may be the best that can be done.