arXiv:2611.08947cs.DCNov 2026

Manuscript Offprint

arXiv:2611.08947

More with Less: Efficient Parallel Scientific Code Translation via an Agent-Skill Workflow

Jianuo Shen, Pengyi Xu, Bo Zhang

Jianuo Shen ∗^{*}, Pengyi Xu †^{\dagger} and Bo Zhang †^{\dagger}

∗^{*} csjianuo.shen@mail.scut.edu.cn

∗^{*} Department of Computer Science & Engineering, South China University of Technology, Guangzhou, Guangdong 510006

†^{\dagger} {vxu, bo.zhang}@mtu.edu

†^{\dagger} Department of Computer Science, Michigan Technological University, Houghton, Michigan 49931

Abstract—Translating parallel scientific codes between HPC programming frameworks is a critical but labor-intensive task. Existing LLM-based approaches rely on fixed sequential pipelines with undifferentiated repair strategies and correctness criteria that do not match scientific computing practice. We present an agent-skill framework that separates translation, compilation diagnosis, and execution validation into three autonomous agents coordinated by a verdict-driven orchestrator, routing each failure to a targeted repair skill rather than retrying blindly. An automated output check drives the self-correction loop, complemented by an offline LLM-based verification that exposes false positives escaping compiler and runtime checks. We evaluate the framework on 30 HeCBench kernels translated bidirectionally among CUDA, OpenMP, and SYCL with three open-source LLMs. Our framework attains the higher verified correctness rate in all 18 model and direction combinations over a state-of-the-art baseline while consuming up to 52.4% fewer tokens, remaining consistent across models and directions without architectural modification.

Index Terms—Large Language Models, Agentic Workflow, Parallel Code Translation, Agent-Skill Architecture, HPC Programming Models

I. INTRODUCTION

The ability to automatically translate code between programming languages has long been a goal of software engineering research, and recent advances in large language models (LLMs) have brought it closer to practical reality. Modern LLMs such as GPT-4 [1], DeepSeek Coder [2], and Qwen2.5-Coder [3] demonstrate strong generalization across programming languages, enabling translation pipelines that combine prompt engineering, compiler feedback, and iterative repair to achieve compelling results on general-purpose benchmarks [4], [5]. These capabilities have sparked growing interest in applying LLMs to automate the translation of real-world codebases, reducing the manual effort required to port software across language ecosystems and opening new avenues for code modernization at scale.

Despite this progress, LLM-based code translation remains poorly understood in the domain of parallel scientific computing. General-purpose translation pipelines typically assess correctness through test case passing rates or code similarity metrics [6], [7], criteria that are adequate for software engineering tasks but insufficient for scientific computing workloads. Parallel scientific codes impose a stricter and more domain-specific notion of correctness: numerical outputs must be equivalent within floating-point tolerance across potentially billions of arithmetic operations, translated code must genuinely offload computation to the target device rather than silently falling back to CPU execution, and results must be deterministic across parallel runs [8], [9]. These requirements are difficult to satisfy precisely because the semantics of parallelism, memory hierarchy, and synchronization differ fundamentally across programming frameworks such as OpenMP [10], CUDA [11], and SYCL [12], a semantic gap that has no analog in conventional language-to-language translation and that general-purpose pipelines are not designed to bridge. Collectively, these failures remain invisible to evaluation methodologies that stop at compilation success or surface-level output matching, yet they are precisely the failures that matter most in scientific computing practice.

Several systems have recently addressed aspects of this problem, but share three recurring limitations. First, existing pipelines follow fixed sequential workflows with no dynamic routing: all errors are handled identically regardless of their root cause, leading to unnecessary LLM calls and poor token efficiency. LASSI [13] exemplifies this pattern, achieving strong results on bidirectional OpenMP ↔ CUDA translation with compiler and execution feedback, but applying the same repair strategy indiscriminately to every failure type. Second, automated semantic verification remains absent or superficial. CodeRosetta [14], a purpose-built encoder-decoder transformer for C++ ↔ CUDA and C++ ↔ Fortran translation, reports 93% functional correctness on a sample of 30 kernels but does not assess numerical equivalence under floating-point arithmetic, the correctness criterion most critical for scientific workloads. LASSI similarly relies on manual output inspection rather than automated output validation. Third, existing pipelines are token-inefficient by design. LASSI and similar systems such as UniPar [15] and ParaCodex [9] apply the same LLM-based repair strategy regardless of error type, incurring unnecessary token consumption on failures that could be resolved with targeted, lightweight interventions. This indiscriminate retry behavior limits practical scalability and increases inference cost without a corresponding improvement in translation quality.

Inspired by the emerging paradigm of agent-skill decomposition in autonomous AI systems [5], [16]–[18], we propose an agentic workflow for parallel scientific code translation that addresses these limitations through principled separation of concerns. Our framework comprises three collaborating agents coordinated by an orchestrator: a TranslationAgent

©2026 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses... Accepted for publication in the Proceedings of the SC'26 Workshops (AgenticAIHPC 2026).

that encapsulates code analysis, memory-aware planning, and self-reviewing translation; a CompilationAgent that combines compilation with structured error classification to dynamically route failures to the appropriate repair strategy; and an ExecutionAgent that automatically checks output correctness between source and translated outputs and diagnoses runtime failures including race conditions and incorrect GPU offloading. Rather than treating every error as a prompt for blind retry, our orchestrator reads the verdict from each agent and selects the repair skill best suited to the diagnosed failure mode, reducing unnecessary LLM calls and improving overall token efficiency. We evaluate the framework on 30 HeCBench [19] kernels translated bidirectionally among OpenMP, CUDA, and SYCL with three recent open-source LLMs, measuring verified correctness and token consumption against a state-of-the-art baseline, and further audit the results under a stricter LLM-based complementary verification. Our results demonstrate that the agent-skill architecture achieves higher verified correctness than the baseline while reducing token consumption by up to 52.4%, remaining consistent across three open-source LLMs and all six translation directions among CUDA, OpenMP, and SYCL without architectural modification.

This paper makes the following contributions:

  • We propose an agent-skill architecture for parallel scientific code translation that separates translation, compilation diagnosis, and execution validation into three autonomous agents. This separation enables verdict-driven routing that targets each repair skill at a specific failure mode, reducing unnecessary LLM calls while improving correctness through more precise self-correction.

  • We introduce an automated output check as a first-class validation step, replacing manual output inspection with a quantitative correctness signal that drives a dedicated semantic repair loop, together with an LLM-based complementary verification that audits translated artifacts offline and exposes false positives escaping the output check.

  • We demonstrate that our framework achieves higher translation correctness than LASSI on the same benchmark while reducing token consumption by up to 52.4%, establishing that more capable behavior does not require more expensive prompting.

  • We show that the framework generalizes across OpenMP, CUDA, and SYCL, supporting bidirectional translation between multiple HPC parallel programming frameworks without architectural changes.

The rest of this paper is organized as follows. Section II reviews related work. Section III describes the agent-skill architecture. Section IV presents experimental setup and results. Section V discusses findings and limitations. Section VI concludes and outlines directions for future work.

References (39)