COM Position - Top vs Front Rail

Top Rail? Front Rail? How do you choose, and where do you want the COM to be?
Short physics lesson: we want to avoid any torques that could twist the toolhead, resulting in vibrations and a loss of print quality.
Torques happen when a force is not aligned with the center of mass of the body on which it is applied, and T = F x L (Torque = Force x Lever arm).
To prevent them, we need to first find what are the forces and the bodies that come to play.
X movement:
- Bodies: toolhead
- Forces: belts (applied directly to the toolhead)
Y movement:
- Bodies: toolhead, X beam assembly
- Forces: belts (applied to the X beam through the XY joints), rail carriage (applied from the rail to the toolhead at the carriage ball raceways)
The rail is orders of magnitude less stiff than the other parts, so it decouples the rest of the parts in two rigid bodies (That holds true if you have a rigid enough toolhead and beam, otherwise you should first fix the worst links in the chain)
The belt forces during X movement are coplanar with the belts, and for Y movement they're aligned along Y in the middle of the belts. The rail force during Y movement is aligned along Y and it can be treated as starting from the middle of the two rail grooves. This means that to get zero torques on the toolhead, the COM of the toolhead has to be coplanar with the belts (along red dashed line in the pics) and aligned horizontally to the rail grooves (horizontal with the middle of the cyan dashed line in the pics). To get zero torques on the X assembly, the COM of the entire "toolhead + rail + X beam + XY joints" assembly has to be aligned horizontally to the middle of the belts.
With Front Rail you can satisfy all the conditions simultaneously, because if the entire assembly is symmetrical around the XY plane., while with Top Rail you can satisfy the optimal position of the toolhead COM, but that automatically forces the COM of the X assembly to move up, leading to a torque around the X axis during Y movement.
Torques around the X axis are the most critical ones, as that's the least rigid axis of the linear rail. The rail is an order of magnitude more rigid in the other axes, so small torques around Y and X can be neglected in a first analysis.