# Read-only implementation mechanics review

Scope: `work/project/lib/mechanics.mjs`, `work/project/lib/engine-scene.mjs`, and `work/project/app/page.tsx`, as read during the initial implementation. No product files edited. Browser appearance and interactions are being checked independently by the controller.

## One material defect

**Valve stems translate sideways with the rotating rocker tip while their valve springs stay on fixed axes.**

At `engine-scene.mjs` lines 132–133 in the reviewed version, both `q.valve` and `q.face` are positioned from `right`, the rotating rocker endpoint. That endpoint contains `q.t * a * cos(phi)`. The spring remains on the fixed axis `q.pivot + q.t * a` at line 134. Consequently the stem/head center shifts laterally by `a*(1-cos(phi))` as the valve opens, instead of translating only along the valve axis `q.n`.

Reproduction: cylinder 1, exhaust, crank angle 270 degrees, commanded cam lift 0.24. The solved rocker rotation is 44.576913060164514 degrees, producing valve opening 0.23863447060291482 and lateral axis displacement **0.0978149685879274**. That lateral displacement is more than twice the stem radius 0.047 and slightly greater than the spring centerline radius 0.095. The visible stem therefore crosses its own fixed spring at high lift. The same relationship affects all 16 valves.

Recommended local fix: position the valve stem and head on the fixed axis `pivot + t*a`, subtracting only `n*rockerLift` for opening. Give the rocker tip a small sliding/rolling contact pad so it can move laterally across the valve tip while retaining contact. Keep the pushrod solver and rocker rotation, which already preserve their stated lengths. Drive spring shortening from the actual `rockerLift` if its top should precisely follow the valve, although the current lift discrepancy alone is small and is not a separate material finding.

## Passing relationships

- The visible crank uses `rotation.z=-radians(angle)` and the cam uses `-radians(angle/2)`. These signs agree with the helpers' sine/cosine coordinates and the stated clockwise-positive angle convention.
- Main crankpin centers start at the declared journal phases. Their transformed x/y positions agree with each corresponding `cylinderState().pin`. The common pin's axial length spans the two bank-offset rod attachment positions.
- Piston groups use `cylinderState().wrist`, and their local y axes align with the bank normals. The wrist-pin meshes remain coaxial with z after the bank rotation.
- Connecting-rod meshes are aligned and scaled between the same helper pin and wrist coordinates; the big/small-end rings share those endpoints. Per-rod axial coordinates agree.
- The cam-outline construction computes `theta=2*(beta-polar)`. With the actual negative cam rotation, the lobe radius along the fixed follower direction beta is at the intended valve-event phase. The sign is correct.
- The pushrod solver is algebraically sound. With half-rocker length `a`, rocker angle phi and pushrod length `L`, the bottom-to-top lateral separation is `a*(1-cos(phi))`, and the axial separation is `L+a*sin(phi)-lift`. The equation solved makes the Euclidean length equal to L. The rendered rocker retains constant 0.68 length and its midpoint at the pivot.
- The linked SVG correctly projects the global crank pin into the selected cylinder's local transverse and axial basis: `x_local=x*cos(beta)-y*sin(beta)`, `y_local=x*sin(beta)+y*cos(beta)`. This agrees with the slider-crank sign and bank geometry for both banks.
- Piston pose uses 360-degree periodicity while stroke/valve state uses 720-degree periodicity. The firing schedule retains the selected legacy order.

## Independent numerical sweep

The actual `mechanics.mjs` was imported by Node. The visible crank transform and valve/pushrod equations were then evaluated from the reviewed source for each of eight cylinders at 0.25-degree increments through 0–720 inclusive: 23,048 cylinder states and 46,096 valve states.

| Property | Maximum absolute residual |
|---|---:|
| Rod center length versus configured 2.65 | 1.3322676295501878e-15 |
| Rendered crank orbit versus helper pin | 3.2296805691587007e-15 |
| Pushrod length versus 3.504 | 8.866192224843417e-10 |
| Analytic lobe lift phase versus helper lift | 5.828670879282072e-16 |
| Valve lateral movement away from fixed spring axis | **0.0978149685879274** |

These checks validate the reviewed coordinate relationships and equations. They are not a browser scene capture, collision solver, or validation of real engine physics. The lobe is a polygonal, schematic radial outline, and the code explicitly discloses that contact geometry is not an engineered cam design. No additional material defect was identified within this read-only scope.
