RustAssure: Differential Symbolic Testing for LLM-Transpiled C-to-Rust Code

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Bai, Yubo, Palit, Tapti
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916997928845312
author Bai, Yubo
Palit, Tapti
author_facet Bai, Yubo
Palit, Tapti
contents Rust is a memory-safe programming language that significantly improves software security. Existing codebases written in unsafe memory languages, such as C, must first be transpiled to Rust to take advantage of Rust's improved safety guarantees. RustAssure presents a system that uses Large Language Models (LLMs) to automatically transpile existing C codebases to Rust. RustAssure uses prompt engineering techniques to maximize the chances of the LLM generating idiomatic and safe Rust code. Moreover, because LLMs often generate code with subtle bugs that can be missed under traditional unit or fuzz testing, RustAssure performs differential symbolic testing to establish the semantic similarity between the original C and LLM-transpiled Rust code. We evaluated RustAssure with five real-world applications and libraries, and showed that our system is able to generate compilable Rust functions for 89.8% of all C functions, of which 69.9% produced equivalent symbolic return values for both the C and Rust functions.
format Preprint
id arxiv_https___arxiv_org_abs_2510_07604
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle RustAssure: Differential Symbolic Testing for LLM-Transpiled C-to-Rust Code
Bai, Yubo
Palit, Tapti
Software Engineering
D.2.4
Rust is a memory-safe programming language that significantly improves software security. Existing codebases written in unsafe memory languages, such as C, must first be transpiled to Rust to take advantage of Rust's improved safety guarantees. RustAssure presents a system that uses Large Language Models (LLMs) to automatically transpile existing C codebases to Rust. RustAssure uses prompt engineering techniques to maximize the chances of the LLM generating idiomatic and safe Rust code. Moreover, because LLMs often generate code with subtle bugs that can be missed under traditional unit or fuzz testing, RustAssure performs differential symbolic testing to establish the semantic similarity between the original C and LLM-transpiled Rust code. We evaluated RustAssure with five real-world applications and libraries, and showed that our system is able to generate compilable Rust functions for 89.8% of all C functions, of which 69.9% produced equivalent symbolic return values for both the C and Rust functions.
title RustAssure: Differential Symbolic Testing for LLM-Transpiled C-to-Rust Code
topic Software Engineering
D.2.4
url https://arxiv.org/abs/2510.07604