Build-Aware Incremental C-to-Rust Migration via Skeleton-First Translation and Historical Knowledge Reuse

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wang, Shengbo, Liu, Mingwei, Ou, Guangsheng, Chen, Yuwen, Li, Zike, Wang, Yanlin, Zheng, Zibin
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917364117798912
author Wang, Shengbo
Liu, Mingwei
Ou, Guangsheng
Chen, Yuwen
Li, Zike
Wang, Yanlin
Zheng, Zibin
author_facet Wang, Shengbo
Liu, Mingwei
Ou, Guangsheng
Chen, Yuwen
Li, Zike
Wang, Yanlin
Zheng, Zibin
contents Automating C-to-Rust migration for industrial software remains difficult because build-critical context is scattered across compile configurations, macros, external symbols, and cross-module dependencies, while reusable migration knowledge is often buried in prior C/Rust evolution. As a result, existing LLM-based approaches often work well on isolated functions or small benchmarks but struggle to produce stable project-level translations in partially migrated systems. We present His2Trans, a framework for incremental C-to-Rust migration in build-complex ecosystems where C and Rust coexist. His2Trans first reconstructs a compilable project-level Rust skeleton from build traces, recovering modules, type definitions, signatures, globals, and dependency relations before function-body generation. It then retrieves Rust-side interfaces and local coding patterns mined from historical compilation-accepted C/Rust pairs to guide translation and compiler-feedback repair. We evaluate His2Trans on five OpenHarmony submodules and nine general-purpose C benchmarks. On the OpenHarmony modules, His2Trans achieves a 97.51% incremental compilation pass rate and substantially improves build feasibility over reproduced baselines; the resulting artifacts also support mixed C/Rust builds without observed interface mismatches. On general-purpose benchmarks, it maintains high compilation feasibility, reduces the unsafe ratio by 24.02 percentage points relative to C2Rust, and, with Claude-Opus-4.5, lowers warning counts on compiled outputs. In addition, the self-evolving knowledge base reduces average repair rounds on unseen modules by approximately 60%. These results suggest that combining build-aware skeleton construction with historical knowledge reuse is an effective strategy for practical, gradual C-to-Rust migration.
format Preprint
id arxiv_https___arxiv_org_abs_2603_02617
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Build-Aware Incremental C-to-Rust Migration via Skeleton-First Translation and Historical Knowledge Reuse
Wang, Shengbo
Liu, Mingwei
Ou, Guangsheng
Chen, Yuwen
Li, Zike
Wang, Yanlin
Zheng, Zibin
Software Engineering
Automating C-to-Rust migration for industrial software remains difficult because build-critical context is scattered across compile configurations, macros, external symbols, and cross-module dependencies, while reusable migration knowledge is often buried in prior C/Rust evolution. As a result, existing LLM-based approaches often work well on isolated functions or small benchmarks but struggle to produce stable project-level translations in partially migrated systems. We present His2Trans, a framework for incremental C-to-Rust migration in build-complex ecosystems where C and Rust coexist. His2Trans first reconstructs a compilable project-level Rust skeleton from build traces, recovering modules, type definitions, signatures, globals, and dependency relations before function-body generation. It then retrieves Rust-side interfaces and local coding patterns mined from historical compilation-accepted C/Rust pairs to guide translation and compiler-feedback repair. We evaluate His2Trans on five OpenHarmony submodules and nine general-purpose C benchmarks. On the OpenHarmony modules, His2Trans achieves a 97.51% incremental compilation pass rate and substantially improves build feasibility over reproduced baselines; the resulting artifacts also support mixed C/Rust builds without observed interface mismatches. On general-purpose benchmarks, it maintains high compilation feasibility, reduces the unsafe ratio by 24.02 percentage points relative to C2Rust, and, with Claude-Opus-4.5, lowers warning counts on compiled outputs. In addition, the self-evolving knowledge base reduces average repair rounds on unseen modules by approximately 60%. These results suggest that combining build-aware skeleton construction with historical knowledge reuse is an effective strategy for practical, gradual C-to-Rust migration.
title Build-Aware Incremental C-to-Rust Migration via Skeleton-First Translation and Historical Knowledge Reuse
topic Software Engineering
url https://arxiv.org/abs/2603.02617