Dependency-Guided Repository-Level C-to-Rust Translation with Reinforcement Alignment
Jia Feng, Wenjie Gan, Cuiyun Gao, Chaozheng Wang, Feng Luo, Xin Xia, Ge Li, and Kui Liu

TL;DR
DepTrans is a novel framework that enhances C-to-Rust translation by modeling cross-file dependencies and using reinforcement learning, significantly improving compilation success and accuracy at the repository level.
Contribution
It introduces reinforcement-aligned syntax training and dependency-guided iterative refinement to improve large-scale C-Rust translation performance.
Findings
Achieves 60.7% compilation success rate
Attains 43.5% computational accuracy
Successfully builds 7 out of 15 industrial C projects
Abstract
Automating C-to-Rust migration is critical for improving software security without sacrificing performance. Traditional rule-based methods struggle with diverse C idioms, often producing rigid and unidiomatic Rust code. Large Language Models (LLMs), trained on massive code corpora, offer a promising alternative by leveraging cross-language generalization to generate more idiomatic and maintainable Rust code. However, several challenges remain. First, existing LLM-based approaches fail to handle cross-file dependencies effectively, either ignoring them or including entire files as context, which limits accurate dependency modeling. Second, complex dependencies and structured inputs and outputs make it difficult to verify syntactic correctness and functional equivalence at the repository level. Third, the lack of large-scale C-Rust parallel data constrains model performance. We propose…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
