P1: before the tag
An appendix to the milestone.
P1: before the first tag
-
cpu()hands back an id the documented consumer cannot use. DONE (Decision A, ruled 2026-11-12 UTC). Finding:cpu()answersSome(word as usize)for every word other thanUNSCHEDULED, with no comparison againstCPU_ID_BOUND. Every documented consumer indexes a[_; CPU_ID_BOUND]by the answer (the doc example at lines 85 to 96,user_mode_runtime::current_cpu's example). A kernel built against a copy of this crate with a larger bound shares the magic with a program built against this one, because the layout does not change, so the program's index is out of bounds and it panics. Inside nife the kernel'sMAXIMUM_CPUSis this constant and the system test carries the bound back across the boundary, so no nife build can reach it today. Once the crate leaves and the two sides pin different versions, nothing checks it. Evidence:src/lib.rslines 277 to 282, 75 to 98;kernel/src/cpu.rsline 28;system_tests/src/user/current_cpu_tests.rslines 62 to 70. Change:cpu()answersNonewhen the word is at or pastCPU_ID_BOUND as u64(one more compare on a path that already compares twice), with the doc sentence "an id this crate's bound cannot index reads as unknown" and a testan_id_past_the_bound_reads_as_unknown. The doc ofCPU_ID_BOUNDstates that a change to its value is a wire break that re-mintsMAGICand bumpsVERSION(Decision A). Door: the compare is the restrictive direction and two-way; whether the bound is part of the identity is one-way (Decision A). Effort: XS. -
allowance()truncates on a narrower target. Finding:NonZeroUsize::new(self.word(OFF_ALLOWANCE)? as usize). On a target whoseusizeis narrower than 64 bits the cast drops the high half, so an allowance of0x1_0000_0000reads asNoneand0x1_0000_0004reads as 4. No target the crate names suffers from it. It is a hole in the claim, not a defect a current user can reach.tick_hertz()answersNonZeroU64and has no such hole, so the two readers also disagree in type. Evidence:src/lib.rslines 255 to 257 and 269 to 271. Change:usize::try_from(word).ok().and_then(NonZeroUsize::new), so an allowance the target cannot hold reads as unknown on every target; one sentence in the doc. The return type stays, sinceavailable_parallelismwants aNonZeroUsize. Door: two-way (no behavior changes on any supported target). Effort: XS. -
The reader reaches its word through an integer, so Miri checks less than it could. Finding:
word()computes(self.base as u64 + off as u64) as *const AtomicU64, and the comment says the author chose the shape so clippy need not trust a pointer cast. Miri reports the integer-to-pointer cast on every such load (verified in the experiment above) and falls back to wildcard provenance, so the weekly undefined-behavior job cannot tie the load to the buffer it came from.publishmust start from an integer, since its API takes au64, butword()holds a pointer and need not. The two sites also differ for no reason:publishuseswrapping_addwith a paragraph on why,word()uses+. Evidence:src/lib.rslines 185 and 244 to 248. Change:self.base.add(off).cast::<AtomicU64>()inword(), with the alignment argued in theSAFETYcomment as it is now (the base is 8-aligned bynew's contract and every offset is a multiple of 8), and a#[allow(clippy::cast_ptr_alignment)]only if clippy still objects. Keeppublish's integer form and its reason. Door: two-way. Effort: XS. -
The two
unsafeentry points check nothing in debug builds. Finding:publish(page_va, UNSCHEDULED)silently un-publishes a thread.publishwith a misaligned address andnewwith one have undefined behavior with no debug-time report. The kernel's two call sites passcpu::id(), which is in range by construction, but the crate cannot know that. Evidence:src/lib.rslines 179 to 187 and 228 to 232. Change:debug_assert!(page_va % 8 == 0),debug_assert!(cpu != UNSCHEDULED)anddebug_assert!(cpu < CPU_ID_BOUND as u64)inpublish;debug_assert!(va % 8 == 0)innew(as aconst unsafe fnit can carry adebug_assert!on au64). Release builds keep the single store. Door: two-way. Effort: XS. -
The builder and the readers disagree about what "unknown" is. Finding:
build_page_allowing(allowance: u64, tick_hertz: u64)takes two plain words where zero means unknown; the readers answerOption<NonZero…>.build_page()isbuild_page_allowing(0, 0). The name says one of its two parameters and reads as if it permits something. Two kernel call sites and the tests call it. Evidence:src/lib.rslines 143 to 166;kernel/src/user/address_space.rsline 159;kernel/src/user/address_space_registry.rsline 300. Change:build_page_with(allowance: Option<NonZeroU64>, tick_hertz: Option<NonZeroU64>), withbuild_page()kept as the all-unknown page. Decision B ratified the name (2026-11-19 UTC); the parameter types are the maintainer's. Door: two-way before the first tag. Effort: S, including the two kernel call sites. -
Nothing is machine-checked, and the template expects a proof or a stated reason. Finding: no
#[kani::proof]and nofalsifications/. The three sibling contract crates reviewed so far (socket_contract,block_roster_contract,entropy_contract) each carry a harness and a patch;counter_frequency_contractcarries none and its package left the question open. The template'sproofs / falsifyjob reads Kani's summary line; nobody has verified what it does with zero harnesses. Evidence:crates/current_cpu_contract/(nofalsifications/, nokaniinsrc/); the template'shelpers/falsify.pyline 42. Change: two harnesses with their patches. First, for any 32 bytes,cpu()isSomeonly when the first eight bytes equalMAGIC, the word is notUNSCHEDULEDand the word is underCPU_ID_BOUND. Likewiseallowance()andtick_hertz()areSomeonly when the magic matches and the word is nonzero. Second, for anyallowanceandtick_hertz, the pagebuild_page_withmakes reads them back and readscpu()asNone. Each harness is small enough for stock Kani in seconds (unverified). Alternatively, the README's## What is provenstates that nothing is, and why, as the sibling's does. Door: two-way. Effort: S. -
The crate's
BUGSsection is stale and its claims have moved. Finding: "Nothing outside tests reads the word yet" is false:user_mode_runtime::current_cpu, the standard library'savailable_parallelism(through the copied source) and the kernel's tests read it. The timing figure names a machine and a pull request. The Miri entry describes a test-side workaround as a crate bug. Evidence:src/lib.rslines 12 to 18. Change: aBUGSlist a stranger can act on. An address space with no thread has no page and a reader faults. A process has at mostTHREAD_PAGE_SLOTSthreads.CPU_ID_BOUNDsizes and does not enumerate. The&AtomicU64over a read-only mapping is a shape the Rust memory model has not settled, and the fallback is a raw atomic load that forms no reference. Door: two-way. Effort: XS, inside item 3's rewrite. -
The standard library copies this file by name, and a stranger cannot see that. Finding:
xtask/src/farm/copied.rscopiescrates/current_cpu_contract/src/lib.rsinto the standard library's platform layer and rewritesaddress_space_layout::to a sibling module. A second source file, amod, or aninclude!in this crate would break that copy with no signal inside the crate's own repository. After the move the farm takes the copy from the pinned package's directory (cargo metadata), so the constraint survives the move. Evidence:xtask/src/farm/copied.rslines 125 to 145;xtask/src/farm/generate.rslines 61 and 110. Change: one sentence in the README's## BUGS("a consumer copies this crate's single source file into a standard library; keep the crate to one file with fully qualified paths"), and, in nife, a check in the farm that refuses a copied package with more than one source file. The second half is a nife lane. Door: two-way. Effort: XS.