physics body velocity never goes to zero

I'm modeling rolling a pair of dice in SceneKit (it's for a part of an educational app that deals with histograms and probablity). The geometry for the dice physics bodies comes from a plain SCNBox. The dice are positioned over an SCNFloor, given a random vertical impulse and then gravity, collisions, friction, damping and restitution do their thing untill the the dice come to rest.


The first problem is determining when the roll is over. The dice visually stop moving a noticable interval before their velocities go to zero. I fixed that by setting a threshold. When the velocities go below the threshold the roll is considered over. The value for the threshold is an empirically determined number.


So far so good, this works fine...about 99% of the time. But about 1% of the time one of the velocities goes to zero and the other oscillates just above the threhhold. Visually that die is sitting on the floor vibrating very slightly. The roll never ends and the app stalls. I have tried every combination of gravity, friction, restitution, and damping I can think of without any success.


Any insight or suggestions greatly appreciated.