Evaluating AI Coding Capabilities: A Particle Interaction Page Case Study
Evaluating AI programming systems requires more than just generating running code; it demands a complete engineering perspective. This article uses a particle interaction page—where particles morph between a galaxy, digital outlines, and custom patterns driven by scrolling—as a case study. It details how to define visual goals, build scene specifications, model particles, map shapes, implement scroll-driven animations, and manage performance. Furthermore, it provides a comprehensive framework for fairly evaluating AI coding outputs across visual consistency, interaction stability, performance, and maintainability, helping developers transition from impressive demos to robust engineering solutions.
1. Evaluating AI Coding Capabilities Requires a Complete Engineering Task
When evaluating AI coding systems, the most common misconception is equating “generating code” with “delivering an engineering project.” For an interactive page involving particle vortices, graphic transformations, and scroll-driven linkage, code that runs is merely the starting point. The real challenge lies in simultaneously satisfying visual, interactive, performance, and maintainability requirements.
This type of task is highly representative: the screen may appear to be just a collection of moving light points, but behind the scenes, it involves spatial modeling, particle sampling, state interpolation, input handling, and rendering resource management. If any part is handled crudely, the static screenshot might closely resemble the reference, while the actual operation feels noticeably distorted.
Therefore, rather than debating the pros and cons of specific systems, we should pose a universal question:
When the goals, materials, and resource constraints are identical, can an AI coding system translate complex visual intent into a stable, explainable, and iterable engineering implementation?
Below, we use a page where “particles gradually morph from a spiral galaxy into a digital outline, then a pointer pattern, and finally a custom logo, dispersing and aggregating with scroll” as an example to illustrate how to decompose, implement, and evaluate this engineering task.
2. Define the Target: Reproduce Visual Patterns, Not Just a Static Image
“Aim to be as close to the reference effect as possible” can serve as a direction, but it cannot act as the direct development specification. A single screenshot only captures the result at a specific moment; it cannot fully describe particle motion, camera changes, and interactive feedback.
Before implementation, the requirements should be broken down into four dimensions.
1. Static Visuals
Record the position, size, orientation, and whitespace ratio of the main shapes in the frame. Simultaneously, clarify the size distribution, color gradients, and brightness relationships of the particles.
Take the spiral galaxy as an example. The high-density core, curved spiral arms, and sparse outer particles collectively form its identity. If you merely scatter particles randomly within a circular area, even with matching colors, it will be difficult to create the same spatial impression.
2. Dynamic Behavior
Clarify whether the particles are rotating as a whole, moving along trajectories, or experiencing slight perturbations around stable positions. Determine whether shape transitions start simultaneously or follow a spatial sequence.
Dynamic behavior determines if the piece feels natural. Two implementations can share similar keyframes but present completely different impressions due to different motion paths.
3. Input Mapping
Scrolling, pointer movement, and window resizing all require clear response rules. For example:
- Scroll progress controls shape transitions, rather than just triggering a one-time playback;
- Pointer movement creates local repulsion or merely shifts the viewing angle;
- Window changes trigger projection recalculations to prevent the main subject from being clipped.
Notably, “pointer outline shape” and “pointer input interaction” are two distinct requirements and should not be conflated due to similar naming.
4. Engineering Constraints
Declare the target devices, browser environments, resource loading requirements, and accessibility needs in advance. Particle count, canvas resolution, and visual complexity should be determined within these constraints, not patched up after implementation.
Additionally, visual references should come from authorized assets or self-designed samples. Studying general interaction patterns does not grant permission to directly copy others’ logos, proprietary assets, or page resources.
3. Establish Scene Specs: Turn Vague Descriptions into Verifiable States
An actionable plan requires defining states first, then designing the connections between them.
The page can be divided into several logical phases:
| Phase | Main Shape | Key Observation Points |
|---|---|---|
| Initial Phase | Spiral Galaxy | Core density, arm structure, depth layers |
| Transition 1 | Galaxy to Digital Outline | Outline recognizability, motion continuity |
| Transition 2 | Digital to Pointer Pattern | Edge integrity, local density consistency |
| Transition 3 | Pointer to Custom Logo | Shape proportions, visual center stability |
| Final Phase | Aggregate or Disperse | Rhythm, brightness changes, page transition |
The phases in the table are schematic designs, not actual measured parameters of an existing page.
Each phase should include verifiable descriptions, such as “the main subject always remains within the safe display area,” “both forward and backward scrolling maintain continuity,” and “particles do not instantly disappear in chunks during transitions.” These descriptions are far better acceptance criteria than vague terms like “premium,” “smooth,” or “tech-savvy.”
4. Particle Modeling: Generate Target Points Before Animating
A particle system can be abstracted as a set of points with attributes. Each point should at least contain a current position, a target position, and properties like size, color, or a random seed to express differences.
If multiple shapes are needed, you can pre-prepare multiple sets of target coordinates for the same batch of particles:
- Galaxy coordinate set;
- Digital outline coordinate set;
- Pointer pattern coordinate set;
- Custom logo coordinate set.
This way, shape transitions become continuous interpolations between different coordinate sets, eliminating the need to reconstruct all geometric data frame by frame.
1. Basic Construction of the Vortex Structure
A common method is to generate particles in polar coordinates and then convert them to Cartesian coordinates. The spiral arm angle can be written as:
θ = θ₀ + k × r + εθ
Where θ₀ is the starting angle of a spiral arm, r is the radius, k controls the degree of twist as the radius increases, and εθ is a random perturbation.
Then calculate:x = r × cosθy = r × sinθ
Add a minor depth offset so the scene doesn’t look like a completely flat disc.
Note that the radius sampling method alters visual density. If you want points to be roughly uniformly distributed across the disc area, the radius should be proportional to the square root of a uniform random number. If you want to emphasize a bright core, a separate central density distribution must be designed; these two goals should not be confused.
2. Sampling Graphic Outlines
Digits, pointers, or logos can be sampled from 2D masks: draw the shape onto an offscreen canvas, read the valid regions, and convert the sampled points into unified coordinates.
A crucial choice here is whether to sample the contour or fill the interior.
Contour sampling can maintain recognizability with fewer particles, but the result may look thin. Interior filling provides more volume but easily leads to uneven local density. Practical solutions can combine both: retaining sufficient density at the edges while using sparser points internally.
All shapes should share a unified center, scale, and coordinate orientation. Otherwise, unexpected translations, flips, or scaling will occur during transitions.
5. Shape Mapping: Same Point Count Doesn’t Guarantee Natural Morphing
Even if each shape has the same number of particles, directly connecting them by array index can result in massive crossover movements. The reason is that adjacent points in the source shape might not remain adjacent in the target shape.
You can choose different strategies based on project complexity.
1. Fixed Index Mapping
Easy to implement and suitable for prototyping. The advantage is low preprocessing cost, but the downside is potentially chaotic paths. If the design itself emphasizes thorough scattering before regrouping, this method might be perfectly acceptable.
2. Spatial Sorting Mapping
Sorting point sets by spatial position before establishing correspondence can reduce some random long-distance movements. However, it doesn’t guarantee global optimization and may cause discontinuities at sorting boundaries.
3. Nearest Neighbor Matching or Approximate Assignment
Finding closer target points for source points and restricting target reuse usually improves local continuity. However, this calculation has extra overhead and is better suited for initialization or preprocessing stages rather than being placed inside the per-frame render loop.
The choice of method should serve the visual goal. If the goal is to make particles morph like a single piece of flexible material, spatial correspondence is critical. If the goal is to show reorganization after a burst, retaining some randomness is fine.
6. Scroll-Driven Animation: Must Support Forward and Backward Movement
Scroll linkage should not be simply implemented as “play animation when reaching a certain position.” Users might quickly drag the scrollbar or scroll back and forth repeatedly. A more robust approach is to map the page scroll position to a deterministic scene progress value.
Assuming the normalized progress t of the current interval ranges from 0 to 1, the particle position can be expressed as:
P(t) = (1 − e(t))A + e(t)B
Where A and B are the corresponding coordinates of the two shapes, and e(t) is the easing function.
For example, the smooth interpolation function:
e(t) = 3t² − 2t³
allows the rate of change to ease in and out at both ends of the interval. This is just one common choice; the actual implementation should be adjusted based on the reference rhythm.
If you need dispersion before aggregation, you can overlay a mid-point disturbance:
P(t) = (1 − e(t))A + e(t)B + a(t)D
Where D is a pre-generated disturbance vector, and a(t) increases in the middle of the transition and zeroes out at both ends. This adds spatial tension without destroying the endpoint shapes.
The key principle is: Randomness must be stable; you cannot regenerate target disturbances every frame. Otherwise, the user will see jitter rather than organized motion.
7. Performance Governance: Smoothness Isn’t Just About Particle Count
Common bottlenecks in complex particle pages include CPU computation, data transfer, pixel fill rate, and frequent memory allocation. Before optimizing, locate the bottleneck instead of blindly cutting features based on intuition.
1. Reduce Per-Frame Temporary Objects
Pre-allocate and reuse coordinates, colors, and random seeds. Creating large arrays of temporary objects per frame increases garbage collection pressure, causing irregular stutters.
2. Reasonably Control Canvas Resolution
High pixel density multiplies the actual number of rendered pixels. For decorative particle backgrounds, set a reasonable resolution cap and observe the trade-off between image quality and frame time.
3. Mind Alpha Blending Costs
Particle count isn’t the only factor. When large numbers of semi-transparent particles overlap, they increase the pressure of repeatedly drawing the same area. Therefore, particle size, halo range, and core density also need control.
4. Decouple Layout Calculation from Drawing
Update necessary layout information during scroll and window changes; the per-frame loop should primarily read state and draw. Avoid frequently alternating between reading layout and modifying styles within the same frame.
5. Provide Degradation Paths
Pause non-essential animations when the page is invisible. If the user prefers reduced motion, provide a static or low-motion version. Devices with insufficient performance can also use fewer particles or simpler layers.
These measures are not meant to sacrifice visuals, but to keep the page usable across different environments.
8. How to Fairly Evaluate AI Coding Output
To judge AI coding capabilities, unify the inputs, development constraints, and acceptance methods rather than comparing demo results under different conditions.
1. Standardize Task Materials
Provide all implementations with the same reference screenshots, key phase descriptions, interaction screen recordings, and asset usage boundaries. If only static images are provided without dynamic information, explicitly acknowledge the limited scope of evaluation; you cannot judge full motion restoration capabilities based on this alone.
2. Record the Delivery Process
Beyond the final effect, record whether it runs after generation, how many blocking issues occurred, what parts were manually modified, and whether it’s easy to adjust after requirement changes.
Succeeding on the first generation doesn’t guarantee future maintainability. Conversely, making corrections based on explicit feedback also reflects a certain level of engineering collaboration capability.
3. Multi-Dimensional Acceptance
Establish a checklist from the following aspects:
- Visual Consistency: Do the main proportions, density, colors, and whitespace match the specs?
- Motion Continuity: Are shape transitions smooth? Does reverse scrolling work normally?
- Interaction Correctness: Is it stable during fast scrolling, window resizing, and after the pointer leaves?
- Performance: Are there noticeable stutters or continuous resource growth on agreed devices and environments?
- Code Quality: Is configuration centralized? Are state and rendering separated? Are resources properly released?
- Delivery Completeness: Are startup instructions, known limitations, and adjustable parameters documented?
If a comprehensive score is needed, agree on the weights before testing. Different businesses value visual precision, device coverage, and maintenance costs differently; rules shouldn’t be adjusted temporarily to cater to a specific outcome.
9. From Demo to Engineering: What Truly Needs Bridging
A mature delivery shouldn’t just be a page where “you can see the effect”; it should contain a clear structure and boundaries.
It is recommended to divide the implementation into modules: target point generation, shape mapping, scene state, input handling, and rendering management. Centralize visual parameters to avoid having to dig into animation logic just to adjust particle size. Decouple shape data from the rendering process to easily add new patterns. Ensure the destruction process explicitly releases event listeners and graphic resources to prevent cumulative overhead after the page is repeatedly accessed.
Acceptance should also cover easily overlooked scenarios: refreshing the page at an intermediate scroll position, continuously crossing multiple phases, switching window orientations, and resource behavior after prolonged idling.
These details rarely appear in promotional screenshots, but they directly determine whether the effect can enter a real project.
Conclusion
A particle interaction page is an excellent AI coding engineering test because it simultaneously examines requirement comprehension, mathematical modeling, interaction design, performance analysis, and code organization.
Evaluating this capability shouldn’t stop at asking “does the generation look similar.” It should probe further: in which verifiable dimensions is it similar? Is the motion driven by stable rules? Has performance been practically tested? Can it be modified at a low cost when requirements change next time?
Once visual intent is decomposed into states, coordinates, mappings, and acceptance criteria, AI coding output is no longer just an impressive demo, but an engineering achievement that can be inspected, compared, and continuously improved.
