Occam's Progressive Harness for Agentic Migration of Legacy Scientific Program
Abstract
Migrating legacy Fortran solvers to modern stacks like JAX manually is expensive, since one solver can reach tens of thousands of lines. Coding agents with a regular harness can pursue a goal autonomously. Such a harness carries the agent's notes, or a history kept by a manager, from one session to the next, and ends the work by decision of the agent, a judge or the manager. A successful migration, however, should preserve the full scientific functionality of the legacy solver. A harness that ends the work without identifying the missing requirements and the redundant code can deliver a program of low quality. We propose Occam's Progressive Harness (OP-Harness), which takes a minimal sufficient program as its target, a program that meets every requirement and contains nothing else, and manages one verified measurement, the distance from the candidate program to that target. A builder plans and builds toward the target from the last measurement. A verifier measures the distance again as the gaps and the redundancies of the program. The two alternate on the same candidate program until both counts are zero. Across six whole legacy Fortran solvers migrated to JAX under the same model and task information, OP-Harness consistently delivers more complete programs, with stronger performance on held-out tests and post-migration probes. These results suggest that explicitly managing the remaining distance to the target can improve the reliability of autonomous whole-solver migration, bringing autonomous modernization of legacy scientific software closer to practical use.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.