arXiv(opens in a new tab)cs.SEAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.23653

Beyond Executable Models: The Pufibara Agent Harness and the Modelica Agent Workflow Benchmark for Physical System Modeling

Zizhe Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

AI agents are increasingly used for simulation-driven engineering. Physical system modeling presents different requirements from general-purpose code generation in software engineering, because correctness depends not only on syntax and executability but also on physical consistency and scenario-dependent behavior. We study this challenge in Modelica, an equation-based modeling language in which a model may compile and simulate while still violating its intended physics or engineering requirements. Across successive revisions, an agent may lose track of requirements or rely on simulation evidence produced by an outdated candidate.

To address this challenge, we present Pufibara, an agent harness that maintains persistent engineering state across revisions, associates execution and simulation evidence with the candidate that produced it, and makes submission an explicit agent action. To evaluate end-to-end Modelica agent workflows, we also propose a source-grounded method for constructing realistic and independently evaluable tasks. We use this method to build the 232-task Modelica Agent Workflow Benchmark, spanning Model Repair, Model Generation, and Model Tuning. Each submitted candidate is scored by a benchmark-owned evaluator outside the agent loop.

We compare Pufibara and Claude Code as complete harnesses under two matched large language model (LLM) backends. With DeepSeek v4 Flash, Pufibara passes 202 tasks, compared with 185 for Claude Code. With Claude Sonnet 5, Pufibara passes 202 tasks, compared with 187 for Claude Code. Under the repository-reported token accounting, Pufibara records 76.4%–82.5% lower logical-token totals. Its sequential runtime is 6.1%–58.4% lower. These findings show that, even under matched LLM backends, complete agent harnesses can differ substantially in both task success and resource use for physical system modeling.

Agent Harness: https://github.com/wangzizhe/Pufibara

Benchmark: https://github.com/wangzizhe/modelica-agent-workflow-benchmark

1 Introduction

AI agents combine large language models (LLMs) with execution harnesses for tool use and iterative problem solving (Yao et al. 2023). An agent harness mediates the LLM's interaction with tools and its environment, maintains task state and execution feedback, and defines termination and submission semantics. These systems range from general-purpose agents such as Manus, Genspark, and OpenClaw to coding-oriented agents such as Claude Code, Codex, and DeepSeek Harness. Applying them to physical system modeling is promising, but executability alone does not establish the correctness of a physical system model.

We study this problem in Modelica, an open, equation-based, object-oriented language for modeling complex multi-domain cyber-physical systems (Fritzson and Engelson 1998). In many general-purpose imperative languages, an assignment specifies a direction of computation: the right-hand side is evaluated and stored in the variable on the left. In a Modelica equation section, an equality instead states a relation among quantities without specifying which variable must be solved for. The Modelica translator determines computational causality as it transforms the coupled equation system for numerical solution (Modelica Association 2026a). Evaluating a generated model therefore requires more than checking syntax and executability. Its equations and simulated trajectories must also be consistent with the intended physics and scenario-dependent engineering requirements.

LLMs can generate plausible Modelica code, while AI agents extend this capability through iterative inspection, modification, and simulation. Yet neither plausible generation nor successful execution ensures that a model satisfies task-specific physical constraints and behavioral requirements. Over an iterative run, the agent may lose track of requirements, while simulation results may remain in context after the model that produced them has changed. The agent may therefore submit an executable model that does not satisfy the engineering brief.

Our goal is to evaluate AI agents as end-to-end Modelica problem-solving systems rather than evaluate only the models they generate. To our knowledge, no existing benchmark evaluates the full Modelica agent workflow, from interpreting an engineering brief through tool use and simulation-driven revision to explicit submission.

Constructing such a benchmark presents an additional challenge. Publicly accessible system-level Modelica models are scarce and concentrated in a small number of open libraries, whereas industrial models are generally proprietary. Public examples may already have appeared in LLM pretraining data. Evaluating them unchanged can therefore conflate task-solving ability with memorization or reproduction of previously seen artifacts. Conversely, arbitrarily authored synthetic tasks may lack realistic physical structure or trustworthy evaluation criteria.

To address these challenges, this paper makes three contributions:

• Agent harness. We present Pufibara, an agent harness that preserves engineering requirements across model revisions and ties execution and simulation results to the candidates that produced them.

• Benchmark. We propose a source-grounded method for constructing realistic and independently evaluable tasks, and use it to build the Modelica Agent Workflow Benchmark for end-to-end agentic Modelica workflows.

• Evaluation. We compare Pufibara with Claude Code across 232 tasks under two matched LLM backends. Pufibara achieves higher pass counts with lower reported logical-token use and runtime under both backends.

To our knowledge, this work introduces the first agent harness specifically designed for end-to-end Modelica workflows and the first benchmark for evaluating those workflows. Under matched LLM backends, the results show that harness design is associated with substantial differences in task success and resource use.

References (32)