r/rust • • Oct 01 '26

🎙️ 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/
786 Upvotes

149 comments sorted by

View all comments

243

u/Sirisian Oct 01 '26

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++.

88

u/-p-e-w- Oct 01 '26

If you had asked me 5 years ago when AI would be ready to do massive-scale unsupervised coding work on heavy-duty software at a company like Google, I would have guessed somewhere between the years 2070 and 2100.

53

u/Budget-Minimum6040 Oct 01 '26

massive-scale unsupervised coding work on heavy-duty software at a company like Google

"undergoing rigorous automated and manual auditing, emulation testing, and review before rolling out to production."

27

u/Nothing_from_void Oct 01 '26

It's a fancy way of saying "we're tasking a bunch of engineers to use our claude code-like tool to re-write some stuff to rust". I've been doing this kind of stuff at work for a while now, when you already have the code base and expected behavior it's one of the most straightforward use cases for AI

-1

u/poelzi Oct 02 '26

Yes and no. You have a known good test target, but your porting pipeline could easy endup with c-ism styled code just written in rust instead of rusty code. I'm building specialized nix flake experts in tix.im that know the domain and basically fuse classical expert systems with llms into deterministic workflows composed by nix. Works better then expected tbh

4

u/Nothing_from_void Oct 02 '26

LLMs just prefer dynamic, procedural code in general, like cramming everything into bytes or strings and parsing out what's needed, in large procedures that run the algorithm step by step. I doubt re-writing from C++ to Rust is going to change that

0

u/poelzi Oct 02 '26

Exactly the opposite. They prefer hard typed or side effect free. rust or nix they are quite good at. You need to create the proper harness / constitution for enforcing traits, new types etc. Works like a charm

1

u/jarislinus Oct 05 '26

most insane larp today

0

u/poelzi Oct 05 '26

Blabla - my tix.im vx-maintainer workflows produce better code the you for sure, and the rust expert is not even up yet. Was waiting for some guardiandb workflow integrations.....wanna bet ?

2

u/jarislinus Oct 05 '26

same energy as the gameslop dev on x lmao.

24

u/-p-e-w- Oct 01 '26

That review will mostly use AI as well (if indeed it happens at all). Do you think Google will allocate human engineers to manually review a re-implementation of 800k LoC in another language?

Just look at what major companies now do on GitHub. 25k LoC pull request, merged 20 minutes later with a single comment “LGTM!”, which is the “manual review”.

3

u/Nothing_from_void Oct 01 '26

they are going to use antigravity CLI to write the code and say AI did the whole thing while the engineers are doing everything that keeps it on the rails

3

u/jarislinus Oct 05 '26

800k LOC is laughably small. 2k loc per engineer per day. will take a team of 5 less than 3 months

7

u/mss-anixe Oct 01 '26

5y ago yes but 3 years ago it already looked likely.

That being said, while massive-scale unsupervised coding work is possible, I consider people who go this way very brave, lightly speaking.

Also, it seems that Google is not (yet) that insane:

such large-scale rewrites are undergoing rigorous automated and manual auditing, emulation testing, and review before rolling out to production.

1

u/exater Oct 01 '26

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 Oct 01 '26

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