I rely on conservative depth extention in my pixel shaders:
layout (depth_greater) out float gl_FragDepth;
Is this feature compatible with shaders with discard instruction?
Yes, you can use discard; with conservative depth. The conservative depth feature controls whether the hardware runs your shader at all whereas executing discard; in the shader prevents the depth write from occurring. In the example you gave, if the depth test hardware determines that if you only make gl_FragDepth greater than it would have been then it is safe to not run the shader if the depth test is set to LESS or LEQUAL. However, if your shader executes discard, the resulting value will not be written to the depth buffer and nor will any other output from the shader.
Retrieving data ...