Skip to content

perf(evm): delegate inline arithmetic/stack opcodes to doExecute handlers#483

Merged
zoowii merged 2 commits into
DTVMStack:mainfrom
ys8888john:ys/use_doExecute_handle
May 9, 2026
Merged

perf(evm): delegate inline arithmetic/stack opcodes to doExecute handlers#483
zoowii merged 2 commits into
DTVMStack:mainfrom
ys8888john:ys/use_doExecute_handle

Conversation

@ys8888john
Copy link
Copy Markdown
Contributor

…lers

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

@ys8888john ys8888john force-pushed the ys/use_doExecute_handle branch from 59cf42e to 6c8a4c2 Compare April 29, 2026 07:40
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 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.62 2.36 +45.8% PASS
total/main/blake2b_huff/empty 0.03 0.04 +45.7% PASS
total/main/blake2b_shifts/8415nulls 12.50 18.95 +51.7% REGRESSED
total/main/sha1_divs/5311 5.18 7.91 +52.8% REGRESSED
total/main/sha1_divs/empty 0.06 0.09 +41.2% PASS
total/main/sha1_shifts/5311 2.90 5.35 +84.3% PASS
total/main/sha1_shifts/empty 0.04 0.07 +81.6% PASS
total/main/snailtracer/benchmark 54.30 69.34 +27.7% REGRESSED
total/main/structarray_alloc/nfts_rank 1.05 1.41 +33.8% PASS
total/main/swap_math/insufficient_liquidity 0.00 0.00 +47.9% PASS
total/main/swap_math/received 0.00 0.01 +45.5% PASS
total/main/swap_math/spent 0.00 0.01 +52.1% PASS
total/main/weierstrudel/1 0.28 0.31 +8.5% PASS
total/main/weierstrudel/15 3.17 3.53 +11.6% PASS
total/micro/JUMPDEST_n0/empty 1.31 1.38 +5.1% PASS
total/micro/jump_around/empty 0.09 0.06 -31.2% PASS
total/micro/loop_with_many_jumpdests/empty 20.88 21.26 +1.8% PASS
total/micro/memory_grow_mload/by1 0.10 0.12 +21.0% PASS
total/micro/memory_grow_mload/by16 0.11 0.13 +17.7% PASS
total/micro/memory_grow_mload/by32 0.12 0.14 +13.4% PASS
total/micro/memory_grow_mload/nogrow 0.10 0.12 +19.4% PASS
total/micro/memory_grow_mstore/by1 0.11 0.12 +11.1% PASS
total/micro/memory_grow_mstore/by16 0.12 0.13 +12.0% PASS
total/micro/memory_grow_mstore/by32 0.13 0.15 +14.2% PASS
total/micro/memory_grow_mstore/nogrow 0.10 0.11 +8.7% PASS
total/micro/signextend/one 0.27 0.26 -5.1% PASS
total/micro/signextend/zero 0.27 0.26 -3.4% PASS
total/synth/ADD/b0 1.99 2.95 +47.7% PASS
total/synth/ADD/b1 2.00 3.11 +55.7% PASS
total/synth/ADDRESS/a0 4.83 5.66 +17.3% PASS
total/synth/ADDRESS/a1 5.44 6.26 +15.0% PASS
total/synth/AND/b0 1.71 3.04 +77.8% PASS
total/synth/AND/b1 1.72 2.98 +73.4% PASS
total/synth/BYTE/b0 6.12 6.82 +11.4% PASS
total/synth/BYTE/b1 4.75 5.42 +14.2% PASS
total/synth/CALLDATASIZE/a0 3.34 3.68 +10.2% PASS
total/synth/CALLDATASIZE/a1 3.61 4.63 +28.3% PASS
total/synth/CALLER/a0 4.83 5.65 +17.1% PASS
total/synth/CALLER/a1 5.41 6.26 +15.7% PASS
total/synth/CALLVALUE/a0 3.75 4.05 +7.8% PASS
total/synth/CALLVALUE/a1 3.76 3.93 +4.4% PASS
total/synth/CODESIZE/a0 3.99 4.18 +4.8% PASS
total/synth/CODESIZE/a1 4.00 4.25 +6.1% PASS
total/synth/DUP1/d0 1.31 1.48 +12.9% PASS
total/synth/DUP1/d1 1.40 1.59 +13.6% PASS
total/synth/DUP10/d0 1.39 1.48 +6.5% PASS
total/synth/DUP10/d1 1.40 1.49 +6.9% PASS
total/synth/DUP11/d0 1.39 1.48 +6.2% PASS
total/synth/DUP11/d1 1.39 1.49 +7.0% PASS
total/synth/DUP12/d0 1.31 1.48 +13.3% PASS
total/synth/DUP12/d1 1.16 1.40 +20.9% PASS
total/synth/DUP13/d0 1.36 1.48 +9.0% PASS
total/synth/DUP13/d1 1.40 1.49 +6.9% PASS
total/synth/DUP14/d0 1.31 1.48 +12.8% PASS
total/synth/DUP14/d1 1.39 1.22 -12.5% PASS
total/synth/DUP15/d0 1.15 1.21 +5.4% PASS
total/synth/DUP15/d1 1.16 1.49 +28.5% PASS
total/synth/DUP16/d0 1.38 1.48 +6.7% PASS
total/synth/DUP16/d1 1.16 1.22 +5.1% PASS
total/synth/DUP2/d0 1.39 1.48 +6.6% PASS
total/synth/DUP2/d1 1.39 1.49 +7.0% PASS
total/synth/DUP3/d0 1.39 1.26 -9.4% PASS
total/synth/DUP3/d1 1.39 1.49 +7.0% PASS
total/synth/DUP4/d0 1.39 1.48 +6.7% PASS
total/synth/DUP4/d1 1.40 1.49 +6.9% PASS
total/synth/DUP5/d0 1.39 1.30 -6.2% PASS
total/synth/DUP5/d1 1.16 1.34 +14.8% PASS
total/synth/DUP6/d0 1.31 1.49 +13.6% PASS
total/synth/DUP6/d1 1.40 1.49 +7.0% PASS
total/synth/DUP7/d0 1.35 1.48 +9.3% PASS
total/synth/DUP7/d1 1.39 1.58 +13.3% PASS
total/synth/DUP8/d0 1.30 1.48 +13.4% PASS
total/synth/DUP8/d1 1.39 1.22 -12.7% PASS
total/synth/DUP9/d0 1.39 1.48 +6.5% PASS
total/synth/DUP9/d1 1.40 1.22 -12.6% PASS
total/synth/EQ/b0 2.69 6.28 +133.5% PASS
total/synth/EQ/b1 1.34 6.12 +357.2% PASS
total/synth/GAS/a0 3.83 3.55 -7.4% PASS
total/synth/GAS/a1 3.91 4.29 +9.7% PASS
total/synth/GT/b0 2.61 6.28 +140.4% PASS
total/synth/GT/b1 1.56 5.72 +266.0% PASS
total/synth/ISZERO/u0 1.15 9.46 +723.1% PASS
total/synth/JUMPDEST/n0 1.31 1.40 +6.8% PASS
total/synth/LT/b0 2.60 6.29 +142.2% PASS
total/synth/LT/b1 1.56 5.73 +267.5% PASS
total/synth/MSIZE/a0 4.26 4.98 +16.9% PASS
total/synth/MSIZE/a1 4.83 5.37 +11.0% PASS
total/synth/MUL/b0 5.32 6.35 +19.2% PASS
total/synth/MUL/b1 5.39 6.40 +18.7% PASS
total/synth/NOT/u0 1.81 4.79 +164.0% PASS
total/synth/OR/b0 1.65 3.04 +84.7% PASS
total/synth/OR/b1 1.71 3.25 +89.3% PASS
total/synth/PC/a0 3.58 3.33 -7.0% PASS
total/synth/PC/a1 3.60 4.68 +30.1% PASS
total/synth/PUSH1/p0 1.15 1.39 +20.9% PASS
total/synth/PUSH1/p1 1.39 1.77 +27.6% PASS
total/synth/PUSH10/p0 1.07 1.57 +47.3% PASS
total/synth/PUSH10/p1 1.40 1.78 +27.1% PASS
total/synth/PUSH11/p0 1.15 1.57 +36.9% PASS
total/synth/PUSH11/p1 1.41 1.78 +25.9% PASS
total/synth/PUSH12/p0 1.15 1.57 +37.0% PASS
total/synth/PUSH12/p1 1.43 1.53 +6.6% PASS
total/synth/PUSH13/p0 0.99 1.54 +55.7% PASS
total/synth/PUSH13/p1 1.41 1.55 +10.0% PASS
total/synth/PUSH14/p0 0.98 1.57 +60.1% PASS
total/synth/PUSH14/p1 1.41 1.78 +26.3% PASS
total/synth/PUSH15/p0 1.15 1.66 +44.8% PASS
total/synth/PUSH15/p1 1.51 1.56 +3.6% PASS
total/synth/PUSH16/p0 0.83 1.48 +77.5% PASS
total/synth/PUSH16/p1 1.40 1.55 +10.5% PASS
total/synth/PUSH17/p0 0.99 1.35 +37.0% PASS
total/synth/PUSH17/p1 1.40 1.57 +11.9% PASS
total/synth/PUSH18/p0 1.15 1.44 +25.3% PASS
total/synth/PUSH18/p1 1.43 1.79 +24.5% PASS
total/synth/PUSH19/p0 1.15 1.30 +13.0% PASS
total/synth/PUSH19/p1 1.42 1.80 +26.8% PASS
total/synth/PUSH2/p0 1.07 1.39 +30.2% PASS
total/synth/PUSH2/p1 1.40 1.78 +27.1% PASS
total/synth/PUSH20/p0 1.15 1.57 +36.5% PASS
total/synth/PUSH20/p1 1.43 1.80 +25.4% PASS
total/synth/PUSH21/p0 1.07 1.39 +30.2% PASS
total/synth/PUSH21/p1 1.42 1.80 +26.9% PASS
total/synth/PUSH22/p0 1.08 1.39 +29.0% PASS
total/synth/PUSH22/p1 1.44 1.52 +5.8% PASS
total/synth/PUSH23/p0 0.99 1.30 +31.0% PASS
total/synth/PUSH23/p1 1.45 1.79 +23.0% PASS
total/synth/PUSH24/p0 0.99 1.39 +41.1% PASS
total/synth/PUSH24/p1 1.42 1.80 +26.7% PASS
total/synth/PUSH25/p0 1.07 1.57 +47.1% PASS
total/synth/PUSH25/p1 1.42 1.53 +8.2% PASS
total/synth/PUSH26/p0 1.15 1.45 +26.0% PASS
total/synth/PUSH26/p1 1.42 1.79 +25.9% PASS
total/synth/PUSH27/p0 1.07 1.39 +30.1% PASS
total/synth/PUSH27/p1 1.42 1.59 +11.5% PASS
total/synth/PUSH28/p0 0.99 1.39 +40.8% PASS
total/synth/PUSH28/p1 1.44 1.53 +6.3% PASS
total/synth/PUSH29/p0 0.99 1.40 +41.8% PASS
total/synth/PUSH29/p1 1.42 1.77 +24.4% PASS
total/synth/PUSH3/p0 1.07 1.57 +47.1% PASS
total/synth/PUSH3/p1 1.39 1.78 +28.4% PASS
total/synth/PUSH30/p0 1.17 1.39 +18.7% PASS
total/synth/PUSH30/p1 1.44 1.59 +10.3% PASS
total/synth/PUSH31/p0 1.07 1.57 +47.2% PASS
total/synth/PUSH31/p1 1.55 1.74 +12.4% PASS
total/synth/PUSH32/p0 0.88 1.59 +80.3% PASS
total/synth/PUSH32/p1 1.44 1.79 +24.9% PASS
total/synth/PUSH4/p0 0.99 1.66 +68.4% PASS
total/synth/PUSH4/p1 1.41 1.81 +28.0% PASS
total/synth/PUSH5/p0 1.07 1.66 +56.0% PASS
total/synth/PUSH5/p1 1.41 1.54 +9.1% PASS
total/synth/PUSH6/p0 1.07 1.57 +47.2% PASS
total/synth/PUSH6/p1 1.39 1.61 +15.8% PASS
total/synth/PUSH7/p0 0.91 1.39 +53.7% PASS
total/synth/PUSH7/p1 1.42 1.78 +25.9% PASS
total/synth/PUSH8/p0 1.15 1.57 +36.9% PASS
total/synth/PUSH8/p1 1.41 1.64 +16.4% PASS
total/synth/PUSH9/p0 1.15 1.39 +21.1% PASS
total/synth/PUSH9/p1 1.41 1.53 +8.0% PASS
total/synth/RETURNDATASIZE/a0 3.99 4.32 +8.3% PASS
total/synth/RETURNDATASIZE/a1 4.01 4.35 +8.6% PASS
total/synth/SAR/b0 3.83 4.33 +13.1% PASS
total/synth/SAR/b1 4.31 4.90 +13.6% PASS
total/synth/SGT/b0 2.61 5.09 +95.4% PASS
total/synth/SGT/b1 1.56 4.50 +189.1% PASS
total/synth/SHL/b0 3.02 3.89 +28.9% PASS
total/synth/SHL/b1 1.56 3.79 +142.4% PASS
total/synth/SHR/b0 3.10 3.30 +6.4% PASS
total/synth/SHR/b1 1.52 3.44 +126.2% PASS
total/synth/SIGNEXTEND/b0 3.49 3.30 -5.3% PASS
total/synth/SIGNEXTEND/b1 3.72 3.43 -7.8% PASS
total/synth/SLT/b0 2.59 4.93 +90.3% PASS
total/synth/SLT/b1 1.48 4.33 +192.3% PASS
total/synth/SUB/b0 2.00 2.96 +48.1% PASS
total/synth/SUB/b1 1.97 3.16 +60.0% PASS
total/synth/SWAP1/s0 1.49 1.68 +12.9% PASS
total/synth/SWAP10/s0 1.50 1.69 +12.9% PASS
total/synth/SWAP11/s0 1.50 1.69 +12.8% PASS
total/synth/SWAP12/s0 1.50 1.70 +12.7% PASS
total/synth/SWAP13/s0 1.51 1.70 +12.8% PASS
total/synth/SWAP14/s0 1.51 1.70 +12.8% PASS
total/synth/SWAP15/s0 1.51 1.70 +12.6% PASS
total/synth/SWAP16/s0 1.51 1.70 +12.8% PASS
total/synth/SWAP2/s0 1.49 1.68 +12.8% PASS
total/synth/SWAP3/s0 1.49 1.68 +12.7% PASS
total/synth/SWAP4/s0 1.49 1.69 +12.9% PASS
total/synth/SWAP5/s0 1.50 1.69 +12.8% PASS
total/synth/SWAP6/s0 1.50 1.69 +12.8% PASS
total/synth/SWAP7/s0 1.50 1.69 +13.0% PASS
total/synth/SWAP8/s0 1.50 1.69 +12.8% PASS
total/synth/SWAP9/s0 1.50 1.69 +12.9% PASS
total/synth/XOR/b0 1.55 3.04 +96.4% PASS
total/synth/XOR/b1 1.55 3.24 +108.7% PASS
total/synth/loop_v1 4.53 6.14 +35.5% PASS
total/synth/loop_v2 4.30 6.17 +43.4% PASS

