Coastal waves and seafoam under an overcast sky at Belhaven Bay

Google’s coding agent just ported a 40-year-old ocean model to safe Rust in under an hour

From Mexico, I’ve been waiting for coding agents to stop being “write the next function” toys and start owning the ugly jobs nobody volunteers for — the 40-year-old simulation that still works, so nobody touches it. On November 3, Google’s Antigravity team published a write-up of one of those jobs: pointing Gemini 4 Argon, inside Google Antigravity, at FVCOM (the Finite-Volume Community Ocean Model) and letting the agent plan, rewrite, test and optimize the core into memory-safe Rust.

What Google says happened

According to the post, FVCOM is a coastal ocean simulation with 174,774 lines of Fortran 90 and C across 264 files. From a single prompt, Antigravity ran for 59 minutes and migrated the core into Rust that forbids unsafe, cut peak memory roughly in half, and sped the simulation up by 1.88x on their harness. Along the way the agent flagged six latent bugs in the old Fortran and C. Those numbers are Google’s own demo run — I haven’t reproduced them — but the shape of the workflow is the part worth stealing even if your speedup looks different.

The prompt wasn’t “port this somehow.” Google says it locked four hard rules: #![forbid(unsafe_code)] everywhere, no heap allocations inside hot loops (with Struct-of-Arrays layouts), every Rust file under 400 lines with runnable doc-tests, and at least 95% branch coverage plus zero numerical difference against the Fortran binary across 100 randomized seeds.

Cream-paper schematic: uneven legacy file stack and baseline box lead to a six-panel blueprint with bug ticks, then thirteen neat safe modules, a closed test loop, and a parity equals between old and new outputs
Legacy stack → blueprint that marks the latent bugs → neat safe modules, a self-heal loop, and parity against the old binary.

Three stages, one closed loop

Google breaks the run into three stages:

  • Stage 0 — baseline (11 min). In the Antigravity terminal the agent cloned FVCOM, compiled the original with gfortran -O3, and built a harness that recorded golden outputs, runtime and memory across 100 random seeds.
  • Stage 1 — audit and blueprint (3 min). It scanned all 264 files, traced globals through the solver loops, and wrote a six-part architectural blueprint artifact before touching Rust — including notes on latent bugs.
  • Stage 2 — port, self-heal, PGO (45 min). Against that blueprint it scaffolded a Cargo workspace, rewrote the core into 13 Rust modules (each under 240 lines), ran cargo test and cargo clippy, checked 100-seed parity, and finished with LLVM Profile-Guided Optimization.

The self-heal bit is the part I’d want in any agent I trust with a rewrite. Google says the first test pass got 36 of 37 unit tests; one shallow single-layer case panicked on a bounds check. The agent read the panic, patched the vertical solver, and re-ran until all 42 tests passed at 96.8% branch coverage. Then the A/B harness matched the Fortran baseline across all 100 seeds to 12 decimal places on the first try, per the post.

Where the speedup supposedly came from

Google’s scorecard (their numbers) walks the same binary through four stops: legacy Fortran/C at 883 ms and 11.84 MB peak RAM; idiomatic safe Rust at 682 ms / 6.39 MB; SoA with zero loop allocations at 548 ms / 5.83 MB; then PGO at 469 ms / 5.48 MB — 1.88x faster and about 54% less RAM. The big jump they call out is the old code allocating and freeing temporary heap arrays many times per time step; pre-allocated workspaces plus an automated PGO pass on a live trace did most of the work.

They shipped the workflow as a skill

This isn’t only a blog demo. Google packaged the pipeline as an open-source skill in the google/skills repository (migrate-to-rust). In Antigravity the entry point they advertise is /migrate-to-rust <github-repo-url>. The skill’s own contract adds a Stage 0 confirmation gate before compiling cloned external code — a detail I’d keep even if I reimplemented the idea in another harness.

What I take from it

  • Lock the definition of done before the agent writes a line: parity harness, coverage floor, and forbid(unsafe_code) beat “make it nicer.”
  • Force a blueprint artifact before the rewrite. The bugs Google says Argon found lived in comments and boundary workarounds that a chat-window snippet pass would miss.
  • Closed-loop terminal access (compile, panic, patch, re-test) is the difference between a demo and a migration.
  • Treat the 59 minutes / 1.88x / six-bug counts as one vendor run until you rerun the skill on your repo with your own golden outputs.

I haven’t pointed Antigravity at FVCOM myself, so everything above is from Google’s post and the public skill. Still, the pattern is clear: the hard part of legacy modernization isn’t typing Rust — it’s capturing what “correct” means, then giving an agent a loop that can fail and heal against that bar.

Sources: Google Antigravity Blog, “Modernizing 40-year-old scientific code with Gemini 4 Argon,” November 3, 2026; migrate-to-rust skill page (google/skills); google/skills repository. Hero image: Coastal East Lothian, Waves, Belhaven Bay by Richard West, Wikimedia Commons / Geograph, CC BY-SA 2.0; cropped and resized.