Sulat.com / Writing on AISaturday, November 28, 2026
Agent Engineering/28 November 2026

Google’s migrate-to-rust skill for coding agents

Google's migrate-to-rust agent skill ports legacy C, C++ and Fortran code to Rust. This is how it works, what Google's FVCOM run showed, and what it didn't.

Glossy 3D Google G logo beside a copper gear on a glowing glass stack, for Google's migrate-to-rust agent skill
Illustration: Sulat, featuring the Google logo

At a glance

  • Google's migrate-to-rust skill, in its skills repository since October, tells a coding agent to port legacy C, C++, Fortran, Java, Python or shell code to Rust with unsafe code forbidden, and Spanish developer midudev's 27 November post brought it a wider audience.
  • Google says Antigravity and Gemini 4 Argon ported the core of the 174,774-line FVCOM Fortran ocean model in 59 minutes, with 1.88 times the speed and 54% less memory, from one benchmark run.
  • The skill makes the agent ask you to confirm the build and run commands before it runs any cloned code, and caps self-healing at 5 rounds per failure.
  • The prompt asked for zero numerical difference, but Google's result is agreement to 12 decimal places, and 13 modules under 240 lines each means the Rust port is at most 3,120 lines.
  • Forbidding unsafe code covers only the crate's own code, and Google has not published the port, the prompt or the telemetry file from the run.

Google has an official agent skill called migrate-to-rust that takes a legacy codebase in C, C++, Fortran, Java, Python or shell and ports it to Rust, with the crate locked against any unsafe code. Spanish developer Miguel Ángel Durán, known online as midudev, put it in front of a wide audience on 27 November, and his post has about 39,500 views. The skill isn’t new. Google added it to its skills repository as version 1.0.0 in October, and its Antigravity team described it on 3 November alongside a Fortran-to-Rust demo.

The demo is where the numbers come from. Google says Antigravity, running Gemini 4 Argon, ported the core of a 174,774-line Fortran ocean model to Rust in 59 minutes, matched the original on 100 test seeds, ran 1.88 times faster and used 54% less memory. All of those are Google’s own figures from one run. The port itself isn’t public.

Miguel Ángel Durán (midudev) on X, 27 November 2026: “Google has an official skill called /migrate-to-rust, which helps you move legacy systems to Rust.” Translated from Spanish.

59 min

autonomous run, per Google

1.88x

faster than the Fortran original

3.91e-13

parity across 100 seeds, not zero

What the skill is

A skill is a folder with a SKILL.md file of instructions that an agent loads when a task matches. This one sits in google/skills, a repository of 220 skills for Google products. Install is npx skills add google/skills, and Google says that in Antigravity the whole pipeline runs with one command:

Code
/migrate-to-rust <github-repo-url>

The file tells the agent to act as a systems architect, performance engineer and Rust specialist. It names the legacy languages it handles (C++, Fortran, Java, Python, C and shell), sets the target as “100% Safe Rust”, and asks for two outputs besides the code: a first-person account of the migration written by the AI, and an interactive HTML scorecard. The description says to skip it for unrelated refactoring and single-line syntax questions.

It also bundles a stdlib-only Python script, telemetry.py, that logs timings, test runs and benchmark stages to a migration_telemetry.json file and renders the scorecard. A read of the script shows no network calls and no subprocesses.

How it works, stage by stage

Google migrate-to-rust skill: Stage 0 baseline, Stage 1 blueprint, Stage 2 port, heal and tune, with 11, 3 and 45 minutes in Google's demo
The skill’s three stages, with the minutes Google reports for its Fortran demo.
  1. Stage 0: baseline. The agent clones the repository, scans it, and records code size, comment density and raw-pointer hazards. It then has to show you the build command, the run command and the working directory and get your confirmation before it compiles or runs anything from a cloned repository. Once confirmed, it builds the legacy code in release mode, records golden outputs across deterministic seeds, and logs run time and peak memory.
  2. Stage 1: audit and blueprint. It reads the code, logs opportunities and latent bugs, and writes a six-part architectural blueprint. It then moves straight on to Stage 2 unless you asked for a plan only.
  3. Stage 2: port, heal, tune. It scaffolds a Rust workspace with #![forbid(unsafe_code)], writes modules of 400 lines or fewer with doc-tests, runs cargo test and cargo clippy, and compares the Rust binary with the legacy one across seeds within a stated numerical tolerance. It finishes with LLVM profile-guided optimisation and link-time optimisation, then renders the scorecard.

