roadmap BUILT

249. The boot lottery is sampled by a person walking to the board, so nine draws is a whole evening

Minted 2026-09-03 by calef, who asked during the boot series whether the soak could reboot itself, and built the same day on milestone/249-self-rebooting-soak. (Number provisional until the merge queue lands it.)

It is the second kind the roadmap README distinguishes: the board is here and this needs a person at it. The mechanism, the escape and the reader are built and are green on what a host can gate; radon's first answer, from 2026-09-04, is recorded below. See What was built, with the board powered off below, and notes/soak.md's procedure, whose first four steps are the ones a lane cannot take.

PARTIAL rather than IN-PROGRESS, deliberately. Building the mechanism shipped; running the series is a bench session, with nothing a lane could pick up and no branch to name, which is what IN-PROGRESS is for. Milestone 218 (every boot of the VisionFive 2 needs a human) answered NOT-STARTED a day earlier, correctly, because it has one phase and none of it had happened. Here a real artifact exists, and saying otherwise would make the column lie in the other direction.

In brief. On 2026-09-03 nine boots of radon produced a fifteenfold throughput range, and milestone 240's census explained it: rate tracks the number of cores free of grinders and carrying an IPC group. Every one of those nine draws cost calef a walk to the board and the maintainer a capture.

The distribution is the thing that is missing, and nine draws barely sketch it. Counting by rate, the nine landed at two clean cores six times, one clean core twice, and zero once. Three and four clean cores have never been drawn at all, so the top of the curve is unmeasured and it is unknown whether it is rare or structurally unreachable. A hundred draws would answer that; nine cannot.

The mechanism already exists and is called with the wrong argument

kernel/src/arch/riscv64/semihosting.rs calls SBI's system_reset today, under the board feature, to power the board off at the end of a test run:

const SRST_RESET_TYPE_SHUTDOWN: usize = 0;

SRST defines reset type 0 as shutdown and 1 as cold reboot. So a self-rebooting soak is one constant and a timer, over an ecall this project already knows radon's OpenSBI honors, because the shutdown path is in use. Milestone 218's boot.scr then drives the next boot with nothing typed at it, which was proven on this board for the first time the same evening.

The hazard, which is the part to design first

A board that reboots itself on a timer is a board nobody can get back. Every boot runs the same image and reboots again, so short of pulling power and rewriting the card there is no way to reach a normal boot. That is worse than the problem being solved, and it is the reason this is a milestone rather than a one-line change somebody makes in an afternoon.

The escape suggested by the situation: before rebooting, check whether a byte has arrived on the UART. A console is attached for the whole series anyway, the kernel already reads that device, and it makes stopping the loop as cheap as pressing a key. Other shapes exist (a bounded count, a build-time cap) and the choice is this milestone's, but something must make an unattended loop stoppable without physical access.

What was built, with the board powered off

radon was unpowered on the evening of 2026-09-03 and this lane could not touch it, which is the same condition milestone 87's UEFI lane worked in and is why the deliverable is shaped the way that one's was. The mechanism, and a bench procedure detailed enough that the person who can reach the board spends their time on the machine rather than on reconstructing what to type.

