← News

Mistral: AI agents migrate 40,000 lines of Fortran to C++

9 Sep 2026: Mistral published a case study on helping a European energy operator migrate 40,000 lines of Fortran 77 to C++ in a physics-intensive reservoir simulator with no test suite and no centralized documentation. Company news post is the primary. Autonomy failure modes and workflow lessons stay Mistral’s account.

9 Sep 2026: Mistral published “Modernizing complex legacy code with AI agents,” by Carlo Antonio Patti and Rasul Alakbarli. The company describes helping a European energy operator migrate 40,000 lines of Fortran 77 to C++ in a physics-intensive reservoir simulator — part of a roughly 300,000-line Fortran codebase. The customer is unnamed. That dated news post is the filing event.

Starting conditions on the post: no test suite and no centralized documentation. Mistral says knowledge was scattered in old PDFs and comments buried in the Fortran.

Before migration, Mistral says it built a numerical parity harness — Fortran state-export subroutines plus a C++ test framework that loads those checkpoints — so final outputs and critical intermediate points flagged by the client’s reservoir engineers could be compared. Treat that as Mistral’s method claim.

Documentation pass, on Mistral’s account: a caller-callee tree from a custom parser; “over a hundred agents” via Vibe CLI documenting nodes and opening PRs, pulling PDFs through document libraries and Mistral OCR. Those are company figures and process.

Attempt 1 (full autonomy): one agent per Fortran subroutine for about a week. Mistral says the result was functional C++, but COMMON blocks became global structs one-to-one and GOTO-driven control flow stayed intact. The company calls it Fortran retyped in C++ syntax — not modernization.

Attempt 2 (structured multi-agent): a planner, coder, tester, and code-quality reviewer per module improved quality, but Mistral says agents stalled on hard bugs with no human available to intervene.

Settled workflow on the page: a human operates coder, tester, and reviewer agents module by module. Reservoir engineers approve the target C++ architecture. Modules were kept under about 10,000 Fortran lines. Each task ran plan → implement → test loops; a human reviewed PRs and requested changes until merge.

First sprint scope on the page: 40,000 of about 300,000 lines — core functionality. The post does not give a duration, production-cutover status, deal size, or customer name.

Three lessons Mistral lists: build the parity harness before writing migration code; get documentation in order before leaning on the agents; at this scale, structured workflows with human review gates beat both full autonomy and hand-driven manual sessions.

A dated Mistral primary is unusually blunt that fully autonomous agents failed at real Fortran modernization — useful receipts for anyone selling “agents rewrite legacy code” without parity tests and human architecture gates.

ONLINE

article thread

guidelines

warming…

warming…

Sources