AI 中文总结
提出智能体工作流,将GAMESS的双电子积分核心从Fortran77转为Fortran2008,通过Claude智能体实现56448行代码转换,所有测试均达基准要求。
AI 中文摘要
改造传统Fortran代码是一项涉及海量工作量的问题:单个转换步骤属于常规操作,但代码库可能极为庞大,且在计算科学领域,大量相关工作根本未被完成。我们提出一种智能体工作流,可在生产规模下完成此类工作,并着手衡量这种委托能达到何种程度。本研究中,三个针对提示词进行了专门优化的智能体角色,在智能体自身编写并修订的版本控制规范下运行,而人类仅把控少量关键节点。该安排通过从领域继承而来的精确验证预言机保障安全性,安全委托的边界恰好位于该预言机无法识别的位置。我们将所提工作流应用于一个案例研究,将拥有48年开发历史的成熟量子化学软件包GAMESS(General Atomic and Molecular Electronic Structure System,通用原子与分子电子结构系统)的双电子积分例程,从固定格式Fortran 77转换为自由格式Fortran 2008。本研究的范围包括12个源文件、56448行代码,以及225个用于计算电子排斥积分的子例程。智能体以三个Claude Code角色的形式在隔离工作树中运行,整个工作过程涉及四代Claude模型。由于GAMESS团队提供了一套标准测试套件,其输出能量被用户群体视为基准,因此我们采用这些能量的逐位复现作为合并标准,其中第十二位小数的偏差被视为失败而非漂移。全部12个源文件均通过了包含49项标准GAMESS测试和2项额外计算的51项测试验证套件,在612次测试运行中,与化学相关的差异数为零,且每个文件均通过了用于持续集成的Jenkins测试。
英文摘要
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.