Skip to content

mfkiwl/C2RustRep

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

C2RustRep: Dependency-Guided Repository-Level C-to-Rust Translation with Reinforcement Alignment

C2RustRep is a framework for automatic repository-level migration from C to Rust. It leverages fine-grained dependency analysis and reinforcement learning to enhance translation accuracy, safety, and idiomaticity.

๐Ÿ“ Directory Structure

  • dataset/: Contains datasets for evaluation, multi-task fine-tuning, and reinforcement learning (in JSONL format).
  • inference/: Scripts for model inference and evaluation.
  • train/: Training scripts for multi-task fine-tuning and reward-based reinforcement learning.

๐Ÿš€ Quick Start

  1. Prepare Data
    Place the source C code and relevant datasets under the dataset/ directory.

  2. Train the Model
    Use train/lora_mft.py for multi-task fine-tuning, or train/lora_grpo.py for reinforcement learning with GRPO.

  3. Run Inference & Evaluation
    Use inference/main.py to perform translation and evaluate results.

โš™๏ธ Notes

  • This project emphasizes the automation workflow and evaluation of repository-level C-to-Rust migration.
  • For implementation details, please refer to the corresponding script files.
  • Requires basic knowledge of Python, Git, and deep learning frameworks.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%