Finally knuckled down and started reading Jason McKesson's excellent GL tutorial. There he says, chapter 5 Boundaries and Clipping section:
But of clipping, if a fragment is to be clipped "it is discarded before any fragment processing takes place".the OpenGL spec says that the depth test must happen after the fragment program executes"
Is the depth and clip test the same, i.e, fragments that are behind what is already in the depth buffer will be discarded before fragment processing takes place? Or does the fragment shader process the fragment, test the depth, and write or not write to the color buffer dependingly?
If the second, then is it possible to do the cull up front like clipping using glsl?