Summary: 194 benchmarks, 3 regressions


✅ Performance Check Passed (multipass)

Performance Benchmark Results (threshold: 25%)

Benchmark Baseline (us) Current (us) Change Status
total/main/blake2b_huff/8415nulls 1.07 0.81 -24.9% PASS
total/main/blake2b_huff/empty 0.02 0.01 -26.8% PASS
total/main/blake2b_shifts/8415nulls 4.85 4.21 -13.1% PASS
total/main/sha1_divs/5311 0.62 0.56 -8.9% PASS
total/main/sha1_divs/empty 0.01 0.01 -12.5% PASS
total/main/sha1_shifts/5311 0.59 0.52 -11.3% PASS
total/main/sha1_shifts/empty 0.01 0.01 -14.6% PASS
total/main/snailtracer/benchmark 36.57 30.20 -17.4% PASS
total/main/structarray_alloc/nfts_rank 0.31 0.29 -7.7% PASS
total/main/swap_math/insufficient_liquidity 0.00 0.00 -11.7% PASS
total/main/swap_math/received 0.00 0.00 -11.5% PASS
total/main/swap_math/spent 0.00 0.00 -13.3% PASS
total/main/weierstrudel/1 0.25 0.23 -9.0% PASS
total/main/weierstrudel/15 2.97 2.45 -17.4% PASS
total/micro/JUMPDEST_n0/empty 0.00 0.00 -10.3% PASS
total/micro/jump_around/empty 0.03 0.05 +44.1% PASS
total/micro/loop_with_many_jumpdests/empty 0.00 0.00 -2.7% PASS
total/micro/memory_grow_mload/by1 0.01 0.01 -10.6% PASS
total/micro/memory_grow_mload/by16 0.01 0.01 -14.6% PASS
total/micro/memory_grow_mload/by32 0.01 0.01 -12.5% PASS
total/micro/memory_grow_mload/nogrow 0.01 0.01 -13.9% PASS
total/micro/memory_grow_mstore/by1 0.02 0.01 -15.6% PASS
total/micro/memory_grow_mstore/by16 0.02 0.01 -13.9% PASS
total/micro/memory_grow_mstore/by32 0.02 0.01 -12.4% PASS
total/micro/memory_grow_mstore/nogrow 0.02 0.01 -16.2% PASS
total/micro/signextend/one 0.08 0.06 -20.8% PASS
total/micro/signextend/zero 0.08 0.06 -21.2% PASS
total/synth/ADD/b0 0.00 0.00 -11.2% PASS
total/synth/ADD/b1 0.00 0.00 -11.4% PASS
total/synth/ADDRESS/a0 0.15 0.14 -8.0% PASS
total/synth/ADDRESS/a1 0.15 0.14 -9.0% PASS
total/synth/AND/b0 0.00 0.00 -9.0% PASS
total/synth/AND/b1 0.00 0.00 -11.2% PASS
total/synth/BYTE/b0 0.00 0.00 -10.7% PASS
total/synth/BYTE/b1 0.00 0.00 -11.0% PASS
total/synth/CALLDATASIZE/a0 0.07 0.06 -7.8% PASS
total/synth/CALLDATASIZE/a1 0.07 0.07 -5.4% PASS
total/synth/CALLER/a0 0.20 0.17 -14.5% PASS
total/synth/CALLER/a1 0.20 0.16 -16.9% PASS
total/synth/CALLVALUE/a0 0.30 0.26 -13.7% PASS
total/synth/CALLVALUE/a1 0.30 0.25 -14.9% PASS
total/synth/CODESIZE/a0 0.07 0.06 -7.5% PASS
total/synth/CODESIZE/a1 0.07 0.06 -8.2% PASS
total/synth/DUP1/d0 0.00 0.00 -8.5% PASS
total/synth/DUP1/d1 0.00 0.00 -11.6% PASS
total/synth/DUP10/d0 0.00 0.00 -9.6% PASS
total/synth/DUP10/d1 0.00 0.00 -10.5% PASS
total/synth/DUP11/d0 0.00 0.00 -10.8% PASS
total/synth/DUP11/d1 0.00 0.00 -6.7% PASS
total/synth/DUP12/d0 0.00 0.00 -11.4% PASS
total/synth/DUP12/d1 0.00 0.00 -11.6% PASS
total/synth/DUP13/d0 0.00 0.00 -11.7% PASS
total/synth/DUP13/d1 0.00 0.00 -12.1% PASS
total/synth/DUP14/d0 0.00 0.00 -11.9% PASS
total/synth/DUP14/d1 0.00 0.00 -10.4% PASS
total/synth/DUP15/d0 0.00 0.00 -9.8% PASS
total/synth/DUP15/d1 0.00 0.00 -9.6% PASS
total/synth/DUP16/d0 0.00 0.00 -8.7% PASS
total/synth/DUP16/d1 0.00 0.00 -8.9% PASS
total/synth/DUP2/d0 0.00 0.00 -11.2% PASS
total/synth/DUP2/d1 0.00 0.00 -11.5% PASS
total/synth/DUP3/d0 0.00 0.00 -11.2% PASS
total/synth/DUP3/d1 0.00 0.00 -11.5% PASS
total/synth/DUP4/d0 0.00 0.00 -10.4% PASS
total/synth/DUP4/d1 0.00 0.00 -11.2% PASS
total/synth/DUP5/d0 0.00 0.00 -10.1% PASS
total/synth/DUP5/d1 0.00 0.00 -9.7% PASS
total/synth/DUP6/d0 0.00 0.00 -11.0% PASS
total/synth/DUP6/d1 0.00 0.00 -9.8% PASS
total/synth/DUP7/d0 0.00 0.00 -10.7% PASS
total/synth/DUP7/d1 0.00 0.00 -11.6% PASS
total/synth/DUP8/d0 0.00 0.00 -10.9% PASS
total/synth/DUP8/d1 0.00 0.00 -11.3% PASS
total/synth/DUP9/d0 0.00 0.00 -9.2% PASS
total/synth/DUP9/d1 0.00 0.00 -11.3% PASS
total/synth/EQ/b0 0.00 0.00 -11.4% PASS
total/synth/EQ/b1 0.00 0.00 -12.3% PASS
total/synth/GAS/a0 0.86 0.71 -17.7% PASS
total/synth/GAS/a1 0.86 0.73 -15.1% PASS
total/synth/GT/b0 0.00 0.00 -11.7% PASS
total/synth/GT/b1 0.00 0.00 -7.4% PASS
total/synth/ISZERO/u0 0.00 0.00 -6.3% PASS
total/synth/JUMPDEST/n0 0.00 0.00 -7.3% PASS
total/synth/LT/b0 0.00 0.00 -12.1% PASS
total/synth/LT/b1 0.00 0.00 -7.6% PASS
total/synth/MSIZE/a0 0.00 0.00 -9.0% PASS
total/synth/MSIZE/a1 0.00 0.00 -11.9% PASS
total/synth/MUL/b0 0.00 0.00 -12.1% PASS
total/synth/MUL/b1 0.00 0.00 -11.9% PASS
total/synth/NOT/u0 0.00 0.00 -11.8% PASS
total/synth/OR/b0 0.00 0.00 -10.4% PASS
total/synth/OR/b1 0.00 0.00 -7.9% PASS
total/synth/PC/a0 0.00 0.00 -11.4% PASS
total/synth/PC/a1 0.00 0.00 -11.3% PASS
total/synth/PUSH1/p0 0.00 0.00 -11.8% PASS
total/synth/PUSH1/p1 0.00 0.00 -11.0% PASS
total/synth/PUSH10/p0 0.00 0.00 -10.7% PASS
total/synth/PUSH10/p1 0.00 0.00 -9.4% PASS
total/synth/PUSH11/p0 0.00 0.00 -11.6% PASS
total/synth/PUSH11/p1 0.00 0.00 -5.9% PASS
total/synth/PUSH12/p0 0.00 0.00 -9.4% PASS
total/synth/PUSH12/p1 0.00 0.00 -12.1% PASS
total/synth/PUSH13/p0 0.00 0.00 -11.0% PASS
total/synth/PUSH13/p1 0.00 0.00 -8.8% PASS
total/synth/PUSH14/p0 0.00 0.00 -6.8% PASS
total/synth/PUSH14/p1 0.00 0.00 -9.8% PASS
total/synth/PUSH15/p0 0.00 0.00 -11.6% PASS
total/synth/PUSH15/p1 0.00 0.00 -11.4% PASS
total/synth/PUSH16/p0 0.00 0.00 -10.7% PASS
total/synth/PUSH16/p1 0.00 0.00 -7.1% PASS
total/synth/PUSH17/p0 0.00 0.00 -10.3% PASS
total/synth/PUSH17/p1 0.00 0.00 -10.4% PASS
total/synth/PUSH18/p0 0.00 0.00 -10.9% PASS
total/synth/PUSH18/p1 0.00 0.00 -10.2% PASS
total/synth/PUSH19/p0 0.00 0.00 -11.4% PASS
total/synth/PUSH19/p1 0.00 0.00 -6.6% PASS
total/synth/PUSH2/p0 0.00 0.00 -9.9% PASS
total/synth/PUSH2/p1 0.00 0.00 -11.7% PASS
total/synth/PUSH20/p0 0.00 0.00 -9.9% PASS
total/synth/PUSH20/p1 0.00 0.00 -7.9% PASS
total/synth/PUSH21/p0 0.00 0.00 -11.1% PASS
total/synth/PUSH21/p1 0.00 0.00 -11.3% PASS
total/synth/PUSH22/p0 0.93 1.22 +31.3% PASS
total/synth/PUSH22/p1 1.21 1.30 +6.9% PASS
total/synth/PUSH23/p0 0.91 1.22 +34.4% PASS
total/synth/PUSH23/p1 1.20 1.32 +9.5% PASS
total/synth/PUSH24/p0 0.89 1.28 +43.2% PASS
total/synth/PUSH24/p1 1.21 1.29 +6.9% PASS
total/synth/PUSH25/p0 0.90 1.22 +35.7% PASS
total/synth/PUSH25/p1 1.23 1.32 +7.5% PASS
total/synth/PUSH26/p0 0.93 1.00 +7.2% PASS
total/synth/PUSH26/p1 1.22 1.31 +7.3% PASS
total/synth/PUSH27/p0 0.89 1.26 +40.6% PASS
total/synth/PUSH27/p1 1.21 1.33 +10.0% PASS
total/synth/PUSH28/p0 0.89 1.25 +40.4% PASS
total/synth/PUSH28/p1 1.26 1.34 +6.6% PASS
total/synth/PUSH29/p0 0.89 1.22 +36.5% PASS
total/synth/PUSH29/p1 1.24 1.30 +4.8% PASS
total/synth/PUSH3/p0 0.00 0.00 -11.7% PASS
total/synth/PUSH3/p1 0.00 0.00 -11.7% PASS
total/synth/PUSH30/p0 0.92 1.25 +35.1% PASS
total/synth/PUSH30/p1 1.24 1.36 +9.6% PASS
total/synth/PUSH31/p0 0.90 1.23 +36.7% PASS
total/synth/PUSH31/p1 1.25 1.63 +30.8% PASS
total/synth/PUSH32/p0 0.90 1.23 +36.9% PASS
total/synth/PUSH32/p1 1.25 1.32 +6.0% PASS
total/synth/PUSH4/p0 0.00 0.00 -8.6% PASS
total/synth/PUSH4/p1 0.00 0.00 -8.6% PASS
total/synth/PUSH5/p0 0.00 0.00 -11.0% PASS
total/synth/PUSH5/p1 0.00 0.00 -10.6% PASS
total/synth/PUSH6/p0 0.00 0.00 -11.8% PASS
total/synth/PUSH6/p1 0.00 0.00 -11.5% PASS
total/synth/PUSH7/p0 0.00 0.00 -10.3% PASS
total/synth/PUSH7/p1 0.00 0.00 -11.2% PASS
total/synth/PUSH8/p0 0.00 0.00 -12.0% PASS
total/synth/PUSH8/p1 0.00 0.00 -10.4% PASS
total/synth/PUSH9/p0 0.00 0.00 -9.3% PASS
total/synth/PUSH9/p1 0.00 0.00 -10.3% PASS
total/synth/RETURNDATASIZE/a0 0.03 0.03 -16.4% PASS
total/synth/RETURNDATASIZE/a1 0.03 0.03 -15.9% PASS
total/synth/SAR/b0 0.00 0.00 -11.5% PASS
total/synth/SAR/b1 0.00 0.00 -7.2% PASS
total/synth/SGT/b0 0.00 0.00 -9.6% PASS
total/synth/SGT/b1 0.00 0.00 -9.9% PASS
total/synth/SHL/b0 0.00 0.00 -10.1% PASS
total/synth/SHL/b1 0.00 0.00 -11.7% PASS
total/synth/SHR/b0 0.00 0.00 -10.2% PASS
total/synth/SHR/b1 0.00 0.00 -10.1% PASS
total/synth/SIGNEXTEND/b0 0.00 0.00 -9.3% PASS
total/synth/SIGNEXTEND/b1 0.00 0.00 -8.2% PASS
total/synth/SLT/b0 0.00 0.00 -8.2% PASS
total/synth/SLT/b1 0.00 0.00 -11.8% PASS
total/synth/SUB/b0 0.00 0.00 -9.0% PASS
total/synth/SUB/b1 0.00 0.00 -12.2% PASS
total/synth/SWAP1/s0 0.00 0.00 -11.9% PASS
total/synth/SWAP10/s0 0.00 0.00 -9.4% PASS
total/synth/SWAP11/s0 0.00 0.00 -12.0% PASS
total/synth/SWAP12/s0 0.00 0.00 -11.2% PASS
total/synth/SWAP13/s0 0.00 0.00 -8.4% PASS
total/synth/SWAP14/s0 0.00 0.00 -10.8% PASS
total/synth/SWAP15/s0 0.00 0.00 -11.8% PASS
total/synth/SWAP16/s0 0.00 0.00 -8.1% PASS
total/synth/SWAP2/s0 0.00 0.00 -11.6% PASS
total/synth/SWAP3/s0 0.00 0.00 -11.3% PASS
total/synth/SWAP4/s0 0.00 0.00 -10.8% PASS
total/synth/SWAP5/s0 0.00 0.00 -11.6% PASS
total/synth/SWAP6/s0 0.00 0.00 -10.0% PASS
total/synth/SWAP7/s0 0.00 0.00 -11.6% PASS
total/synth/SWAP8/s0 0.00 0.00 -11.7% PASS
total/synth/SWAP9/s0 0.00 0.00 -7.6% PASS
total/synth/XOR/b0 0.00 0.00 -8.4% PASS
total/synth/XOR/b1 0.00 0.00 -11.7% PASS
total/synth/loop_v1 1.20 1.15 -4.6% PASS
total/synth/loop_v2 1.11 1.02 -8.6% PASS

