Skip to content

infra(ci): start the macOS/Windows Rust lanes with Fast Gate (#2985) - #2999

Merged
zackees merged 2 commits into
masterfrom
infra/2985-platform-lanes-overlap-gate
Oct 30, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/2985-platform-lanes-overlap-gate

Conversation

@zackees

@zackees zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member

What

rust-tests-macos, rust-tests-windows, rust-tier2-macos and rust-tier2-windows no longer needs: rust-tests-linux, so they are created together with Fast Gate instead of after it. rust-cross-lint keeps its gate (see below).

RED

cf979c0e3 (first commit of the branch) adds ci/test_platform_lane_overlap.py and fails on the unmodified workflow — 8 failures in 5 tests, one per lane and per assertion:

AssertionError: 'rust-tests-linux' unexpectedly found in {'ci-mode', 'check-event', 'rust-tests-linux'}
  test_platform_lanes_have_no_fast_gate_ancestor (lane='rust-tests-macos')
  ... rust-tests-windows, rust-tier2-macos, rust-tier2-windows

ci/test_rust_scope.py::test_costly_lanes_wait_for_the_fast_gate pinned the old arrangement; it is renamed test_costly_lanes_overlap_the_fast_gate in the GREEN commit and keeps asserting that rust-cross-lint still waits.

GREEN

84567914 drops the gate from the four lanes' needs and from their if: (needs.rust-tests-linux.result != 'failure' would otherwise be a dangling reference).

Why this is the trade the issue asks for

The lanes consume none of Fast Gate's output, and needs is static in GitHub Actions, so "keep the gate on pull_request" cannot be expressed: the choice is every event or none. The issue's option (a) is the one that gets the wall time back, and the repo already carries the same decision for Tier 2 compilation (#966/ci/test_tier2_compile_overlap.py: "Compilation consumes no Fast Gate output and can overlap its runner").

Measured, merge-queue run 40993230941 (a PR touching macOS and Windows code — the only lane shape this shortens):

job started ended
Fast Gate ⚡ 02:42:46 02:46:22
Rust Tests (macos-26) 02:46:25 02:49:44
Rust Tests (windows-2025-vs2026) 02:46:25 02:50:01
Rust Tier 2 (macos-26) 02:46:25 03:00:49
Rust Tier 2 (windows-2025-vs2026) 02:46:25 03:00:46

The critical path was 14.4 min and 3.6 min of it was the gate's own duration. In runs where the gate replayed lane proofs it was 1.8–3.6 min; on a PR run in the same window (#2593 recorded 10.4–11.2 min) it is longer.

Failure gating does not move

A red Fast Gate still fails the run: ci.yml's CI Gate ✅ lists every job of the run attempt (ci/gate_jobs.py, #1793), so the required check goes red even though the platform lanes started early. test_a_failed_fast_gate_still_fails_the_run pins that wiring.

The cost this moves: on a PR whose Fast Gate fails, the platform lanes now run to completion on an already-red run instead of never starting. In the last 40 PR runs, 3 of 20 sampled had a failed Fast Gate; those were the only ones where the wasted runner time appears. Cancelling the siblings on gate failure would need actions: write, which this workflow deliberately withholds from every job.

rust-cross-lint stays gated: it runs on the gate's own ubuntu-26.04 pool, so starting it early saves no wall time and would only spend a runner on a rejected diff.

Tests

  • cd ci && uv run --no-project python -m unittest discover -s . -p 'test_*.py' → 2060 tests, 3 pre-existing failures unrelated to this branch (test_check_changes.OutputsTest, test_master_scope_base, test_flatpak_manifest_validator); test_check_changes fails identically on clean origin/master with the branch stashed, the other two are cwd-relative and pass from the repo root.
  • Targeted: test_platform_lane_overlap, test_rust_scope, test_tier2_compile_overlap, test_ci_job_timeouts, test_gate_jobs, test_merge_queue, test_ci_scope, test_ci_toml → OK.
  • ruff check clean on both touched files.

Acceptance left for the merge

The second acceptance criterion in the issue — "a queue run shows them starting with Fast Gate" — is only observable on a merge_group run of this branch's result. The first queue run after this lands is that evidence; if it shows anything else, this PR's body is wrong and the change should be reverted rather than patched around.

Refs #2985

…2985)

RED: the four platform lanes still depend on rust-tests-linux, so
test_platform_lanes_have_no_fast_gate_ancestor fails for each of them
(8 failures in 5 tests).

The pin records the measured cost (3.6 min of a 14.4 min platform critical
path on merge-queue run 40993230941) and the run-level failure gate
(ci/gate_jobs.py in CI Gate) that keeps a red Fast Gate out of a merge once
the lanes no longer wait for it.
The four platform Rust lanes needed rust-tests-linux only to avoid
spending a macOS/Windows runner on a diff Fast Gate rejects. They consume
none of its output, and GitHub cannot express a per-event `needs`, so every
merge paid the gate's duration on its critical path: on merge-queue run
40993230941 the platform lanes started at 02:46:25 after a gate that ran
02:42:46-02:46:22, and Rust Tier 2 (macos-26) ended at 03:00:49 of a
03:01:05 run -- 3.6 min of a 14.4 min critical path that the gate owned.

Drop the gate from the needs of rust-tests-macos, rust-tests-windows,
rust-tier2-macos and rust-tier2-windows. This is the same decision
rust-linux-tier2-build already carries ("Compilation consumes no Fast Gate
output and can overlap its runner").

Merge protection does not move: a failed Fast Gate still fails the run,
because ci.yml's CI Gate lists every job of the run attempt
(ci/gate_jobs.py, #1793) and the caller's required check sees it. What
changes is only when the platform runners start. rust-cross-lint keeps its
gate: it runs on the gate's own Linux pool, so an early start saves no
wall time.

Trade recorded in the PR: on the 3 of the last 20 PR runs whose Fast Gate
failed, the platform lanes now run to completion on a red run instead of
not starting. Cancelling them would need actions: write, which this
workflow deliberately withholds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant