820. extensible_host_controller_interface: proven xHCI logic, released on its own
(From calef's rulings on pull request #1806; the title and slug are drafts. Milestone 813 (a proven FAT crate released on its own) is the shape this follows.)
calef's rulings, quoted from the maintainer comments on #1806 of 2026-10-07 (UTC):
- Policy: "Each publish-ours crate (NVMe, e1000e, the DesignWare pair, the JH7110 pair, xHCI, and
portable_executableonce it carries proofs) is published when ready (proofs passing, API stable), each through its own milestone at its review." His words: "Since the consumer would be other hobby OSes, I think it makes sense to publish them. [...] a nice legacy is a bunch of hobby oses that use its parts." - Crates: "one milestone per crate, minted now, each keeping its tree name (all free on crates.io
as of today): [...]
extensible_host_controller_interface(no offer to rust-osdev's dormantxhci, per today's only-our-dependencies rule) [...] Names are ratified now and permanent on first publication." His words: "Yes, one per crate". - That rule: "nife contributes upstream only to projects nife depends on [...] For projects nife does not use, nife makes no offer and maintains no proofs there; our proofs stay public under our license for anyone to take." His word: "Yes".
- The release rules are forks 1 to 4 and 6 of the same pull request, applied in Release below.
What exists, checked 2026-10-07 (UTC)
partsfoundry/extensible_host_controller_interface: 1,191 code lines (1,817 with comments), written by milestone 242 (USB host and HID, because on commodity hardware the keyboard is not a UART), which is PARTIAL. It is everything a USB host controller driver computes and nothing it touches: capability and operational registers, device and endpoint contexts, the rings, port status and HID boot reports. Class A in #1806's notenotes/releasable-crates-2026-10-07.md, so it depends on no other nife crate and needs no cut.- Three Kani harnesses, each with a falsification patch: a producer ring stays in bounds, the event ring stays in bounds and flips its cycle only at the wrap, and the extended-capability walk ends inside its limit.
- Its consumers:
kernel/src/extensible_host_controller_interface.rs(finds and confines the controller),kernel/src/user.rs,kernel/src/user/usb_keyboard_service.rsandcomponents/src/usb_keyboard_driver.rs(the EL0 driver). - The
Handofftypes encode nife's spawn ABI rather than xHCI. Whether they stay in the published crate or move to the driver is the lane's call, recorded in its pull request. - Ruled 2026-10-25 (UTC), on #2720: nife's process plan and the bring-up report leave the crate.
Pull request #2737 moved
Handoff,register_window,WindowRefusal,MAX_REGISTER_PAGES,WORK_PAGES,region_pagesand two harnesses into a module of the nife-internal cratedriver_process_contract, which holds each driver's process layout. Thereportmodule's bring-up report sits beside the handoff in that module (ruled 2026-10-26 UTC). The crate's remaining names are all ratified, in theName:blocks of its source. - crates.io answers 404 for the name (checked 2026-10-07).
Reuse: the alternatives were surveyed in #1806's other-implementations.md appendix (looked up 2026-10-07),
and none is taken. rust-osdev's xhci 0.9.2 (2023-07, MIT OR Apache-2.0, 108k downloads, no proofs)
has the right scope and has been dormant since 2024-09. The first proposal on #1806 was to ask
rust-osdev to revive it, and calef ruled no offer, since nife does not depend on it. rcore-os's
crab-usb 0.12.1 (Apache-2.0, 28k) lives in the tgoskits monorepo with no proofs found. Redox's
xhcid is a daemon whose GitHub mirror is archived. The xHCI 1.2 specification is the reference.
What is proven
Each row is a property this crate must prove before it publishes. The harness cell reads as in
milestone 813's table. Each patch is at falsifications/ in the
partsfoundry/extensible_host_controller_interface repository. The window and handoff rows left
with their code for driver_process_contract, which does not publish, so the crate proves 3 of 3.
| property | harness |
|---|---|
| A producer ring stays in bounds | verification::a_producer_ring_stays_in_bounds |
The event ring stays in bounds and flips its cycle bit only at the wrap (EventRing::advance) |
verification::the_event_ring_stays_in_bounds_and_flips_only_at_the_wrap |
The extended-capability walk (regs::find_extended) ends within its hop bound and inside limit for any register contents |
verification::the_capability_walk_ends_and_stays_inside_the_limit |
The two new rows are this lane's reading of the hostile surface: the controller writes the event
ring and the capability list. The event ring proof assumes the segment does not run past the end of the address space. The
capability walk models the register file as an arbitrary dword per read, which covers every fixed
register file. Not proven: event decoding (Event::decode), the context builders
and port decoders (context, port). The report words left with the handoff for driver_process_contract.
Release, by #1806's rulings
- The name is settled before anything leaves (857's Fork 5 as calef amended it on 2026-10-11 UTC).
script/names extensible_host_controller_interfacereports it ratified, crates.io answers 404 for it (or it is already ours), andpartsfoundry/extensible_host_controller_interfacedoes not exist yet.script/crate-standalonechecks the first. - In the tree,
script/verifyproves the harnesses andCargo.tomlsayspublish = false. - The package meets Fork 3 of
milestone 857 (crates released on their own).
cargo package --listshows its harnesses and falsification patches. - Ready means proofs passing and the API stable.
Milestone 814 (proven NVMe queue logic)
says how each is measured; here the soak is step 5. When the soak exits, calef adds it to the
lint-checked publish allowlist. The
partsfoundry/extensible_host_controller_interfacerepository is created when the crate moves, on the shared CI template (milestone 887), through reusable workflows: Kani throughkani-github-action, lint, release. Its release workflow refuses to publish unless the proof job is green. No harness here readstarget_arch, so stock Kani proves them. §218 (carry a Kani patch so riscv64 is proved) applies only if a harness comes to need riscv64. Milestone 589 (Kani can prove riscv64 from the hosts we already have) built it. - Soak, as its own repository, until the soak's five end conditions in the runbook hold.
- Publish and consume the release by version, by the runbook's publication steps.
Parity
Pure logic, tested on the host. This lane built it on 2026-10-07 with the pinned nightly for
aarch64-unknown-none-softfloat, riscv64imac-unknown-none-elf, x86_64-unknown-none and the
host, all exit 0. The release workflow builds the same four.
Standalone, measured 2026-10-11 (UTC)
script/crate-standalone extensible_host_controller_interface fails today, at base ae6b91e79. The
manifest and files fail as for all nine crates in
milestone 814 (proven NVMe queue logic).
Builds and tests on stable for the host and the three bare-metal targets. Stock Kani proves all
three harnesses in the copy, and each falsification patch, applied with -p3, turns its harness
red. It fails on manifest and files only, plus 12 lines citing this tree: 5 milestone N, 3 §N, 2
naming calef, 1 tree path and 1 provenance block.
script/names reports the name extensible_host_controller_interface ratified (checked
2026-10-25).
Measured again on 2026-10-25 (UTC) with --no-kani: the manifest and files pass, the build passes
on all four targets, and the only citations left sit in Name: blocks, which stay until the
ratification pass. With Kani, every harness proves and every falsification patch fails its harness.
Review before release
- The public API speaks the device's vocabulary, by the test milestone 813 states. A reviewer judges
this; no script can.
Handoffand thereportwords, nife's spawn ABI and spawn report, left the crate on 2026-10-26 (#2737).
Exit
A check proves it. In nife, cargo tree --locked -i extensible_host_controller_interface resolves
to v0.1.x from crates.io with a checksum in Cargo.lock,
crates/extensible_host_controller_interface no longer exists, and the tree builds for all three
targets. In partsfoundry/extensible_host_controller_interface, the run that published 0.1.0 shows the
Kani job green ahead of the publish job, and every harness's falsification patch makes its proof
fail. The five soak criteria of release step 5 hold before it publishes.
The name check of release step 1 passes first, by Fork 5 of milestone 857. Before the move,
script/crate-standalone extensible_host_controller_interface exits 0 in nife, and every row of
What is proven names a harness that stock Kani proves in the copy and whose falsification patch
makes it fail. No crate publishes without the proofs milestone 857 (crates released on their own)
requires.
What the crate no longer cites
The crate's source cites nothing of this tree beyond its Name: blocks. This section keeps the
links it carried, by milestone 857's provenance rule.
src/lib.rs, the crate doc: the ring design is in notes/usb.md, "The rings and the cycle bit".src/window.rs,register_window: notes/usb.md, "The register window". The function left the crate on 2026-10-26 (#2737), with the test below that names xenon.src/port.rs,PortDebounce(Settleuntil 2026-10-26): the settle rule and its numbers are in notes/usb.md, "The ports settle before the scan".src/tests.rs, the module doc: lane maintainer/mutation-triage-2026w42 moved the tests out oflib.rson 2026-10-12 (UTC), so the crate root stays an index under §282 (when a file is split, the parent becomes an index).src/tests.rs,a_sixty_four_kibibyte_bar_maps_sixteen_pages_less_the_table: the bench step that reads xenon's own capability values is calef's.Cargo.toml, the manifest comment: the crate is a host-testable pure-logic crate under §7 (testing: QEMU harness + host-testable crates, from commit one). The keyboard driver it serves belongs to milestone 242 (USB host and HID, because on commodity hardware the keyboard is not a UART).
The soak
- The crate lives in
partsfoundry/extensible_host_controller_interface, on the shared template of milestone 887 (crate repositories share one CI template).script/apply-settingsapplied the settings there. The manifest keepspublish = false, and the caller setsallow-unpublishedfor the soak. No tag exists. - nife keeps no copy.
kernel,componentsanddriver_process_contractdepend on the repository byrev, at a landed commit where itsmainis green. The verify table, the Kani peaks table, the mutation exclusions, the crate's fuzz workspace and its package entry no longer list it; the repository's ownproofsjobs prove the harnesses. - End condition 1 holds once nife's merge queue is green at the pin. Condition 2 waits on the first weekly run, 3 on a release dry run, 4 on a recorded stranger run, and 5 on its three checks from the tag nife pins.
- A bump of the pin is a separate pull request citing the landed commit as
partsfoundry/extensible_host_controller_interface@<sha>.
What remains
- The tag
v0.1.0, which the release workflow makes when calef dispatches it, and the pin moved to that tag's commit. - The soak, which ends on evidence and not a duration.
- The publication of 0.1.0 by trusted publishing, which waits for the architect's approval.
- nife consuming the release by semantic version, with
Cargo.lockrecording its checksum.
BUGS
- Steps 4 and 5 wait on milestone 887 (one CI template) and on 610's co-change column.
- Milestone 242 is PARTIAL, and the crate's own
BUGSsays a device behind a hub cannot be addressed. A stranger meets that limit first, so the published README states it. - Whether the context and port decoders want proofs before 0.1 is still open.
needs_personisyesbecause the exit includes a publication only calef can approve. Everything before step 6 can start now.
Follow-on
- Outstanding. The tag
v0.1.0, the pin moved to that tag's commit, the soak's end conditions 1 to 5 and the publication. Checked bygh api repos/partsfoundry/extensible_host_controller_interface/tags, which lists no tag. - Recorded. The crate's mutation baseline row stays in
.cargo/mutants-baseline.txtuntil the repository's first weekly mutation run names each survivor.
Index row
nife's xHCI host controller logic, its Kani proofs and their falsification patches, published on
crates.io as extensible_host_controller_interface 0.1 from its own nifeos repository instead
of being offered to rust-osdev's dormant xhci, then consumed back by nife from that release.