Summary: 194 benchmarks, 0 regressions


Copy link
Copy Markdown
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

Refactors the computed-goto interpreter fast path to delegate previously inlined arithmetic/logic and stack-manipulation opcodes to centralized handler/helper implementations, aiming to simplify the hot dispatch loop and align behavior with existing opcode handler code.

Changes:

  • Replaced inline implementations of binary/ternary/unary arithmetic & logic opcodes with HANDLER_CALL(...::doExecute()) delegation.
  • Replaced inline stack ops (POP, PUSH0, PUSHn, DUPn, SWAPn) with execute*OpcodeNoGas(...) helpers in the computed-goto path.
  • Added an explicit revision gate in CLZ target before delegating to the handler.

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

Comment thread src/evm/interpreter.cpp
Comment on lines +551 to +553
TARGET_ADD:
HANDLER_CALL(AddHandler::doExecute());
TARGET_MUL:
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

HANDLER_CALL advances Pc unconditionally (via ++Pc inside the macro) before checking Context.getStatus(). With the new delegation, doExecute() can set error statuses (e.g., via EVM_STACK_CHECK), which means the interpreter may record the program counter after the faulting opcode in the computed-goto fast path. This differs from the other interpreter paths in this file (which break before incrementing Frame->Pc on error) and from the previous inline implementation here. Consider changing the HANDLER_CALL flow so Pc is only advanced when Context is still EVMC_SUCCESS (or otherwise keep PC reporting consistent on failure).

