always sort inputs to final reduce by shard index