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 resumable calls via register-machine wasmi engine backend #814

Merged
merged 8 commits into from
Nov 30, 2023

Conversation

Robbepop
Copy link
Member

Closes #811.

@paritytech-cicd-pr
Copy link

paritytech-cicd-pr commented Nov 29, 2023

BENCHMARKS

NATIVEWASMTIME
BENCHMARKMASTERPRDIFFMASTERPRDIFFWASMTIME OVERHEAD
execute/
br_table
1.53ms 1.52ms ⚪ -0.28% 1.31ms 1.38ms 🔴 5.61% 🟢 -9%
execute/
call/host/1
36.33µs 36.73µs ⚪ 2.18% 38.73µs 38.37µs ⚪ -0.97% 🟢 4%
execute/
call/rec
169.51µs 165.81µs 🟢 -1.78% 357.37µs 388.64µs 🔴 11.84% 🔴 134%
execute/
count_until
7.57ms 7.46ms ⚪ -0.78% 7.53ms 7.60ms ⚪ 0.98% 🟢 2%
execute/
factorial/iter
248.05µs 210.96µs 🟢 -14.03% 303.86µs 315.46µs 🔴 3.80% 🟢 50%
execute/
factorial/rec
685.06µs 677.10µs ⚪ -1.23% 1.30ms 1.36ms 🔴 4.43% 🟡 100%
execute/
fibonacci/iter
1.39ms 1.36ms 🟢 -2.01% 1.27ms 1.18ms 🟢 -7.48% 🟢 -13%
execute/
fibonacci/rec
6.36ms 6.10ms 🟢 -4.11% 13.24ms 13.42ms 🔴 1.38% 🔴 120%
execute/
fibonacci/tail
1.42ms 1.38ms 🟢 -3.42% 3.62ms 3.72ms 🔴 2.70% 🔴 170%
execute/
fuse
7.25ms 8.01ms 🔴 10.55% 12.68ms 12.94ms 🔴 2.02% 🟡 62%
execute/
global/bump
1.32ms 1.33ms ⚪ 0.30% 1.66ms 1.60ms 🟢 -3.81% 🟢 21%
execute/
global/get_const
707.90µs 735.55µs 🔴 3.76% 751.00µs 747.44µs ⚪ -0.49% 🟢 2%
execute/
is_even/rec
1.08ms 1.12ms 🔴 3.62% 2.24ms 2.41ms 🔴 7.42% 🔴 116%
execute/
memory/fill_bytes
1.13ms 1.14ms ⚪ 1.11% 1.24ms 1.22ms 🟢 -1.88% 🟢 7%
execute/
memory/sum_bytes
1.09ms 1.13ms 🔴 3.76% 1.26ms 1.20ms 🟢 -4.35% 🟢 6%
execute/
memory/vec_add
2.94ms 2.95ms ⚪ 0.58% 3.58ms 3.51ms 🟢 -2.24% 🟢 19%
execute/
recursive_scan
189.67µs 184.02µs 🟢 -3.07% 376.67µs 402.80µs 🔴 7.02% 🔴 119%
execute/
recursive_trap
15.84µs 15.48µs 🟢 -1.88% 36.65µs 37.93µs 🔴 3.76% 🔴 145%
execute/
regex_redux
594.92µs 595.12µs ⚪ 0.33% 1.04ms 1.01ms 🟢 -2.51% 🟡 70%
execute/
rev_complement
440.75µs 445.27µs ⚪ 1.00% 659.97µs 661.17µs ⚪ 0.24% 🟢 48%
execute/
tiny_keccak
350.10µs 352.14µs ⚪ 0.39% 388.32µs 395.86µs 🔴 2.15% 🟢 12%
execute/
trunc_f2i
614.49µs 615.28µs ⚪ 0.05% 943.30µs 941.88µs ⚪ -0.23% 🟡 53%
instantiate/
wasm_kernel
55.25µs 55.18µs ⚪ 2.39% 56.40µs 56.59µs ⚪ 0.83% 🟢 3%
overhead/
call/typed/0
1.23ms 1.22ms ⚪ -1.12% 891.24µs 950.76µs 🔴 6.73% 🟢 -22%
overhead/
call/typed/16
1.61ms 1.59ms ⚪ -1.34% 2.06ms 2.24ms 🔴 9.16% 🟢 41%
overhead/
call/untyped/0
1.65ms 1.61ms 🟢 -2.47% 1.35ms 1.35ms ⚪ -0.32% 🟢 -16%
overhead/
call/untyped/16
2.57ms 2.42ms 🟢 -5.88% 3.92ms 4.20ms 🔴 6.90% 🟡 73%
translate/
bz2/default
1.38ms 1.39ms ⚪ 0.76% 2.57ms 2.46ms 🟢 -3.92% 🟡 77%
translate/
bz2/fuel
1.42ms 1.44ms 🔴 1.43% 2.72ms 2.62ms 🟢 -3.41% 🟡 81%
translate/
erc1155/default
284.26µs 282.96µs ⚪ -0.03% 496.27µs 476.07µs 🟢 -4.14% 🟡 68%
translate/
erc1155/fuel
302.06µs 302.44µs ⚪ -0.24% 524.46µs 521.86µs ⚪ -0.70% 🟡 73%
translate/
erc20/default
135.54µs 136.72µs ⚪ 0.91% 237.26µs 227.49µs 🟢 -3.96% 🟡 66%
translate/
erc20/fuel
143.98µs 144.88µs ⚪ 0.58% 248.16µs 238.08µs 🟢 -4.01% 🟡 64%
translate/
erc721/default
193.67µs 196.10µs ⚪ 1.17% 340.19µs 329.83µs 🟢 -2.93% 🟡 68%
translate/
erc721/fuel
204.57µs 205.42µs ⚪ 0.28% 355.82µs 347.56µs 🟢 -2.73% 🟡 69%
translate/
pulldown_cmark/default
3.77ms 3.78ms ⚪ 0.31% 6.72ms 6.58ms 🟢 -2.02% 🟡 74%
translate/
pulldown_cmark/fuel
3.85ms 3.88ms ⚪ 0.87% 7.12ms 6.86ms 🟢 -3.16% 🟡 77%
translate/
spidermonkey/default
0.00ns 0.00ns ⚪ -0.04% 0.00ns 0.00ns 🟢 -3.09% 🟢 0%
translate/
spidermonkey/fuel
0.00ns 0.00ns ⚪ 0.52% 0.00ns 0.00ns 🟢 -2.88% 🟢 0%
translate/
wasm_kernel/default
5.05ms 5.13ms 🔴 1.72% 8.94ms 8.72ms 🟢 -2.69% 🟡 70%
translate/
wasm_kernel/fuel
5.16ms 5.21ms ⚪ 0.77% 9.37ms 9.15ms 🟢 -2.40% 🟡 76%

