Repository navigation
Gate caps from measured leg walls instead of a hand table; weekly CI cap report (#8701) - #9124
Merged
Merged
Conversation
…port (#8701) The Full Suite Gate's caps came from per-test durations x hand-set speeds, floored by SLOWEST_SEEN_MIN, a table a person re-typed after each red night (#8944 speed, #8975 pin: bump, fail, bump). suite_shard_plan.py --gate --history-runs now reads the wall of each (os, python, parts) leg over the latest 10 scheduled runs (the plan job already had a token): with 3+ observations the measured worst x 1.3 floors the cap, and a leg measured over its target at n parts is planned with one more part (up to the pool cap) before its cap is raised. A cut leg counts at its cap, so a killed leg raises its own next cap. History that cannot be read never fails the plan. ci-cap-report.yml runs the two tight-cap tools (ci_cap_headroom.py, gate_leg_margin.py) weekly; a tight cap is a red run, which Main Watch turns into an issue the fleet works. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
squid-protocol
marked this pull request as ready for review
November 23, 2026 15:31
Contributor
…and det-mutation from measured wall time; bound the ctags install that hung job_cap_plan.py plans a job's timeout-minutes as worst measured wall x 1.3 clamped to [floor, ceiling] and falls back to the workflow's current literal when history cannot be read (never fails the workflow). A job stopped in a setup step is a hang, not evidence the work needs longer: both tri-comparison runs stopped at 30 min were 'Install universal-ctags' hung ~29 min (normal job <= 8 min), so their cap goes to 15 and the install is bounded (3 attempts x 180 s under a 12-min step cap, in tri-comparison-audit, tri-comparison-history and doom-rosetta). det-mutation: the literal 150 was 1.2x its worst real run (124.7 min); it is now planned (floor 150 so det_mutation.py's 130-min budget still ends the work first). Existing tests that pinned the old literals are taught to read the planned fallback; the network-inventory doc and the apt line table are updated. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… planner test independent of the committed durations - test_every_workflow_is_a_listed_gate_or_says_why_not: ci-cap-report.yml goes in NOT_GATES with its reason. - test_a_leg_measured_slow_at_n_parts...: it read the real durations, and in CI's merge with main Windows 3.12 already planned 4 of 4 parts (GATE_MAX_PARTS), so it could not add a fifth. Now pins the maximum: with room it adds a part; at the maximum it adds none and the cap still covers worst x 1.3. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why the Windows leg kept timing out (#8701)
Short answer: yes, it was "bump, fail, bump", but not in the YAML. The Full Suite Gate's caps were already planner-written (#5919), so there was no literal
25to bump. The bumping moved into two hand-typed inputs of the planner:SLOWEST_SEEN_MIN, a table a person re-typed with the number from the last failure (25 for Windows 3.12: Gate: pin the Windows step cap 3+ min over the slowest seen part (Part of #8701) #8975).Windows 3.12 shard 1 was planned for 18 minutes and measured 25 (all tests green, killed at the cap). Over the last 12 nightly Gate runs the Gate failed or was cancelled on 6 nights. Over the same 12 runs the measured walls were (p50 / p95 / max minutes): Windows 3.12 at 2 parts 18.9 / 25.1 / 25.1 (cut twice), Windows 3.11 at 3 parts 15.7 / 19.1 / 21.1 (once within 1 minute of its cap), macOS about 10 / 18 / 19.5, Ubuntu 9.3 / 17.2 / 17.4. Runner speed varies by about 30%, so a cap planned near the median fails on the slow night.
Two tools that measure exactly this already existed (
ci_cap_headroom.py#5156,gate_leg_margin.py#8701), but nothing ever ran them.What this changes
suite_shard_plan.py --gate --history-runs 10reads the measured wall of each (os, python, parts) leg over the latest 10 scheduled runs (the plan job already had a token and an API call). With 3 or more observations the measured worst wall x 1.3 floors the cap. A leg measured over its target at n parts is planned with one more part (up to the pool cap) before its cap is raised. A leg that was killed counts at its cap, so it raises its own next cap. History it cannot read never fails the plan; the table is the fallback and history only raises a cap above the durations plan, never cuts under it.CI cap reportruns both existing tools (literal caps and Gate legs). A tight cap makes the run red, Main Watch opensmain is red: CI cap report, and the fleet works that issue.With today's history the live plan gives the same caps as before (Windows 3.12 at 3 parts has only 2 observations), so this changes nothing today. It changes what happens the next time a leg slows down.
Checked
--history-runs 10against GitHub ran and printed today's caps.gate_leg_margin.pyandci_rerun_stats.py, which a PR run of the Gate will exercise.The other 96 jobs (measured today with the existing
ci_cap_headroom.py, last 4 runs per workflow since 11-01)98 literal-cap jobs reported, 4 tight, 10 with no recent run. Most have 5-75x headroom, so the Gate was the outlier. The tight ones:
evidence-refresh.ymldet-mutation: cap 150 min, worst 104 min on the first four runs (1.4x); 124.7 min over 30 runs (1.2x)graph-accuracy-audit.yml: cap 25 min, worst 18.4 min (1.4x)tri-comparison-audit.ymlandtri-comparison-history.yml: a run was stopped at 30.3 / 30.2 min by their 30-min capThe four are fixed in the second commit (below).
The four other tight caps, planned the same way (second commit)
A small shared tool,
tests/tools/job_cap_plan.py, plans a job'stimeout-minutesas the worst measured wall of its recent runs x 1.3, clamped to a floor and a ceiling, and writes it as a plan-job output. Each workflow reads it astimeout-minutes: ${{ fromJSON(needs.<plan>.outputs.cap || '<old literal>') }}. If history cannot be read, or there are fewer than 5 runs, nothing is written and the old literal applies. It never fails the workflow, and one run whose jobs cannot be read (a transient 502) is skipped, not fatal.timeout 180, inside a 12-minute step cap (ci_retryretries a failed attempt but never a hung one). The same install indoom-rosetta.ymlgets the same fix.The weekly cap report no longer lists these four, because a planned cap is the planner's (the report only audits literal caps), and the Gate legs stay covered by
gate_leg_margin.py.Tested: 16 new tests (the maths and clamps, hang versus slow using the real tri-comparison shapes, matrix legs, unreadable history, one unreadable run, and the wiring of all four workflows plus the three ctags steps). The 1,055 related workflow and plan tests pass; ruff is clean on the new files (the remaining findings in files I touched are on main too). Existing tests that pinned the old literals were taught to read the planned fallback, the generated network-inventory doc was regenerated, and the known-
aptline table was moved for the shifted lines.Not verified: none of the five workflows have run in Actions with the new steps. The first PR run of each exercises them, and a failed plan step falls back to the old literal. Live, the planner reads today's history as above.
Not done
96 jobs across 55 workflows still have a literal
timeout-minutesand only 10 are planner-driven. This PR does not rewrite those; the weekly report tells you which ones are tight.🤖 Generated with Claude Code