Partition an ordered list of tests across shard.total shards using deterministic
Longest Processing Time (LPT) greedy load balancing, and return the tests for
shard.index (1-based) in their original sequence order.
Key invariants:
Disjoint & complete partition: Every test in tests is assigned to exactly one shard
in 1..shard.total.
Order preservation: Within each shard, assigned tests are sorted back into their original
index order from tests, preserving all sequence invariants (including server-before-client).
Companion co-location: Linked bundle pairs (CO_LOCATED_BUNDLE_PAIRS, e.g.
realtime-session-guard + realtime-session-verification) are always placed in the same shard.
Uniform fallback: When all tests have equal weight, tie-breaking by bucket item count and
bucket index produces exact round-robin (i % total === index - 1) assignment.
Partition an ordered list of tests across
shard.totalshards using deterministic Longest Processing Time (LPT) greedy load balancing, and return the tests forshard.index(1-based) in their original sequence order.Key invariants:
testsis assigned to exactly one shard in1..shard.total.tests, preserving all sequence invariants (including server-before-client).CO_LOCATED_BUNDLE_PAIRS, e.g.realtime-session-guard+realtime-session-verification) are always placed in the same shard.i % total === index - 1) assignment.