I am curious how picking interacts with functionality that can discard geometry, i.e. clipping, culling and depth testing.
The tests draw geometry outside z [0.0; 1.0], and it doesn't seem to influence the result (at least the initial test that counts hit vs miss is easy-ish to read there). That indicates the near and far clip planes don't matter. Testing a z result < 0 or > 1 would be more confirmation.
Relatedly, can you get a hit for a coordinate outside the viewport? x = -1, x > 640 or so?
Afaics user clip planes were not supported before d3ddevice7, so they won't influence picking.
I don't expect the depth test to influence the result, this would be rather difficult to implement. But you could e.g. enable the depth test and clear the depth buffer to 0.5 and show hits < 0.5 and > 0.5.
Culling is the most likely one to matter IMHO since it is easy to implement without consulting the GPU.