SEMay 14

Documentation-Guided Agentic Codebase Migration from C to Rust

arXiv:2605.1463495.0
Predicted impact top 4% in SE · last 90 daysOriginality Highly original
AI Analysis

For developers migrating legacy C codebases to Rust, RustPrint provides a scalable, architecture-aware approach that significantly improves compilation and feature preservation over existing methods.

RustPrint, a documentation-guided agentic framework, achieves repository-level C-to-Rust migration with 93.26% feature preservation and 95.17% test pass rate on eight real-world repositories (11K–84K LoC), outperforming prior LLM-based translators that fail repository-wide.

Migrating legacy C repositories to Rust promises stronger memory safety, but existing translators often work at the level of files or functions and miss architectural intent. We present RustPrint, a documentation-guided agentic framework for repository-level C-to-Rust migration. RustPrint first converts the source repository into architecture-aware documentation and treats it as a migration blueprint capturing module structure, data flow, APIs, and design rationale. Coding agents then use this blueprint to plan crates, implement modules, check compilability, reduce unsafe code, and iteratively refine the translated repository. RustPrint next compares documentation from the Rust output against the source documentation and uses mismatches as repair signals. It also translates and runs source test suites so runtime failures can guide targeted fixes. Experiments on eight real-world C repositories ranging from 11K to 84K LoC show that RustPrint compiles every target under both an open-weight (Kimi-K2-Instruct) and a closed-weight (GPT-5.4) backbone, while prior LLM-based translators (Self-Repair, EvoC2Rust) fail repository-wide. With the open-weight Kimi-K2-Instruct backbone, RustPrint exceeds an agentic Claude Code baseline on feature preservation (93.26% vs. 52.52%) and on cross-evaluation test pass rate (95.17% vs. 79.85%). These results suggest that documentation-guided coordination is a useful direction for scalable codebase migration.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes