This paper introduces an agentic workflow designed to modernize massive, legacy High-Performance Computing (HPC) codebases by automating routine code transformations. The authors demonstrate this approach by converting the two-electron-integral core of GAMESS, a quantum-chemistry package with 48 years of development history, from fixed-form Fortran 77 to free-form Fortran 2008.
Automating Legacy Code Modernization
Modernizing legacy Fortran is often hindered by the sheer volume of code, which makes manual refactoring impractical. The authors propose a workflow that delegates these routine tasks to AI agents. The system utilizes three prompt-specialized agent roles operating within isolated worktrees. These agents follow a version-controlled specification that they are responsible for authoring and revising themselves. Humans remain involved by managing a small number of "gates" to oversee the process.
The GAMESS Case Study
The researchers applied this workflow to 56,448 lines of code across twelve source files and 225 subroutines within GAMESS. The project spanned four generations of Claude models. To ensure the integrity of the scientific calculations, the team used the GAMESS community’s standard test suite as a verification oracle. They established a strict merge criterion: the modernized code had to produce bit-for-bit identical energy outputs compared to the original, where even a deviation in the twelfth decimal place was classified as a failure.
Validation and Results
The modernized code successfully passed a 51-test validation battery, which included the 49 standard GAMESS tests plus two additional calculations. Across 612 total test runs, the researchers reported zero chemistry-relevant differences between the original and modernized code. Furthermore, every file passed the Jenkins tests used for the project's continuous integration.
Scope and Limitations
The authors note that the safety of this agentic delegation is bounded by the capabilities of the verification oracle. The workflow is effective specifically where an exact, domain-inherited oracle—such as the canonical energy outputs in this chemistry package—can be used to validate the output. The study suggests that while individual code transformations are routine, the primary challenge in HPC modernization is the scale of the codebase, which this agentic approach addresses by enabling production-scale automation.
Comments (0)
to join the discussion
No comments yet
Be the first to share your thoughts!