Goal-Persistent Coding Agents as Scientific Performance Engineers: A Fixed-Radius Nearest-Neighbor Case Study
Abstract
Coding agents can pursue persistent objectives across many tool-use turns, but evidence that general-purpose agents can conduct rigorous scientific performance engineering remains limited. We present a repository-scale case study in which off-the-shelf Codex and Claude Code agents optimize fixed-radius nearest-neighbor (FRNN) search for particle tracking. Starting from a PyTorch-dependent CUDA implementation, the agents follow an executable goal that specifies exact-correctness tests, profiling requirements, and acceptance criteria without prescribing code transformations. In the primary sequential trajectory, they autonomously remove the PyTorch dependency and conduct hypothesis-driven optimization experiments. The resulting standalone C++/CUDA library exactly reproduces the targeted reference result. Its synchronous NumPy interface achieved 1.6-fold speedup over the original GPU-resident PyTorch interface, despite including host transfers. Similar speedups were observed across different GPU architectures and software stacks. An independent optimization rerun followed a different sequence of hypotheses and reached even better performance on the target workload. These results show that goal-persistent coding agents can act as experimental performance engineers, and that executable scientific contracts are needed both to guide and to validate their optimization.
Create a lesson
Metadata
- Categories
- cs.AI, cs.PF, cs.SE
- Comments
- 10 pages, 2 figures
Related papers
AGL-SKILL: Coding Harnesses as Agentic Optimizers
Shared title terminologycs.AIRyan Tsui, Yuge Zhang, Yuqing Yang
AI-Assisted Auto-formalization for Trustworthy Scientific Computing: Case Studies and Lessons Learned
Shared title terminologycs.AIMohit Tekriwal, Het Mankad, Naifeng Zhang et al.
SWE-MILE: Asynchronous Potential-Induced Milestone Credit Assignment for Long-Horizon Software Engineering Agents
Shared title terminologycs.AIChaoqun Cui, Hao Zhou, Meiqi Chen et al.
CUA-SWE: When Computer-Use Agents Meet Visual Software Engineering
Shared title terminologycs.AIPrince Zizhuang Wang, Chenhao Liang, Zelong Xu et al.
A bilingual AI audiologist built through rubric-guided closed-loop engineering outperforms human audiologists in a blinded evaluation of simulated cases
Shared title terminologycs.AILinkai Li, Changgeng Mo, Hanlin Yu et al.
CP-Agent: A Harness-Engineered Agent for Crystal Plasticity Simulation Workflows
Shared title terminologycs.AISamuel Onimpa Alfred, Abhishek Kumar, Veera Sundararaghavan