Test if code models are able to perform/be tuned for migration purposes
Run the unified setup script that checks and installs everything automatically:
# Windows
python scripts/setup_all.py
# Linux/Mac
python3 scripts/setup_all.pyThis script will:
- Check for Rust, Node.js, and C++ compiler
- Automatically install missing tools (where possible)
- Download Catch2 testing framework
- Set up Python environment with uv
If you prefer manual setup or the automated script doesn't work:
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Linux/Mac
curl -LsSf https://astral.sh/uv/install.sh | shuv syncThis will create a virtual environment and install all Python dependencies.
- Download and install from: https://nodejs.org/
- Or use a version manager like
nvm:nvm install 20 nvm use 20
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh- Linux:
sudo apt-get install g++ - Mac:
xcode-select --install - Windows: Install MinGW-w64 or use WSL
# Option 1: Download single header (recommended)
python scripts/install_catch2.py
# Option 2: Install via package manager
# Linux: sudo apt-get install catch2
# Mac: brew install catch2
# Or download from: https://github.com/catchorg/Catch2/releases# Activate uv environment
uv run python scripts/setup_environment.pyThis will check if all required tools are installed.
# 1. Download and split MBPP dataset
uv run python scripts/00_make_splits.py
# 2. Canonicalize the dataset
uv run python scripts/01_canonicalize.py
# 3. Convert tests to different languages
uv run python scripts/02_convert_tests.pyfrom runners import run_js_test, run_cpp_test, run_rust_test
# Test a JavaScript solution
result = run_js_test(
test_id=511,
solution_code="function find_Min_Sum(num) { ... }"
)
# Test a C++ solution
result = run_cpp_test(
test_id=511,
solution_code="int find_Min_Sum(int num) { ... }"
)
# Test a Rust solution
result = run_rust_test(
test_id=511,
solution_code="pub fn find_Min_Sum(num: i32) -> i32 { ... }"
)migration_tuning/
├── data/
│ ├── mbpp_raw/ # Raw MBPP dataset
│ ├── splits/ # Train/validation splits
│ └── canonical/ # Canonicalized data
├── gen/
│ ├── tests/ # Generated test files
│ │ ├── js/
│ │ ├── cpp/
│ │ └── rust/
│ └── solutions/ # Solution files
│ ├── js/
│ ├── cpp/
│ └── rust/
├── runners/ # Test runners for each language
├── scripts/ # Data processing scripts
└── pyproject.toml # uv project configuration
Each runner returns a dictionary with:
status:'pass' | 'compile_error' | 'runtime_error' | 'timeout' | 'wrong_answer'passed_tests: Number of tests that passedtotal_tests: Total number of testsstderr: Error outputstdout: Standard output