Evaluating Lightweight Coding Models: From Animation Generation to Engineering Acceptance
How should you evaluate lightweight coding models beyond "did it generate a page"? This article uses a compass-and-straightedge construction animation as a test case, presenting acceptance criteria, geometric validation, animation architecture, GIF export pipelines, and layered scoring methods for reliable model comparison.
1. Evaluating Lightweight Coding Models Takes More Than “Did It Generate a Page”
Lightweight coding models are typically expected to deliver fast responses, controlled inference costs, and reliable code quality all at once. In practice, these goals often conflict: some models quickly produce visually complete pages but omit critical logic; others handle complex constraints well but take longer to generate, or require multiple rounds of fixes before delivery.
So before asking whether a lightweight model has strong coding ability, we first need to define what “ability” means.
For developers, a genuinely valuable result is not code that merely looks plausible, but an implementation that runs, satisfies constraints, is easy to verify, and fits into existing engineering workflows. This is especially true for tasks involving mathematical logic, continuous animation, and file export — a page that opens is just the starting point, not sufficient evidence that the task is complete.
A compass-and-straightedge construction animation is a representative test scenario. It looks like a frontend page generation task, but it actually requires the model to handle natural language constraints, geometric relationships, state transitions, graphics rendering, and resource management simultaneously. Tasks like this reveal whether a model can turn abstract requirements into a consistent, executable program.
That said, a single task provides only local evidence. Even an outstanding result cannot prove the model is stronger across all coding tasks, let alone support a comprehensive performance ranking.
2. Why a Compass-and-Straightedge Animation Has Evaluation Value
Consider this task: given three non-collinear points on a circle, locate the center by constructing the perpendicular bisectors of two chords, fully demonstrate the compass-and-straightedge process, and support exporting the animation as an animated GIF.
This requirement involves at least five interrelated capabilities.
2.1 Understanding Operational Requirements and Prohibitions
“Show the perpendicular bisector” and “show the compass-and-straightedge process for constructing the perpendicular bisector” are not the same requirement.
The former allows directly computing a line perpendicular to the segment through its midpoint; the latter requires demonstrating the process of drawing arcs with equal radii centered on the segment’s two endpoints, then connecting the arc intersections. If the model simply draws the final line, the mathematical conclusion may be correct, but the process requirement is unmet.
Similarly, “compass movement” does not mean “leave a trace along the entire path.” A compass can first move into position, adjust its radius, and only then begin drawing an arc. The program must distinguish tool movement from marks drawn on the paper.
2.2 Keeping Geometric Relationships Correct
Perpendicular bisector construction depends on explicit geometric conditions. Let the segment endpoints be A and B with length d, and let both auxiliary circles use the same radius r. To obtain two distinct intersection points, the condition is:
r > d / 2
If the radius is too small, the two circles have no intersection; if the radius exactly equals half the segment length, the circles are tangent, yielding no two distinct points to connect.
These conditions are not visual decoration — they are the foundation on which the algorithm stands.
2.3 Managing Animation Steps with Dependencies
The animation should not simply display several shapes at once; each step must remain consistent with prior states. For example, before drawing the second arc, the compass must have moved to the second endpoint; before marking the intersections, both relevant arcs should already exist.
This requires a degree of process modeling — not just concatenating drawing instructions.
2.4 Implementing Interaction and Export
Playback, pause, replay, progress control, and GIF export involve different technical concerns. Correct playback in the browser does not guarantee correct export. Export also involves frame-by-frame rendering, frame timing, color conversion, memory usage, and file generation.
2.5 Making the Whole Implementation Verifiable
A good implementation should let an evaluator answer three questions:
- Which operation produced each object on screen?
- Does each step satisfy the geometric constraints?
- Does the exported file faithfully reproduce the animation shown on the page?
If the only judgment available is a visual impression that “it seems done,” the test result lacks explanatory power.
3. Define Acceptance Criteria Before Running the Model
If the test prompt is ambiguous, differences between models may reflect different interpretations of the requirements rather than different implementation capabilities. Therefore, convert the natural language requirements into explicit acceptance items first.
For the task above, you can build a checklist like this:
| Acceptance Dimension | Core Checks |
|---|---|
| Input conditions | Three points lie on the target circle and are not collinear |
| Construction process | The full construction of both chord perpendicular bisectors is demonstrated |
| Tool behavior | Compass movement and pen-down drawing are clearly separated |
| Geometric result | The two perpendicular bisectors intersect at the circle’s center |
| Process constraints | No extra steps substituting for the specified construction method |
| Playback interaction | Play, pause, and replay supported with consistent state |
| Export result | File opens; timing and content match the page |
| Error handling | Warnings for degenerate inputs and export failures |
Here it is especially important to distinguish “correct result” from “correct method.”
For example, a program that computes the center directly from the three points and then plays an animation that merely looks like construction may land on the exactly correct position — but if the animation steps do not independently constitute a valid compass-and-straightedge construction, it should not pass.
Conversely, a program that uses analytic geometry internally to compute intersection points and then drives the animation from those results does not necessarily violate the construction requirements. Computer implementations need numerical computation; what matters is that the visible operations faithfully correspond to the specified construction method, not that the program performs no coordinate math at all.
4. Geometry: Build the Visuals on Verifiable Data
A reliable implementation should compute the geometry first and generate the animation from it — not piece together a “looks correct” result from fixed pixel positions.
Let A and B be two points in the plane, M their midpoint, and d the segment length. Take the unit vector u along AB and a unit vector n perpendicular to it. The intersection points of the two equal-radius auxiliary circles can be written as:
P = M + h × n
Q = M − h × n
where:
h = √(r² − d² / 4)
Connecting P and Q yields the perpendicular bisector of AB. Repeating this for the other chord and intersecting the two bisectors gives the circle’s center.
The implementation must also handle numerical stability. If the three points are nearly collinear, the center calculation can be highly sensitive to input error; if the two lines used for intersection are nearly parallel, the resulting coordinates can be enormous. The program should therefore set tolerances appropriate to the coordinate scale and warn on degenerate cases instead of rendering distorted output.
During acceptance, add an independent check: compute the distance from the derived center to each of the three input points and verify that the differences fall within the allowed error range. This avoids judging correctness by visual position alone.
5. Animation Architecture: Separate “Moving” from “Leaving a Mark”
The place where implementation quality is most easily exposed is whether the animation state is clearly structured.
A robust design splits the system into three layers:
5.1 Geometry Data Layer
Stores mathematical objects such as input points, auxiliary circles, arcs, intersection points, and lines. This layer knows nothing about animation progress — it only supplies correct data.
5.2 Timeline Layer
Describes each action’s start time, duration, tool state, and drawing progress. For example:
- Move the compass to endpoint A;
- Adjust the compass radius;
- Draw the first required arc;
- Lift the compass and move to endpoint B;
- Draw the second arc;
- Mark the two intersection points;
- Connect the intersections to form the perpendicular bisector.
“Lifting” and “pen-down” should be explicit states. While the compass center moves, no line should be generated automatically just because its position changes.
5.3 Rendering Layer
At any given moment, draws the tools and geometric marks that should be visible.
The core design principle: given the same inputs and the same timestamp, the rendered result should be identical. Do not let the visual state depend on how many playback callbacks have occurred, otherwise pause, seeking, and replay will easily produce inconsistencies.
A schematic structure:
Scene = compute state from timeline (input data, current time)Draw geometric marks (existing objects in the scene)Draw construction tools (tool positions in the scene)Draw captions (step information in the scene)
This structure also provides a unified foundation for frame-by-frame export.
6. GIF Export Is Not an Extra Button — It Is a Separate Pipeline
“Add an export feature” sounds like placing one more button, but it can significantly increase implementation complexity.
Page playback relies on the runtime’s refresh rhythm; file export requires knowing each frame’s content and duration. A reliable approach reuses the same scene computation and rendering logic and draws frame by frame at fixed timestamps — not simply recording whatever the page happens to display.
A typical export pipeline:
- Determine total animation duration, output size, and sampling frame rate;
- Compute the scene state for each frame in time order;
- Render each scene to an offscreen canvas;
- Perform color processing and frame encoding;
- Generate the downloadable file;
- Release the temporary canvas, frame data, and related resources.
The main risk to watch is memory usage. If each frame is stored as raw data at four bytes per pixel, the full raw frame buffer for W × H pixels and N frames has a theoretical size of roughly:
W × H × 4 × N bytes
This is not the final file size and excludes encoder and temporary-copy overhead, but it explains why high-resolution, long-duration animations easily create memory pressure.
Therefore, control size, frame rate, and duration based on actual needs, avoid holding all raw frames in memory simultaneously for long periods, and provide export progress indicators, failure messages, and protection against duplicate clicks.
7. How to Compare Models Fairly
When comparing models, control variables outside the task itself. Different editing environments, tool permissions, timeout settings, and dependency conditions can all significantly affect results.
Fix at least the following conditions:
- Use the same full prompt and initial files;
- Use the same runtime environment and network permissions;
- Set a consistent maximum wait time;
- Use consistent error feedback methods and fix rounds;
- Save raw outputs, run logs, and final artifacts;
- Run multiple independent tests per task.
The metrics should not be limited to “generation time.” More meaningful metrics include:
Time to first runnable version: how long from task submission to an implementation that starts.
Time to first acceptance pass: how long from task submission to meeting all key requirements.
Manual fix effort: how much logic developers had to modify, and whether key modules needed rewriting.
Repeat success rate: whether qualified results are consistently produced across repeated tests under the same conditions.
If a generation produces no usable output for a long time, record it as a delay or failure in delivery — do not interpret the wait itself as deeper reasoning. Whether the output process runs smoothly and whether the final program is correct should be evaluated separately.
8. Use Layered Scoring So Visual Polish Doesn’t Mask Logic Flaws
Start with mandatory hard pass/fail conditions, then evaluate experience quality.
Layer 1 — Runnability: Does the code start? Do the key features actually exist? Are there blocking errors?
Layer 2 — Semantic correctness: Do the geometric relationships hold? Are the steps complete? Is the specified construction method followed?
Layer 3 — Engineering reliability: Are state transitions stable? Is export consistent? Are abnormal inputs handled?
Layer 4 — Experience: Is the layout, captioning, animation pacing, and visual clarity reasonable?
This ordering avoids a common trap: assuming that a polished interface with all the buttons means stronger capability. For constraint-heavy tasks, a plain but correct implementation is usually more valuable than a flashy one that changes the solution method.
Also, avoid reporting a single total score. Keeping per-item results shows whether a model excels at requirement understanding, mathematical implementation, or interface organization — and helps developers choose the right human-AI collaboration approach.
9. From a Single Demo to Reliable Model Selection
A compass-and-straightedge animation tests a model’s ability to execute complex constraints, but it remains just one item in a test suite.
For actual model selection, add tasks of different types, such as fixing defects in existing code, cross-file feature changes, data processing, test supplementation, and error-path handling. Only stable performance across multiple task types provides a solid basis for judging a model’s overall coding ability.
For teams, the goal of model selection is not to find the most impressive single demo, but to reduce the total cost of completing real tasks — a cost that includes inference and waiting, but also review, fixing, testing, and ongoing maintenance.
So evaluating lightweight coding models should return to a plain standard: can it, under explicit constraints, consistently produce results that run, that can be verified, and that can be maintained? Turning this standard into test cases, acceptance checklists, and reproducible processes is far closer to reliable technical judgment than relying on a single experience or visual impression.
