sort the loaded variants by version before sorting by variant index, so we get the solver can take the higher version first