Skip to content

feat(wasm): support bulk memory operations proposal (interpreter mode)#415

Open
ys8888john wants to merge 1 commit intoDTVMStack:mainfrom
ys8888john:wasm-bulk-memory
Open

feat(wasm): support bulk memory operations proposal (interpreter mode)#415
ys8888john wants to merge 1 commit intoDTVMStack:mainfrom
ys8888john:wasm-bulk-memory

Conversation

@ys8888john
Copy link
Contributor

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y

2. What is the scope of this PR (e.g. component or file name):

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains CI/CD configuration changes
  • Contains documentation changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

6. Release note

None

@github-actions
Copy link

github-actions bot commented Mar 18, 2026

⚡ Performance Regression Check Results

✅ Performance Check Passed (interpreter)

Performance Benchmark Results (threshold: 25%)

Benchmark Baseline (us) Current (us) Change Status
total/main/blake2b_huff/8415nulls 1.48 1.49 +0.5% PASS
total/main/blake2b_huff/empty 0.02 0.02 +0.4% PASS
total/main/blake2b_shifts/8415nulls 11.52 11.70 +1.5% PASS
total/main/sha1_divs/5311 5.11 5.00 -2.1% PASS
total/main/sha1_divs/empty 0.06 0.06 -0.9% PASS
total/main/sha1_shifts/5311 2.86 2.81 -1.8% PASS
total/main/sha1_shifts/empty 0.04 0.04 +1.1% PASS
total/main/snailtracer/benchmark 52.84 53.25 +0.8% PASS
total/main/structarray_alloc/nfts_rank 1.01 1.04 +3.5% PASS
total/main/swap_math/insufficient_liquidity 0.00 0.00 +2.1% PASS
total/main/swap_math/received 0.01 0.01 +1.2% PASS
total/main/swap_math/spent 0.00 0.00 +0.4% PASS
total/main/weierstrudel/1 0.29 0.29 -1.3% PASS
total/main/weierstrudel/15 3.16 3.15 -0.2% PASS
total/micro/JUMPDEST_n0/empty 1.63 1.64 +0.3% PASS
total/micro/jump_around/empty 0.09 0.09 -2.1% PASS
total/micro/loop_with_many_jumpdests/empty 24.89 24.87 -0.1% PASS
total/micro/memory_grow_mload/by1 0.09 0.09 +8.9% PASS
total/micro/memory_grow_mload/by16 0.10 0.10 +4.0% PASS
total/micro/memory_grow_mload/by32 0.11 0.11 -2.3% PASS
total/micro/memory_grow_mload/nogrow 0.09 0.09 +4.6% PASS
total/micro/memory_grow_mstore/by1 0.09 0.09 +1.9% PASS
total/micro/memory_grow_mstore/by16 0.11 0.10 -3.1% PASS
total/micro/memory_grow_mstore/by32 0.12 0.12 -4.6% PASS
total/micro/memory_grow_mstore/nogrow 0.09 0.09 +2.6% PASS
total/micro/signextend/one 0.27 0.23 -12.6% PASS
total/micro/signextend/zero 0.27 0.23 -13.3% PASS
total/synth/ADD/b0 3.50 1.98 -43.5% PASS
total/synth/ADD/b1 1.99 1.97 -1.0% PASS
total/synth/ADDRESS/a0 4.82 4.86 +0.9% PASS
total/synth/ADDRESS/a1 5.27 5.27 +0.0% PASS
total/synth/AND/b0 1.64 1.63 -0.3% PASS
total/synth/AND/b1 1.69 1.71 +1.0% PASS
total/synth/BYTE/b0 6.04 6.13 +1.6% PASS
total/synth/BYTE/b1 4.72 4.78 +1.3% PASS
total/synth/CALLDATASIZE/a0 3.18 3.05 -3.9% PASS
total/synth/CALLDATASIZE/a1 4.02 3.77 -6.3% PASS
total/synth/CALLER/a0 4.82 4.84 +0.4% PASS
total/synth/CALLER/a1 5.36 5.27 -1.7% PASS
total/synth/CALLVALUE/a0 3.03 3.10 +2.2% PASS
total/synth/CALLVALUE/a1 3.35 3.44 +2.6% PASS
total/synth/CODESIZE/a0 3.43 3.42 -0.2% PASS
total/synth/CODESIZE/a1 3.76 3.77 +0.2% PASS
total/synth/DUP1/d0 0.82 1.15 +39.6% PASS
total/synth/DUP1/d1 1.23 1.23 +0.4% PASS
total/synth/DUP10/d0 1.07 1.15 +7.6% PASS
total/synth/DUP10/d1 1.15 1.23 +6.9% PASS
total/synth/DUP11/d0 1.07 1.15 +7.7% PASS
total/synth/DUP11/d1 0.92 1.23 +34.8% PASS
total/synth/DUP12/d0 1.07 1.15 +7.9% PASS
total/synth/DUP12/d1 0.92 1.23 +34.6% PASS
total/synth/DUP13/d0 0.84 1.23 +45.4% PASS
total/synth/DUP13/d1 1.10 1.23 +11.8% PASS
total/synth/DUP14/d0 1.07 1.15 +7.6% PASS
total/synth/DUP14/d1 1.14 1.00 -13.0% PASS
total/synth/DUP15/d0 1.07 1.15 +7.5% PASS
total/synth/DUP15/d1 1.15 1.23 +7.0% PASS
total/synth/DUP16/d0 1.07 1.15 +7.6% PASS
total/synth/DUP16/d1 0.92 1.23 +34.6% PASS
total/synth/DUP2/d0 1.07 1.14 +7.4% PASS
total/synth/DUP2/d1 1.15 1.23 +7.2% PASS
total/synth/DUP3/d0 1.07 1.15 +7.6% PASS
total/synth/DUP3/d1 1.15 1.23 +7.0% PASS
total/synth/DUP4/d0 1.07 1.15 +7.6% PASS
total/synth/DUP4/d1 1.15 1.23 +7.0% PASS
total/synth/DUP5/d0 1.07 1.15 +7.8% PASS
total/synth/DUP5/d1 1.15 1.23 +7.1% PASS
total/synth/DUP6/d0 1.07 1.15 +7.5% PASS
total/synth/DUP6/d1 1.15 1.23 +7.1% PASS
total/synth/DUP7/d0 1.07 1.15 +7.6% PASS
total/synth/DUP7/d1 0.95 1.23 +29.6% PASS
total/synth/DUP8/d0 0.83 1.23 +48.3% PASS
total/synth/DUP8/d1 1.15 1.23 +7.0% PASS
total/synth/DUP9/d0 1.07 0.99 -7.3% PASS
total/synth/DUP9/d1 1.15 1.23 +7.1% PASS
total/synth/EQ/b0 2.73 2.76 +1.2% PASS
total/synth/EQ/b1 1.39 1.39 +0.1% PASS
total/synth/GAS/a0 3.67 3.67 -0.0% PASS
total/synth/GAS/a1 3.68 3.69 +0.3% PASS
total/synth/GT/b0 2.61 2.63 +0.8% PASS
total/synth/GT/b1 1.39 1.48 +6.4% PASS
total/synth/ISZERO/u0 0.99 0.98 -0.3% PASS
total/synth/JUMPDEST/n0 1.63 1.63 -0.1% PASS
total/synth/LT/b0 2.67 2.67 +0.1% PASS
total/synth/LT/b1 1.39 1.47 +6.3% PASS
total/synth/MSIZE/a0 4.25 4.28 +0.7% PASS
total/synth/MSIZE/a1 4.67 4.68 +0.1% PASS
total/synth/MUL/b0 5.29 5.29 -0.0% PASS
total/synth/MUL/b1 5.29 5.29 -0.0% PASS
total/synth/NOT/u0 1.68 1.66 -1.5% PASS
total/synth/OR/b0 1.63 1.63 +0.0% PASS
total/synth/OR/b1 1.71 1.71 +0.1% PASS
total/synth/PC/a0 3.16 3.09 -2.4% PASS
total/synth/PC/a1 4.01 3.71 -7.7% PASS
total/synth/PUSH1/p0 1.07 0.98 -7.5% PASS
total/synth/PUSH1/p1 1.13 1.16 +2.7% PASS
total/synth/PUSH10/p0 1.07 0.99 -7.3% PASS
total/synth/PUSH10/p1 1.19 1.19 +0.3% PASS
total/synth/PUSH11/p0 1.07 0.99 -7.2% PASS
total/synth/PUSH11/p1 1.20 1.20 -0.4% PASS
total/synth/PUSH12/p0 1.07 0.99 -7.7% PASS
total/synth/PUSH12/p1 1.23 1.20 -2.9% PASS
total/synth/PUSH13/p0 1.07 0.99 -7.6% PASS
total/synth/PUSH13/p1 1.20 1.20 +0.5% PASS
total/synth/PUSH14/p0 1.07 1.00 -7.1% PASS
total/synth/PUSH14/p1 1.20 1.19 -0.6% PASS
total/synth/PUSH15/p0 0.83 0.98 +18.6% PASS
total/synth/PUSH15/p1 1.28 1.28 +0.4% PASS
total/synth/PUSH16/p0 1.07 0.85 -20.7% PASS
total/synth/PUSH16/p1 1.20 1.21 +0.6% PASS
total/synth/PUSH17/p0 1.07 1.07 -0.1% PASS
total/synth/PUSH17/p1 1.21 1.19 -1.2% PASS
total/synth/PUSH18/p0 1.07 0.85 -20.5% PASS
total/synth/PUSH18/p1 1.21 1.21 +0.0% PASS
total/synth/PUSH19/p0 0.84 0.99 +17.0% PASS
total/synth/PUSH19/p1 1.24 1.20 -3.5% PASS
total/synth/PUSH2/p0 0.83 1.07 +28.7% PASS
total/synth/PUSH2/p1 1.15 1.17 +1.8% PASS
total/synth/PUSH20/p0 1.07 0.99 -7.7% PASS
total/synth/PUSH20/p1 1.21 1.21 -0.1% PASS
total/synth/PUSH21/p0 1.07 0.99 -7.7% PASS
total/synth/PUSH21/p1 1.21 1.20 -1.1% PASS
total/synth/PUSH22/p0 0.85 0.98 +15.4% PASS
total/synth/PUSH22/p1 1.22 1.20 -1.3% PASS
total/synth/PUSH23/p0 1.07 0.85 -20.5% PASS
total/synth/PUSH23/p1 1.24 1.24 +0.4% PASS
total/synth/PUSH24/p0 0.85 1.07 +25.6% PASS
total/synth/PUSH24/p1 1.25 1.21 -3.5% PASS
total/synth/PUSH25/p0 1.07 1.07 +0.0% PASS
total/synth/PUSH25/p1 1.24 1.21 -2.5% PASS
total/synth/PUSH26/p0 1.07 0.84 -21.3% PASS
total/synth/PUSH26/p1 1.24 1.22 -2.2% PASS
total/synth/PUSH27/p0 0.85 0.99 +15.7% PASS
total/synth/PUSH27/p1 1.24 1.20 -2.7% PASS
total/synth/PUSH28/p0 1.07 1.07 -0.0% PASS
total/synth/PUSH28/p1 1.22 1.22 -0.4% PASS
total/synth/PUSH29/p0 1.07 1.07 -0.1% PASS
total/synth/PUSH29/p1 1.23 1.20 -2.5% PASS
total/synth/PUSH3/p0 0.83 1.07 +28.1% PASS
total/synth/PUSH3/p1 1.21 1.19 -2.0% PASS
total/synth/PUSH30/p0 1.08 1.01 -6.9% PASS
total/synth/PUSH30/p1 1.24 1.21 -2.2% PASS
total/synth/PUSH31/p0 0.85 1.07 +25.6% PASS
total/synth/PUSH31/p1 1.31 1.31 -0.1% PASS
total/synth/PUSH32/p0 1.07 1.07 +0.0% PASS
total/synth/PUSH32/p1 1.24 1.23 -1.3% PASS
total/synth/PUSH4/p0 1.07 0.85 -20.3% PASS
total/synth/PUSH4/p1 1.20 1.19 -1.2% PASS
total/synth/PUSH5/p0 0.83 1.06 +28.2% PASS
total/synth/PUSH5/p1 1.21 1.20 -0.7% PASS
total/synth/PUSH6/p0 0.83 0.98 +18.4% PASS
total/synth/PUSH6/p1 1.23 1.19 -2.7% PASS
total/synth/PUSH7/p0 1.07 1.07 -0.1% PASS
total/synth/PUSH7/p1 1.21 1.19 -1.4% PASS
total/synth/PUSH8/p0 0.85 0.83 -2.5% PASS
total/synth/PUSH8/p1 1.22 1.19 -2.1% PASS
total/synth/PUSH9/p0 1.07 0.99 -7.3% PASS
total/synth/PUSH9/p1 1.20 1.19 -0.2% PASS
total/synth/RETURNDATASIZE/a0 3.26 3.42 +5.0% PASS
total/synth/RETURNDATASIZE/a1 3.60 3.77 +4.7% PASS
total/synth/SAR/b0 3.76 3.77 +0.2% PASS
total/synth/SAR/b1 4.27 4.27 -0.0% PASS
total/synth/SGT/b0 2.59 2.59 -0.3% PASS
total/synth/SGT/b1 1.63 1.56 -4.8% PASS
total/synth/SHL/b0 3.05 3.04 -0.2% PASS
total/synth/SHL/b1 1.63 1.62 -0.9% PASS
total/synth/SHR/b0 3.08 3.08 -0.1% PASS
total/synth/SHR/b1 1.63 1.59 -1.9% PASS
total/synth/SIGNEXTEND/b0 3.43 3.52 +2.7% PASS
total/synth/SIGNEXTEND/b1 3.58 3.65 +1.8% PASS
total/synth/SLT/b0 2.58 2.62 +1.5% PASS
total/synth/SLT/b1 1.63 1.64 +0.3% PASS
total/synth/SUB/b0 1.94 1.98 +1.9% PASS
total/synth/SUB/b1 1.97 1.97 +0.1% PASS
total/synth/SWAP1/s0 1.49 1.49 -0.0% PASS
total/synth/SWAP10/s0 1.50 1.50 +0.0% PASS
total/synth/SWAP11/s0 1.50 1.50 -0.0% PASS
total/synth/SWAP12/s0 1.51 1.51 +0.0% PASS
total/synth/SWAP13/s0 1.51 1.51 +0.0% PASS
total/synth/SWAP14/s0 1.51 1.51 -0.1% PASS
total/synth/SWAP15/s0 1.51 1.51 +0.0% PASS
total/synth/SWAP16/s0 1.51 1.51 +0.0% PASS
total/synth/SWAP2/s0 1.49 1.49 -0.2% PASS
total/synth/SWAP3/s0 1.49 1.49 -0.0% PASS
total/synth/SWAP4/s0 1.49 1.49 +0.0% PASS
total/synth/SWAP5/s0 1.49 1.49 -0.0% PASS
total/synth/SWAP6/s0 1.49 1.49 -0.0% PASS
total/synth/SWAP7/s0 1.50 1.50 -0.1% PASS
total/synth/SWAP8/s0 1.50 1.50 +0.1% PASS
total/synth/SWAP9/s0 1.50 1.50 +0.0% PASS
total/synth/XOR/b0 1.55 1.55 -0.0% PASS
total/synth/XOR/b1 1.55 1.55 -0.0% PASS
total/synth/loop_v1 4.74 4.76 +0.4% PASS
total/synth/loop_v2 4.74 4.76 +0.5% PASS

