I'm trying to implement a collision system for a raymarched SDF renderer, which I've mostly managed to do except the collisions don't line up with the visuals at all. It seems like the coordinates for my spatial shader (in a cubic mesh instance) are different than those used for the KinematicBody transforms. Firstly, is there a way to get a readout of co-ordinate data from the shader itself? from what I can tell this is difficult if not impossible, so failing that does anyone know what the relationship is between these co-ordinates and how you could convert them? Thanks!

The coordinates in a shader are arbitrary. Most likely model local, but it could be anything. You'd need to pass in transforms if you need world space or possibly look at the shader built-ins, it might be there already.

You can get most of the commonly needed stuff from built in variables. VERTEX gives you vertex position in object's local space. Multiplying it with WORLD_MATRIX will result in vertex position in the world space. Check the shading language reference to see available built-ins.