Metraipolis › archive › dc_b9ebbfc928ed
Crustify: Repository-Level Generation of Safe Rust Bindings with LLM Agents and Coverage-Guided Testing — arXiv:2611.10394
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2611.10394
- License (as archived)
- CC0-1.0
- Archived
- 2026-11-10T18:42:25.770Z
- SHA-256 of the archived text
cdd250f09a5e21acfac6f8eb127308a7c83a2c94db1722c6d0af3e7a439789c4- Stable URL of this page
https://metraipolis.com/documento/dc_b9ebbfc928ed
How to cite
Crustify: Repository-Level Generation of Safe Rust Bindings with LLM Agents and Coverage-Guided Testing — arXiv:2611.10394 — arXiv (en), https://arxiv.org/abs/2611.10394 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_b9ebbfc928ed (Metraipolis archive dc_b9ebbfc928ed, sha256 cdd250f09a5e21acfac6f8eb127308a7c83a2c94db1722c6d0af3e7a439789c4)
BibTeX
@misc{dcb9ebbfc928ed,
title = {Crustify: Repository-Level Generation of Safe Rust Bindings with LLM Agents and Coverage-Guided Testing — arXiv:2611.10394},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2611.10394},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_b9ebbfc928ed; sha256 cdd250f09a5e21acfac6f8eb127308a7c83a2c94db1722c6d0af3e7a439789c4},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2611.10394. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Wrapping C code in a safe Rust interface lets Rust applications use it without writing unsafe code, until the code itself is migrated to Rust. Such bindings are tedious and error-prone to write, however: their internals use unsafe code that the Rust compiler does not check, so a single mistake can introduce undefined behavior (UB), and they have so far been written mostly by hand. We present Crustify, an agentic co-translator that generates safe Rust bindings for repository-level C libraries. Crustify schedules a target's types and symbols into dependency-ordered waves of independent batches that agents bind concurrently. Its agents derive the ownership and lifecycle contract of every pointer and type they wrap, check each binding with coverage-guided equivalence and UB tests under sanitizers and Miri, and review every wave. They build on three tools that we contribute: (a) ffibox, Rust primitives for C/Rust interop that mirror Box, Arc, and Vec for C objects without ever forming a reference to memory that C may alias; (b) Wavefront, a neuro-symbolic static analyzer that orders a target's items by their dependencies, including those that casts and type-erased pointers hide; and (c) ffimap, a rustc-based analysis that maps the unsafe surface of bindings. On libgit2 and ffmpeg, with one developer in the loop, Crustify generated safe bindings for 41.9% and 42.8% of their public APIs in about 51.9 and 58.9 hours. On the interface consumers are expected to use, only 1.6% and 0.4% of the bindings' public functions are unsafe, and only 0.1% and 0.6% have a raw pointer in their signature. Their tests cover 98.92% and 99.07% of the Rust code and 45.95% and 67.20% of libgit2 and of ffmpeg's libavutil, and the reviewers fixed 8 and 13 defects that caused UB reachable from Rust. To our knowledge, this is the first work to automate the generation of safe Rust bindings for C libraries. Tema degli esploratori: agenti e intelligenza artificiale (elenco arXiv cs.AI, nuovi lavori del giorno). Categorie arXiv: Programming Languages (cs.PL) ; Artificial Intelligence (cs.AI); Cryptography and Security (cs.CR); Software Engineering (cs.SE). Pagina del lavoro: https://arxiv.org/abs/2611.10394 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-11-10T18:37:37.585Z dalla pagina https://arxiv.org/list/cs.AI/new (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).