Comparing AI Coding Models on Firmware-Level Development: A Practical Test
This article compares how different AI coding models perform on a hands-on firmware-level project: building a self-contained graphical game in a UEFI Shell environment with no OS runtime, no window system, and no safety net. It explains why firmware development exposes model weaknesses that algorithm puzzles miss, details the three-round task setup, and documents four recurring failure patterns—directory boundary violations, incomplete runtime setup, graphics protocol and memory misunderstandings, and underestimated input and Chinese text rendering. It closes with capability profiles for three model types and reusable engineering practices for constraints, interfaces, and acceptance criteria.
1. Why Firmware-Level Projects Are a Better Test for Coding Models
When you build applications on top of an operating system, a model can rely on mature language runtimes, graphics libraries, and debuggers. At the firmware level, everything starts from zero. There are no system calls and no ready-made window system. Screen output requires direct interaction with the graphics output protocol, input requires polling keyboard devices, builds depend on a cross-compilation toolchain, and verification depends on a virtual machine or real hardware. This environment has no built-in fallback, so any wrong assumption is exposed immediately.
For this reason, measuring an AI coding tool with a small but complete firmware graphics program is more discriminating than assigning a few algorithm problems. It tests four things at once: the ability to self-learn an unfamiliar tech stack, respect for directory and file boundaries, the ability to reconstruct a runtime environment, and self-correction across multiple iterations.
2. Task Setup and Overall Approach
The goal was to run a pure software graphics program in a UEFI Shell environment and implement a small game with a menu, status display, pause, and multiple levels, with an all-Chinese interface and no sound.
Key technical requirements included: obtaining the physical resolution and framebuffer address through the graphics output protocol; implementing pixel writes, rectangle fills, and character bitmap rendering from scratch; using double buffering (an off-screen buffer plus full-frame refresh) to eliminate tearing; driving logic updates at a fixed timestep to support increasing difficulty, obstacle generation, and simple particle effects; and supporting both arrow keys and WASD mappings for the keyboard.
Development was split into three rounds. The first round established the minimal closed loop of “compile, package bootable media, produce graphics output, respond to keyboard input.” The second round added levels, obstacles, and effects. The third round completed the Chinese localization and cleaned up prompt text. In total, this took just over twenty prompts and more than three hours.
3. Four Typical Problems Exposed
3.1 Overreach and Loss of Directory Boundaries
As soon as the first instruction was issued, the model created the project one level above the working directory, then generated tool, build, and configuration directories in bulk in that parent directory. The harm is not just “messiness”: relative paths in build scripts drift accordingly, later cleanup becomes difficult, and unrelated projects may be polluted. The root cause is that models tend to improvise according to a “generic project template” and under-prioritize explicit path constraints.
A practical way to constrain this is to hard-code the boundaries in a project description file and repeat them in the prompts:
All files, directories, downloads, and build artifacts must stay inside the current working directory.Do not access or create any path outside the current directory.Build scripts must use relative paths and print the final resolved path before execution.
3.2 The Runtime Environment “Looks Ready”
The model downloaded prebuilt firmware and virtual machine components on its own, saving compile time but creating two fatal gaps: the firmware image had no built-in Shell boot entry, and the bootable media did not contain the program under test. The result was “the VM boots, but the target code never runs.” This shows that models are good at steps that only require a network connection to install, but tend to skip final verification of environment usability.
A better approach is to define acceptance criteria upfront as executable commands—for example, requiring the model to provide and actually run a complete command chain “from cold boot to graphics output” before delivery, and to paste key output as evidence.
3.3 Misunderstanding Graphics Protocol and Memory Semantics
Common errors include: treating a read-only information region as writable, ignoring differences in pixel format and bits per pixel, calculating offsets by “pixel count” instead of “row stride,” and forgetting the full-frame copy during the refresh phase of double buffering. These problems share one trait: they cannot be detected at compile time and can only be judged by on-screen results.
A minimal usable drawing skeleton looks roughly like this (illustrative):
// Pseudocode: only illustrates the relationship between drawing and flushingtypedef struct { UINT32 Y, X, stride; UINT8 *base; } FB;void put_pixel(FB *fb, UINT32 x, UINT32 y, UINT32 argb) {UINT8 *p = fb->base + y * fb->stride + x * 4; // 32bpp case*(UINT32 *)p = argb;}void flush(FB *dst, FB *src, UINT32 w, UINT32 h) {for (UINT32 y = 0; y < h; y++)copy_row(dst->base + y*dst->stride, src->base + y*src->stride, w*4);}
3.4 Input Handling and Chinese Display Are Underestimated
Keyboard polling requires handling scan-code-to-character mapping, two encodings for arrow keys and letter keys, and long-press repeat. Chinese display depends on a built-in bitmap font library, and models often output English placeholders first and leave localization to the end, causing a large amount of rework in the third round. A more robust approach is to abstract the “text rendering interface” in the first round, so that Chinese and English only differ in the underlying font source.
4. Capability Profiles of Three Types of Coding Models
Abstracting the above process yields relatively neutral observations about different coding models:
- Type 1: Strong engineering closed-loop ability; it proactively completes bootable media and verification scripts, but still needs explicit reminders on path constraints.
- Type 2: Fast code generation and clear structure, but a tendency to reuse existing binaries, with insufficient completeness in environment reconstruction.
- Type 3: Good single-point implementation (such as effects and level logic), but weaker multi-round consistency on long-chain tasks, with inconsistent style and interfaces appearing before and after.
The common weakness is “boundary awareness” and “final verification awareness,” while the common strength is “fast reading of unfamiliar documentation and code implementation.” This suggests that differences in model capability often lie not in single-file code quality, but in self-constraint and acceptance closure across long workflows.
5. Reusable Engineering Recommendations
- Write the constraint file before the business requirements, fixing hard rules for paths, builds, and verification.
- In the first round, build only the minimal closed loop; graphics output and input take priority over gameplay.
- Reserve interfaces for each abstraction layer (rendering, input, font, levels) to reduce later rework.
- Make “acceptance command + key output” part of the deliverable; do not accept “it should run.”
- Set a whitelist for download and installation actions to avoid introducing prebuilt artifacts of unknown origin.
- Use a fixed timestep and off-screen buffering to ensure stable visuals and reproducible logic.
6. Conclusion
Firmware-level development acts like a magnifying glass, clearly revealing differences in autonomy, boundary awareness, and verification habits among AI coding tools. For developers, the truly effective approach is not to find the “strongest model,” but to engineer constraints, interfaces, and acceptance criteria so that different models can all produce runnable, maintainable low-level programs on a controllable track. Combined with general capabilities such as cloud builds and artifact hosting, the compile, package, and distribution workflow can be further standardized, turning this kind of exploration from a one-off attempt into a sustainable engineering practice.
