Mistral details AI-agent migration of 40,000 lines of Fortran code
미스트랄은 유럽의 한 에너지 사업자가 패리티 테스트와 문서화 에이전트, 구조화된 휴먼 리뷰 워크플로를 활용해 포트란 77 코드 4만 줄을 C++로 이전하도록 지원했다고 밝혔다.
한 줄 답
What did Mistral announce about using AI agents to modernize legacy code?
미스트랄은 한 유럽 에너지 사업자와 진행한 프로젝트를 소개했다. 이 프로젝트에서는 물리 연산이 많은 저류층 시뮬레이터의 포트란(Fortran) 77 코드 4만 줄을 C++로 이전했다. 이 회사는 수치적 정합성을 검증하는 하네스를 구축하고, 에이전트를 활용해 코드베이스를 문서화했으며, 코더·테스터·리뷰어 에이전트와 사람의 점검 단계를 결합한 워크플로를 최종적으로 채택했다고 밝혔다.
핵심 요약
- 미스트랄에 따르면, 자사는 테스트 스위트나 중앙화된 문서화 체계도 없는 저류층 시뮬레이터에서 유럽의 한 에너지 운영사가 포트란 77 코드 4만 줄을 C++로 전환하도록 지원했다.
- The company built a parity harness that compared final outputs and critical intermediate checkpoints between the Fortran and C++ codebases.
- 미스트랄은 Vibe CLI를 활용해 100개 이상의 에이전트를 배치, 포트란 프로그램의 문서를 작성하고 검토용 풀 리퀘스트를 생성하도록 했다.
- After testing fully autonomous and more structured approaches, Mistral adopted a workflow combining coder, tester and reviewer agents with human intervention and review gates.
Mistral said it helped a European energy operator migrate 40,000 lines of Fortran 77 to C++ in a physics-intensive reservoir simulator. The company described the project in a post published Wednesday, saying the legacy code had no test suite or centralized documentation.
Building a numerical check
Mistral said it built a parity harness before beginning the migration. The harness was designed to establish numerical equality between the two codebases, checking both final results and critical intermediate points identified by the client’s reservoir engineers.
The company added Fortran subroutines to export program state, created a C++ test framework to load those checkpoints and supplied Skill.md files to guide agents. Mistral said agents used the setup to instrument the Fortran program, dump state snapshots and verify migrated C++ modules. In one example, a Fortran run exported a value for the RHOG variable, which was then used as a reference checkpoint in a C++ test.
Documenting the codebase
Mistral said documentation was scattered among old PDFs and comments in the Fortran source. It parsed the codebase with a custom parser to generate a caller-callee tree, which represents the program as linked subroutines.
Using Vibe CLI, the company spawned more than 100 agents to document the tree. Agents could retrieve relevant PDFs through document libraries and Mistral OCR. Starting with the tree’s leaves, each node spawned a subagent to document it and open a pull request to the original repository. A reviewer agent running on a cron schedule checked newly opened pull requests and scheduled fixes when needed.
Testing different agent setups
Mistral said its first approach assigned one autonomous agent to each Fortran subroutine for a week. The resulting code was functional, but the company said it retained global structures based on COMMON blocks and GOTO-driven control flow, resembling Fortran rewritten in C++ syntax.
In a second approach, a planner, coder, tester and code-quality reviewer worked together on each module. Mistral said code quality improved, but agents eventually stalled after encountering bugs.
The company then adopted a human-operated workflow using coder, tester and reviewer agents. Working with reservoir engineers, it identified independent modules of less than about 10,000 lines of Fortran, generated a target C++ architecture, reviewed it with an engineer, and broke approved designs into task queues. Each task followed a plan, implement, test and repeat cycle, with human review of pull requests before merging.
Mistral said the first sprint covered 40,000 of 300,000 lines. It noted that the codebase was self-contained and runnable, while migrations involving external systems, no runnable baseline or undocumented physics would present additional challenges.
Source: Mistral, “Modernizing complex legacy code with AI agents,” published September 9, 2026.
자주 묻는 질문
- 얼마나 많은 코드가 마이그레이션되었나요?
- Mistral says the first sprint migrated 40,000 of the codebase’s 300,000 lines, from Fortran 77 to C++.
- 패리티 하니스는 무엇에 사용되었나요?
- It exported state from the Fortran codebase, loaded checkpoints into C++ tests and checked numerical equality of final results and selected intermediate points.
- 에이전트들은 레거시 코드를 어떻게 문서화했을까?
- Mistral generated a caller-callee tree with a custom parser and used Vibe CLI to spawn more than 100 agents. The agents drew on relevant PDFs through document libraries and Mistral OCR, then opened pull requests.
- 미스트랄이 최종적으로 채택한 워크플로는 무엇이었을까요?
- A human operated a workflow of coder, tester and reviewer agents, migrating modules one at a time. Humans reviewed pull requests and intervened when agents became stuck.