Back to AI Research

AI Research

An Agentic Workflow for Legacy HPC Modernization: C... | AI Research

Key Takeaways

  • This paper introduces an agentic workflow designed to modernize massive, legacy High-Performance Computing (HPC) codebases by automating routine code transfo...
  • Modernizing legacy Fortran is a problem of volume: the transformations are individually routine, but the codebases can be enormous, and across much of computational science the work simply goes undone.
  • We propose an agentic workflow that takes this work on at production scale, and we set out to measure how far such delegation can reach.
  • In this work, three prompt-specialized agent roles operate under a version-controlled specification that the agents themselves authored and revised, while humans hold a small number of gates.
  • The arrangement is kept safe by an exact verification oracle inherited from the domain, and the boundary of safe delegation lies exactly where that oracle stops seeing.
Paper AbstractExpand

Modernizing legacy Fortran is a problem of volume: the transformations are individually routine, but the codebases can be enormous, and across much of computational science the work simply goes undone. We propose an agentic workflow that takes this work on at production scale, and we set out to measure how far such delegation can reach. In this work, three prompt-specialized agent roles operate under a version-controlled specification that the agents themselves authored and revised, while humans hold a small number of gates. The arrangement is kept safe by an exact verification oracle inherited from the domain, and the boundary of safe delegation lies exactly where that oracle stops seeing. We apply the proposed workflow in a case study, converting the two-electron-integral routines of GAMESS (General Atomic and Molecular Electronic Structure System), a mature quantum-chemistry package with a 48-year development history, from fixed-form Fortran 77 to free-form Fortran 2008. The scope of this work was twelve source files, 56,448 lines, and 225 subroutines for computing electron repulsion integrals. The agents ran as three Claude Code roles in isolated worktrees, and the work spanned four Claude model generations. Because the GAMESS group ships a standard test suite whose printed energies its user community treats as canonical, we could adopt bit-for-bit reproduction of those energies as the merge criterion, where a deviation in the twelfth decimal place counts as a failure rather than drift. All twelve source files pass a 51-test validation battery comprising the 49 standard GAMESS tests and two additional calculations, and across 612 test runs the number of chemistry-relevant differences is zero, and every file also passes the Jenkins tests that are used for continuous integration.

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)

No comments yet

Be the first to share your thoughts!