Summary: 194 benchmarks, 0 regressions


✅ Performance Check Passed (multipass)

Performance Benchmark Results (threshold: 25%)

Benchmark Baseline (us) Current (us) Change Status
total/main/blake2b_huff/8415nulls 1.59 1.58 -0.8% PASS
total/main/blake2b_huff/empty 0.07 0.10 +37.3% PASS
total/main/blake2b_shifts/8415nulls 6.48 6.45 -0.3% PASS
total/main/sha1_divs/5311 3.53 3.53 +0.1% PASS
total/main/sha1_divs/empty 0.05 0.05 +0.1% PASS
total/main/sha1_shifts/5311 3.70 3.73 +0.7% PASS
total/main/sha1_shifts/empty 0.05 0.05 +0.3% PASS
total/main/snailtracer/benchmark 54.14 54.21 +0.1% PASS
total/main/structarray_alloc/nfts_rank 0.30 0.30 +1.1% PASS
total/main/swap_math/insufficient_liquidity 0.02 0.02 -0.8% PASS
total/main/swap_math/received 0.02 0.02 -1.0% PASS
total/main/swap_math/spent 0.02 0.02 -0.1% PASS
total/main/weierstrudel/1 0.36 0.36 -2.1% PASS
total/main/weierstrudel/15 3.26 3.23 -0.8% PASS
total/micro/JUMPDEST_n0/empty 0.13 0.13 +0.0% PASS
total/micro/jump_around/empty 0.62 0.62 +0.1% PASS
total/micro/loop_with_many_jumpdests/empty 1.95 1.95 +0.1% PASS
total/micro/memory_grow_mload/by1 0.19 0.18 -2.4% PASS
total/micro/memory_grow_mload/by16 0.23 0.20 -12.2% PASS
total/micro/memory_grow_mload/by32 0.22 0.24 +11.9% PASS
total/micro/memory_grow_mload/nogrow 0.18 0.18 +1.6% PASS
total/micro/memory_grow_mstore/by1 0.19 0.19 -1.2% PASS
total/micro/memory_grow_mstore/by16 0.21 0.20 -4.4% PASS
total/micro/memory_grow_mstore/by32 0.22 0.22 -0.5% PASS
total/micro/memory_grow_mstore/nogrow 0.19 0.18 -0.5% PASS
total/micro/signextend/one 0.38 0.34 -9.4% PASS
total/micro/signextend/zero 0.38 0.37 -1.3% PASS
total/synth/ADD/b0 0.01 0.01 -0.1% PASS
total/synth/ADD/b1 0.01 0.01 -0.1% PASS
total/synth/ADDRESS/a0 0.16 0.16 -0.0% PASS
total/synth/ADDRESS/a1 0.16 0.16 -0.0% PASS
total/synth/AND/b0 0.01 0.01 -0.1% PASS
total/synth/AND/b1 0.01 0.01 -0.1% PASS
total/synth/BYTE/b0 1.95 1.96 +0.1% PASS
total/synth/BYTE/b1 2.29 2.31 +0.6% PASS
total/synth/CALLDATASIZE/a0 0.08 0.08 +2.6% PASS
total/synth/CALLDATASIZE/a1 0.08 0.08 +2.6% PASS
total/synth/CALLER/a0 0.16 0.16 +0.1% PASS
total/synth/CALLER/a1 0.16 0.16 +0.0% PASS
total/synth/CALLVALUE/a0 0.27 0.27 +0.1% PASS
total/synth/CALLVALUE/a1 0.27 0.27 -0.0% PASS
total/synth/CODESIZE/a0 0.08 0.08 +0.0% PASS
total/synth/CODESIZE/a1 0.08 0.08 -0.0% PASS
total/synth/DUP1/d0 0.01 0.01 -0.1% PASS
total/synth/DUP1/d1 0.01 0.01 -0.2% PASS
total/synth/DUP10/d0 0.01 0.01 -0.4% PASS
total/synth/DUP10/d1 0.01 0.01 -0.1% PASS
total/synth/DUP11/d0 0.01 0.01 -0.2% PASS
total/synth/DUP11/d1 0.01 0.01 -0.0% PASS
total/synth/DUP12/d0 0.01 0.01 -0.1% PASS
total/synth/DUP12/d1 0.01 0.01 -0.1% PASS
total/synth/DUP13/d0 0.01 0.01 -0.3% PASS
total/synth/DUP13/d1 0.01 0.01 -0.1% PASS
total/synth/DUP14/d0 0.01 0.01 -0.1% PASS
total/synth/DUP14/d1 0.01 0.01 -0.1% PASS
total/synth/DUP15/d0 0.01 0.01 +0.2% PASS
total/synth/DUP15/d1 0.01 0.01 -0.2% PASS
total/synth/DUP16/d0 0.01 0.01 -0.1% PASS
total/synth/DUP16/d1 0.01 0.01 -0.1% PASS
total/synth/DUP2/d0 0.01 0.01 -0.0% PASS
total/synth/DUP2/d1 0.01 0.01 -0.2% PASS
total/synth/DUP3/d0 0.01 0.01 +0.2% PASS
total/synth/DUP3/d1 0.01 0.01 -0.3% PASS
total/synth/DUP4/d0 0.01 0.01 -0.1% PASS
total/synth/DUP4/d1 0.01 0.01 -0.1% PASS
total/synth/DUP5/d0 0.01 0.01 -0.2% PASS
total/synth/DUP5/d1 0.01 0.01 -0.2% PASS
total/synth/DUP6/d0 0.01 0.01 -0.2% PASS
total/synth/DUP6/d1 0.01 0.01 -0.1% PASS
total/synth/DUP7/d0 0.01 0.01 -0.1% PASS
total/synth/DUP7/d1 0.01 0.01 +0.0% PASS
total/synth/DUP8/d0 0.01 0.01 -0.1% PASS
total/synth/DUP8/d1 0.01 0.01 -0.2% PASS
total/synth/DUP9/d0 0.01 0.01 -0.1% PASS
total/synth/DUP9/d1 0.01 0.01 -0.0% PASS
total/synth/EQ/b0 0.01 0.01 -0.1% PASS
total/synth/EQ/b1 0.01 0.01 -0.0% PASS
total/synth/GAS/a0 0.79 0.79 +0.0% PASS
total/synth/GAS/a1 0.79 0.79 +0.0% PASS
total/synth/GT/b0 0.01 0.01 -0.1% PASS
total/synth/GT/b1 0.01 0.01 -0.1% PASS
total/synth/ISZERO/u0 0.01 0.01 -0.2% PASS
total/synth/JUMPDEST/n0 0.13 0.13 +0.3% PASS
total/synth/LT/b0 0.01 0.01 -0.1% PASS
total/synth/LT/b1 0.01 0.01 -0.1% PASS
total/synth/MSIZE/a0 0.01 0.01 +0.1% PASS
total/synth/MSIZE/a1 0.01 0.01 -0.1% PASS
total/synth/MUL/b0 0.01 0.01 -0.1% PASS
total/synth/MUL/b1 0.01 0.01 +0.3% PASS
total/synth/NOT/u0 0.01 0.01 -0.0% PASS
total/synth/OR/b0 0.01 0.01 -0.1% PASS
total/synth/OR/b1 0.01 0.01 -0.2% PASS
total/synth/PC/a0 0.01 0.01 -0.1% PASS
total/synth/PC/a1 0.01 0.01 -0.0% PASS
total/synth/PUSH1/p0 0.01 0.01 -0.9% PASS
total/synth/PUSH1/p1 0.01 0.01 +2.9% PASS
total/synth/PUSH10/p0 0.01 0.01 +2.8% PASS
total/synth/PUSH10/p1 0.01 0.01 +2.9% PASS
total/synth/PUSH11/p0 0.01 0.01 +3.1% PASS
total/synth/PUSH11/p1 0.01 0.01 +2.9% PASS
total/synth/PUSH12/p0 0.01 0.01 +3.0% PASS
total/synth/PUSH12/p1 0.01 0.01 +2.9% PASS
total/synth/PUSH13/p0 0.01 0.01 +2.9% PASS
total/synth/PUSH13/p1 0.01 0.01 +3.0% PASS
total/synth/PUSH14/p0 0.01 0.01 +2.9% PASS
total/synth/PUSH14/p1 0.01 0.01 +3.0% PASS
total/synth/PUSH15/p0 0.01 0.01 +2.9% PASS
total/synth/PUSH15/p1 0.01 0.01 +3.0% PASS
total/synth/PUSH16/p0 0.01 0.01 +3.0% PASS
total/synth/PUSH16/p1 0.01 0.01 +3.0% PASS
total/synth/PUSH17/p0 0.01 0.01 +3.0% PASS
total/synth/PUSH17/p1 0.01 0.01 +2.9% PASS
total/synth/PUSH18/p0 0.01 0.01 +3.0% PASS
total/synth/PUSH18/p1 0.01 0.01 +2.6% PASS
total/synth/PUSH19/p0 0.01 0.01 +2.6% PASS
total/synth/PUSH19/p1 0.01 0.01 +2.9% PASS
total/synth/PUSH2/p0 0.01 0.01 +2.9% PASS
total/synth/PUSH2/p1 0.01 0.01 +3.2% PASS
total/synth/PUSH20/p0 0.01 0.01 +2.9% PASS
total/synth/PUSH20/p1 0.01 0.01 +2.7% PASS
total/synth/PUSH21/p0 0.01 0.01 +3.1% PASS
total/synth/PUSH21/p1 0.01 0.01 +3.0% PASS
total/synth/PUSH22/p0 1.08 1.09 +1.2% PASS
total/synth/PUSH22/p1 1.21 1.27 +4.9% PASS
total/synth/PUSH23/p0 1.08 1.00 -7.1% PASS
total/synth/PUSH23/p1 1.30 1.25 -3.6% PASS
total/synth/PUSH24/p0 1.08 1.08 +0.1% PASS
total/synth/PUSH24/p1 1.22 1.28 +5.0% PASS
total/synth/PUSH25/p0 1.08 1.08 -0.1% PASS
total/synth/PUSH25/p1 1.26 1.22 -3.3% PASS
total/synth/PUSH26/p0 0.88 0.88 -0.7% PASS
total/synth/PUSH26/p1 1.23 1.22 -0.6% PASS
total/synth/PUSH27/p0 1.08 1.08 -0.1% PASS
total/synth/PUSH27/p1 1.29 1.24 -3.6% PASS
total/synth/PUSH28/p0 1.08 1.08 +0.1% PASS
total/synth/PUSH28/p1 1.25 1.24 -0.8% PASS
total/synth/PUSH29/p0 1.08 1.08 +0.0% PASS
total/synth/PUSH29/p1 1.29 1.24 -3.8% PASS
total/synth/PUSH3/p0 0.01 0.01 +2.9% PASS
total/synth/PUSH3/p1 0.01 0.01 +2.6% PASS
total/synth/PUSH30/p0 1.11 1.10 -0.3% PASS
total/synth/PUSH30/p1 1.28 1.26 -2.2% PASS
total/synth/PUSH31/p0 1.08 1.08 -0.3% PASS
total/synth/PUSH31/p1 1.34 1.35 +1.1% PASS
total/synth/PUSH32/p0 1.08 0.89 -17.5% PASS
total/synth/PUSH32/p1 1.26 1.28 +1.5% PASS
total/synth/PUSH4/p0 0.01 0.01 +2.9% PASS
total/synth/PUSH4/p1 0.01 0.01 +3.0% PASS
total/synth/PUSH5/p0 0.01 0.01 +2.9% PASS
total/synth/PUSH5/p1 0.01 0.01 +2.9% PASS
total/synth/PUSH6/p0 0.01 0.01 +2.9% PASS
total/synth/PUSH6/p1 0.01 0.01 +2.9% PASS
total/synth/PUSH7/p0 0.01 0.01 +2.9% PASS
total/synth/PUSH7/p1 0.01 0.01 +2.8% PASS
total/synth/PUSH8/p0 0.01 0.01 +3.1% PASS
total/synth/PUSH8/p1 0.01 0.01 +2.9% PASS
total/synth/PUSH9/p0 0.01 0.01 +2.9% PASS
total/synth/PUSH9/p1 0.01 0.01 +3.1% PASS
total/synth/RETURNDATASIZE/a0 0.53 0.53 +0.4% PASS
total/synth/RETURNDATASIZE/a1 0.49 0.49 +0.5% PASS
total/synth/SAR/b0 3.87 3.91 +1.0% PASS
total/synth/SAR/b1 4.49 4.50 +0.2% PASS
total/synth/SGT/b0 0.01 0.01 -0.0% PASS
total/synth/SGT/b1 0.01 0.01 -0.1% PASS
total/synth/SHL/b0 3.06 3.04 -0.6% PASS
total/synth/SHL/b1 1.64 1.66 +1.1% PASS
total/synth/SHR/b0 3.09 3.12 +1.0% PASS
total/synth/SHR/b1 1.64 1.60 -2.0% PASS
total/synth/SIGNEXTEND/b0 3.13 3.30 +5.4% PASS
total/synth/SIGNEXTEND/b1 3.59 3.69 +2.7% PASS
total/synth/SLT/b0 0.01 0.01 -0.1% PASS
total/synth/SLT/b1 0.01 0.01 -0.2% PASS
total/synth/SUB/b0 0.01 0.01 -0.1% PASS
total/synth/SUB/b1 0.01 0.01 -0.1% PASS
total/synth/SWAP1/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP10/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP11/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP12/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP13/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP14/s0 0.01 0.01 -0.2% PASS
total/synth/SWAP15/s0 0.01 0.01 -0.2% PASS
total/synth/SWAP16/s0 0.01 0.01 -0.2% PASS
total/synth/SWAP2/s0 0.01 0.01 -0.2% PASS
total/synth/SWAP3/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP4/s0 0.01 0.01 -0.4% PASS
total/synth/SWAP5/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP6/s0 0.01 0.01 -0.2% PASS
total/synth/SWAP7/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP8/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP9/s0 0.01 0.01 -0.2% PASS
total/synth/XOR/b0 0.01 0.01 -0.2% PASS
total/synth/XOR/b1 0.01 0.01 -0.1% PASS
total/synth/loop_v1 1.43 1.42 -0.3% PASS
total/synth/loop_v2 1.43 1.43 -0.2% PASS

