feat(compiler): add opt-in EVM compiler observation - #587
Open
ZR74 wants to merge 2 commits into
Open
Conversation
Emit schema-versioned phase, IR, stack-lift, Phi, register-allocation, and code-size metrics only when DTVM_EVM_COMPILER_OBSERVE is enabled. Add an atomic S0/S1 collection tool and unit tests so compiler growth can be attributed instead of inferred from aggregate JIT time.
Keep stack-lift statistics in the lightweight metrics header and let the EVM frontend consume that definition. Avoid pulling EVMC-only headers into generic multipass compiler builds that do not enable EVM support.
ZR74
marked this pull request as ready for review
July 29, 2026 03:30
⚡ Performance Regression Check Results✅ Performance Check Passed (interpreter)Performance Benchmark Results (threshold: 25%)
Summary: 194 benchmarks, 0 regressions ✅ Performance Check Passed (multipass)Performance Benchmark Results (threshold: 25%)
Summary: 193 benchmarks, 0 regressions |
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.
What changed
DTVM_EVM_COMPILER_OBSERVE=1.verification and cleanup, CgIR lowering, Phi elimination, register
allocation, post-RA processing, machine-code lowering, object emission, and
code publication.
fallback, feature-coverage, and actual emitted-code metrics.
the exact contract being studied.
run_ssa_compiler_observation.pyfor paired S0/S1 collection, comparison,atomic checkpointing, and resumable experiments.
generic WASM/multipass configurations continue to build without EVM include
paths.
Why
Aggregate JIT time and executable mapping size show that compilation changed,
but not which compiler stage caused the change. This made stack-SSA compile
growth difficult to explain: frontend expansion, Phi materialization, virtual
register growth, spilling, and object emission were all combined into one
number.
Effect
The new record makes S0/S1 differences attributable per bytecode:
register growth appears;
covered by the optimization;
size;
being mistaken for the selected replay target.
The collection tool alternates S0/S1 order and writes an atomic checkpoint
after every fixture, making a real-transaction experiment reproducible and
safe to resume.
Observation is disabled by default. When disabled, no structured record or IR
snapshot walk is produced. Compiler decisions, generated code, and
deterministic EVM execution remain unchanged.
Validation
evmJitFrontendTests: 108/108 passed in each configuration.the selected bytecode, with identical EVM execution output.
clang-format --dry-run --Werrorandgit diff --checkpassed.