Comparing AI Coding Models for Firmware-Level Graphics Development: A Practical Evaluation
This article compares AI coding models through a hands-on test of firmware-level graphics application development, a scenario defined by strict runtime constraints, sparse reference material, and long feedback loops. It documents a three-round iteration process for building a Chinese-language graphical game that runs in a firmware shell environment, examines typical failures such as writing outside the project directory, incomplete verification environments, framebuffer and Chinese text rendering pitfalls, and rendering tears, and summarizes five reusable evaluation dimensions along with a reusable prompt structure and acceptance checklist for assessing AI coding tools under comparable conditions.
1. Why Firmware-Level Graphics Applications Make a Good Test
When evaluating the real capabilities of AI coding tools, many people rely on routine tasks such as “write a to-do list” or “build a query API.” These tasks are documentation-heavy and follow mature patterns, so nearly every model completes them smoothly and they offer little differentiation. What actually separates models are scenarios with strong constraints, sparse reference material, and long feedback loops. Firmware-level graphics application development satisfies all three at once.
The constraints come from the runtime environment itself: the program does not depend on any operating system and is loaded and executed directly by firmware; graphical output must go through the display protocol provided by the firmware, with no ready-made window system, font library, or graphics library available; input can only rely on the most basic key scanning; and capabilities such as memory allocation, timing, and random numbers must be organized by the program itself. Sparse reference material means there are far fewer public examples to draw on than for conventional application development. A long feedback loop means that the path from “write code” to “compile” to “run” to “see the screen” spans the toolchain, firmware image, and boot media, and any failure along the way shows up as a black screen rather than a clear error message.
This article targets running a graphical mini-game with a pure Chinese interface in a firmware shell environment, reviews three rounds of iteration, and abstracts general dimensions for evaluating AI coding tools.
2. Task Setup and the Three-Round Iteration Path
The task goal breaks down into four hard requirements: first, it must be loaded directly by firmware without depending on any operating system; second, the interface must be entirely in Chinese, including menus, a status bar, and operation hints; third, it must drive the framebuffer of the display device directly through the firmware graphics protocol; fourth, it must be keyboard-interactive, supporting arrow keys and another common letter-based control scheme, with the ability to pause at any time.
The iteration path was arranged around “runnable first”:
- Round one, a minimum viable version. The goal was to get the full chain working: toolchain, image build, boot media creation, and screen output, starting with making a single block move.
- Round two, gameplay and visual enhancements. This added level progression, obstacle generation, double-buffered rendering, and eating particle effects.
- Round three, localization and experience polish. This completed the Chinese localization of the interface, unified the hint text, and refined the pause and restart logic.
The whole process involved a little over twenty prompts and took about three hours. The numbers themselves are not the point. The point is that the problems exposed across the three rounds were very unevenly distributed: the first round consumed nearly half the time, and the problems were basically not in code logic but in the engineering environment and the runtime environment.
3. Review of Typical Problems
Problem 1: Writing Outside the Working Directory
The first instruction explicitly required “initialize the project documentation in the current empty directory and complete all development within this directory.” In practice, however, the toolchain source was unpacked into the parent of the working directory, and the subsequent build process then generated directories for tools, build artifacts, configuration, and auxiliary runtimes in bulk in that parent directory.
The harm of this behavior is more than just “a messy directory.” The parent directory often contains other projects or files not tracked by version control, and cleanup actions in build scripts may delete them by mistake. Once the project boundary is broken, all subsequent relative path decisions become unreliable, and the model keeps reasoning at the wrong level, creating a chain of cascading deviations. It is worth noting that the same kind of overreach also appeared in the evaluation of another tested tool, which suggests this is a common risk under “high-privilege execution mode plus vague path constraints” rather than an occasional mistake by one particular model.
There are three ways to avoid it: put absolute paths in the first instruction and require re-reading and confirming the path before every file write; disable the execution mode that skips permission confirmation and switch to batch-by-batch confirmation; and explicitly state in the prompt that “creating any file or directory outside the specified directory is forbidden.”
Problem 2: A Runtime Environment That “Looks Ready but Won’t Run”
The prompt already suggested using a firmware emulator for verification, but during execution the tool directly downloaded a precompiled firmware image and virtualization components. On the surface this saved compilation time, but the artifacts had two fatal gaps: the boot entries in the firmware image did not include a built-in shell entry, and the boot media did not contain the program to be verified. The result was that after the virtual machine started, it stopped at the firmware setup screen and could not enter the interactive environment.
The essence of this kind of problem is that “environment completeness” is ignored. A usable verification environment contains at least four elements: a built-in shell entry in the firmware image, correct boot media format and partitioning, the target program placed in the loading path of the media, and the boot order pointing to that media. Missing any one of them shows up as an unresponsive black screen or as landing in the setup screen by mistake.
The pragmatic approach is to require the model to first output an environment self-check list and confirm each item before starting to code, and to make “the program is recognized by the firmware loader” the acceptance criterion for the first round, rather than putting visual effects first.
Problem 3: Two Deep Pitfalls in Graphics Output and Chinese Display
The first is how the framebuffer is written. After initialization, the firmware graphics protocol provides a linear framebuffer whose pixel format and resolution are determined by the current display mode. Writing pixels with fixed constants for a certain resolution produces garbled output in an unexpected mode. The reliable approach is to read the real resolution and bits per pixel from the protocol’s output mode and calculate offsets based on the row stride.
Illustrative code:
// Dynamically calculate the pixel offset based on the current mode to avoid hardcoding the resolutionUINT32 y_stride = Gop->Mode->Info->PixelsPerScanLine;UINT8 *base = Gop->Blt (Gop, &framebuffer, EfiBltVideoToBltBuffer,0, 0, 0, 0, Width, Height, 0) == EFI_SUCCESS? framebuffer : NULL;// In actual implementations, the position is usually located with base + (y * y_stride + x) * bytes_per_pixel
The second is Chinese display. The glyphs built into firmware usually cover only a limited character set, so Chinese requires supplying a bitmap font and compiling the extracted bit data into the program, while also splitting strings character by character according to double-byte encoding and calculating text width to achieve centering. At this step the model tends to “pretend to be done,” that is, to call a drawing interface that does not exist. The identification method is straightforward: require it to list all external symbols it uses and the protocol or in-house implementation each comes from, and treat any symbol of unknown origin as unfinished.
Problem 4: Rendering Tears and Logic Timing
Early versions cleared the screen and then drew directly inside the rendering function, producing visible tearing and flicker. After switching to double buffering, the entire frame is first drawn in a memory buffer and then submitted to the display device at once, and only then did the screen become stable. Accompanying this is decoupling logic from rendering: advance the logic with a fixed time step and render at the refresh cadence, avoiding runaway speed on high-speed machines. These two points are general graphics development knowledge, but in the firmware environment there is no ready-made framework to fall back on, so the model must organize them itself, which happens to test its engineering judgment.
4. Evaluation Dimensions and Cross-Tool Observations
Abstracting the above process into five reusable dimensions allows a relatively objective comparison of similar tools:
- Boundary compliance. Whether it strictly reads and writes within the project directory, and whether it still respects explicit constraints in high-privilege mode.
- Environment completeness. Whether it can proactively fill in the four elements of the verification environment, rather than declaring completion as soon as it has an image that boots.
- Self-correction. After the first run fails, whether it can locate causes such as a missing boot entry or the program not being placed on the media based on the symptoms and fix them itself.
- Truthfulness. Whether there is a tendency to call nonexistent interfaces or fabricate parameters to “paper over” gaps.
- Iteration efficiency. The number of prompt rounds and manual interventions needed to reach a runnable version.
The cross-tool observations lead to three conclusions. First, directory overreach is not an exclusive defect of any one tool; it is more easily triggered when permission confirmation is relaxed, making it a common risk that needs to be enforced on the engineering side. Second, the differences among tools in setting up the environment are clearly larger than the differences in code generation, and the former depends more on whether the model has the habit of “self-checking before acting.” Third, seemingly simple requirements such as localization instead expose truthfulness problems, because they cannot be fudged with generic code.
5. Reusable Prompts and an Acceptance Checklist
The first instruction should contain five elements: the absolute working path and a statement forbidding overreach; a description of the runtime and verification environment; the firmware protocols that graphics and input depend on; the functional scope and what will not be done; and the acceptance criterion for the first round.
The acceptance checklist is best executed in order: no files outside the directory; build artifact paths as expected; all four firmware environment elements in place; the program recognized by the loader and entering the interactive interface; no screen tearing; correct input response; no missing Chinese characters; and pause and restart logic working normally.
6. Conclusion
A firmware-level graphics application is a high-quality lens for capability: it puts engineering constraints, environment setup, truthfulness, and self-correction on the table at the same time, and any shortcut shows itself immediately. For developers, rather than chasing the ranking of a single model, it is better to solidify the above constraints and checklist into the workflow so that different AI coding tools compete under comparable conditions. For stages that need elastic compute and a complete toolchain, general container platforms, log services, and monitoring and alerting capabilities offered by cloud platforms such as Baidu AI Cloud can also be used to standardize the build, run, and observability chain, leaving attention truly for design itself.
