Search papers, labs, and topics across Lattice.
His2Trans is introduced as a framework for automated C-to-Rust migration that addresses challenges related to unavailable build context and missing domain-specific evolutionary knowledge. It constructs a compilable Project-Level Skeleton Graph through build tracing for a strictly typed environment and employs Retrieval-Augmented Generation (RAG) to guide LLMs toward idiomatic interface reuse using historical migration traces. Experiments on OpenHarmony modules show a 99.75% incremental compilation pass rate and a 23.6% reduction in unsafe code ratio compared to C2Rust, with knowledge accumulation leading to a 60% reduction in repair overhead.
Achieve near-perfect compilation rates in automated C-to-Rust translation by combining build-aware skeleton graphs with retrieval-augmented generation from historical migration data, slashing repair overhead by 60%.
Automated C-to-Rust migration encounters systemic obstacles when scaling from code snippets to industrial projects, mainly because build context is often unavailable ("dependency hell") and domain-specific evolutionary knowledge is missing. As a result, current LLM-based methods frequently cannot reconstruct precise type definitions under complex build systems or infer idiomatic API correspondences, which in turn leads to hallucinated dependencies and unproductive repair loops. To tackle these issues, we introduce His2Trans, a framework that combines a deterministic, build-aware skeleton with self-evolving knowledge extraction to support stable, incremental migration. On the structural side, His2Trans performs build tracing to create a compilable Project-Level Skeleton Graph, providing a strictly typed environment that separates global verification from local logic generation. On the cognitive side, it derives fine-grained API and code-fragment rules from historical migration traces and uses a Retrieval-Augmented Generation (RAG) system to steer the LLM toward idiomatic interface reuse. Experiments on industrial OpenHarmony modules show that His2Trans reaches a 99.75% incremental compilation pass rate, effectively fixing build failures where baselines struggle. On general-purpose benchmarks, it lowers the unsafe code ratio by 23.6 percentage points compared to C2Rust while producing the fewest warnings. Finally, knowledge accumulation studies demonstrate the framework's evolutionary behavior: by continuously integrating verified patterns, His2Trans cuts repair overhead on unseen tasks by about 60%.