[SATYR PATCH 3/6] Make thread distance type-agnostic