roadmap PARTIAL

808. Every gate accounts for its time

(Promoted from the proposal pile on 2026-10-06 (UTC); number provisional until the merge queue lands it.)

(Ruled 2026-10-06 (UTC), calef on PR #1778, four forks. §254 (a gate prints what each item cost, and a job near its budget warns rather than fails) records them. Fork 2 went against this block's recommendation: per-suite budgets are refused, and a soft warning with a tracking issue replaces them. The text below is rewritten to the rulings.)

Raised 2026-10-06 (UTC) by lane gate-time-proposal, a writing-only lane. calef asked for a proposal measuring where the riscv64 suite's time goes, then: "Is there a more general milestone here? Don't we want all of the gates to account for how they spend their time?" The maintainer agreed. This is the general milestone. Its first slice, and the riscv64 answer, is milestone 807 (the kernel suite reports what each test cost), which this block depends on. Title and slug are drafts.

Why

Milestone 721 (each merge-group CI job has a 20-minute budget) gave every ci.yml job one number, its wall time, and a gate on it. That gate works. On 2026-10-06 it fired on cpu-matrix at 20.1 to 21.0 minutes and ejected pull requests from the queue, which is what PR #1775 answered by splitting the job in two.

A wall-time gate can say that a job is slow. It cannot say why. To answer that, PR #1775 sampled 31 runs over seventeen days and read per-step times from the Actions API. Per-model and per-test times had to be read from log timestamps. Its finding was that no step regressed and the suite grew, across many milestones, at about 0.1 minutes per model per day. The gate fired about two weeks into a drift that every run in the window showed.

So the rule this milestone builds: a gate that spends time says where, in a form a script can read, without anyone scraping a log.

What the tree already accounts for

Some gates do this already, each its own way:

gate what it records where
every ci.yml job its own wall time, against 20 minutes helpers/job-budget.py, .github/ci-job-budgets (milestone 721)
swish-check seconds per line, per leg, against a baseline xtask/src/swish_check.rs, milestone 722 (swish-check fails a leg that costs five times the others per line)
re-falsify seconds per harness, used to balance shards notes/project-metrics/falsification-times.tsv
fuzz 60 s per target, fixed by design script/fuzz
the kernel suite seconds per test, printed only at 5 s and over kernel/src/testing.rs
cpu-matrix one log per model, as an artifact ci.yml

Nothing reads CI time over weeks. script/metrics charts the merge queue's ejections, from milestone 724 (the merge queue reports its ejection share and its time to merge), but not the wall time of the jobs that cause them. verify.yml is outside milestone 721's budget because nobody measured its job medians, which is that milestone's first BUGS entry.

What "accounts for its time" means

Three levels. Each gate provides the ones that apply to it.

  1. Per step, for every job. GitHub's jobs API already returns each step's start and end, so this needs no change to any job. A daily collector reads it for green merge-group runs and appends a committed record. It follows helpers/merge_queue_share.py, which writes merge-queue-daily.csv the same way for milestone 724.
  2. Per phase, inside a step that does several things. script/ci-build test runs fifteen phases in one step: the host pass, std-src, three architectures, three x86_64 variants and the boot tour. xtask times each phase on the host and writes it to a machine-readable file per job (name provisional), uploaded as an artifact.
  3. Per item, for a gate made of many items: tests per architecture, Kani harnesses, fuzz targets, cpu-matrix models, swish-check lines. The item's own framework reports the time, never a log scrape. For the kernel suite that is milestone 807, in §254's time <ms> <test path> format. For swish-check and re-falsify it already exists and only moves into the shared file.

What the first read of per-step data already found

Run 37505448674 on 2026-10-06: 85 of script/bootstrap's 92 seconds in the test job were cargo install building script/lint's tools. Six jobs that never lint did it, about 8.5 runner-minutes per merge-group run. It was cheap and reversible, so it did not wait for this milestone: NIFE_SKIP_LINT_TOOLS (#1778) removed it.

What catches the next drift before the wall-time gate fires

The drift PR #1775 found was spread across about a hundred tests, which a per-test ceiling would not have seen. This block recommended a per-suite budget; calef refused it (§254, Fork 2), because a second hard limit fails whichever pull request tips an aggregate over, as cpu-matrix's budget did to #1755 and #1766. Milestone 721's job budget stays the only hard limit. In its place, a warning that fails nothing:

At the measured growth of about 0.1 minutes per model per day, the longer cpu-matrix shard would have opened its issue about three weeks before the hard limit. A script/lint check holds the rule itself: a ci.yml job that checks out the tree uploads the breakdown file or has an exemption line with its reason.

Where it lands

The runner-minutes measurement pass calef approved on 2026-10-05 is a one-off report on concurrency, and it stays owed. The daily record makes it repeatable by script.

Parity

The per-step record and the warning are host-side, so they are architecture-neutral. The per-test record is the kernel's shared test framework and lands on aarch64, riscv64 and x86_64 at once (milestone 807). The step summary and the chart show suites per architecture, because the three emulators cost differently: riscv64 system tests took 129 s against aarch64's 98 s in the run above. A suite that runs on fewer than three architectures says why in its exemption line, which is §19 (architectural parity is a tenet) applied to cost. Milestone 722 already compares cost across architectures for swish-check.

Exit criteria a stranger can check

  1. notes/project-metrics/ holds a daily CSV of per-job, per-step and per-test times for green runs on main of ci.yml and verify.yml, appended by a scheduled workflow on the pattern of helpers/merge_queue_share.py. script/metrics charts each job's weekly time against its milestone 721 budget.
  2. Every ci.yml job that checks out the tree uploads the breakdown file or carries an exemption line with a reason, and script/lint fails a job that does neither.
  3. The kernel suite on all three architectures, cpu-matrix, swish-check, re-falsify and fuzz write per-item times into that file from their own frameworks.
  4. A job's run on main past about 85% of its budget emits a warning, stays green, and lists its slowest suites and tests in the step summary. A host test proves the warning fires above the line, stays silent below it, and never changes the exit status.
  5. The routine opens a labeled tracking issue for a job that crosses the line, updates the same issue on a later crossing rather than opening a second, and closes it when the job is back under. A host test drives all three transitions against a recorded API fixture.
  6. An open budget issue appears in the session's needs-maintainer listing with cause budget, and leaves it when the issue closes. helpers/needs-maintainer-selftest.sh proves both from fixtures, and briefs/session-start.md and briefs/survey-the-queue.md give the one combined query.
  7. While a budget issue is open, the weekly job-time chart carries a bullet naming the job, its percentage of budget and the issue number, written through week-notes.csv, and the bullet ages out with its week.
  8. verify.yml joins milestone 721's budget, using the medians the record now has, which closes that milestone's first BUGS entry.
  9. Milestone 663 (bound the host pass) takes its deadline from the host pass's measured time in the record, as its block asks.

Cost

Ranking

This is not one of the nine fatal risks, and it is not on the customer path, which is vacant. It serves principle 2: queue throughput is the method, and the bottleneck since 2026-08-04 has been how fast one merge queue lands. A wall-time gate that fires late ejects pull requests, which is where lanes and tokens are lost. So it ranks below work that moves a fatal-risk verdict and above work that does neither. The bootstrap fix and the calendar fix are each under an hour of lane work and should go now on cost alone. The first slice should go when a lane frees. The rest can wait for it.

The forks, ruled by §254

All four were ruled on 2026-10-06 (UTC), in the order this block asked. §254 has calef's words and the refused options.

  1. The kernel record's format: the printed time <ms> <test path> block, grammar in a shared crate. Milestone 807 builds it.
  2. What gates drift: a soft warning at about 85% of the milestone 721 budget, raised as a labeled tracking issue per job. The per-suite budget this block recommended was refused.
  3. Where the per-run breakdown shows: step summary plus artifact, no pull request comment.
  4. The daily record and chart: a CSV under notes/project-metrics/ on milestone 724's pattern, charted weekly by script/metrics.

Reuse

Taken: GitHub's jobs API for per-step times, actions/upload-artifact for the file, and the step summary for display. Followed: helpers/verify_times.py and helpers/merge_queue_share.py for the daily record, and helpers/job-budget.py itself for the budget, the line and the job parser, which helpers/ci_job_times.py imports rather than copies. The issue routine calls gh issue directly; helpers/watcher_watch.py (milestone 723 (a stopped merge watcher is reported within three of its own intervals)) was read and is shaped around watchers. Written: the collector, the warning and the issue routine, a few hundred lines of Python against this tree's own record formats. JUnit XML was considered as the file's format and not taken, because no consumer here reads it.

What was considered and lost

What was built

Every name below is provisional.

Exit criteria

criterion state
1 the daily CSV per job, step and test, and the weekly chart met. Per-item rows start with the first daily pass after merge, when artifacts first carry their job key. Over 2026-10-18's 88 green runs they are 454 rows, 73 kB a day. ci_job_times.py --selftest holds the floor and the mapping
2 upload or exemption, held by script/lint met. time_record.py --selftest; deleting fmt's exemption line fails the lint naming fmt
3 per-item times from the kernel suite, cpu-matrix, swish-check, re-falsify and fuzz met. Run 39292789618 uploaded every record with rows: lines on three architectures, ten fuzz targets, the host pass. Re-falsify wrote rows in a local sweep; its first CI shard runs on a diff that reaches a record
4 the 85% warning, its summary, its host test met
5 the issue's three transitions, tested against a recorded fixture met
6 budget in the needs-maintainer listing, the selftest, the briefs met
7 a week-notes bullet while an issue is open met, through sync
8 verify.yml joins the budget met. To 2026-10-19 (UTC), prove shards ran 12 to 14 minutes, maximum 21.1 once in about 600 merge-group runs; re-falsify shards 8.5 to 10.8, maximum 18.3
9 milestone 663's deadline from the host pass's measured time not yet. Rows (test-shard, host / host crates, phase, suite) start 2026-10-19 20:40 (UTC). The week 2026-10-20 to 26 is recorded by the 2026-10-27 daily pass; the deadline is then milestone 663's work

BUGS

Follow-on

Index row

Milestone 721 gave every CI job a wall-time budget that says a job is slow but not why. This makes every gate report where its time goes, per step, per phase and per item, in a step summary and an artifact, with a daily record and a weekly chart against the budgets. A job on main past about 85% of its budget warns and opens a labeled tracking issue rather than failing (§254), so the next drift is named weeks before it ejects a pull request.