The issue was in the optimization code path for opaque shadow rays which was wrongly considering all primitives in the node to have same visibility flags.
The issue was in the optimization code path for opaque shadow rays which was wrongly considering all primitives in the node to have same visibility flags.