Skip to content

Conversation

@dmitry123
Copy link
Member

No description provided.

dmitry123 and others added 30 commits May 8, 2025 13:36
* refactor!: a major refactoring of rwasm compiler and executor

* fix: parsing i32 params

* chore: code cleanup and tiny fixes

* ci: enable running e2e tests after unit tests

* ci: fix missing symbol in ci config

* refactor: simplifying the runtime

- Remove `ElementSegmentEntity` and associated logic.
- Refactor `RwasmExecutor` to use bit vectors for tracking empty segments.
- Consolidate module organization, migrating `executor` to `vm`.
- Replace legacy data structures with more efficient implementations.
- Update Cargo dependencies, adding `bitvec` and removing unused packages.
* feat(svm): increas initial global memory 2 times

* feat(svm): put N_MAX_MEMORY_PAGES under the feature

* feat(svm): added comment

---------

Co-authored-by: Stas Stepanov <[email protected]>
…since it's always zero), simplified indirect calls to null, add support of constructor params, tiny bug fixes
…dd support of default imported global value, signature check collision, segment compilation order, execution of global variable, global compilation, func types calculation, global variable init issue, func ref offset calculation, table elements allocation
…it code from runtime, add `no_std` compilation test
bfdays and others added 10 commits October 14, 2025 22:10
…ry only for unix; rewrote some benches using iter_batched strategy (#60)

* feat(rwasm-optimisation): turn on pooling-allocator; enable unix-memory only for unix

* feat(rwasm-optimisation): reuse iter_batched for all possible benches

* feat(rwasm-optimisation): perf graph for fib32 on wasmtime

* feat(rwasm-optimisation): rollback iter_batched to iter for bench_strategy

* chore: tiny dep fix

---------

Co-authored-by: Dmitry Savonin <[email protected]>
* fix: don't store acquired call/value stack inside engine

* feat(vm): implement reusable memories/stack, fix bug with clearing on-demand memory, add engine config with memory allocator config, tiny engine refactoring
* fix: default config for shared engine

* chore: warning fixes
@github-actions
Copy link

github-actions bot commented Oct 21, 2025

Criterion results (vs baseline)


running 2 tests
test tests::fib32_rwasm_test ... ignored
test tests::fib32_wasmtime_test ... ignored

test result: ok. 0 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 0.00s

Comparisons/bitvec      time:   [18.592 µs 18.601 µs 18.611 µs]
Found 19 outliers among 200 measurements (9.50%)
  3 (1.50%) low severe
  5 (2.50%) low mild
  10 (5.00%) high mild
  1 (0.50%) high severe
Comparisons/bitvec_inlined
                        time:   [3.7351 µs 3.7360 µs 3.7371 µs]
Found 33 outliers among 200 measurements (16.50%)
  6 (3.00%) low severe
  1 (0.50%) low mild
  12 (6.00%) high mild
  14 (7.00%) high severe
Comparisons/bitvec_inlined (half of inline store)
                        time:   [1.8652 µs 1.8655 µs 1.8658 µs]
Found 25 outliers among 200 measurements (12.50%)
  7 (3.50%) low severe
  4 (2.00%) low mild
  6 (3.00%) high mild
  8 (4.00%) high severe
RwasmModule {
 .function_begin_0 (#0)
  0000: StackCheck(5)
  0001: I32Const(1)
  0002: MemoryGrow
  0003: Drop
  0004: I32Const(0)
  0005: I32Const(0)
  0006: I32Const(80)
  0007: MemoryInit(0)
  0008: DataDrop(1)
  0009: ReturnCallInternal(10)
 .function_end

 .function_begin_10 (#1)
  0010: SignatureCheck(0)
  0011: ConsumeFuel(4)
  0012: StackCheck(4)
  0013: LocalGet(1)
  0014: LocalGet(1)
  0015: I32Load(4)
  0016: LocalGet(2)
  0017: I32Load(0)
  0018: LocalSet(2)
  0019: LocalGet(2)
  0020: LocalSet(3)
  0021: LocalGet(1)
  0022: LocalSet(2)
  0023: Drop
  0024: Return
 .function_end

 .ro_data: [61, 62, 63, 64, 65, 66, 67, 68, 69, 6a, 6b, 6c, 6d, 6e, 6f, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 7a, 61, 62, 63, 64, 65, 66, 67, 68, 69, 6a, 6b, 6c, 6d, 6e, 6f, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 7a, 61, 62, 63, 64, 65, 66, 67, 68, 69, 6a, 6b, 6c, 6d, 6e, 6f, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 7a, 61, 62],
 .ro_elem: [],
}

Comparisons/bitvec_inlined (through ExecutionEngine)
                        time:   [3.3594 ms 3.3631 ms 3.3691 ms]
Found 5 outliers among 200 measurements (2.50%)
  3 (1.50%) high mild
  2 (1.00%) high severe

Comparisons Module Compilation/bench_evm
                        time:   [417.17 ns 417.42 ns 417.66 ns]
Found 5 outliers among 200 measurements (2.50%)
  1 (0.50%) low mild
  2 (1.00%) high mild
  2 (1.00%) high severe
Comparisons Module Compilation/bench_wasmtime
                        time:   [4.8105 ms 4.8120 ms 4.8134 ms]
Found 2 outliers among 200 measurements (1.00%)
  1 (0.50%) low mild
  1 (0.50%) high mild
Comparisons Module Compilation/bench_wasmi
                        time:   [19.849 µs 19.878 µs 19.906 µs]
Found 16 outliers among 200 measurements (8.00%)
  13 (6.50%) high mild
  3 (1.50%) high severe
Comparisons Module Compilation/bench_rwasm
                        time:   [26.926 µs 26.938 µs 26.952 µs]
Found 16 outliers among 200 measurements (8.00%)
  6 (3.00%) low severe
  3 (1.50%) low mild
  3 (1.50%) high mild
  4 (2.00%) high severe

Comparisons Fib256/bench_native
                        time:   [41.292 ns 41.298 ns 41.306 ns]
Found 22 outliers among 200 measurements (11.00%)
  11 (5.50%) low severe
  3 (1.50%) low mild
  3 (1.50%) high mild
  5 (2.50%) high severe
Comparisons Fib256/bench_evm
                        time:   [26.167 µs 26.206 µs 26.248 µs]
Found 2 outliers among 200 measurements (1.00%)
  2 (1.00%) high mild
Comparisons Fib256/bench_wasmtime
                        time:   [3.3990 µs 3.4019 µs 3.4047 µs]
Found 26 outliers among 200 measurements (13.00%)
  7 (3.50%) low severe
  7 (3.50%) low mild
  5 (2.50%) high mild
  7 (3.50%) high severe
Comparisons Fib256/bench_wasmi
                        time:   [7.1959 µs 7.1971 µs 7.1984 µs]
Found 24 outliers among 200 measurements (12.00%)
  7 (3.50%) low severe
  6 (3.00%) low mild
  5 (2.50%) high mild
  6 (3.00%) high severe
Comparisons Fib256/bench_rwasm
                        time:   [3.8236 µs 3.8283 µs 3.8325 µs]
Found 2 outliers among 200 measurements (1.00%)
  1 (0.50%) high mild
  1 (0.50%) high severe

Comparisons fib32/bench_native
                        time:   [6.9503 ns 6.9514 ns 6.9526 ns]
Found 28 outliers among 200 measurements (14.00%)
  12 (6.00%) low severe
  3 (1.50%) low mild
  9 (4.50%) high mild
  4 (2.00%) high severe
Comparisons fib32/bench_evm
                        time:   [21.851 µs 21.868 µs 21.887 µs]
Found 12 outliers among 200 measurements (6.00%)
  1 (0.50%) low mild
  7 (3.50%) high mild
  4 (2.00%) high severe
Comparisons fib32/bench_wasmtime
                        time:   [3.3577 µs 3.4002 µs 3.4594 µs]
Found 30 outliers among 200 measurements (15.00%)
  7 (3.50%) low severe
  5 (2.50%) low mild
  7 (3.50%) high mild
  11 (5.50%) high severe
Comparisons fib32/bench_wasmi
                        time:   [2.0683 µs 2.0687 µs 2.0691 µs]
Found 21 outliers among 200 measurements (10.50%)
  8 (4.00%) low severe
  3 (1.50%) low mild
  5 (2.50%) high mild
  5 (2.50%) high severe
Comparisons fib32/bench_rwasm
                        time:   [1.5131 µs 1.5135 µs 1.5138 µs]
Found 21 outliers among 200 measurements (10.50%)
  7 (3.50%) low severe
  6 (3.00%) low mild
  6 (3.00%) high mild
  2 (1.00%) high severe

Comparisons fib64/bench_native
                        time:   [6.8331 ns 6.8346 ns 6.8367 ns]
Found 34 outliers among 200 measurements (17.00%)
  11 (5.50%) low severe
  4 (2.00%) low mild
  10 (5.00%) high mild
  9 (4.50%) high severe
Comparisons fib64/bench_evm
                        time:   [23.547 µs 23.644 µs 23.747 µs]
Found 19 outliers among 200 measurements (9.50%)
  1 (0.50%) low mild
  11 (5.50%) high mild
  7 (3.50%) high severe
Comparisons fib64/bench_wasmtime
                        time:   [3.2502 µs 3.2531 µs 3.2560 µs]
Found 29 outliers among 200 measurements (14.50%)
  7 (3.50%) low severe
  8 (4.00%) low mild
  6 (3.00%) high mild
  8 (4.00%) high severe
Comparisons fib64/bench_wasmi
                        time:   [2.1259 µs 2.1262 µs 2.1265 µs]
Found 21 outliers among 200 measurements (10.50%)
  7 (3.50%) low severe
  2 (1.00%) low mild
  7 (3.50%) high mild
  5 (2.50%) high severe
Comparisons fib64/bench_rwasm
                        time:   [4.0313 µs 4.0330 µs 4.0349 µs]
Found 14 outliers among 200 measurements (7.00%)
  7 (3.50%) low mild
  3 (1.50%) high mild
  4 (2.00%) high severe

Comparisons Module Parsing/bench_evm
                        time:   [311.36 ps 312.21 ps 313.26 ps]
Found 36 outliers among 200 measurements (18.00%)
  10 (5.00%) low severe
  1 (0.50%) low mild
  5 (2.50%) high mild
  20 (10.00%) high severe

Heads-up: runner perf is noisy; treat deltas as a smoke check.

@dmitry123 dmitry123 force-pushed the devel branch 2 times, most recently from bcc771d to d808ed0 Compare November 3, 2025 18:49
djadjka and others added 9 commits November 6, 2025 22:21
* add memory access for i64 ops

* fix magic
* update i32_mul64 that works with spec

* clint

* fix

---------

Co-authored-by: Suleyman Kardas <[email protected]>
revert to original implementation of I32Mul64
* update i32_mul64 that works with spec

* clint

* rebase tracing

* fix zkvm

---------

Co-authored-by: Suleyman Kardas <[email protected]>
* feat: add sig check

* use memory for sig check

* fix clk

* fix
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.

6 participants