I thought a sure fire way to detect the number of sides of a polygon was via the vertex count of a polygon.
This does not seem to be the case when you mix triangles and quads.
This short script counts the number of sides for each face in the mesh. As you can see by the image there are two quads and two triangles and no duplicate vertices.
However the script gets it wrong. It prints out that there are in fact 3 quads and 1 triangle which is clearly not what is displayed in the viewport.
It was my mistake. I was specifying the shaders in the ginstance node instead of the polymesh. Arnold needs multi-material shaders specified in the polymesh 1st before you can override them in a ginstance. I am still learning about that render system.