AI 编程 4.0 · 优秀 2026-11-17 · 论文

EmbedGym: Letting Coding Agents Develop and Debug Embedded Firmware Without Physical Hardware

编码 agent 写嵌入式固件时编译通过不等于能跑:引脚极性总线协议时序网络 bug 都要在真硬件上才暴露EmbedGym 用指令级 MCU 仿真器执行本要烧进真板的同一份二进制,接 41 个外设模型模拟电路仿真器和虚拟 WiFi/BLE 端点,agent 可改传感器输入按按钮查硬件状态;配套基准 6 组 MCU-框架 598 个任务,用隐藏时序测试向量判分8 个模型超 1.4 万条轨迹:编译成功率 99.7% 时仍有 19.9% 运行时失败;接交互式硬件测试后各模型通过率提升 4.9-14.7 个百分点,轻量模型以 30-70 倍低成本打平前沿模型

打开原文回到归档

EmbedGym: Letting Coding Agents Develop and Debug Embedded Firmware Without Physical Hardware

  • Source: https://arxiv.org/abs/2611.21845
  • Author: unknown
  • Published: 2026-11-17
  • Intake: 2026-11-19 evening (daily-intake-evening, openclaw)
  • Evidence: /Users/gracker/Library/Mobile Documents/iCloud~md~obsidian/Documents/Obsidian/OpenClaw定时任务/论文流水线/2026-11-19-论文流水线.md

中文摘要

编码 agent 写嵌入式固件时编译通过不等于能跑:引脚极性、总线协议、时序、网络 bug 都要在真硬件上才暴露。EmbedGym 用指令级 MCU 仿真器执行本要烧进真板的同一份二进制,接 41 个外设模型、模拟电路仿真器和虚拟 WiFi/BLE 端点,agent 可改传感器输入、按按钮、查硬件状态;配套基准 6 组 MCU-框架 598 个任务,用隐藏时序测试向量判分。8 个模型、超 1.4 万条轨迹:编译成功率 99.7% 时仍有 19.9% 运行时失败;接交互式硬件测试后各模型通过率提升 4.9-14.7 个百分点,轻量模型以 30-70 倍低成本打平前沿模型。

English Summary

EmbedGym lets coding agents develop and debug embedded firmware without physical hardware: instruction-level MCU emulators execute the same binary that would be flashed onto a board, connected to 41 peripheral models, an analog circuit simulator and virtual WiFi/BLE endpoints, with an interface for agents to change sensor inputs, press buttons and inspect hardware states. EmbedGym-Bench spans 598 tasks over 6 MCU-framework pairs graded by hidden timing test vectors. Across 8 models and 14k+ trajectories: at 99.7% compile success, 19.9% of firmware still failed at runtime; interactive hardware testing raised pass rates 4.9-14.7 points, and a lightweight model with EmbedGym matched frontier models at 30-70x lower cost.

Abstract (arXiv)

Modern coding agents perform well on general software benchmarks because they can run code and unit tests in a closed loop. Embedded firmware development, however, breaks this loop: a program that compiles can still fail on real hardware due to pin polarity, bus protocol, timing, or networking bugs that an agent at a text terminal cannot observe. Existing embedded coding agents either skip hardware execution, drive GPIO-only simulators with multi-second delays, or test on physical boards in a static environment. In this paper, we present EmbedGym, an interactive virtual hardware environment that lets coding agents develop and debug embedded firmware without physical hardware. EmbedGym uses instruction-level microcontroller unit (MCU) emulators to execute the same binary that would be flashed onto a physical board, connects them to 41 peripheral models, an analog circuit simulator, and virtual WiFi/Bluetooth Low Energy (BLE) endpoints, and exposes an interface for agents to change sensor inputs, press buttons, and inspect hardware states. On top of it, we build EmbedGym-Bench, which consists of 598 tasks across 6 MCU-framework pairs graded by hidden timed test vectors, using a five-stage multi-agent workflow that synthesizes peripheral models and tasks from datasheets and driver libraries. We expose EmbedGym to a coding agent at three levels and evaluate eight models over more than 14K trajectories. Even when compilation succeeds 99.7% of the time, 19.9% of compiled firmwares fail at runtime (up to 73% on individual targets). In contrast, interactive hardware testing in EmbedGym increases pass rates across models by +4.9% to +14.7% (up to +31% on individual targets). Our results also show that an agent with EmbedGym outperforms prior embedded agent frameworks, and lightweight models with EmbedGym match frontier models without it at 30-70x lower cost.