Skip to content

CI: the always-on np 3 and np 4 runs move to shard 6; shard 4's limit 70 -> 80 - #1245

Merged
lmoresi merged 3 commits into
developmentfrom
ci/balance-shard-4
Nov 20, 2026
Merged

lmoresi merged 3 commits into
developmentfrom
ci/balance-shard-4

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

A CI balance fix, no issue. Review: H1, a session on a 96-thread Linux workstation that does review and parallel test runs.

Why

Shard 4 owns the whole np 2 parallel phase, and it is at its time limit on development itself:

run shard 4 limit
development, recent (46, 53, 66 and 52 min) up to 66 min 70
#1225 first run cancelled at 70 min 13 s (test_1103 at np 4, 9 s in) 70
#1225 re-run 68 min 37 s 70

Shard 4's test sessions sum to the same time on development and on #1225 (3,677 s against 3,681 s), so development's new test files cause the growth. The next file added there would cancel every PR.

Shard 4's phases on the #1225 re-run, from the log's timestamps:

phase time
install and build 4.6 min
serial batches 33.5 min
parallel batches at np 2 26.5 min
always-on runs at np 3 and np 4 (13 files) 3.4 min

Shard 6 had about 4 minutes of work.

Correction: this PR's first version split the parallel phase at the wrong timestamp. It counted most of the np 2 batches as the always-on runs ("20.3 min") and moved only those to shard 6. On this PR's first CI run, they took 3.4 min on shard 6. The second commit fixes the balance.

The change

  • np 2 batches alternate. The np 2 batches of tests/parallel/test_*.py alternate between shards 4 and 6: even-numbered batches run on shard 4, odd-numbered on shard 6 (parallel_batch_owned).
    • The batch boundaries are the unsharded ones, since a hang has followed a batch boundary before.
    • A new file adds to whichever shard its batch falls on, so neither shard grows alone.
    • An unsharded run (locally) still runs every batch.
    • The opt-in --full-parallel passes split the same way.
  • Always-on runs move. The always-on np 3 and np 4 runs move, unchanged, to a block owned by shard 6, under the same supervisor.
  • Timeout. timeout-minutes goes from 70 to 80 as headroom. The matrix job sets one limit for every shard.
  • Messages and comments. A non-owning shard's message names both shards. The comments that carried the 20-minute figure are corrected.

Measured

Every shard's job time in minutes. Runners vary by up to about 2x in CPU, so treat single runs as indicative.

run shard 1 shard 2 shard 3 shard 4 shard 5 shard 6 longest
before: #1225 re-run (development's layout) 33.8 50.2 33.2 68.6 27.2 3.8 68.6
first commit only (np 3/np 4 runs moved) 50.7 36.4 44.2 53.5 27.8 7.2 53.5
this PR (np 2 batches alternate as well) 35.8 28.4 44.5 41.7 22.6 23.1 44.5

Shard 4 is no longer the long pole. It went from 68.6 min to 41.7 min, against a limit of 80. Shard 6 now carries 23 min. The longest shard is shard 3, at 44.5 min.

Moving serial batches from shard 4 to shard 6 was also considered. It isn't needed with these numbers, so the serial assignment is unchanged.

Checks

  • bash -n scripts/test.sh: OK.
  • Batch ownership: with six shards, shard 4 takes batches 0, 2, 4, … and shard 6 takes 1, 3, …; unsharded, every batch runs.
  • scripts/test.sh --print-shards: [1,2,3,4,5,6], unchanged.
  • scripts/check_test_coverage.py: OK.

Underworld development team with AI support from Claude Code

… 70 -> 80

Shard 4 reached 68.5 of its 70 minutes on #1225's re-run and 66 on
development itself (the sum of its test sessions is the same on both): the
next file added would cancel every PR. Its always-on runs at three and four
ranks (oversubscribed on a two-core runner) took 20.3 of those minutes; they
now belong to shard 6, which had 4 minutes of work, under the same
supervisor. Shard 4's timeout-minutes goes from 70 to 80 as headroom.

Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 20, 2026 01:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

lmoresi and others added 2 commits November 20, 2026 12:41
The always-on np 3 and np 4 runs took 3.4 minutes on shard 6, not the 20
estimated for them: on #1225's shard 4 the np 2 batches were 26.5 of the
68.6 minutes. Sharded, the batches of tests/parallel/test_*.py now alternate:
even-numbered on shard 4, odd on shard 6. The batch boundaries are the
unsharded ones, and an unsharded run still runs every batch. The comments that
carried the 20-minute figure are corrected.

Underworld development team with AI support from Claude Code
@lmoresi
lmoresi merged commit acc2cba into development Nov 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants