roadmap BUILT

807. The kernel suite reports what each test cost, and the riscv64 suite's time is explained

(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: "Yes on Fork 1, the printed block", and "Step summary plus artifact, with no PR comment". §254 (a gate prints what each item cost, and a job near its budget warns rather than fails) records all four rulings and the refused options. Milestone 808 (every gate accounts for its time) builds on this block.)

Raised 2026-10-06 (UTC) by lane gate-time-proposal, a writing-only lane, from calef's ask the same day: "Write up a proposal milestone that measures where the riscv64 suite's time goes." This is the first slice of milestone 808 (every gate accounts for its time). Title and slug are drafts.

Why this is its own milestone

The general milestone is open-ended. This slice is a few days of work, and two things already wait on it alone: whether cpu-matrix needs a third shard in about three weeks, and the deadline milestone 663 (bound the host pass) must take from a measurement. When a piece of work depends on part of a milestone, the tree splits the milestone rather than naming a rung inside it. So this slice has a number of its own, and milestone 808 depends on it.

What happened

PR #1775 split cpu-matrix into two shards, because the job had reached 20.1 to 21.0 minutes against milestone 721 (each merge-group CI job has a 20-minute budget). Its measurement covered 31 green merge-group runs on main from 2026-09-20 to 2026-10-06. No step regressed. Each riscv64 model's boot went from 1.6 to 3.1 minutes because the suite grew: the riscv64 section of test went from 358 to 457 tests, and from about 47 to 110 seconds of test time. Growth runs about 0.1 minutes per model per day. The longer shard reaches 20 minutes again in about three weeks.

Every per-test number in that pull request was scraped from the timestamps GitHub stamps on log lines. That is the gap this slice closes.

The suite already measures each test, and throws the number away

Testable::run in kernel/src/testing.rs stamps arch::timer::now() before each test, because the per-test ceiling needs a start time. After the test it computes the elapsed seconds and prints [N s] only when the figure reaches SLOW_REPORT_SECONDS, which is 5. Below that the number is discarded. So the instrument exists on all three architectures; it is the record that is missing.

The console is the only channel all three architectures share. aarch64 and riscv64 exit through semihosting, but x86_64 exits through QEMU's isa-debug-exit device (kernel/src/arch/x86_64/semihosting.rs), which has no file I/O. So the record has to travel in the transcript, and xtask has to parse it, as it already parses test result: lines in xtask/src/suite.rs.

Where the riscv64 suite's time goes, scraped once

One run, to check the premise before building on it: the green merge-group run 37505448674 at 34cfc9c93, test job, 2026-10-06 17:41 to 17:56 UTC (14.9 minutes). Per-test times are deltas between consecutive test ... lines, so each includes the output printed between them.

The riscv64 leg took 160.5 s:

phase seconds
build and boot to the kernel's running line 19.1
kernel unit tests (137) 6.4
build and boot system_tests 6.1
system_tests (320) 129.0

The same system tests took 98.3 s on aarch64 and 59.6 s on x86_64, where 46 of 299 skip. Five modules hold 84 of riscv64's 129 seconds:

module riscv64 s aarch64 s
compositor_tests 24.5 14.1
login_tests 18.0 11.4
riscv_virtual_io_tests 14.8 (riscv64 only)
display_tests 14.6 9.3
timetable_tests 12.2 11.6

Two tests hold 20 of the 129 seconds:

This scrape reads 129 s where PR #1775 read about 110 s for the same section, on a different run and with a different cut. Two scrapes of one suite disagreeing by 17% is the argument for having the framework report its own numbers.

What to build

Exit criteria a stranger can check

  1. cargo xtask test on a clean checkout prints a per-test timing record for every image on aarch64, riscv64 and x86_64, in §254's format, and writes the per-job file. A host test in the shared crate proves the parser round-trips a line and rejects a malformed one.
  2. The latest green merge-group run of test and of cpu-matrix has the file as an artifact, and it names every test the transcript names, with no gaps. Its step summary lists the slowest tests.
  3. On each architecture the cross-check holds for every image, and a host test proves that it fails when the two clocks disagree.
  4. The notes page exists, cites the runs it read by id, and gives the riscv64 answer per module.
  5. The calendar test's waits are fixed or refused in writing, and the display test has a measured explanation.

Cost

Reuse

The guest side is kernel code, written here by rule. It reuses the start stamp the ceiling already takes. The host side reuses xtask/src/suite.rs's transcript reading. libtest's JSON event format was considered for the record and not taken: it is unstable on nightly, and it would make a kernel console line depend on a format rustc may change.

What was considered and lost

The fork, ruled by §254

Fork 1, the record's format, was an architect's call because two programs agree on it, the kernel and xtask. calef took the recommendation: a block after the suite, one line per test, shaped time <milliseconds> <full test path>, its grammar in a shared crate and never a #[path] module. It leaves every existing line unchanged, it is greppable, and it costs one parser. The crate's name is provisional.

What was built

Lane lane/807-kernel-test-cost, pull request #1819, 2026-10-07 (UTC). Every name below is provisional.

Exit criteria, as built

criterion state
1 the record on three architectures, the per-job file, a parser host test met: run 37650753759 recorded every image of aarch64, riscv64 and x86_64 (PVH, AMD-Vi, root port and OVMF); crates/test_times has the round trip and the refusals
2 the artifact and step summary from a merge-group run, with no gaps met on a dispatched run (37650753759); the gap check fails the leg otherwise. The first merge-group run follows the merge
3 the cross-check holds everywhere, and a host test proves it can fail met: guest over host was 0.97 to 1.00 on every PVH image and 0.65 and 0.80 under OVMF; the_clock_check_fails_when_the_guest_and_host_disagree
4 the notes page over ten or more merge-group runs met: notes/kernel-suite-time.md reads 30 merge-group runs by id. It says plainly what it cannot explain: nothing before 2026-10-15 was recorded, and about 22 s of the riscv64 suite's growth since 2026-10-06 is unattributed
5 the calendar waits fixed or refused; the display test explained met. The calendar test fell from 10.5 s to 2.4 to 2.7 s with #1779. The display test is below

What the first record says

Run 37650753759, one run, so a premise check and not a baseline:

BUGS

Follow-on

Index row

The kernel suite already times each test for its ceiling and discards the number below 5 s. This milestone prints every test's time in a shared format on all three architectures, upload it from test and cpu-matrix, and answer where riscv64's 129 s of system tests go.