Evaluating Lightweight Model Coding Capabilities: From Geometric Animations to Engineering Acceptance

    This article explores how to comprehensively evaluate the coding capabilities of lightweight AI models beyond surface-level page effects. By using complex geometric construction tasks as a benchmark, it details the importance of specification clarification, separating mathematical logic from visual rendering, and implementing rigorous acceptance testing for animations and file exports. It also provides guidelines for designing fair, reproducible tests and making informed development decisions based on verification costs.

    1. Evaluating Lightweight Models: Why Page Effects Aren’t Enough

    In AI-assisted programming scenarios, “lightweight” usually implies lower resource consumption, deployment overhead, or invocation costs. However, it does not correspond to a uniform parameter size, response speed, or capability level. Determining whether a model is suitable for development tasks requires evaluating it against specific workloads rather than inferring performance from its name.

    Web animations serve as an intuitive coding test: after receiving a prompt, the browser immediately displays the result, and developers can easily judge whether the page is visually appealing and the animation is smooth. However, visual completeness does not equate to technical correctness.

    A geometric animation might quickly draw a regular shape using preset vertex coordinates without actually implementing the required construction method. An export button might respond to clicks but fail to output a playable dynamic image file. Therefore, a truly valuable evaluation should not merely ask “Did it draw it?” but should probe further:

    1. Did it understand the mathematical meaning of the problem?
    2. Did it follow the specified construction path?
    3. Does the animation faithfully reflect the calculation process?
    4. Does the export functionality have a complete, verifiable execution chain?
    5. Are the results still stable after repeated runs and requirement modifications?

    These questions align more closely with actual software delivery requirements than a single page screenshot.

    2. Why Geometric Construction Tasks Have High Discriminative Power

    Consider a task that starts from a square and uses circles, perpendicular bisectors, and the constrained movement of a marked ruler to demonstrate the construction of a regular heptagon, followed by exporting an animated GIF.

    On the surface, this is just a web drawing requirement. In reality, it simultaneously involves mathematical understanding, numerical computation, state organization, graphics rendering, and file encoding—a small-scale, multi-layered engineering task.

    First, it requires identifying the capability boundaries of different construction systems. A regular heptagon cannot be precisely constructed using only an unmarked straightedge and compass; introducing a marked ruler that allows specific alignment operations changes the tool system. Therefore, a marked ruler construction cannot simply be disguised as a standard compass-and-straightedge construction.

    Second, natural language requirements are not always sufficiently clear. For example, does “the ruler touches a vertex” mean the edge of the ruler passes through that point, or that a specific graduation mark aligns with it? Does “the second graduation line passes through the perpendicular bisector” mean the mark’s position falls on the line, or that the physical line itself intersects it? Different interpretations form different geometric constraints.

    Third, “filling in omitted steps” does not permit arbitrary auxiliary operations. Supplementary steps must be derivable from known conditions and must not secretly introduce the target shape’s vertex coordinates to reverse-engineer the construction process.

    Thus, these tasks truly test whether a model can translate natural language requirements into an executable, verifiable constraint system, rather than merely whether it can call drawing APIs.

    3. Clarify Specifications Before Generating Code

    A reliable implementation should begin with requirement clarification, not by immediately generating a complete page.

    For a marked ruler construction, the following must be determined at minimum:

    • The side length of the square and the positional relationship of its vertices;
    • The definition of the circle’s center, radius, and auxiliary lines;
    • The distance between the two graduation points;
    • The relationship between the graduation spacing and the square’s side length;
    • The fixed point through which the ruler must pass;
    • The conditions each graduation point must satisfy;
    • Selection rules when multiple intersections or feasible poses occur;
    • How the edges or vertices of the heptagon are determined by these objects upon completion.

    If key conditions are not provided, one should not claim that a specific implementation is the “only correct solution.” A safer approach is to list items pending confirmation or explicitly state the assumptions used and restrict conclusions within those assumptions.

    Engineering-wise, specifications can be organized into three layers:

    The first layer is the geometric specification, describing objects and their relationships.

    The second is the presentation specification, describing the display order, movement trajectories, pauses, and auxiliary traces.

    The third is the delivery specification, describing the execution method, interactions, export formats, and acceptance criteria.

    This layering prevents mathematical errors from being misjudged as animation issues and stops page functionality from masking construction logic flaws.

    4. How to Identify “Right Result, Wrong Process”

    A common deviation in generative programming is bypassing difficult requirements by using easily implementable substitutes.

    For instance, to draw a regular heptagon, one might directly use the parametric equation of a circle:

    xₖ = cₓ + R cos(θ₀ + 2πk/7)

    yₖ = cᵧ + R sin(θ₀ + 2πk/7)

    Where k ranges from 0 to 6, the center is (cₓ, cᵧ), R is the radius, and θ₀ is the initial angle.

    While this method is suitable for general graphic display and can serve as an independent reference result, it cannot replace the construction process if the task explicitly requires demonstrating a specific geometric construction.

    It is crucial to distinguish between two types of behavior:

    One is using numerical computation to solve construction constraints. For example, calculating the ruler’s pose via root-finding so that the graduation points simultaneously satisfy the circle and perpendicular bisector conditions. This is a computational implementation of the specified construction.

    The other is calculating the final heptagon first and then arranging auxiliary lines to match these vertices. This is reverse-engineering a presentation from the target and does not prove the validity of the original construction.

    The two might look identical in a final screenshot, but their correctness foundations are completely different. Therefore, during acceptance testing, one must not only check the vertex coordinates but also verify whether the input, constraints, and output of each step form a genuine dependency.

    5. Separating Mathematical Objects from Animation Performance

    To improve testability, it is recommended to split the program into three parts.

    1. Geometric Calculation Layer

    This layer handles only points, lines, circles, intersections, and constraint solving. It is not responsible for colors, animation timing, or button states.

    For a point P on a circle, verify that its distance to the center E satisfies:

    |‖P-E‖-r| ≤ ε

    For a point that should fall on the perpendicular bisector, verify that its distance to the line is within the tolerance.

    Tolerance should be set based on the coordinate scale and numerical methods; “invisible deviation on the screen” should not be considered mathematical correctness.

    2. Construction State Layer

    Divide the construction into finite phases, such as initialization, creating auxiliary circles, adjusting the ruler pose, determining key intersections, finding the center, and completing the polygon.

    Each phase should document preconditions, generated objects, movable objects, and traces to be retained. If a certain intersection does not exist, the program should halt and report the reason rather than automatically switching to an unexplained construction method.

    3. Rendering and Interaction Layer

    This layer draws based on the state and handles play, pause, progress dragging, and export operations. It should not arbitrarily modify geometric results.

    This architecture offers a direct benefit: even if the drawing method changes, mathematical verification can still run independently; even if the animation looks abnormal, you can first confirm whether the geometric data is correct.

    6. Don’t Confuse Compass Trajectories with Auxiliary Traces

    “Showing the movement of points while retaining only necessary construction traces” is an easily overlooked detail.

    A motion path represents an object’s position over time; construction traces represent the segments, arcs, or intersection marks that must be left behind during the construction process. These should be managed separately.

    For example, when a compass opens and rotates, the tool’s pose and the moving endpoint can be displayed, but there is no need to permanently draw the entire rotation range as an arc. Only the relevant arc segments used to determine intersections should enter the retained layer.

    If all historical frames are simply overlaid, the screen will quickly become cluttered and may mislead the reader’s understanding of the construction steps. A more reliable method is to maintain temporary objects, permanent objects, and explanatory marks separately, clearly defining their lifecycle for each phase.

    7. Independent Acceptance Testing for Animated Exports

    The ability to play an animation on a page does not mean the capability to export an animated image exists.

    A complete export process typically involves: determining the timeline, sampling states at fixed intervals, rendering each frame, handling colors and transparent backgrounds, encoding, generating the file, and providing a download.

    Missing any single link can result in empty files, static files, frame sequence errors, or abnormal playback duration.

    A key practice is to let the export and real-time playback share the same state calculation function. For any given time t, the corresponding frame can be directly calculated without depending on “where the previous frame left off.”

    This makes progress dragging easier and reduces the risk of state drift during export.

    Additionally, exporting consumes extra computation and memory. You cannot infinitely increase resolution and frame rate just to pursue smoothness. Reasonable quality options should be provided, along with processing progress, failure reasons, and a cancel option. Final acceptance must actually open the exported file to confirm frame count, duration, visual content, and looping behavior, rather than just checking if the download button is clickable.

    8. Designing Fair and Reproducible Capability Tests

    A single complex task can expose problems but is insufficient to support a general capability ranking. Different runtime environments, context lengths, retry counts, and human interventions can significantly affect results.

    A more reasonable test should fix the following conditions:

    • Use the same task text and clarification information;
    • Provide consistent runtime permissions and resource limits;
    • Specify whether follow-up questions and automatic repairs are allowed;
    • Record total time, number of modifications, and human interventions;
    • Save raw outputs, runtime logs, and acceptance results;
    • Conduct multiple repeated tests on similar tasks.

    Evaluation results should be presented separately, rather than giving a single vague total score.

    Mathematical correctness focuses on whether constraints hold; instruction adherence focuses on whether the construction path is consistent; engineering completeness focuses on interactions, exports, and exception handling; maintainability focuses on module division and readability; efficiency focuses on the time and cost required to meet acceptance criteria.

    It is especially necessary to distinguish between the first output time, the first runnable version time, and the final acceptance time. A fast response requiring extensive fixes may not be more efficient than a slower generation that delivers stably; similarly, taking a long time does not automatically prove the result is more reliable.

    9. From Single Demos to Actual Development Decisions

    Whether a lightweight model is worth using for development ultimately depends on task boundaries and verification costs.

    For layout adjustments, repetitive component generation, and scripted tasks with clear specs, the feedback cycle is usually short, and errors are easy to locate. For tasks like mathematical constructions, complex state machines, and file encoding, stronger independent verification mechanisms are required; all judgments cannot be left to the generative model itself.

    In practical work, a “verify the high-risk core first, then build peripheral features” approach can be adopted: confirm the geometric construction works before implementing the animation; complete a decodable export result before adding the full interface. This helps discover directional errors earlier and reduces piling code onto a flawed solution.

    The value of complex web tasks lies not in creating an impressive demo, but in observing how the system handles constraints, ambiguities, and failures. Truly reliable coding capability should manifest as an explainable modeling process, reproducible execution results, and independently verifiable delivery quality. For lightweight models, these metrics are more practically meaningful than simply “looking like a larger model.”