Reasoning from Traces: Divergence-Guided Agentic Repair of WebAssembly Discrepancies
cs.SE
Submitted: 2026-08-06
Updated: 2026-10-28
Code: https://github.com/fmtlib/fmt
Project page: https://webassembly.github.io/spec/core/intro/introduction.html
License: http://creativecommons.org/licenses/by/4.0/
The gist: WebAssembly (Wasm) promises seamless reuse of C/C++ codebases as portable, efficient, sandboxed binaries for execution on the Web.
Terminology
Abstract
WebAssembly (Wasm) promises seamless reuse of C/C++ codebases as portable, efficient, sandboxed binaries for execution on the Web. In practice, however, this promise often falls short: recent studies show that cross-compiling C/C++ source to Wasm and native binaries frequently produces runtime discrepancies due to differences in library implementation and compiler bugs. Since the root causes are platform-level and hidden beneath the source code, even state-of-the-art LLM-based coding agents can struggle to diagnose and repair these discrepancies. In this paper, we present WasmMend, the first system for automatically repairing Native-Wasm functional discrepancies. WasmMend transforms open-ended debugging into a two-stage process. First, a novel differential trace analysis approach localizes the function where Wasm and native executions first diverge. Second, guided by this localization, a multi-agent system coordinates separate agents to interpret platform-specific behavior and synthesizes patch plans. Experiments on discrepancies from real-world C/C++ projects show that, across five backbone models, WasmMend achieves a fix rate of up to 84.8%, with average gains of at least 37.2 percentage points over the evaluated open-source coding agent baselines, while maintaining comparable cost.
Sources
- Teaching Large Language Models to Self-Debug
- TraceCoder: A Trace-Driven Multi-Agent Framework for Automated Debugging of LLM-Generated Code
- SWE-bench: Can Language Models Resolve Real-World GitHub Issues?
- Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation
- Agentic Program Repair from Test Failures at Scale: A Neuro-symbolic approach with static analysis and test execution feedback
- HyperAgent: Generalist Software Engineering Agents to Solve Coding Tasks at Scale
- DebugRepair: Enhancing LLM-Based Automated Program Repair via Self-Directed Debugging
Related papers
- ArkEval: Benchmarking and Evaluating Automated CodeRepair for ArkTS
- TestPrism: Rethinking Test Evaluation Beyond a Single Reference
- Mining Workflow Graphs for Black-Box Boundary Testing of Conversational LLM Agents
- Falsification-Based Verification of LLM-Generated Optimization Models: Sound Test Batteries and Their Detection Limits
- GitSkills: A Dataset of Agent Skills on GitHub
- For Coding Agents, the Repository Matters