The limits are written into the file. The agent gets 5 self-healing rounds, or 15 minutes per phase, to fix failing tests or diverging output. If something still fails, it has to record the partial state and document the gap instead of looping. The stated definition of done is zero clippy warnings, at least 95% branch coverage, and output parity within a documented epsilon.

Hand-drawn card reading Ask first: no run until you say yes, between a cloned repo folder and a play button
The Stage 0 confirmation gate: cloned code is not built or run until you approve the commands.

The skill builds and runs code from a repository you didn’t write, so Stage 0 is the one place a human is asked to look before anything executes. Where the host allows autonomous execution, the file tells the agent to carry on from there without pausing. Running it in a sandbox or a throwaway container is still sensible.

What Google says it did with FVCOM

The skill came out of an internal stress test described in a 3 November post by Dan Gruhl, a principal engineer in Google AI R&D, and Prashant Nair. The target was FVCOM, the Finite-Volume Community Ocean Model, a coastal ocean simulation of 174,774 lines of Fortran 90 and C across 264 files. The prompt set four rules: no unsafe anywhere, no heap allocations in hot loops, every file under 400 lines with doc-tests, and at least 95% branch coverage with zero numerical difference from the Fortran across 100 random seeds.

Google reports the run took 59 minutes: 11 for the baseline, 3 for the audit and 45 for the port, testing and tuning. It says the agent rewrote the core solver as 13 Rust modules, each under 240 lines, and that on the first test run 36 of 37 unit tests passed. The failure was a single-layer ocean basin that hit a bounds check; the agent added a guard, and all 42 tests then passed with 96.8% branch coverage. In the parity check, Google says all 100 seeds matched to 12 decimal places, a difference of 3.91 × 10-13, on the first attempt.

Hand-drawn card reading One autonomous run, 59 min, split into baseline, audit and port segments for Google's FVCOM port
Google says the whole FVCOM run took 59 minutes, 45 of them on the port, tests and tuning.

It also lists six latent bugs it says the port exposed: a mesh builder that wrote past a 50-column limit, a triangle check that multiplied three node IDs in 32-bit precision and overflowed above 1,300 nodes, reads of index 0 on shallow grids, uninitialised values pulled from dry cells, and a seawater-density routine that took the square root of salinity without guarding against a small negative value.

Google FVCOM Rust port runtimes: Fortran 883 ms, safe Rust 682 ms, SoA 548 ms, PGO 469 ms, a 1.88x speedup
Google’s four benchmark stages for the FVCOM port. All figures are Google’s, from a single run.
StageRuntimeSpeedupPeak RAMWhat changed
0. Legacy Fortran 90 and C, -O3883 ms1.00x11.84 MBOriginal, with shared global arrays
1. Idiomatic safe Rust682 ms1.29x6.39 MBNo globals, bounds-checked slices
2. Struct-of-arrays, no loop allocations548 ms1.61x5.83 MBPreallocated workspaces instead of 24 heap allocations per time step
3. LLVM profile-guided optimisation469 ms1.88x5.48 MBBranch layout and vectorisation, 54% less RAM
Google’s figures, from its 3 November post.

The biggest single step in Google’s account was memory. A 2D Runge-Kutta loop allocated and freed eight temporary arrays 24 times per time step, and moving them into preallocated workspaces took the run from 682 to 548 ms.

What the run does and doesn’t show

Google’s claim is real as far as it goes, and the post is specific about what was done. These are the gaps.

Hand-drawn card: FVCOM source of 174,774 lines versus a Rust port of 13 modules under 240 lines each, at most 3,120 lines
Google’s own limits put the port at 3,120 lines at most, against 174,774 lines of source.
  • It ported the core, not the model. Google says “the core of” FVCOM. Thirteen modules of under 240 lines is at most 3,120 lines of Rust, against 174,774 lines of source. Google doesn’t say which parts of FVCOM were left out, and it hasn’t published the port.
  • One run, one machine, one workload. The benchmark is a single 883 ms run. The post gives no repeats, spread or hardware, and neither the Fortran compile flags beyond gfortran -O3 nor the Rust build settings are listed in the post.
  • “Zero difference” became 3.91e-13. The prompt asked for zero difference across 100 seeds. The result is agreement to 12 decimal places. That is excellent for floating-point code, but it isn’t bit-identical, and the post doesn’t say whether the tolerance was set before or after the run.
  • The bugs are Google’s account. The six defects are described in the post, but Google doesn’t say it reported them to the FVCOM maintainers, and no issue is linked.
  • Speed gains are from restructuring. The jump from 1.61x to 1.88x is profile-guided optimisation, which Fortran compilers can use too. The gain mixes language choice with removing allocations the original code made, so 1.88x isn’t a measure of Rust against Fortran.