The build without the feature is byte-for-byte the build that was there before, and that was measured rather than argued. The release riscv64 --features board kernel was disassembled at this branch and at its base commit, with the four edited kernel files swapped and nothing else touched. The two disassemblies differ on 216 lines and every one of them is an LLVM local-symbol disambiguator (....llvm.<hash>, which is a hash of the module's text and changes when a comment does). Not one instruction differs, so the plain board build, the plain soak build and every QEMU run are untouched by construction and by measurement:

$ diff before.asm after.asm | grep -E '^[<>]' | grep -vc '\.llvm\.'
0

The one edit that a board build without reboot_soak even compiles is sbi_system_reset taking its reset type as a parameter and returning sbiret.error. Its existing caller passes the same constant it always did, and the disassembly above is what says the compiler agrees.

What is not built, and the reason it is not: a distribution. That is this milestone's stated proof and it requires the board.

The hazard, designed first, and what each layer buys

Four things make the loop stoppable without physical access (the requirement above), listed strongest-first in AGENTS.md's ladder because the ordering is the argument.

  1. The loop exists only in a build that asked for it, by a name carrying the word reboot. boot_lottery was the other candidate and was refused: it names the finding, and the flag is met by an operator about to write a card that makes their board reset itself. The name has to say what the machine will do.
  2. A build that cannot reboot must not pass for one. It would look exactly like a board that drew the same placement fifty times. script/soak-test --reboot fails any build that does not come back.
  3. The kernel polls the console UART's data-ready bit, every beat and again through the five seconds before each reset. The bit is sticky (set while a byte is unread, cleared only by reading it, and nothing in a soak boot reads it), so a five-second poll cannot miss a keypress: the question is "has anyone typed since this armed", not "is anyone typing now". Any byte counts, so nothing has to agree on a character.
  4. Stopping disarms the reboot and leaves the soak running, rather than halting. This is the half of the design worth arguing for, because the obvious answer is to halt. Stage::Soak has already told serial_console that silence after a soak starts is a hang, so a halting escape would report itself as the exact failure this instrument exists to detect. It would throw the run away to get the board back. Disarming leaves the board in milestone 219's understood state, still beating, and costs nothing.

And one that needs no cooperation from this kernel: U-Boot's autoboot countdown runs on every one of these boots, and anything typed at it lands the board at StarFive #. That is a two-second window rather than a five-second one, which is why it is the fallback rather than the design, and it is exactly the escape a person had before milestone 218 removed the need for it.

What was refused, and why

A bounded reboot count. The obvious rung-one answer, and it cannot be built here. A cold reset takes the RAM, and the only persistent store on this path is the U-Boot environment in the SPI flash of the only board of its kind this project owns. Milestone 218 already refused to write to it, for the same reason. What is bounded instead is the wall clock per draw, which is weaker and is stated as such: the board never wedges in the loop, it only stays in it.

A magic stop character. Refused because it is a thing two programs would have to agree on, for no gain: any byte is strictly easier to send and cannot be got wrong by a person at a terminal.

Rebooting on a failure. The reset is asked for after the beat's verdict, and panic! diverges, so a soak that found something keeps its evidence.

Nothing in this kernel can prove the escape is reachable, because a UART cannot receive a byte it sends. A receive path that is miswired, unpowered at the adapter, or held by something else reads "nobody typed" forever, which is indistinguishable from nobody typing. What closes that is step 4 of the procedure: press a key on the first boot and confirm soak-reboot: DISARMED before walking away. That is rung four wearing a procedure's clothes, it is the lowest rung in the design, and it is in the BUGS sections of both kernel/src/soak.rs and notes/soak.md as well as here.

The one fact this milestone could not check

Whether radon's OpenSBI implements SRST reset type 1 as a reset. SBI permits any subset of the reset types, so the kernel prints sbiret.error rather than assuming. A refusal (-2) or a dark board would each close this route and point at a power-cycled series; notes/soak.md's outcome table separates the two. The bench answered on 2026-09-04, below.

What it must not become

This is not milestone 248 (a placement can only be drawn, never constructed, so the strongest finding on this machine rests on two boots), and the two should not be folded together. 248 builds an arrangement on purpose; this draws many more of them at random. They have different risks, and this one can ship in an afternoon while 248 needs a design. Keeping them apart is what stops the cheap one waiting on the expensive one.

The proof that this milestone worked

A distribution over at least fifty unattended boots, recorded in notes/soak.md beside the nine hand-drawn ones: how often each clean-core count comes up, and whether three or four ever does.

Not a kernel that reboots, which is the mechanism rather than the result. The count under "The distribution" below meets it. script/board-console --tally is what turns a session's log into the rows this section asks for, and it prints the caveats beside them so a count of draws is not quoted as a probability.

The bench answered it, 2026-09-04, and closed the route

radon's OpenSBI accepts SRST reset type 1, and the board does not come back. Corrected 2026-09-24: no reset happens. OpenSBI's reset is an I2C write to the PMIC, the write fails, and OpenSBI hangs. The transcript is target/board/radon-2026-09-04-srst-reset-pmic.log and notes/soak.md carries the line-numbered extract.

That is a third outcome, and neither this block nor the note predicted it. Both priced a refusal (sbiret.error == -2) against silence at the ecall. What happens is that the firmware accepts and then fails before any reset, in its own PMIC write.

The kernel half is sound and was verified the same evening. The reboot fires when it says it will, prints what it is about to do, and the escape works: a byte sent mid-soak produced soak-reboot: DISARMED at t=75s and the soak carried on past the 120s mark it would otherwise have rebooted at. That is step 4 of the bench procedure, the one thing no mechanism in the kernel can prove for itself, done. The mechanism is not what failed.

What it retires. This block refused a smart-plug series as "a lane spent on a guess until the firmware has actually refused reset type 1". It has now effectively refused, so milestone 224 (nothing can power-cycle radon, so a hung soak needs a person) is no longer a convenience. It is the only remaining route to an unattended series on this board, and the guess it was waiting on is spent.

And the escape's own limitation showed up in use. script/board-console holds the port and cannot write, so the byte had to be sent by detaching it, which is exactly the proposal this lane filed (design/roadmap/proposals/board-console-cannot-speak-to-the-board.md). Sending it at the wrong moment also stopped U-Boot's autoboot countdown and cost a power cycle, which is the fallback this block names working as an obstacle.

The distribution, read 2026-10-22

script/board-console --tally over the seven radon captures in bench/ counts 129 unattended draws of the rebooting soak: 7 at zero clean cores, 119 at one, 3 at two, none at three or four. That passes the fifty this block's proof asks for. One series is 52 draws on one build with nobody at the board (bench/radon-2026-10-22/249-lottery-draws.log): 6 at zero and 46 at one. The builds disagree (two clean cores only on the two 2026-10-10 builds, zero only on the two latest), so the pooled count is not one distribution. notes/soak/boot-lottery.md has the table, what was left out, and why these do not compare with the nine hand-drawn power cycles.

The rate follows the tally's clean-core count on every draw: about 30,860/s at zero, 177,520 to 206,734/s at one, about 318,000/s at two.

All three architectures, 2026-09-24

aarch64 and x86_64 now reboot through the same soak path, each proven under QEMU by a second boot. The routes, the proofs, each board's first bench step and the corrected radon diagnosis are in notes/board-reboot.md.

Follow-on

BUGS

Index row

radon reboots itself between soak draws, so the boot lottery is sampled unattended: 129 draws, 7 at zero clean cores, 119 at one, 3 at two, and never three or four.