P1: before the tag
An appendix to the milestone.
P1: before the first release
-
mark_freerounds outward, and its documentation says the opposite of what the code does. Finding:mark_freeandmark_usedboth callpage_frame_range, which rounds the start down and the end up (src/lib.rslines 313 to 325). The documentation ofmark_free(src/lib.rslines 179 to 184) says this rounding "is the opposite of whatmark_usedmust do". It is identical. For a reserved region outward is the safe direction and the note argues it well. For usable RAM the safe direction is inward: a frame only partly inside a usable region is partly something else. The x86_64 front end hands e820 usable regions tomark_freeclipped at the low megabyte and otherwise as the firmware reported them (kernel/src/arch/x86_64/machine.rslines 766 to 777), so the direction is live on one architecture. Every listed system in the prior-art table rounds usable memory inward. Verified by a throwaway test: a region beginning 16 bytes into frame 2 and spanning three frames frees frames 2, 3, 4 and 5, two of which it only touches. Evidence:src/lib.rslines 179 to 193,313-325.kernel/src/arch/x86_64/machine.rslines 766 to 777. The throwaway test described above. Change:mark_freetakes a second private range function that rounds inward (start up withnext_multiple_of, end down, empty when they cross). It keeps the clamp to[base, base + total). Its documentation states the asymmetry as it then stands: usable memory rounds in, reservations round out, and a region that touches no whole frame frees nothing. A host test pins the shape above (frames 3 and 4 free, 2 and 5 still used). Item 6 proves both range functions. The kernel's regions are frame-aligned on every board the tree boots today, so the kernel sees no change. The test boots confirm it. Door: two-way now. A published behavior after a release, which is why this lands first. Effort: S. -
The crate says it has no
unsafeand does not make the compiler hold it to that. Finding: the crate documentation (src/lib.rsline 3) claims pure logic with nounsafe. There is no#![forbid(unsafe_code)]. The template'sunsafe_scanpasses today, and the weekly fuzz opt-in rests on the same claim.# guards acfg(test)module that does not exist. The integration tests and the documentation tests are separate crates and linkstdon their own. Evidence:src/lib.rsline 3, 13. Change:#![no_std]and#![forbid(unsafe_code)]at the top oflib.rs. The README's one line says "nounsafe" because the compiler now refuses it. Door: two-way. Effort: XS. -
The proofs cover allocation, indexing and sizing, not the rounding or the accounting. Finding: the five harnesses prove that two
allocs differ, that an allocated frame lies aligned and in range, thatindex_ofinverts the address, thatcontainingrounds down, and that the bitmap is big enough. Nothing provespage_frame_range, the function the note calls the whole ballgame. Host tests alone pin it. Nothing proves theusedcounter: every allocator harness builds the struct withused: 0over an arbitrary bitmap and never readsused, soStats::freeand the counts the kernel publishes rest on tests alone. Nothing provesalloc_contiguous(that it returnscountadjacent frames that all started free and all end used) or thatfree(alloc())restores the bit. The reach record agrees: 50 viable mutants in reach, 38 killed by a proof. Evidence:src/lib.rslines 349 to 445. Thepage_framesrow of the Kani reach record innotes/. Change: three harnesses in the same module, each with a falsification patch. One takes a symbolicstartandsizeover the full 64-bit space against a fixed base and eight frames. It asserts that both range functions return exactly the indices of frames the range touches (outward) or contains (inward), clamped, and empty forsize == 0. The natural patch turnsdiv_ceilinto/. One takes a symbolic 8-frame bitmap withusedset to its popcount, applies one symbolic operation (mark_free,mark_used,alloc,alloc_contiguous, orfreeof an allocated frame) and assertsusedequals the popcount afterwards. The patch turnsused += countintoused += 1. One asserts that a successfulalloc_contiguous(n)returns a frame whosensuccessors were free before and which the allocator marks used after. The patch marksn - 1. Each stays within the 8-frame bound and the existingunwind(9). Door: two-way. Effort: M. -
The acronyms gate fails on three words. Finding:
prose_acronyms.pyreads Rust doc comments at a ceiling of zero and reportsDMA(src/lib.rsline 2),MMU(15) andMMIO(86) unexpanded at first use. The pinnedv7template does not runpassive_voice,spelled_out,unit_symbolsorfunction_length, and a later pin will. The crate passes those four today except the passive count, which does not read doc comments. Evidence: the helper's output.crate-workflows/.github/workflows/check.ymllines 274 to 286. Change: "direct memory access (DMA)", "the memory management unit (MMU)" and "memory-mapped input and output (MMIO)" at first use, in nife before the move. Door: two-way. Effort: XS. -
The names the release review meets for the first time. Finding: no public item carries a
Name:block, so none has a ratification and every one meets design/naming.md for the first time at this review. Two fail a rule and are public: the constantFRAME_SIZEis a length without its unit, where the rule says a length carries its unit and the tree's precedent for the same quantity isPAGE_BYTES(Decision 1).addrandfrom_addrcarry an abbreviation a reader decodes, where the one sibling with the same accessor spellsaddress; Decision 2 decidesphysical_addressandfrom_physical_address, provisionally. The rest are two-way or private: the parameterssize: u64ofmark_freeandmark_usedandspan: u64ofpage_frames_inhold byte counts and carry no unit (bytes,span_bytes).Stats::totalandStats::usedcount frames and name the count (frames,used_frames), andStats::free()shares its word with the verbPageFrameAllocator::free, which the vocabulary rule asks to qualify (free_frames). The harness localsbm,faandfb. The crate name,PageFrame,PageFrameAllocator,Stats,containing,alloc,alloc_contiguous,free,is_used,stats,largest_free_run,bitmap_bytesandmark_free/mark_usedpass every rule this review can apply. Evidence:src/lib.rsline 17, 48, 62,69-74,78,135,185,201,390,409-419.crates/page_tables/src/translation_lookaside_buffer_flush.rsline 41.design/naming/crates.mdline 65. Change: done by one rename lane across the tree (about 60FRAME_SIZEsites inkernel/andsystem_tests/). The names areFRAME_BYTES,physical_address,from_physical_address, the parametersbytesandspan_bytes, theStatsfieldsframesandused_frames, andStats::free_frames. The privateis_index_usedand the harness localsbitmap,allocator,firstandsecondfollow. All ship provisional. The rule that a crate carries no alias for this tree's own earlier spelling before its first release refuses#[doc(alias = "FRAME_SIZE")]. Door: one-way after a release for the public names. Two-way for the rest. Effort: S after the rulings. -
page_frames_intruncates where its name and documentation promise coverage. Finding: the documentation reads "How many frames span[base, base + span)" and the body isspan / FRAME_SIZE(src/lib.rslines 134 to 137). For a span that is not a whole number of frames the answer is one short, and the kernel rounds the top up by hand before calling it with a comment that names the trap (kernel/src/memory.rslines 361 to 362). Verified by a throwaway test:page_frames_in(FRAME_SIZE + 1)is 1. Evidence:src/lib.rslines 134 to 137.kernel/src/memory.rslines 361 to 362. The throwaway test. Change: the documentation says "whole frames inspan", and a second constant functionpage_frames_covering(span)returnsspan.div_ceil(FRAME_SIZE)for the span a bitmap must reach. The kernel calls it and drops its own rounding. Both names ship provisional. Door: two-way now. A public name after a release. Effort: XS. -
The in-tree falsification patches have drifted, and the move regenerates one of them badly. Finding: all five patches apply to the in-tree source only at an offset (25 to 52 lines), so their hunk headers no longer describe the file. nife's own replay passes with a note. The dry run regenerates them over the stripped source, and the regenerated
verification.index_of_inverts_frame_addressing.patchfails the template'sfalsify.pywith "corrupt patch at line 23": its hunk header promises seven old lines and the file carries six. The missing line is the blank line afterindex_of's closing brace (src/lib.rsline 309), which the regeneration drops when it is the hunk's last context line. The other four end their hunks on non-blank lines and survive. The dry run therefore cannot finish for this crate until the tooling changes. Evidence:patch -p1 --dry-run -F0 < falsifications/*.patchin the tree. The stagedfalsifications/verification.index_of_inverts_frame_addressing.patch(hunk@@ -298,7 +298,7 @@with six lines).helpers/crate_release.py, the regeneration (the dropping line was not located during this review). Change: in nife, the regeneration keeps an empty trailing context line (or emits the hunk with one fewer context line and a matching header). Its self-test gains a case whose hunk ends on a blank line. Separately, nife regenerates the five in-tree patches so their headers match the file, as item 6 adds three more. Door: two-way. Effort: S.