Sort enum values so generation is stable.