roadmap

The bench steps for a hardware run of a crate version

An appendix to milestone 1035 (a crate names the version that ran on hardware). The main page is complete without it. These steps follow the bench procedure of milestone 159 (a real hardware entropy source: the JH7110's TRNG). The network boot of milestone 257 (boot radon over the network, so the microSD card stops being the tax on every experiment) replaces its card. A person runs them at the board; an agent can drive the host side and read the result.

The maintainers keep the bench's unit-specific details off-tree: which serial device is the board's, which outlet powers it, and which outlets and hubs must never lose power. Read those before touching anything.

What it needs

The steps

  1. Choose the nife commit. Check out origin/main, or the commit on it that bumped the pins, with no local changes:

    git fetch origin && git checkout --detach origin/main && git status --short
    git rev-parse HEAD
    

    git status --short prints nothing. Record the commit. Its three manifests (kernel/Cargo.toml, components/Cargo.toml, crates/machine_discovery/Cargo.toml) state the crate's version and rev, and the judge in step 6 checks that the rev is the commit of the tag v<version>.

  2. Build. script/board-image --tftp. It builds the archive and then the kernel, in that order, so the two are one measured pair, and it writes them under target/board/. Record the SHA-256 of target/board/nife-vf2.img and target/board/nife-initial-ramdisk.img (shasum -a 256 on macOS, sha256sum on Linux).

  3. Serve and watch. In two terminals:

    script/board-netboot
    script/board-console --port <device> --until selftest --for 5m --log target/1035-boot-1.log
    
  4. First boot. Power the board on from off. The log shows nife: payload came from net, then the boot tour. board-console stops once the self-test verdict prints. If the log shows payload came from card instead, the board booted an older kernel from the card; the judge refuses that boot because its true_random_number_generator line names another crate commit or none. Fix the network and boot again.

  5. Second boot. Power the board off, wait ten seconds, start board-console again with --log target/1035-boot-2.log, and power it on. Two cold boots are what make condition 6 (the first draws differ across boots) mean that the device reseeds per boot.

  6. Judge.

    python3 -I helpers/crate_hardware_run.py judge target/1035-boot-1.log target/1035-boot-2.log \
        --nife-commit <the commit from step 1>
    

    It prints one row per condition of the main page's definition and ends PASS or FAIL, N problem(s). Each boot's line reads like this, and its last clause names the crate:

    self-test       : true_random_number_generator ok      JH7110 TRNG at 0x1600c000 (tree says disabled): report 0x524e475550,
        STAT 0x00040308 (256-bit: all eight RAND words are the answer), draws 32/32 bytes, first 625b4bc8..,
        differ true; bring-up 1637 us, 64 bytes in 102 us (627450 bytes/s);
        crate jh7110_entropy 0.3.0-pre.1 at 497d3ec4f0b4d7fc36634dee47d1afd56eb22485
    

    A FAILED line, or one the judge refuses, goes to milestone 159's table of what each line means before anyone theorizes.

  7. Record. Commit the two logs under bench/<board>-<date>/ with a README-1035.md that names the nife commit, the crate version and commit, the two image hashes and the judge's output. Put each boot's true_random_number_generator line, the nife commit and the crate version in the main page's block. Only then does the crate's README name the version.

What the log holds

A board log carries the board's serial number, its MAC addresses and private local addresses. The runs of milestone 1049 (jh7110_entropy is ready to publish: the release review's findings) committed theirs as the board printed them. The person may instead trim those lines first, and the bench README then says so. The judge reads only the banner and the true_random_number_generator lines.