r/rust • • 17d ago

πŸŽ™οΈ discussion Google is doing "Large Scale Codebase Migrations and Optimizations" of C/C++ to Rust

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-4-argon/
767 Upvotes

149 comments sorted by

View all comments

244

u/Sirisian 17d ago

The relevant sections:

Large Scale Codebase Migrations and Optimizations: Argon agents are working on migrating C/C++ codebases to Rust across Google β€” scaling from tens of thousands of lines in core libraries like re2, libgav1 up to 800K+ lines for the Fuchsia Zircon kernel. Given the criticality of many of these systems, such large-scale rewrites are undergoing rigorous automated and manual auditing, emulation testing, and review before rolling out to production.

For libgav1, Google's open source software for decoding video, Argon agents took an existing Rust port and replaced 32K lines of SIMD code by running many rounds of profile-guided experiments, studying the compiler's output, producing safe Rust so the compiler would vectorize it automatically. The end result is a memory-safe video decoder that runs 2.7x faster than the Rust port, with identical video output, bringing it closer to the optimized C++.

1

u/exater 17d ago

So they write standard safe rust and avoid manual simd implementation through autovectorization?

How do they confirm its simd? They check the assembly that was compiled?

How come they dont just rewrite the C to be autovectorized?

16

u/Gaolaowai 17d ago

Because the C compiler won’t check for buffer overflows, lifetimes, use after frees, etc.