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

evmmax: Implementation of vectorized version od EVMMAX opcodes (EIP-6690) #1120

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rodiazet
Copy link
Contributor

@rodiazet rodiazet commented Jan 30, 2025

This PR implements PoC version of EVMMAX according to EIP-6690 (called vectorized, SIMD or sequential version).
Gas model is not updated to how the EIP defines it.

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 92.57642% with 34 lines in your changes missing coverage. Please review.

Project coverage is 94.45%. Comparing base (0be7b16) to head (af85f49).

Files with missing lines Patch % Lines
lib/evmmax/evmmax.cpp 81.81% 30 Missing ⚠️
lib/evmone/instructions.hpp 95.50% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1120      +/-   ##
==========================================
- Coverage   94.50%   94.45%   -0.05%     
==========================================
  Files         167      169       +2     
  Lines       18193    18650     +457     
==========================================
+ Hits        17193    17616     +423     
- Misses       1000     1034      +34     
Flag Coverage Δ
eof_execution_spec_tests 15.03% <2.85%> (-0.31%) ⬇️
ethereum_tests 27.69% <2.85%> (-0.63%) ⬇️
ethereum_tests_silkpre 20.44% <3.52%> (-0.39%) ⬇️
execution_spec_tests 20.65% <2.85%> (-0.45%) ⬇️
unittests 89.79% <92.76%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
include/evmmax/evmmax.hpp 100.00% <100.00%> (ø)
lib/evmone/advanced_instructions.cpp 100.00% <ø> (ø)
lib/evmone/baseline_execution.cpp 100.00% <100.00%> (ø)
lib/evmone/execution_state.hpp 94.82% <100.00%> (+0.09%) ⬆️
lib/evmone/tracing.cpp 100.00% <ø> (ø)
test/unittests/eof_validation_test.cpp 99.41% <100.00%> (+<0.01%) ⬆️
test/unittests/evmmax_instructions_test.cpp 100.00% <100.00%> (ø)
test/unittests/evmmax_test.cpp 98.34% <100.00%> (+3.03%) ⬆️
test/unittests/instructions_test.cpp 89.58% <100.00%> (ø)
test/utils/bytecode.hpp 97.52% <100.00%> (+0.17%) ⬆️
... and 2 more

@pdobacz
Copy link
Contributor

pdobacz commented Jan 30, 2025

Nice! Would it be unreasonable to, instead of 2 branches, just have both options (vectorized and not) available on 1 branch, with opcodes assigned somewhere arbitrarily and with heavily copy-pasted code? Or even same opcodes but a feature flag on the libevmone.so? I'm guessing there's going to be a lot of experimentation and measuring involved here, maybe it's better to plan for it from day 1?

@rodiazet
Copy link
Contributor Author

Good point. I can think of some c++ macro which enables requested version or maybe introduce a runtime flag.

@rodiazet rodiazet force-pushed the evmmax-vectorized branch 10 times, most recently from 646e1aa to 8e8e020 Compare February 7, 2025 13:29
@rodiazet rodiazet added the EVMMAX label Feb 7, 2025
@rodiazet rodiazet changed the title Evmmax vectorized evmmax: Implementation od vectorized version od EVMMAX opcodes (EIP-6690) Feb 7, 2025
@rodiazet rodiazet changed the title evmmax: Implementation od vectorized version od EVMMAX opcodes (EIP-6690) evmmax: Implementation of vectorized version od EVMMAX opcodes (EIP-6690) Feb 7, 2025
@rodiazet rodiazet force-pushed the evmmax-vectorized branch 2 times, most recently from f0a4caf to a4ef7ea Compare February 14, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants