Picking problem in OptiX7.1

I’m hitting an intermittent picking bug in a scene with multiple geometry instances. In the enclosed screenshot, the Pick origin and Pick direction debug info come from inside the kernel and show that the same ray is being generated but occasionally a different object is reported from optixGetInstanceIndex() inside the closest hit program.

Any ideas what might cause this behavior?

Windows 10 Home
Visual Studio Community 2019 version 16.7.2
GeForce RTX 2070 SUPER
Driver version 452.06
OptiX 7.1
CUDA 11.0

Is anything changing between the picking operations?

Maybe floating point inaccuracies?
Dump the origin and direction as unsigned int bit-fields to see if they are really identical.

Maybe highlight the picking pixel and the two instances to see their spatial relationship.
Dump the intersection distance as well.
Hitting a coplanar face or some geometry along the silhouette would be susceptible to LSB differences.

Thanks for the suggestions. Turned out to be a stupid error on my end and it’s working fine now.

BTW, I recently discovered shocker-0x15’s well designed and robust OptiX7_Utility project

He’s done a great job of taking much of the pain out of developing OptiX7 apps, especially for those of us had no CUDA programming experience prior to OptiX7’s arrival

I made a simple WIP demo app using the his library here.