818. jh7110_entropy: proven JH7110 TRNG 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) [...] Names are ratified now and permanent on first publication." His words: "Yes, one per crate".
- The release rules are forks 1 to 4 and 6 of the same pull request, applied in Release below.
- The crates take plain values, by the ruling in milestone 857 (crates released on their own).
What exists, checked 2026-10-07 (UTC)
partsfoundry/jh7110_entropy(moved fromcrates/jh7110_entropy; see The soak below): 516 code lines (1,247 with comments), written by milestone 159 (a real hardware entropy source: the JH7110's TRNG), which is BUILT. It holds the StarFive JH7110 true random number generator's register layout, the decision whether a generation attempt succeeded, failed or is still running, and the device-tree query that finds it.- Four Kani harnesses, each with a falsification patch: a lockup bit is never overridden, ready
requires
RAND_RDYand carries the words untouched, neither bit set is always not ready, and an unseeded core never yields bytes. - Class B in #1806's note
notes/releasable-crates-2026-10-07.md. The cut, which is codebase rule 2 (a driver gets what it needs passed in), and the crate now depends on nothing. It holds both spellings (COMPATIBLES) and the property decodersinterrupt_lineandis_status_okay, andmachine_discovery::jh7110::entropy::discoverwalks the tree and fills inDiscovered. The fixtures and the tests that read QEMU's tree moved there with the walk. - Its consumers:
kernel/src/user/entropy_service.rs,kernel/src/memory.rs,kernel/src/lib.rsandcomponents/src/jh7110_entropy.rs. - crates.io answers 404 for the name (checked 2026-10-07).
- A ruling of 2026-10-26 (UTC) ratified the crate's names and renamed six of them first. The
Name:blocks of its source hold them.
Reuse: the alternatives were surveyed in #1806's other-implementations.md appendix (looked up
2026-10-07), and none is taken, because calef ruled this crate "publish ours". The only Rust JH7110
crates found, weathered-steel's jh71xx-pac 0.11.1 and jh71xx-hal 0.7.2 (Codeberg, 2025-03), are
register maps under GPL-3.0-only, which nife cannot take under its license and which carry no TRNG
logic. No Rust crate for the TRNG was found. Linux's jh7110-trng driver stays the reference and is
read, never copied. No upstream offer goes anywhere, by the ruling in
milestone 814 (proven NVMe queue logic).
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 partsfoundry/jh7110_entropy. All four
prove.
| property | harness |
|---|---|
| A lockup bit is never overridden | verification::a_lockup_bit_is_never_overridden |
Ready requires RAND_RDY and carries the words untouched |
verification::ready_requires_rand_rdy_and_carries_the_words_untouched |
| Neither bit set is always not ready | verification::neither_bit_set_is_always_not_ready |
| An unseeded core never yields bytes | verification::an_unseeded_core_never_yields_bytes |
Not proven: the quality of the randomness, which is a property of the silicon that no proof
reaches; Pool and output_bytes, which copy words; and the device-tree query, which the cut moves
out.
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 jh7110_entropyreports it ratified, crates.io answers 404 for it (or it is already ours), andpartsfoundry/jh7110_entropydoes not exist yet.script/crate-standalonechecks the first. - Make the cut above.
cargo tree -p jh7110_entropythen lists no nife crate, and the tests read only fixtures inside the package. - 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 6. When the soak exits, calef adds it to the
lint-checked publish allowlist. The
partsfoundry/jh7110_entropyrepository 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. This crate is the pilot and soaks first: it is the smallest crate with a real cut, and the cut is where refactor lessons show up.
- 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. The silicon is riscv64 only; the
crate is not.
Standalone, measured 2026-10-11 (UTC)
script/crate-standalone jh7110_entropy fails today, at base ae6b91e79. The manifest and files
fail as for all nine crates in
milestone 814 (proven NVMe queue logic).
It does not build alone: device_tree_blob is a path dependency outside the copy, so neither the
build nor Kani ran. A test reads a fixture from ../../device_tree_blob/tests/fixtures/, outside
the crate. Beyond manifest and files, 26 lines cite this tree: 14 milestone N, 5 tree paths, 3
§N, 2 naming calef and 2 provenance blocks.
script/names reports the name jh7110_entropy 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, the four harnesses prove and each falsification patch fails its
harness.
The soak, started 2026-10-31 (UTC)
- The crate moved to
partsfoundry/jh7110_entropyon the shared template atpartsfoundry/crate-workflows, whose currentmain(4e5b07d) its workflows pin, afterscript/apply-settingsran against it: both rulesets, thecrates-ioenvironment with calef as reviewer, the labels and the team. The manifest keepspublish = false; the caller setsallow-unpublishedfor the soak. crates/jh7110_entropyno longer exists here.kernel,componentsandmachine_discoverydepend onpartsfoundry/jh7110_entropybyrevdf37dc9(§305), a commit 6 commits past its tagv0.3.0-pre.1. The verify table, the Kani reach list and the trust-boundary table no longer list it; the repository's ownproofs / kaniandproofs / falsifyjobs prove the four harnesses.- End condition 1 holds: nife builds against the repository at that commit and its
mainis green. Condition 2 holds: the first scheduled weekly run, on 2026-11-02 (UTC), is green. Condition 4 holds:docs/stranger-test.mdthere records a run on 2026-10-31. Condition 3 holds: thereleaseworkflow's gate and rehearse jobs passed at522b98bon 2026-11-11 (UTC), run 42997968584. Condition 5, measured 2026-11-26 (UTC) at the crate'smaineac91ef: check 5b holds, sincecargo semver-checks --baseline-rev v0.3.0-pre.1 --release-type minorpasses 202 checks and fails none (the same run againstv0.2.0fails three). Check 5c holds: the repository has no open issue and no milestone, and no milestone orBUGSentry here proposes a break. The one open issue naming the crate in either organization, nifeos/nife#4118, asks for a new pre-release tag. Check 5a does not hold: no consumer pins a tag.kernel,componentsandmachine_discoverypindf37dc9, 6 commits pastv0.3.0-pre.1with the same source (only the README differs), and the board check pinsee0bde8, an untagged commit betweenv0.2.0andv0.3.0-pre.1, withversion = "0.2.0". No[patch]names the crate. The soak ends when one nife pull request moves all four pins to a tag's commit and 5b holds from that tag. - A bump of the pin is a separate pull request citing the landed commit as
partsfoundry/jh7110_entropy@<sha>.
The architect's review and the tags
The architect reads every crate by hand before it leaves (condition 4 of §247 (the split begins
with basalt holding nife, and procps moves first), ruled 2026-11-01 (UTC)). This crate is the
first so reviewed, the pilot of the review as of the mechanics. It moved on 2026-10-31 (UTC),
before that ruling, so the review reads its repository, and it comes before any contract crate
leaves. The ruling's second item needs a tagged release whose
commit carries the Cargo version, so that cargo-semver-checks --baseline-rev has a baseline.
partsfoundry/jh7110_entropy carries the tags v0.1.0, v0.1.1, v0.2.0 and v0.3.0-pre.1, and nife's three pins
state version = "0.3.0-pre.1" beside the revision. The architect cleared this crate's review on 2026-11-01
(UTC).
Review before release
- The public API speaks the device's vocabulary, by the test milestone 813 states. A reviewer judges this; no script can. Known today: nothing; the decoders take raw property bytes.
Exit
A check proves it. In nife, cargo tree --locked -i jh7110_entropy resolves to v0.1.x from
crates.io with a checksum in Cargo.lock, crates/jh7110_entropy no longer exists, and the tree
builds for all three targets. In partsfoundry/jh7110_entropy, 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 6 hold before it publishes.
Two checks of the shared template (milestone 887) are this crate's, because it publishes first. calef, 2026-10-22 (UTC): "A: 887 is BUILT once a v7 dry-run release on the canary passes the gate and waits in crates-io for my approval; the first-publish and semver-baseline checks move to 818."
- First publish: 0.1.0 publishes through the scoped token (
CRATES_IO_FIRST_PUBLISH_TOKENon thecrates-ioenvironment, reaching the called release job), after the gate and calef's approval. calef then binds the trusted publisher and deletes the secret. - Semver baseline: a pull request that breaks the API against the published 0.1.0 gets
needs-architectfrom the template's labeler.
The name check of release step 1 passes first, by Fork 5 of milestone 857. Before the move,
script/crate-standalone jh7110_entropy 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.
- The crate doc: the sources behind its
[trm],[driver],[netbsd]and[binding]labels, with the bring-up order and health testing, arenotes/entropy/jh7110-trng.md; the driver program iscomponents/src/jh7110_entropy.rs. IE_GLBL_EN: the bench run that showed polling works withIEnever written istarget/board/radon-2026-09-04-clock-and-first-entropy.log, and the driver program says why it polls.COMPATIBLE_VENDOR,Discovered: the vendor node and its evidence are the note's "The vendor spelling" section, found by milestone 239 (radon's device tree does not describe the TRNG, so a working driver never runs).generation_outcome,Pooland thean_unseeded_core_never_yields_bytesharness and patch: milestone 159 (a real hardware entropy source: the JH7110's TRNG) added thestatparameter and the pool.output_bytes: no conditioning here for the reason §44 (entropy is a capability,std::randomimproves transparently, and the refusal is loud) givescomponents/src/entropy.rs.WORD_BYTESandtake's clamp: the same 8 asentropy_contract::MAX_BYTES, andentropy_contract::wantclamps first in the driver.- The tests: milestone 326 (nobody has been assigned to turn a mutation score upward) found the survivors the transcription, clear-mask and deadline tests kill.
- The harness
ready_requires_rand_rdy_and_carries_the_words_untouchedand its patch: milestone 211 (a harness that states its property through the function under test cannot see that function break) rewrote the harness after it verified blind. The module's proofs serve §14 (the project's direction: a verified-Rust capability microkernel).
BUGS
- An organization owner has to install the
nife-smelterapp onpartsfoundry/jh7110_entropy;script/apply-settingscould not (the API wants an owner). The release workflow's tag job needs it, so a dry run past the gate waits on calef installing the app. The weekly drift job reads the organization'sSETTINGS_TOKENsecret. - Before the 0.1.0 release tag job can run, a person with an
admin:orgtoken addspartsfoundry/jh7110_entropy(id 1441110094) to the selected-repositories lists ofNIFE_SMELTER_APP_IDandNIFE_SMELTER_PRIVATE_KEY. Ruled 2026-11-01 UTC; the extraction checklist of milestone 857 (crates released on their own) has the command. - Steps 5 and 6 wait on milestone 887 (one CI template) and on 610's co-change column.
- The TRNG needs its clocks and reset released first, which is
jh7110_clock_and_reset's plan (milestone 819 (JH7110 clock and reset logic, proven, then released on its own)). A stranger using this crate alone must do that bring-up some other way; the crate's documentation says so before it is published. - The device-tree fixtures (
tests/fixtures/*.dts) are excerpts of the mainline and vendor JH7110 trees. Their licenses were not checked here; record each beforecargo packageships them. needs_personisyesbecause the exit includes a publication only calef can approve. Everything before step 7 can start now.
Follow-on
- Outstanding. The soak's end condition 5 and release step 7. Checked 2026-11-26 (UTC): conditions 1 to 4 hold, checks 5b and 5c hold, and 5a waits on nife's pins moving to a tag's commit (The soak above); nothing has published.
- Recorded. Ruled 2026-11-02 UTC: until
jh7110_entropyreaches crates.io, nife depends onpartsfoundry/jh7110_entropyby git revision (rev = "df37dc91383c4226b0266499c48de7e5e92ecb99", withversion = "0.3.0-pre.1"). A crates.io version replaces the pin after the soak release dry run. - Recorded. Ruled 2026-11-01 (UTC): the
needs-architecthold on a semver break applies on wire-identity changes only for contract crates.jh7110_entropyis not one, so its hold on every break stands. - Recorded. An organization owner installs the
nife-smelterapp; see BUGS above.
Index row
nife's StarFive JH7110 true random number generator logic, with four Kani proofs and their
falsification patches, cut free of nife's device tree. It is published on crates.io as
jh7110_entropy 0.1 from its own nifeos repository, and nife consumes that release.