Copilot uses AI. Check for mistakes.
Comment thread src/evm/interpreter.cpp
Comment on lines +607 to +613
Frame->Sp = sp;
Frame->Pc = Pc;
executePopOpcodeNoGas(Frame, Context);
sp = Frame->Sp;
++Pc;
if (INTX_UNLIKELY(Context.getStatus() != EVMC_SUCCESS))
goto cgoto_error;
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

In the new stack-op delegation, Pc is incremented before checking Context.getStatus(). If executePopOpcodeNoGas() reports an error (e.g., stack underflow), the computed-goto fast path will record Frame->Pc as the next instruction when jumping to cgoto_error, which is inconsistent with the non-computed-goto loops in this file (they check status before Frame->Pc++). Consider only incrementing Pc after confirming EVMC_SUCCESS, to keep error PC/state consistent across interpreter paths.

Copilot uses AI. Check for mistakes.
Comment thread src/evm/interpreter.cpp Outdated
Comment on lines +597 to +602
TARGET_CLZ : {
if (INTX_UNLIKELY(sp < 1)) {
Context.setStatus(EVMC_STACK_UNDERFLOW);
if (INTX_UNLIKELY(Revision < EVMC_OSAKA)) {
Context.setStatus(EVMC_UNDEFINED_INSTRUCTION);
goto cgoto_error;
}
auto &A = Frame->Stack[sp - 1];
A = intx::clz(A);
++Pc;
DISPATCH_NEXT;
HANDLER_CALL(ClzHandler::doExecute());
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

TARGET_CLZ is already gated by the per-revision computed-goto dispatch table (cgoto_table is selected by Revision and opcodes missing from evmc_get_instruction_names_table() map to TARGET_UNDEFINED). The extra runtime Revision < EVMC_OSAKA check here is therefore redundant on this fast path and adds an always-false branch to a hot opcode. Consider removing this check (or relying on the dispatch table) to avoid unnecessary overhead.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


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

Comment thread src/evm/interpreter.cpp
// ---- Inline stack ops ----
// ---- Binary arithmetic/logic ops (delegate to doExecute) ----
TARGET_ADD:
HANDLER_CALL(AddHandler::doExecute());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why were inline blocks used here originally? If we switch back to a handler function, are there any performance costs? It seems this was previously refactored from a handler to inline code. We should verify that the macro + function approach is effectively as efficient as the inlined logic

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We benchmarked this on ethereum blockchain cases; no measurable overhead from the handler call form vs. inlined version.

@zoowii zoowii merged commit 2950664 into DTVMStack:main May 9, 2026
20 checks passed
abmcar added a commit to abmcar/DTVM that referenced this pull request May 12, 2026
After rebasing onto current upstream/main (which now includes DTVMStack#458 / DTVMStack#460
/ DTVMStack#482 / DTVMStack#483 perf work) and running a 10-rep evmone-bench on the 27 paper
benches, the cumulative PR delta has collapsed to noise (raw geomean
+1.15%, +0.46% after correcting a single-iteration outlier on
main/blake2b_shifts/8415nulls via a focused 20-rep re-measurement).
0 benches above the +/-25% CI gate.

The A-vs-PR-base -2.73% from this commit's own optimization is unchanged;
the framing shift is that the absolute runtime delta of the whole PR vs
unmodified main has been absorbed by the intervening upstream perf
optimizations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
abmcar added a commit to abmcar/DTVM that referenced this pull request May 12, 2026
…perf evidence

- README.md: status Proposed → Implemented; tick all checklist items
  (Phase 1–4 done, gates green, perf measured); update Phase 3 header
  to reflect both non-lifted and lifted-block factory wiring; correct
  Findings "Future work" note now that lifted-block plumbing (2ebfd29)
  has landed; bump white-box test count 39 → 40.
- Append "What shipped (2026-05-12)" section: 12-commit grouping,
  four-way perf comparison table (pre-rebase / post-rebase / D1 /
  lifted-plumbing), summary of decision path.
- Track perf-run evidence directories from the rebase decision cycle:
  bench-2026-05-07/ (original PR data), perf-2026-05-11/ (pre-rebase
  re-run on current upstream, −1.97% geomean), perf-2026-05-11-rebased/
  (post-rebase, −0.57%), perf-2026-05-11-no-483/ (D1 DTVMStack#483-revert
  hypothesis test, +0.95%), perf-2026-05-11-lifted/ (final lifted-block
  plumbing, +0.34%).  Each directory has summary.md plus raw JSON +
  analyze.py + run_aba.sh + console captures for full reproducibility.
- Track pr493-body-final.md: source-of-truth for the PR description
  pushed to GitHub via `gh pr edit`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

3 participants