Link to pipeline

Tails calls work when calling host functions in the new register-machine engine.
@codecov-commenter
Copy link

codecov-commenter commented Nov 30, 2023

Codecov Report

Attention: 99 lines in your changes are missing coverage. Please review.

Comparison is base (52f180c) 81.45% compared to head (a76aa21) 81.15%.

Files Patch % Lines
crates/wasmi/src/engine/regmach/mod.rs 0.00% 51 Missing ⚠️
crates/wasmi/src/engine/resumable.rs 43.75% 18 Missing ⚠️
crates/wasmi/src/engine/regmach/executor/mod.rs 33.33% 14 Missing ⚠️
crates/wasmi/src/engine/mod.rs 52.17% 11 Missing ⚠️
crates/wasmi/src/engine/regmach/trap.rs 55.55% 4 Missing ⚠️
...s/wasmi/src/engine/regmach/executor/instrs/call.rs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #814      +/-   ##
==========================================
- Coverage   81.45%   81.15%   -0.31%     
==========================================
  Files         274      275       +1     
  Lines       25389    25510     +121     
==========================================
+ Hits        20680    20702      +22     
- Misses       4709     4808      +99     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Robbepop Robbepop merged commit 11f51be into master Nov 30, 2023
18 checks passed
@Robbepop Robbepop deleted the rf-regmach-resumable-calls branch November 30, 2023 11:28
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 resumable function calls for the register-machine wasmi engine backend
3 participants