That is not an issue, it will get auto truncated.
If you do
position.xyz = position.xyzw
result will be same as
position.xyz = position.xyz
Multiple branching inside loop within shader is insanity, but it shouldnt cause the crash, some more details about crash? I would suggest you to start removing part of code, in fact start with basic VertexShader and PixelShader that just return float4(1,0,0,1) and see if that past, then readd your vertex shader and go from that point on.
On second though, if you are not using custom vertex declaration or simplified vertex declaration without UVcoords, add
float2 TexCoord : TEXCOORD0;
to vertex input... also are you sure that you are using vertex declaration where SV_Position is float4 and not float3? Is there chance you just commented off UV coords and changed input of SV_Position from float3 to float4 because this part:
Didnt work? So you've done that instead of
mul(float4(input.Position,1), world); ?