Chiosa
Software & Code

Interactive virtual hardware exposes firmware runtime bugs

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

2 min
Updated

In plain words

Embedded firmware can compile successfully and still fail when it interacts with sensors, buttons, or other hardware. EmbedGym gives coding agents a virtual board where they can run their compiled program, change inputs, and inspect what the hardware does.

In tests across six hardware and software pairings, agents passed more tasks when they could actively change inputs and inspect component states than when they had only build messages or serial output. A check on 60 firmware samples found that simulated and physical-board grades agreed in 59 cases.

The research

A successful build can create false confidence when firmware still fails on connected hardware.

For coding agents working without a physical board, the results change what counts as useful debugging feedback: letting them vary inputs and inspect hardware states was more informative than relying on build messages or idle serial output in these tests.

EmbedGym gives coding agents interactive virtual hardware for testing compiled firmware, so they can vary inputs and inspect component states while debugging.

Across 598 tasks, the evaluation compared build feedback, passive serial output, and full interaction with virtual hardware. A task counted as passed only when firmware compiled, started, and met every hidden timed hardware check.

Full interaction produced higher pass rates than either lower-feedback level across all tested model-platform pairs. The comparison supports the conclusion that changing inputs and inspecting hardware states helps agents find runtime faults that builds or passive output can miss.

The physical-board check covered 60 firmware binaries sampled from 30 tasks across four MCU targets. One compass task differed because the simulator enforced a sensor-register rule that the compatible physical clone did not.

What the evidence shows

  • What counts as working firmware

    EmbedGym is an interactive virtual hardware environment for coding agents, and EmbedGym-Bench is its test set for grading firmware behavior. The benchmark uses hidden timed checks of hardware state; a task passes only if submitted firmware compiles, starts, and satisfies every check. This makes the score a measure of tested runtime behavior, not just whether code builds.

  • Build success misses runtime faults

    The compile-only comparison shows why build success is a weak check: the grading harness separately tests whether compiled firmware meets hidden hardware checks at runtime. Programs can therefore build cleanly yet still behave incorrectly with hardware.

  • Changing inputs improves task passes

    Because full interaction beat both lower-feedback levels for every tested model-platform pair, the comparison supports the value of changing inputs and inspecting component states during debugging.

    The result applies to the evaluated models and tasks; it does not show that every task benefits equally.

  • Passive output adds little

    Passive serial output alone was a weak substitute: its net gain was only 0.9 percentage points, because it fixed some tasks while breaking others that had passed with compile-only feedback.

    This contrast supports the explanation that agents benefit from actively probing inputs and reading component states, especially when idle hardware does not expose an input-dependent bug.

  • A physical-board cross-check

    The simulator's grades also matched physical-board grades for 59 of 60 sampled firmware binaries. That check supports the relevance of the virtual tests for these sampled tasks, while the one mismatch shows that a simulated component can differ from a compatible physical part.

Deep

Next paperA kit makes local coding-agent comparisons clearer