Summary: 194 benchmarks, 0 regressions


@zoowii zoowii requested a review from Copilot March 19, 2026 10:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds WebAssembly Bulk Memory Operations proposal support for the interpreter execution mode, with corresponding spec/proposal tests and validation/runtime plumbing.

Changes:

  • Implement interpreter execution for memory.init, data.drop, memory.copy, memory.fill, table.init, elem.drop, and table.copy (0xFC-prefixed opcodes).
  • Extend module loading/instantiation to track element/data segment modes and “dropped” state.
  • Update spec/proposals test inputs and CI test generation to include bulk-memory instructions; skip these proposal tests in JIT modes.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/wast/spec.patch Adjusts upstream spec test patch content to align with updated wast expectations.
tests/wast/proposals/table_init.wast Adds proposal test coverage for table.init + elem.drop.
tests/wast/proposals/table_copy.wast Adds proposal test coverage for table.copy.
tests/wast/proposals/memory_init.wast Adds proposal test coverage for memory.init.
tests/wast/proposals/memory_fill.wast Adds proposal test coverage for memory.fill.
tests/wast/proposals/memory_copy.wast Adds proposal test coverage for memory.copy.
tests/wast/proposals/elem_drop.wast Adds proposal test coverage for elem.drop.
tests/wast/proposals/data_drop.wast Adds proposal test coverage for data.drop.
tests/bulk_memory/run_tests.sh Adds a standalone bulk-memory test runner script (manual).
src/utils/wasm.cpp Updates bytecode skipping logic to understand 0xFC-prefixed instructions.
src/tests/spec_unit_tests.cpp Skips bulk-memory proposal tests in non-interpreter modes.
src/tests/CMakeLists.txt Enables wast2json bulk-memory support during spec JSON generation.
src/runtime/module.h Adds element/data segment mode fields and segment validation/helpers.
src/runtime/instance.h Adds dropped segment tracking API/state on instances.
src/runtime/instance.cpp Frees dropped segment tracking arrays in the instance destructor.
src/common/wasm_defs/opcode.def Adds bulk-memory opcode names (currently as single-byte entries).
src/common/errors.def Adds errors for unknown segments + out-of-bounds table access.
src/common/enums.h Defines 0xFC prefix constant and sub-opcode constants.
src/action/module_loader.cpp Parses new element/data segment encodings with flags and mode tracking.
src/action/interpreter.cpp Implements runtime semantics for bulk-memory ops in interpreter mode.
src/action/instantiator.cpp Skips non-active segments during instantiation; initializes dropped tracking arrays.
src/action/function_loader.cpp Validates bulk-memory ops during function validation.
src/action/bytecode_visitor.h Makes JIT paths reject bulk-memory ops with a clear UnsupportedOpcode error.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +60 to +69
if echo "$result" | grep -q "error\|trap\|failed"; then
FAIL=$((FAIL + 1))
echo -e "${RED}FAIL${NC}: $desc (expected success, got '$result')"
else
PASS=$((PASS + 1))
echo -e "${GREEN}PASS${NC}: $desc (success)"
fi
fi
}

