Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement bulk-memory Wasm proposal #628

Merged
merged 49 commits into from Jan 25, 2023
Merged

Conversation

Robbepop
Copy link
Collaborator

@Robbepop Robbepop commented Jan 21, 2023

Closes #364.

This PR also updates the Wasm spec testsuite to a much more recent version where bulk-memory´ and reference-typesare already included as stable components of the Wasm standard. However, sincewasmidoes not yet supportreference-types` that means that we had to expect failures for a subset of the Wasm spec testsuite tests temporarily.

We are going to merge this PR and immediately create a follow-up PR that implements the reference-types Wasm proposal in order to make those tests pass again.

They are currently all failing obviously since bulk-memory has not yet been implemented.
The goal is to implement bulk-memory until all tests pass in this PR.
Those errors are now panics which makes more sense considering the fact that the wasmparser crate already filters out all of those items unless there is a bug. And if there is a bug we should panic instead of properly managing the error.
@paritytech-cicd-pr
Copy link

paritytech-cicd-pr commented Jan 21, 2023

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
bare_call_0
1.34ms 1.33ms ⚪ -0.34% 1.10ms 1.10ms ⚪ -0.59% 🟢 -18%
execute/
bare_call_0/typed
1.02ms 1.02ms ⚪ -0.42% 746.59µs 754.96µs ⚪ 1.04% 🟢 -26%
execute/
bare_call_1
1.41ms 1.40ms 🔴 -0.68% 1.19ms 1.26ms 🔴 6.05% 🟢 -10%
execute/
bare_call_16
2.32ms 2.45ms 🔴 5.78% 4.24ms 4.25ms 🔴 0.28% 🟡 74%
execute/
bare_call_16/typed
1.56ms 1.94ms 🔴 24.65% 2.62ms 2.65ms 🔴 1.34% 🟢 37%
execute/
bare_call_1/typed
1.10ms 1.12ms 🔴 1.74% 1.07ms 1.14ms 🔴 7.46% 🟢 2%
execute/
bare_call_4
1.53ms 1.56ms 🔴 2.18% 1.78ms 1.89ms 🔴 6.32% 🟢 21%
execute/
bare_call_4/typed
1.09ms 1.13ms 🔴 3.70% 1.20ms 1.26ms 🔴 4.81% 🟢 11%
execute/
br_table
1.10ms 1.17ms 🔴 7.18% 1.36ms 1.32ms 🟢 -3.34% 🟢 13%
execute/
count_until
651.33µs 682.19µs 🔴 4.76% 2.40ms 2.09ms 🟢 -12.83% 🔴 206%
execute/
factorial_iterative
315.11µs 317.93µs ⚪ 0.94% 962.73µs 916.19µs 🟢 -4.89% 🔴 188%
execute/
factorial_recursive
626.46µs 630.06µs ⚪ 0.48% 1.26ms 1.31ms 🔴 4.13% 🔴 108%
execute/
fib_iterative
1.49ms 1.41ms 🟢 -5.40% 5.54ms 5.05ms 🟢 -9.01% 🔴 258%
execute/
fib_recursive
5.68ms 5.73ms ⚪ 1.12% 10.82ms 11.79ms 🔴 9.11% 🔴 106%
execute/
global_bump
949.15µs 1.04ms 🔴 10.12% 2.66ms 2.78ms 🔴 4.41% 🔴 166%
execute/
global_const
773.45µs 723.59µs 🟢 -8.72% 2.79ms 2.12ms 🟢 -24.02% 🔴 193%
execute/
host_calls
26.08µs 25.72µs ⚪ -0.74% 36.31µs 36.47µs ⚪ 0.81% 🟢 42%
execute/
memory_fill
1.22ms 1.24ms 🔴 1.45% 4.40ms 4.08ms 🟢 -7.24% 🔴 228%
execute/
memory_sum
1.18ms 1.26ms 🔴 6.80% 4.39ms 3.93ms 🟢 -10.42% 🔴 213%
execute/
memory_vec_add
2.42ms 2.45ms 🔴 1.92% 8.31ms 7.90ms 🟢 -4.90% 🔴 222%
execute/
recursive_is_even
1.16ms 1.14ms ⚪ -0.76% 2.26ms 2.19ms 🟢 -3.28% 🟡 92%
execute/
recursive_ok
142.19µs 144.36µs 🔴 1.71% 285.89µs 299.36µs 🔴 4.87% 🔴 107%
execute/
recursive_scan
174.03µs 175.32µs ⚪ 0.73% 356.39µs 389.94µs 🔴 9.55% 🔴 122%
execute/
recursive_trap
13.80µs 14.34µs 🔴 3.85% 28.86µs 29.35µs 🔴 1.66% 🔴 105%
execute/
regex_redux
523.81µs 525.00µs ⚪ 0.25% 1.40ms 1.40ms ⚪ 0.41% 🔴 167%
execute/
rev_complement
481.13µs 473.05µs 🟢 -1.72% 1.46ms 1.44ms 🟢 -1.82% 🔴 204%
execute/
tiny_keccak
335.56µs 332.23µs ⚪ -0.88% 1.22ms 1.17ms 🟢 -4.26% 🔴 252%
execute/
trunc_f2i
694.53µs 701.70µs ⚪ 1.07% 2.14ms 2.18ms ⚪ 1.76% 🔴 211%
instantiate/
wasm_kernel
64.98µs 63.63µs ⚪ -2.68% 83.45µs 82.60µs ⚪ -0.63% 🟢 30%
translate/
erc1155
205.67µs 208.18µs ⚪ 1.17% 371.00µs 383.47µs 🔴 3.49% 🟡 84%
translate/
erc20
101.56µs 103.07µs ⚪ 1.07% 180.84µs 188.25µs 🔴 4.40% 🟡 83%
translate/
erc721
148.81µs 147.50µs ⚪ 0.41% 263.90µs 272.57µs 🔴 3.33% 🟡 85%
translate/
spidermonkey
0.00ns 0.00ns 🔴 1.33% 0.00ns 0.00ns 🔴 3.24% 🟢 0%
translate/
wasm_kernel
3.75ms 3.77ms ⚪ 0.70% 7.18ms 7.36ms 🔴 2.22% 🟡 95%

Link to pipeline

@Robbepop Robbepop marked this pull request as ready for review January 25, 2023 12:41
@Robbepop Robbepop changed the title WIP: Implement bulk-memory Wasm proposal Implement bulk-memory Wasm proposal Jan 25, 2023
@Robbepop Robbepop merged commit 5f9d81a into master Jan 25, 2023
@Robbepop Robbepop deleted the rf-implement-bulk-memory branch January 25, 2023 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Wasm proposal: bulk-memory
2 participants