arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2604.12048cs.SE
收藏

ORBIT: 用于自主C到Rust转换的引导代理 orchestration

ORBIT: Guided Agentic Orchestration for Autonomous C-to-Rust Transpilation

Stony Brook University(石溪大学);Amazon Web Services(亚马逊云科技);University of California, Davis(加州大学戴维斯分校)

Muhammad Farrukh, Baris Coskun, Tapti Palit, Michalis Polychronakis

AI总结:

ORBIT 提出一种自主代理框架,通过动态上下文收集和依赖引导 orchestration 实现项目级 C到Rust转换,显著提升大规模代码转换的准确性和安全性。

摘要:

大规模迁移遗留C代码到Rust为提高内存安全性提供了有前景的路径,但基于LLM的C到Rust转换仍面临受限上下文窗口和幻觉的挑战。先前方法主要在小规模程序或偏向小代码库的数据集上评估,提供有限的现实系统可扩展性见解。它们还依赖静态上下文构建,在存在复杂跨模块依赖时会失效,通常需要手动干预。近期的编码代理提供了一种有前途的替代方案,通过动态代码库导航和上下文整理。然而,直接使用时,它们经常产生不完整的翻译,看似正确。我们提出了ORBIT,一种自主代理框架,结合动态上下文收集、依赖引导 orchestration 和迭代验证,构建依赖感知的翻译图,生成Rust接口,将C函数映射到Rust对应函数,并协调多个专门化代理。我们在CRUST-Bench的24个程序上评估ORBIT,其中91.7%的程序超过1000行代码。ORBIT在专家接口和自动生成功能接口设置中均实现100%编译成功和91.7%的测试成功,显著优于C2Rust和CRUST-Bench,同时将不安全Rust代码块减少到几乎为零。我们进一步在DARPA TRACTOR基准的挑战性案例上评估ORBIT,其性能相对参与系统具有竞争力。

英文摘要:

Large-scale migration of legacy C code to Rust offers a promising path toward improving memory safety, but LLM-based C-to-Rust translation remains challenging due to limited context windows and hallucinations. Prior approaches are evaluated primarily on small programs or datasets skewed toward small codebases, providing limited insight into scalability on real-world systems. They also rely on static context construction, which breaks down in the presence of complex cross-module dependencies and often requires manual intervention. Recent coding agents offer a promising alternative through dynamic codebase navigation and context curation. When used out of the box, however, they frequently produce incomplete translations that appear superficially correct. We present ORBIT, an autonomous agentic framework for project-level C-to-Rust translation that combines dynamic context collection with dependency-guided orchestration and iterative verification. ORBIT constructs a dependency-aware translation graph, generates Rust interfaces, maps C functions to Rust counterparts, and coordinates multiple specialized agents. We evaluate ORBIT on 24 programs from CRUST-Bench, with 91.7% of the programs exceeding 1,000 lines of code. ORBIT achieves 100% compilation success and 91.7% test success in both expert-interface and automatically generated-interface settings, substantially outperforming C2Rust and CRUST-Bench, while reducing unsafe Rust code blocks to nearly zero. We further evaluate ORBIT on challenging cases from the DARPA TRACTOR benchmark, where it achieves competitive performance relative to participating systems.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