Add comprehensive fuzz testing pipeline for Kotlin native compiler evaluation #6
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.
Overview
This PR implements a complete differential fuzzing pipeline to evaluate changes in the Kotlin native compiler across versions. The pipeline systematically generates progressively complex Kotlin programs and performs differential testing between compiler versions to detect behavioral changes, crashes, or output differences.
Problem Statement
Testing compiler changes requires:
Solution
A 4-step pipeline that automates the entire fuzzing workflow:
Step 1: Grammar Evaluation
Evaluated three Kotlin ANTLR4 grammars to find the best foundation:
Result: All three achieved 95% compilation success on 60 test samples, with the official spec selected as the baseline.
Step 2: Complex Code Generation
Enhanced code generation with 15+ templates covering advanced Kotlin features:
<T: Any>,<T, R>)Result: 94% compilation success on 50 complex samples, far exceeding the 50% target.
Step 3: Maximum Complexity
Pushed complexity to the limits with:
Result: 89% compilation success on 84 samples, intentionally including edge cases.
Step 4: Differential Fuzzing Pipeline ⭐
The core differential testing system:
Features:
What it detects:
Result: Tested 50 programs, 100% success rate, 0 differences found between Kotlin 2.2.20 and 2.0.0.
Usage
Configuration
All parameters are easily configurable:
Statistics
Total Programs Generated: 244
Performance: ~5 minutes for 50 differential tests with 4 workers
Documentation
Comprehensive documentation included:
Project Structure
Key Benefits
Future Enhancements
Testing
All components have been tested:
Ready for use in evaluating Kotlin compiler changes! 🚀
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.