Issue #2477: CI’s test shards are balanced by measured duration, not round-robin by name

Open and answer this issue on GitHub.

blocked, ci · opened 2026-11-21 · updated 2026-11-21 · 1 comment

Part of the ci lane’s goal, a short CI run.

Facts: CI and caches

After #2474 After #2476

What happens today

The suite’s test shards (.github/workflows/suite.yml, matrix shard) are uneven. Two recent x86 runs on develop, in seconds:

The run lasts as long as its slowest shard, so compiler-2 sets the length at about 610 s while five shards finish under 260 s. compiler-K takes every K-th program by sorted name, and it-K every K-th short test, so a few long programs landing together make one shard long.

To build

  1. Take each program’s and each short test’s duration from the logs of the latest five develop runs on both architectures. Use the per-test times the runner prints.
  2. Assign compiler-* programs and it-* tests to shards by measured duration, longest first onto the shortest shard, instead of round-robin by name. Keep the durations in a committed file that the shard script reads. A program with no entry goes round-robin as today.
  3. A tools/*.nika subcommand, or a script run with nikaia run, rewrites that file from a run’s logs. Write no Python or shell.
  4. If the measured sums show the heavy-* and ledgers shards can share runners, merge them. Keep the comment in the workflow on why they are split true.

Done when

Files and limits

Comments

keywan-ghadami, 2026-11-21

Driver: not queued, this issue waits for #2474, #2476, which is still open (#1819). Set ready again when it is closed.


Generated by Claude Code

Back to Open Issues