[INTERNAL] ensure sortedness in x