feat: add burntpix benchmark and unify execution paths#316
Open
feat: add burntpix benchmark and unify execution paths#316
Conversation
Add EvmCompiler::new_llvm(aot) convenience constructor that combines EvmLlvmBackend::new and EvmCompiler::new. Replace all call sites that were using the two-step pattern with the concrete LLVM backend.
Add the BurntPix on-chain generative art contracts as a fixture-based benchmark (Cancun spec). Unify the CLI and criterion benchmark execution so both bytecode-only and fixture benchmarks go through the same transact() flow. Bytecode benchmarks are wrapped into a synthetic fixture with a BENCH_CONTRACT and BENCH_CALLER. Benchmarks using stack_input are detected via is_runnable() and skipped for transaction-based execution.
Address::ZERO causes ERC20 contracts to revert on mint-to-zero checks when running through transact(). Use 0x1111...1111 instead and update the WETH balanceOf storage slot hash accordingly.
Call jit_function after translate_inner in JIT mode so the module gets finalized and opt.ll/opt.s dumps are written. Without this the codegen FileCheck tests failed because opt.ll was never produced. Change sanity_check to compare interpreter vs JIT result parity instead of asserting both succeed. Benchmarks like fiat_token called with no calldata legitimately revert.
Merging this PR will degrade performance by 99.98%
Performance Changes
Comparing Footnotes
|
Use iter_batched so DB + EVM construction happens in the setup closure and only transact/handler.run is measured. Introduce EvmWithDb to safely co-locate the CacheDB and the EVM that borrows it.
Add load_with that takes an external compiler, and clear_ir() between benchmarks to free IR while keeping JIT'd machine code alive. This avoids rebuilding the LLVM compiler per benchmark, which is especially costly under valgrind (codspeed).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the BurntPix on-chain generative art contracts as a fixture-based benchmark (Cancun spec).
Unify the CLI and criterion benchmark execution so both bytecode-only and fixture benchmarks go through the same
transact()flow. Bytecode benchmarks are wrapped into a synthetic fixture with aBENCH_CONTRACTandBENCH_CALLER. Benchmarks usingstack_inputare detected viais_runnable()and skipped for transaction-based execution.Depends on #315.