-
Notifications
You must be signed in to change notification settings - Fork 24
perf(evm): relax jit fallback thresholds for benchmark corpus #430
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,13 +111,15 @@ struct JITSuitabilityResult { | |
| size_t DupFeedbackPatternCount = 0; // DUPn immediately before RA-expensive | ||
| }; | ||
|
|
||
| /// Thresholds for JIT suitability fallback. Normal contracts have <20 | ||
| /// RA-expensive ops per block; these values are conservatively high. | ||
| /// Thresholds for JIT suitability fallback. Keep the bytecode size cap intact, | ||
| /// but raise the MIR / RA pattern limits high enough that the current evmone | ||
| /// benchmark corpus stays on the JIT path (including the pathological | ||
| /// signextend micro benchmark). | ||
| static constexpr size_t MAX_JIT_BYTECODE_SIZE = 0x6000; | ||
| static constexpr size_t MAX_JIT_MIR_ESTIMATE = 50000; | ||
| static constexpr size_t MAX_CONSECUTIVE_RA_EXPENSIVE = 128; | ||
| static constexpr size_t MAX_BLOCK_RA_EXPENSIVE = 256; | ||
| static constexpr size_t MAX_DUP_FEEDBACK_PATTERN = 64; | ||
| static constexpr size_t MAX_JIT_MIR_ESTIMATE = 0x50000; | ||
| static constexpr size_t MAX_CONSECUTIVE_RA_EXPENSIVE = 0x3000; | ||
| static constexpr size_t MAX_BLOCK_RA_EXPENSIVE = 0x3000; | ||
| static constexpr size_t MAX_DUP_FEEDBACK_PATTERN = 0x3000; | ||
|
Comment on lines
118
to
+122
|
||
|
|
||
| class EVMAnalyzer { | ||
| using Byte = zen::common::Byte; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new threshold comment hard-codes a policy goal tied to the current evmone benchmark corpus (and a specific micro-benchmark). That’s likely to go stale and makes it harder to reason about the safety goal of this fallback (avoiding pathological JIT compile-time blowups). Consider rewriting this comment to describe the invariant being protected (e.g., cap compile-time / RA complexity) and, if needed, reference the benchmark corpus in a higher-level tuning doc or commit/benchmark notes rather than as the normative requirement in a public header.