Comment on lines +75 to +82
# ---- memory.fill tests ----
echo "--- memory.fill ---"
assert_return "basic fill" "0xff:i32" \
$DTVM -m interpreter "$SCRIPT_DIR/memory_fill.wasm" -f test_basic_fill

assert_return "fill value truncation (0xABCD -> 0xCD)" "0xcd:i32" \
$DTVM -m interpreter "$SCRIPT_DIR/memory_fill.wasm" -f test_fill_value_truncation

Comment on lines +19 to +21
;; The data segment is active (format 0 with no explicit offset means passive
;; in this case since there's no offset expression). Actually this is passive
;; because there's no (i32.const X) offset.
ZEN_ASSERT_TODO();
}
} else {
ZEN_LOG_ERROR("munimplemented opcode: 0x%x", Opcode);
Entry->TableIdx = 0;
Entry->InitExprKind = 0;
Entry->InitExprVal = {};
Entry->Mode = 1; // passive
Comment on lines +213 to +221
// Bulk Memory Operations (encoded as 0xFC prefix + sub-opcode in wasm binary)
DEFINE_WASM_OPCODE(MEMORY_INIT, 0xc7, "memory.init")
DEFINE_WASM_OPCODE(DATA_DROP, 0xc8, "data.drop")
DEFINE_WASM_OPCODE(MEMORY_COPY, 0xc9, "memory.copy")
DEFINE_WASM_OPCODE(MEMORY_FILL, 0xca, "memory.fill")
DEFINE_WASM_OPCODE(TABLE_INIT, 0xcb, "table.init")
DEFINE_WASM_OPCODE(ELEM_DROP, 0xcc, "elem.drop")
DEFINE_WASM_OPCODE(TABLE_COPY, 0xcd, "table.copy")

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.

2 participants