Table of Contents
Fetching ...

AkiraRust: Re-thinking LLM-aided Rust Repair Using a Feedback-guided Thinking Switch

Renshuang Jiang, Yichong Wang, Pan Dong, Xiaoxiang Fang, Zhenling Duan, Tinglue Wang, Yuchen Hu, Jie Yu, Zhe Jiang

TL;DR

AkiraRust is presented, an LLM-driven repair and verification framework that incorporates a finite-state machine to dynamically adapt its detection and repair flow to runtime semantic conditions, enabling context-aware and runtime-adaptive repair.

Abstract

Eliminating undefined behaviors (UBs) in Rust programs requires a deep semantic understanding to enable accurate and reliable repair. While existing studies have demonstrated the potential of LLMs to support Rust code analysis and repair, most frameworks remain constrained by inflexible templates or lack grounding in executable semantics, resulting in limited contextual awareness and semantic incorrectness. Here, we present AkiraRust, an LLM-driven repair and verification framework that incorporates a finite-state machine to dynamically adapt its detection and repair flow to runtime semantic conditions. AkiraRust introduces a dual-mode reasoning strategy that coordinates fast and slow thinking across multiple agents. Each agent is mapped to an FSM state, and a waveform-driven transition controller manages state switching, rollback decisions, and semantic check pointing, enabling context-aware and runtime-adaptive repair. Experimental results show that AkiraRust achieves about 92% semantic correctness and delivers a 2.2x average speedup compared to SOTA.

AkiraRust: Re-thinking LLM-aided Rust Repair Using a Feedback-guided Thinking Switch

TL;DR

AkiraRust is presented, an LLM-driven repair and verification framework that incorporates a finite-state machine to dynamically adapt its detection and repair flow to runtime semantic conditions, enabling context-aware and runtime-adaptive repair.

Abstract

Eliminating undefined behaviors (UBs) in Rust programs requires a deep semantic understanding to enable accurate and reliable repair. While existing studies have demonstrated the potential of LLMs to support Rust code analysis and repair, most frameworks remain constrained by inflexible templates or lack grounding in executable semantics, resulting in limited contextual awareness and semantic incorrectness. Here, we present AkiraRust, an LLM-driven repair and verification framework that incorporates a finite-state machine to dynamically adapt its detection and repair flow to runtime semantic conditions. AkiraRust introduces a dual-mode reasoning strategy that coordinates fast and slow thinking across multiple agents. Each agent is mapped to an FSM state, and a waveform-driven transition controller manages state switching, rollback decisions, and semantic check pointing, enabling context-aware and runtime-adaptive repair. Experimental results show that AkiraRust achieves about 92% semantic correctness and delivers a 2.2x average speedup compared to SOTA.
Paper Structure (14 sections, 1 equation, 12 figures, 3 tables)

This paper contains 14 sections, 1 equation, 12 figures, 3 tables.

Figures (12)

  • Figure 1: Existing Rust Repair Frameworks. (a) Template-Based: Rely on pattern matching; out-of-scope patterns lead to failed repairs. (b) LLM-Aided: Single-process with a fixed agent pipeline, while multi-process dispatch agents by heuristic features. Unable to traverse solution space and semantically inaccurate.
  • Figure 2: Fast vs. Slow Thinking in Rust Repair.
  • Figure 3: Temperature and Rollback Effects on Rust Repair.
  • Figure 4: AkiraRust Framework: (a) illustrates the AkiraRust workflow. (b) presents the detailed design of AkiraRust. ❶ and ❷ integrate a dual-mode multi-agent library, mapping to the FSM states in ❸, while ❹ and ❺ guide state transitions.
  • Figure 5: TestGenAgent: User-Intent–Guided Test Agent.
  • ...and 7 more figures