Building position map when materializing variants.