Hand-drawn card reading Evidence so far: 1 run, with a stopwatch and the words 100 seeds, one program
Google’s published evidence is one benchmark run of one program, checked on 100 seeds.

The 1.88x figure sits oddly beside Google’s own framing of the work. The post says teams can bring this kind of port forward “in an afternoon”, but the demo was run by Google’s own engineers, on a codebase they chose, using Google’s own tooling.

What “100% safe Rust” means

Hand-drawn card: forbid unsafe_code covers your crate; dependencies, the standard library and C ABI or OS calls sit outside the rule
The lint covers the crate’s own code. It doesn’t make dependencies, the standard library or operating system calls safe.

#![forbid(unsafe_code)] is a compiler lint that rejects any unsafe block in the crate it is set on. That removes a class of memory bugs from the code the agent wrote. It doesn’t cover dependencies, the standard library, or anything the crate calls through a C interface, and it doesn’t say the maths is right. A model can be memory-safe and still wrong.

Real-world ports show where the line falls. In the Copilot runtime port Microsoft counted 158 unsafe blocks, every one at an external boundary: the C ABI, Windows calls, POSIX and libc, SQLite and dynamic library loading. Whether a codebase can live under the lint depends on how much it touches C interfaces and the operating system.

How it compares

The skill sits in a crowded year for Rust migrations. They differ in what they port, what they use as a checker and who is accountable for the result.

ProjectWhat movedCheckerReported result
Google migrate-to-rust (FVCOM)Core of a Fortran 90 and C model, 174,774 lines of source100 seeds against the Fortran binary, within a tolerance1.88x faster, 54% less RAM, per Google; port unpublished
Google giflib rewriteAbout 3,000 lines of C, one-shot with GeminiOver 30 million real GIFs, with experts reviewing all unsafe codeDrop-in replacement; sandboxing for the C library dropped, tail latency lower
DARPA TRACTORC to Rust across six performer teams and two baselinesMIT Lincoln Laboratory’s test suiteFirst report, 13 October 2026, put average failure on correctness at 17.8%
Anthropic Messages APIPython service to RustProduction traffic as the oracle, with agents fixing differencesAbout 70% less CPU per request, per Anthropic
AppwritePHP server to Rust, service by service5,329 end-to-end tests plus 43,075 recorded cases2.6x the requests on the Users API, per Appwrite
Spatie Ray 4Electron app to a Rust and GPUI appParity harness with screenshots and an overnight fix loopAbout 194x faster on 10,000 logs; Spatie’s own chart says 213x
Each result is the company’s or programme’s own. Sources are listed below.

Three things follow. First, Google’s own giflib rewrite is the stronger evidence for the approach: a smaller target, a far bigger test corpus and human review of every unsafe line. The FVCOM run uses 100 seeds. Second, TRACTOR’s evaluators measure failure rates across several teams rather than reporting one best run, and the report describes the baseline tool c2rust as “often producing unsafe and unidiomatic Rust”. Third, Anthropic and Appwrite show a different shape from a skill: engineers built the checker alongside the port and reviewed the fixes.

A benchmark paper called f2x50 shows why Fortran is a harder test than it looks. It gathers 50 public Fortran repositories (12,116 files and about 6.57 million lines) with 561 behavioural probes, and says scientific Fortran has its own problems: array conventions, global state and numerical tolerances. FVCOM is one codebase. Fifty would be a better test of a skill that claims to handle Fortran.

Using it

  • Install with npx skills add google/skills and pick migrate-to-rust. In Antigravity, run /migrate-to-rust with a repository URL.
  • Read the Stage 0 commands before you approve them, and run the legacy build in a container.
  • Write your own tests for the behaviour you care about first. The skill’s parity check compares outputs on seeds; it isn’t a specification.
  • Check the final scorecard for unavoidable exceptions the agent documented, and for the unsafe count it scans for at the end.
  • Expect cost. The demo ran on Gemini 4 Argon, which Google is doubling in price on 1 December. Google’s post doesn’t give the run’s token use.

Google’s installer lets you choose which agents to configure, but the demo and the one-command route are Antigravity’s.

What’s still open

Google hasn’t said whether it will publish the FVCOM port, the telemetry file from the run or the exact prompt, and Sulat found no independent run of the skill reported. The FVCOM maintainers haven’t commented on the bug list in anything Sulat has found. Until someone else runs it on code Google didn’t pick, the 1.88x figure is a result about one run of one program.

Related: why Bun, GitHub, Ubuntu and Cloudflare moved to Rust, and Google’s Sashiko Linux reviewer.


Sources