WasmMend's divergence-guided AI agents fix WebAssembly bugs at 70%
LLM repair agents hit 50%; WasmMend's trace analysis pushes fixes to 70%
WasmMend, developed by researchers Liyan Huang, Kaicheng Wang, and Weihang Wang, tackles a stubborn problem: C/C++ code compiled to WebAssembly (Wasm) often behaves differently from native binaries due to library differences or compiler bugs. These platform-level discrepancies hide beneath the source code, leaving even state-of-the-art LLM-based repair agents unable to fix them. WasmMend is the first system to automate repair of these Native-Wasm functional discrepancies, converting undirected exploration into focused reasoning.
The system works in two stages. First, a novel differential trace analysis localizes the exact function where Wasm and native executions diverge. Guided by that localization, LLM agents then reason about root causes and generate patches that eliminate the divergent behavior. In experiments on real-world C/C++ projects, WasmMend achieved a fix rate of 70.0%, significantly beating the 50.2% agentic baseline and the 54.5% approach augmented with repair-time LLM-based instrumentation. The paper, published on arXiv (2608.05521), demonstrates that divergence-guided reasoning materially improves cross-platform repair, paving the way for more trustworthy Wasm adoption.
- WasmMend is the first automated system to fix Native-Wasm functional discrepancies using divergence-guided LLM agents
- Achieves 70.0% fix rate on real C/C++ projects, versus 50.2% for the agentic baseline and 54.5% with LLM-based instrumentation
- Two-stage approach: differential trace analysis localizes divergence, then LLM agents reason about root cause and generate patches
Why It Matters
Makes WebAssembly more reliable for C/C++ reuse, saving developers from debugging hidden cross-platform runtime discrepancies.