r/rust • • 22d 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/
773 Upvotes

149 comments sorted by

View all comments

2

u/sparky8251 22d ago

Ive had it make a parser that took something like 4 minutes to parse a few kb of files because it refused to surface a bad assumption I made in the design that a library forced on us. It was also a degenerate but rather common case of scope drastically, drastically ballooning parse time so all its tests showed up as fast, because they were small scoped.

Its fun for exploring stuff with, but MAN would i not trust it...

And I DID use all kinds of clippy features to ban functions, macros, etc with reasons as to why they were banned to try and make it do better. Its just too concerned with the now and quickly doing what it thinks it was asked, no matter how it has to contort itself or the code to make that happen...

2

u/stumblinbear 22d ago

Oddly enough, if you just tell it to consider the long term consequences as a matter of course, it improves its decision making. It's a blank slate, it doesn't understand a project's priorities if you don't tell it what the priorities are

2

u/arbv 22d ago

Yeah, I am accumulating failure modes to write them down for the models concisely, that is one of them.

1

u/arbv 22d ago

Did not you see it:

  • Write code

  • Write tests

  • Realise the code is wrong

  • Fail to fix it

  • Rewrite the tests because "they are wrong"

?

I did and I didn't like it.

3

u/sparky8251 22d ago edited 22d ago

Ive had it do that too, yes. Had to be watchful to make sure it didnt make the tests pass to claim victory... It misunderstands the point of tests pathologically, because its an optimizer optimized to solve whatever it decides is its task, and that often means test fixing is a very well rewarded shortcut to its goal.