Back to Feed
Agents / Benchmarks & Evals

Automating Legacy Fortran Code Modernization with Agents

Original: An Agentic Workflow for Legacy HPC Modernization: Converting the Two-Electron-Integral Core of GAMESS

Listen to the summary

Uses a voice available on your device

Audio options
On this page 4 sections
Related concepts 1 concepts

Key Takeaways

  • Modernizing large-scale legacy Fortran codebases is traditionally a labor-intensive task, but this paper addresses how agentic workflows can automate this at scale.
  • The workflow successfully converted 56,448 lines and 225 subroutines across twelve source files of GAMESS from fixed-form Fortran 77 to free-form Fortran 2008.
  • All converted files passed a 51-test validation battery with zero chemistry-relevant differences across 612 test runs.
  • Safety is maintained through prompt-specialized agent roles in isolated worktrees, version-controlled specs, domain-specific exact verification oracles, and human-in-the-loop gates.

Summary & Methodology Analysis

Modernizing large-scale legacy Fortran codebases is a labor-intensive task that often remains undone. To address this, the authors developed an agentic workflow to automate codebase modernization at scale. The method relies on a version-controlled specification that the agents themselves author and revise, combined with three prompt-specialized agent roles operating in isolated worktrees. To maintain safety, the system integrates a domain-specific exact verification oracle alongside human-in-the-loop gates for oversight, validating the final code conversion using bit-for-bit reproduction of canonical test suite energy outputs.

Applying this architecture to GAMESS using tools like Claude Code and Jenkins, the workflow successfully converted 56,448 lines and 225 subroutines across twelve source files from fixed-form Fortran 77 to free-form Fortran 2008. The resulting codebase was subjected to rigorous testing, passing a 51-test validation battery with zero chemistry-relevant differences across 612 test runs, proving that automated migration can maintain precise domain semantics at scale.

Despite these strong results, the approach comes with specific boundaries. The primary limitation is that the safety of the delegation is strictly constrained by the limitations of the verification oracle. If the oracle cannot catch a discrepancy or evaluate a specific edge case, the automated migration safety guarantees degrade accordingly.

Interactive System Flowchart

Click diagram to expand and zoom

Cross-Examination & FAQs

A deeper dive clarifying mechanics, constraints, and baseline evaluations.

Q1. What problem does this paper address?

Modernizing large-scale legacy Fortran codebases is a labor-intensive task that often remains undone.

Q2. What software was used in the modernization process?

The paper used GAMESS, Claude Code, and Jenkins.

Q3. Did the modernized code pass validation?

Yes, all converted files passed a 51-test validation battery with zero chemistry-relevant differences across 612 test runs.

Q4. How many lines and subroutines were converted?

The workflow successfully converted 56,448 lines and 225 subroutines across twelve source files.

Q5. What format was the code converted from and to?

The code was converted from fixed-form Fortran 77 to free-form Fortran 2008.

Q6. How are safety and correctness maintained during conversion?

Safety is maintained by integrating a domain-specific exact verification oracle and implementing human-in-the-loop gates for oversight.

Q7. How do the agents coordinate their work?

They employ three prompt-specialized agent roles operating in isolated worktrees using a version-controlled specification that the agents themselves author and revise.

Q8. How is code conversion ultimately validated?

Code conversion is validated using bit-for-bit reproduction of canonical test suite energy outputs.

Q9. What is the main limitation of this workflow?

The safety of the delegation is constrained by the limitations of the verification oracle.