Skip to content

ci(unittest-ordering): shard the protocols leg into internet and the rest (#1029) - #1032

Merged
JarryShaw merged 1 commit into
mainfrom
ci/split-protocols-leg
Oct 5, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
ci/split-protocols-leg

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • ci — workflows or build tooling

Description of your pull request and other information

Closes #1029. Splits the protocols cell of unittest-ordering into protocols/internet and protocols (rest) (protocols --exclude protocols/internet). run_unittest_leg.py gains sub-path legs and a repeatable --exclude; the nine other cells run as before. Cap stays 45.

Measured on CI: protocols 27.8m unsharded (run 37334173854, #1031) -> protocols/internet 8.2m, protocols (rest) 7.6m (run 37341197811, this PR). Controls foundation 6.2 -> 6.4m, const 6.0 -> 6.1m. Baseline is the same-hour 27.8m (matching controls), not #1029's 30.4m, its quiet-runner re-run after a window of cancelled runs.

Cost (from leg_modules on the rebased tree; pairs are C(n,2)): 51 modules in tests/protocols; 1275 pairs co-ran, 807 after (internet 66 + rest 741), 468 lost. The 255 module-then-root pairs all survive. Moving the 10 direct modules into internet would keep 637 and slow the slower cell. A third cell would save under 2 minutes (next slowest leg is 6.4m).

Alternative, timeout-minutes: 60: keeps all pairs but leaves a ~28-minute cell. Sharding was taken for the headroom the issue asked for.

New tests/project/test_unittest_ordering_shards.py pins disjoint shards, union = old leg, other cells plain; fails on main (6 of 7). workflows.rst now says eleven cells and its unit-tests.yml:<line> citations are re-pointed.

@JarryShaw JarryShaw added ci Pull requests that change CI or workflow configuration (ci: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 5, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on c79b1d797: NEEDS CHANGES (ran on Opus; authored on Sonnet). Prose only — the mechanism is sound.

Confirmed: the nine other cells collect identical module tuples, order included; the shards are disjoint and their union is exactly the old leg; both shards run directory modules first, root modules second; the new test fails 6/7 against main and fails on exactly the sharding assertion with only the workflow reverted. Invalid sub-paths, .. traversal and out-of-leg --exclude are all rejected.

Measured on CI, run 37341197811 — this supersedes the estimate in the comment. Against #1031's run an hour earlier (37334173854): protocols 27.8m unsharded → protocols/internet 8.2m, protocols (rest) 7.6m. Controls foundation 6.2→6.4m and const 6.0→6.1m, so the runners compare. All 11 cells exist and pass, which settles the matrix-expansion questions.

Changes needed:

  1. Rebase onto main. feat(protocols)!: move OSPF and RARP to the application layer (#719) #1031 added three modules under tests/protocols/application/, so the comment's counts go stale on merge. Re-derived on a merge with 30714cd51: 51 modules; 1275 pairs before, 807 after (66 + 741), 468 lost; 255 protocols×root. The "if moved to internet" figure becomes 637.
  2. Replace "about 15 minutes on CI if CI scales" with the measured 8.2m. The estimate divided a real-CLI figure (541s) by a per-test-timer one (1086s); on consistent units it would have been 17.7m. That no longer matters now that CI has been measured.
  3. docs/source/contributing/workflows.rst:210 says "ten tests/ legs". It becomes wrong when this merges, so update it here.

Measurement detail is on #1029.

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 5, 2026
@JarryShaw
JarryShaw force-pushed the ci/split-protocols-leg branch from c79b1d7 to b863da4 Compare October 5, 2026 17:00
@JarryShaw JarryShaw added review: pending No verdict for the current head - never reviewed, or the head moved since the last one and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 5, 2026
@JarryShaw
JarryShaw force-pushed the ci/split-protocols-leg branch 2 times, most recently from 1280c89 to 149d29f Compare October 5, 2026 17:03
@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 5, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on 149d29ff3: NEEDS CHANGES (ran on Opus; authored on Sonnet). Prose only. The mechanism, counts, CI figures and citations all hold.

Confirmed: the CI figures match the jobs API (27.78m; 8.20m / 7.58m; controls 6.20→6.40m and 6.03→6.13m). The counts match (51 modules, 1275 → 807, 468 lost, 255, 637). Every shifted unit-tests.yml citation in workflows.rst and releasing.rst points at the same lines it did on main. A repo-wide grep finds no other line or leg-count pins. There are 8 jobs and no duplicate keys. Since round 1 the script changed only in its docstring and the test not at all; it passes 7/7.

Changes needed:

  1. The 30.4m attribution is backwards, and the error was mine. I wrote it into the brief and into my CI: Plain unittest ordering (protocols) doubled and now cancels at its 45-minute cap on main #1029 comment. CI: Plain unittest ordering (protocols) doubled and now cancels at its 45-minute cap on main #1029 places the slow window at about 10:49Z–13:20Z, when runs were cancelled at 45.3m and up. 30.4m is the 14:17Z re-run after that window, and CI: Plain unittest ordering (protocols) doubled and now cancels at its 45-minute cap on main #1029 cites it as the quiet-runner figure. Fix unit-tests.yml:814-815 and the PR body: keep 27.8m as the same-hour baseline, and describe 30.4m as the quiet-runner figure (quiet runs measured 22.6–30.4m). At :887-888, size the headroom against the ≥45m cancellations, not "about 1.1x". The slowdown CI: Plain unittest ordering (protocols) doubled and now cancels at its 45-minute cap on main #1029 saw was at least 45.3/27.8 ≈ 1.6x. The conclusion stands: 8.2m × 1.6 ≈ 13m.
  2. :779, :784 and :791 still say one leg per matrix cell or top-level directory. protocols is now two cells, so those sentences are false. Also :796: "about 6.2" needs a unit.

@JarryShaw JarryShaw added review: needs-changes Cross-review at the current head says changes are required; see the verdict comment and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 5, 2026
…rest (#1029)

- The `protocols` cell took 27.8m on CI (30.4m in #1029) against the
  45-minute cap. It is now `protocols/internet` and `protocols (rest)`
  (`protocols --exclude protocols/internet`): 8.2m and 7.6m on CI.
- `util/run_unittest_leg.py` accepts a sub-path leg and a repeatable
  `--exclude`; the other nine cells run as before.
- New `tests/project/test_unittest_ordering_shards.py` pins that the shards
  are disjoint, their union is the old leg, and other cells are plain.
- `workflows.rst`: eleven matrix cells, and the `unit-tests.yml:<line>`
  citations shifted by the inserted comment.

Narrow run of the new test only: 7 passed.
@JarryShaw
JarryShaw force-pushed the ci/split-protocols-leg branch from 149d29f to 0186451 Compare October 5, 2026 17:10
@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet and removed review: needs-changes Cross-review at the current head says changes are required; see the verdict comment labels Oct 5, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on 0186451e7: GOOD TO GO (ran on Opus; authored on Sonnet). Both round-2 findings are addressed.

  • The 30.4m figure is now described correctly. It is CI: Plain unittest ordering (protocols) doubled and now cancels at its 45-minute cap on main #1029's quiet-runner re-run at 14:17Z, after the 10:49Z–13:20Z window. The window's runs were all cancelled at 45.3–55.0m. Headroom is now sized against the fastest of those cancelled runs: 45.3/27.8 = 1.63x, stated as a lower bound, which puts the 8.2m cell at about 13.4m. The PR body says the same.
  • "One leg per cell" is true again. :779, :785 and :793 now account for the two protocols cells, and :799 gives 6.2 a unit and a source.
  • The renumbering is right. The file grows +58 (1167 → 1225). All 10 shifted citations in workflows.rst and releasing.rst point at the same lines they did on main. The other 22 sit above the inserted block or cite other workflow files, 32 in total. No unit-tests.yml citation past the insertion point was left unshifted.
  • No code changed since round 2. The YAML has zero changed non-comment lines, and util/ and tests/ are untouched. 8 jobs, 11 cells; the test passes 7/7.

The previous head's run, 37345564685, was cancelled because the next push superseded it (cancel-in-progress on pull_request, unit-tests.yml:40). It was not a timeout. This head's run is 37346495801. I will confirm its sharded timings against 8.2m / 7.6m when it finishes.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 5, 2026
@JarryShaw
JarryShaw merged commit b92ea84 into main Oct 5, 2026
74 checks passed
@JarryShaw
JarryShaw deleted the ci/split-protocols-leg branch October 5, 2026 17:45
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 5, 2026
@JarryShaw JarryShaw added this to the 1.5 milestone Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pull requests that change CI or workflow configuration (ci: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

CI: Plain unittest ordering (protocols) doubled and now cancels at its 45-minute cap on main

1 participant