An Agentic Evaluation Framework for AI-Generated Scientific Code in PETSc

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhang, Hong, Smith, Barry, Balay, Satish, Chen, Le, Keceli, Murat, McInnes, Lois Curfman, Zhang, Junchao
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914399964364800
author Zhang, Hong
Smith, Barry
Balay, Satish
Chen, Le
Keceli, Murat
McInnes, Lois Curfman
Zhang, Junchao
author_facet Zhang, Hong
Smith, Barry
Balay, Satish
Chen, Le
Keceli, Murat
McInnes, Lois Curfman
Zhang, Junchao
contents While large language models have significantly accelerated scientific code generation, comprehensively evaluating the generated code remains a major challenge. Traditional benchmarks reduce evaluation to test-case matching, an approach insufficient for library code in HPC where solver selection, API conventions, memory management, and performance are just as critical as functional correctness. To address this gap, we introduce petscagent-bench, an agentic framework built on an agents-evaluating-agents paradigm. Instead of relying on static scripts, petscagent-bench deploys a tool-augmented evaluator agent that compiles, executes, and measures code produced by a separate model-under-test agent, orchestrating a 14-evaluator pipeline across five scoring categories: correctness, performance, code quality, algorithmic appropriateness, and library-specific conventions. Because the agents communicate through standardized protocols (A2A and MCP), the framework enables black-box evaluation of any coding agent without requiring access to its source code. We demonstrate the framework on a benchmark suite of realistic problems using the PETSc library for HPC. Our empirical analysis of frontier models reveals that while current models generate readable, well-structured code, they consistently struggle with library-specific conventions that traditional pass/fail metrics completely miss.
format Preprint
id arxiv_https___arxiv_org_abs_2603_15976
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle An Agentic Evaluation Framework for AI-Generated Scientific Code in PETSc
Zhang, Hong
Smith, Barry
Balay, Satish
Chen, Le
Keceli, Murat
McInnes, Lois Curfman
Zhang, Junchao
Artificial Intelligence
While large language models have significantly accelerated scientific code generation, comprehensively evaluating the generated code remains a major challenge. Traditional benchmarks reduce evaluation to test-case matching, an approach insufficient for library code in HPC where solver selection, API conventions, memory management, and performance are just as critical as functional correctness. To address this gap, we introduce petscagent-bench, an agentic framework built on an agents-evaluating-agents paradigm. Instead of relying on static scripts, petscagent-bench deploys a tool-augmented evaluator agent that compiles, executes, and measures code produced by a separate model-under-test agent, orchestrating a 14-evaluator pipeline across five scoring categories: correctness, performance, code quality, algorithmic appropriateness, and library-specific conventions. Because the agents communicate through standardized protocols (A2A and MCP), the framework enables black-box evaluation of any coding agent without requiring access to its source code. We demonstrate the framework on a benchmark suite of realistic problems using the PETSc library for HPC. Our empirical analysis of frontier models reveals that while current models generate readable, well-structured code, they consistently struggle with library-specific conventions that traditional pass/fail metrics completely miss.
title An Agentic Evaluation Framework for AI-Generated Scientific Code in PETSc
topic Artificial Intelligence
url https://arxiv.org/abs/2603.15976