P1: before the tag
An appendix to the milestone.
-
The documentation assumes a reader inside nife. 52 lines in
src/andtests/cite§N,milestone N,notes/...ordesign/.... 30 lines areName:provenance blocks.src/lib.rsline 11 names the architect.standalone.pyrefuses all of them. A stranger cannot follownotes/page-tables.md,MappingHold::record_mapping,revoke::revoke_region,framebuffer_driver,board_th1520,arch::x86_64::initialize,mmu::initializeorkernel/src/arch/x86_64/iommu.rs. A doc comment points at each of them as if the reader had it (src/mapper.rslines 35 to 43,src/mapper.rsline 372,src/flags.rsline 46,src/flags.rsline 146,src/sv39.rsline 147,src/x86_64.rsline 17,src/x86_64.rsline 235,src/aarch64.rsline 92). The hardware citations (Arm DDI 0487, the Intel SDM, AMD 48882 revision 2.62, QEMU'sintel_iommu_internal.h, Linux'spgtable-64.h) are the ones to keep. Fix: rewrite each comment to say what the kernel does with the item in words, keep the hardware sources, move the history to git, and runstandalone.pyto zero. Effort M. Two-way. -
Public names the spelled-out rule refuses. The template's
spelled_out.py, at a ceiling of 0, refuses 84 definitions. Public among them:is_user_page_va(src/page_format.rsline 43) andPageFormat::entry_pa(src/page_format.rsline 66). Thevaandpaparameters of everyPageFormatmethod and everyMappermethod (src/mapper.rslines 138 to 451).PageSize::largest_fitting(src/page_size.rsline 53),DmaRegion(src/domain.rsline 12) andpage_attribute_table::MSR(src/x86_64.rsline 23).AMD_VI_PR(src/x86_64.rsline 331, refused aspr; it is "present"). The rule (design/naming.md, "Acronyms and abbreviations") listsva,pa,dmaandmsrby name, and says an integer constant is never kept. The helper does not catch these, but the same rule applies by judgment.phys_to_ptrandalloc_page_frameas parameters (src/mapper.rslines 66 to 67,src/domain.rslines 81 to 82).attrs(src/aarch64.rsline 111,src/sv39.rsline 55,src/x86_64.rsline 107).kernel_rodataanduser_rodata(src/flags.rsline 84,src/flags.rsline 125), where "read-only data" is the spoken phrase. Fix: one rename lane:virtual_addressandphysical_addressthroughout,is_user_page_virtual_address,entry_physical_address,DirectMemoryAccessRegion,page_attribute_table::MODEL_SPECIFIC_REGISTERwith#[doc(alias = "IA32_PAT")],AMD_VI_PRESENT,physical_to_pointer,allocate_page_frame,attributes,kernel_read_only_dataanduser_read_only_data. Every new name provisional. The kernel's call sites move with them. Effort M. Two-way before the first release. The maintainer rules them provisionally, and the release review rechecks them. -
Kept specification names carry no alias.
Aarch64,Sv39,Sv39Mae,Ia32e,Vtd,AmdVi,TranslationLookasideBufferFlush, the modulesmairandpat, and the register-bit constants (AF,SH_INNER,PXN,UXN,NG,PPN_SHIFT,PWT,PCD,XD,DTE_TV) keep their source's spelling. The rule allows this for a term a reader searches for. The condition is that the doc comment opens with the full name and source and the item carries#[doc(alias = "<plain-English name>")]. The crate has zerodoc(alias)attributes.Ia32e(src/x86_64.rsline 99) andSv39Mae(src/sv39.rsline 150) state their source. The rest do not.TranslationLookasideBufferFlushis the one judgment call: the rule keeps an acronym only where nobody says the expansion as a phrase, and "translation lookaside buffer" is rarely spoken, so the recommendation is to keep it with an alias. Fix: one pass adding the opening line and the alias to each kept name. Effort S. Two-way. -
Mapper::new's safety contract omits the allocator.src/mapper.rslines 77 to 88 requires a zeroed, page-alignedrootand aphys_to_ptrthat satisfies the type's contract, and says nothing aboutalloc_page_frame. The safe methodsmapandmap_blockthen write(*(self.phys_to_ptr)(new)).entries = [0; ENTRIES]through a*mut PageTablebuilt from whatever the allocator returned (src/mapper.rslines 159 to 167,src/mapper.rslines 226 to 231). A frame that lacks 4 KiB alignment, lacks exclusive ownership, or lacks a route throughphys_to_ptrmakes safe code reach undefined behavior.build_identity_domain(src/domain.rslines 75 to 78) states exactly this condition.Mapper::newdoes not, and every kernel call site argues only the root. Fix: state inMapper::new's# Safetythat every frame the allocator returns is page-aligned, exclusively owned by the mapper from that moment, reachable throughphys_to_ptr, and not a frame any live leaf maps. Adddebug_assert!(new.is_multiple_of(PAGE_SIZE))at both sites or returnMapError::Misalignedfor a misaligned frame. Effort S. Two-way. -
The proofs say "over every constructor" and miss some. Every
allarray in the format harnesses omitsFlags::write_combiningandFlags::user_write_combining. The arrays are atsrc/aarch64.rslines 402 to 411, 433 to 442 and 481 to 490. More are atsrc/sv39.rslines 468 to 477, 500 to 509 and 544 to 553. The rest are atsrc/x86_64.rslines 1000 to 1009, 1037 to 1046, 1072 to 1081 and 1133 to 1142.flag_tests::ALL(src/flag_tests.rslines 3 to 12) omits them too. OnIa32ethose two are the only flags that take the PWT-alone path (src/x86_64.rslines 118 to 123), so the W^X, round-trip and address-field proofs never see that branch. The host tests do (src/eighth_pass_attacks.rslines 56 to 67,src/x86_64.rslines 614 to 635), andsrc/flags.rslines 41 to 47 already records half of this gap in its BUGS. Fix: aFlags::ALLconstant of every constructor (eleven), with one test that its length equals the number of public constructors, used by every harness and test. The harness docs then say "every constructor" truthfully. Effort S. Two-way. -
The mutation exemptions and their reasons live in nife's
.cargo/mutants.toml. Lines 328-388 there hold 33 regexes of the form^crates/page_tables/src/<file>\.rs:..., each justified by aTHE_*_SHARE_NO_BITcompile-time assertion (src/share_no_bit.rs). In the new repository the paths becomesrc/..., and the template reads.github/mutants-exempts, notmutants.toml. Without the port, the first full run reports those 33 as survivors. The ledgers record this crate's history: 39 survivors in the first baseline, 17 killed and 22 equivalent, and a later inflow of 18, 8 killed and 10 equivalent (notes/mutation-testing/baseline-ledger.mdline 22,notes/mutation-testing/inflow-2026-10-12-triage.mdline 31; the inflow columns were not re-derived). The file lists 644 mutants today. Fix: port each exemption with its reason into the template's format and run one fullmutation.ymlinside the window. Expect thepage_attribute_table::VALUEconstant-level|(src/x86_64.rsline 34) to survive, as nife's note atmutants.tomllines 385 to 387 says it does, and exempt it with that reason. Effort S to M. Two-way. -
Address arithmetic that can overflow.
map_rangecomputesva + i * PAGE_SIZEand `pa + i
- PAGE_SIZE
(src/mapper.rsline 285), andmap_spancomputesva + doneandpa + done(src/mapper.rslines 269 to 270).PageFormat::indexcomputes9 * (Self::LEVELS - 1 - level)(src/page_format.rsline 104). With overflow checks on, which the workspace's release profile sets, acountorlenthat runs pastu64::MAXpanics instead of returning aMapError. Without them it wraps into the low half and maps a page nobody asked for. The kernel's callers derive counts from link-time symbols and page-aligned user requests, so this is inferred to be unreachable today (not proven).domain.rsalready refuses the same shape withMapError::BadRegion(src/domain.rslines 50 to 52) and says in its comment that it avoidsmap_range's unchecked arithmetic. Fix:checked_addandchecked_mul, returningMapError::BadRegion, in both functions, with a test atu64::MAX - PAGE_SIZE. Aconstassertion or a doc line thatindexis defined forlevel < LEVELS`. Effort S. Two-way.
- There is no README, and the examples need twenty hidden lines. The crate root's docs
(
src/lib.rslines 1 to 11) are four sentences and a pointer into nife. The twoMapperdoctests (src/mapper.rslines 107 to 137,src/mapper.rslines 298 to 325) hide the table allocation behind#lines, so the rendered example omits the one thing a user has to supply. The scaffold'sREADME-crate.mdrequires## EXAMPLESand## BUGS, the build and prove commands, the Kani install line at the template's version, measured run time and memory, and one real falsification example. Fix: write it. Include a visibleMapperexample over aVec<Box<PageTable>>and a table of the six formats (levels, split bit, block sizes, whatleaf_flagscan report). Add the "what is proven" list in a user's words. State the limits: no permission change, no block split, no table reclamation, the 4 KiB granule, and theSPLIT_SHIFTfiction on the IOMMU formats. Effort M. Two-way.