Mistral Details AI Agent Migration of 40,000 Lines of Fortran to C++

Image: mistral.ai
On September 9, 2026, Mistral published details on migrating a legacy scientific codebase for a European energy operator in Mistral's post on modernizing legacy code. The project centered on converting 40,000 lines of Fortran 77 into C++. The client's software was a physics-intensive reservoir simulator with no existing test suite and no centralized documentation.
Fortran 77 was standardized in 1977, and its constraints created architectural friction during the migration. The procedural language stores program state in global COMMON blocks, uses implicit variable typing based on the first letter of a name, and caps variable names at 6 characters. Converting the software into object-oriented C++ required structural refactoring to add explicit types, remove global state writes, and integrate modern frameworks such as PetSc.
To confirm that both codebases agreed, Mistral built a parity test harness before running translation agents. The team added Fortran subroutines to export internal state snapshots, built a C++ test framework to ingest those checkpoints, and used Skill.md files to direct agent behavior. In a verification run, agents dumped a Fortran RHOG variable value of 42.71834 to serve as the exact target for the corresponding C++ module.
To recover undocumented system behavior, Mistral parsed the codebase into a caller-callee tree. Mistral used Vibe CLI to spawn agents that traversed the tree from the leaf subroutines upward, pulling context from PDF files using Mistral OCR and submitting documentation pull requests. A separate reviewer agent running on a cron schedule inspected these pull requests and scheduled fix tasks.
Mistral tried several agent arrangements. The first attempt assigned one autonomous agent per subroutine over a week, producing functional code that preserved global structures and GOTO control flow instead of modernizing them. A second attempt paired planner, coder, tester, and reviewer agents, but the models stalled on complex bugs without human guidance. Mistral resolved this by placing a human operator over the workflow of coder, tester, and reviewer agents to migrate the software module by module.
Related AI News
Enjoyed this? Get more in your inbox.
Up to ten of the week's AI news stories, by email once a week.