A Practical Guide to Choosing AI Coding Models: A Kinematics Solver Case Study
This article presents a practical evaluation of AI coding models through a real engineering task: adding a lightweight pure-kinematics constraint solver alongside an existing impulse-based dynamics engine. It explains why the team chose this bounded, verifiable requirement, how the comparison was kept fair with a unified baseline, tooling environment, and acceptance criteria, and what happened across the first wish-style prompt and later iterations. Key findings cover the tendency to reuse existing systems under incomplete information, the trade-off between short and long reasoning chains, and the value of converging on a design document rather than generating more code. The article closes with a layered selection framework spanning requirement clarification, architecture design, implementation and testing, and cost.
1. Background and Problem Definition: Why Add Kinematics Alongside Dynamics
During the development of an in-house physics simulation engine, the core solver is typically built on an impulse-based soft-constraint dynamics framework. This kind of framework is highly general: it can handle contacts, friction, joint limits, and external disturbances in a unified way, which makes it suitable for high-degree-of-freedom physical simulation. The cost is equally clear. When dealing with purely kinematic coupled linkage mechanisms, a dynamics solver requires a full set of parameters such as mass, inertia, damping, and integration step size, which raises both computation and debugging costs.
For this reason, the team identified a requirement that is non-core but appears frequently: add a lightweight, pure-kinematics constraint-solving capability outside the existing dynamics system. It is intended for end-effector pose solving, mechanism topology validation, test tooling, and model-authoring assistance. This type of requirement has the following characteristics:
- It is not on the product’s main line, has low priority, and tends to be postponed indefinitely.
- The goal is clear, but many constraints are implicit, such as coordinate-system conventions, joint ordering, consistency between forward and inverse solutions, and singular-configuration handling.
- It must remain compatible with the existing engine’s data structures, logging system, and debugging tools.
This requirement was chosen to test AI coding models because it has clear boundaries and strong verifiability, while also exposing a model’s real level in “understanding implicit constraints” and “engineering integrability.”
2. Experiment Design: Keeping the Comparison Fair
To make the evaluation close to real engineering, the experiment followed three principles.
First, a unified baseline. All models were asked directly on the same version of the main codebase, with no additional private context provided, to avoid artificially raising the starting point for any one side.
Second, a unified tool environment. The same AI coding tool was used with identical system prompts, skills, and external interface configurations to reduce interference from tool differences. This also exposed a common problem: the default configuration often injects too many system capability descriptions unrelated to the task, bloating the initial prompt to tens of thousands of tokens and consuming a large share of the budget meant for the actual task. The practical recommendation is to trim irrelevant skills in project-level configuration and keep only the read, write, search, and test capabilities relevant to the current repository.
Third, unified acceptance criteria. The endpoint was not “whether code can be generated,” but whether the design document covered the following elements:
- Data structure definitions for mechanism topology and joint parameters;
- The forward kinematics solving pipeline;
- The inverse kinematics solving strategy and handling of multiple solutions;
- Singular-configuration and numerical-stability strategies;
- Interface boundaries and log output with the existing engine.
3. First Prompt Round: Real Feedback on a Wish-Style Requirement
The first prompt was deliberately kept in a “wish-style” form: a capability to solve mechanism end-effector poses based on a worm gear mechanism. This phrasing is close to how real business stakeholders raise requirements, with incomplete information and many implicit constraints.
The first versions from the four tested models were highly similar: all recommended extending the existing dynamics system rather than building a separate solving module. This shows that, given insufficient information, models generally prefer to reuse existing capabilities to reduce change risk. The differences mainly appeared in elapsed time and context consumption: models with a “fast thinking” tendency were significantly faster, while models with a “deep reasoning” tendency were slower. However, because each model had to understand the entire engineering structure from scratch, multiple rounds of tool calls narrowed the speed gap considerably.
A key observation is that models with shorter reasoning chains produced results faster but were more likely to overlook implicit constraints and “go off track” under wish-style requirements; models with longer reasoning chains were more stable but needed more time. This resembles human experience: a newly onboarded engineer reacts quickly and dares to act, but tends to miss items; only after being polished by engineering constraints do they confirm boundary conditions before starting.
4. Iteration Process: Converging on a Design Document Rather than Piling Up Code
The following rounds entered normal iteration: adding coordinate-system conventions, clarifying joint rotation directions, requiring pure-function interfaces that can be unit tested, and restricting changes to the dynamics core. At this stage, the models’ outputs converged and became hard to differentiate, so the evaluation stopped at the design-document stage. Repeatedly having multiple models do the same mechanical coding yields little value; what truly differentiates them is requirement clarification and architectural trade-offs.
A reusable prompt structure is as follows:
Goal: Add a pure-kinematics solving module without changing the dynamics core.Input: Mechanism topology description (joint type, axis, initial pose).Output:1) Forward kinematics solving interface and data structures;2) Inverse kinematics solving strategy (analytical first, numerical fallback);3) Singular-configuration detection and degradation strategy;4) Unit test cases and log fields.Constraints: Right-handed coordinate system; angles in radians; no new dependencies.
This kind of structured prompt significantly reduces “wish-style going off track” and channels the model’s strengths toward solution enumeration and code-skeleton generation.
5. Conclusions and Recommendations: Use AI Coding Capabilities by Task Layer
Overall, the value of AI coding models in this type of task is mainly reflected in three points: quickly understanding an unfamiliar project, generating a runnable skeleton, and producing stable output once constraints are clear. Selection should not rely only on brand or a single run’s elapsed time; instead, a layered evaluation should be established:
- Requirement-clarification layer: assess whether the model proactively asks about implicit constraints rather than giving conclusions directly;
- Architecture-design layer: assess whether it respects existing system boundaries and avoids intruding into core modules;
- Implementation-and-testing layer: assess interface testability, log observability, and dependency restraint;
- Cost layer: focus on context consumption and the number of tool calls, and trim irrelevant system prompts and skills.
For non-core but well-defined tooling requirements, the recommended process is “structured prompt + design document first + small-step unit tests”; for core pipelines, human review and architectural oversight should be retained. Using AI coding capabilities rationally, treating them as accelerators for getting familiar with a codebase and producing skeletons rather than decision-makers that replace engineering judgment, is the way to achieve stable returns in real projects.
