Summary
Build infrastructure to compare Solar-generated bytecode against solc for behavioral and structural equivalence.
Parent issue: #687
Context
To achieve bytecode parity with solc, we need automated testing that:
- Compiles the same Solidity code with both compilers
- Compares the results (behavior and/or structure)
- Reports differences and tracks progress over time
This is Phase 1 of the roadmap and provides continuous feedback for all other work.
Tasks
Compilation harness
Behavioral equivalence (Level 1)
Structural equivalence (Level 2, optional)
Test corpus
CI integration
Example workflow
# Run equivalence test on a contract
solar-test-equiv contracts/Token.sol
# Output:
# Token.sol:
# Compile: ✓ Solar, ✓ solc
# Bytecode size: Solar 1234, solc 1256 (-22 bytes)
# Behavioral tests: 45/50 passing
# Failures:
# - transfer(address,uint256): different return value
# - approve: Solar reverts, solc succeeds
Patterns to follow
From Venom & Sonatina:
- Heavy reliance on differential testing against reference compilers
- Corpus-based testing + fuzzers feeding random programs
Acceptance Criteria
Estimated Complexity
Medium - Tooling work, not algorithmically complex
Dependencies
- Solar can emit some bytecode (even if incomplete)
- Foundry/Anvil/revm for execution
Summary
Build infrastructure to compare Solar-generated bytecode against solc for behavioral and structural equivalence.
Parent issue: #687
Context
To achieve bytecode parity with solc, we need automated testing that:
This is Phase 1 of the roadmap and provides continuous feedback for all other work.
Tasks
Compilation harness
Behavioral equivalence (Level 1)
Structural equivalence (Level 2, optional)
Test corpus
CI integration
Example workflow
Patterns to follow
From Venom & Sonatina:
Acceptance Criteria
solar-test-equiv path/to/contractsworksEstimated Complexity
Medium - Tooling work, not algorithmically complex
Dependencies