1103. page_frames: what an outside maintainer would fix before 0.1.0
Raised by a read-only review of crates/page_frames as a stranger to this tree would meet it,
made before any move to nifeos/page_frames. It changes nothing; it lists what the next lanes
change, in nife before the move where the runbook puts a finding against the crate itself, and in
the new repository after it.
The crate has no review package in notes/crate-reviews/, so this review has a thinner baseline
than its siblings had. It takes the following as settled and does not reopen them. The crate name, which the crate-level Name: block records as ratified at a kernel-dependency crate naming review. The bitmap design and the all-used start, which notes/physical-memory.md argues. The five Kani harnesses and their falsification patches. The three mutation survivors nife's census argued equivalent. The move itself, once a package exists. No Name: block below the crate level
exists, so every public item name was provisional until the ratification of 2026-11-20 (UTC), and the naming pass of item 8 is the first time
they meet design/naming.md. Two of them fail a rule there and are one-way doors
after a release (Decisions 1 and 2).
Reuse: the template partsfoundry/crate-workflows, script/crate-move --dry-run, Kani, cargo-mutants and
the crate's own harness pattern (a symbolic 8-frame bitmap built without new).
Goal
A stranger who finds page_frames can tell in one screen what it allocates, in what unit, and why
everything starts used. The same stranger can follow the README alone to a build, the tests, the
proofs and one falsification, and meets no sentence in the README or the documentation that the
code contradicts. mark_free rounds in the direction its documentation describes and the safe one.
The repository's check and proofs runs are green on the first push for the crate's own reasons.
Finding status
- P0-1, the manifest stands alone: Done, #3971. The manifest writes its license, lint
set and measured
rust-version(1.87) itself, and both license files sit beside it.publish = falsestays, as the soak allows, andscript/crate-move --dry-runreports the crate clean. - P0-2, a README: Done, #3971, in the template's shape with the three design arguments, the nine harnesses, the measured proof run and one falsification.
- P0-3, documentation that cites this tree: Done, #3805.
The sentences in
src/lib.rs,tests/allocator.rsand the falsification headers carry their reasons and cite no section, milestone, path or program of this tree. - P1-4,
mark_freerounds outward: Done, #3524. - P1-5,
forbid(unsafe_code): Done, #3567. - P1-6, three more harnesses: Done, #3567, each with a falsification patch.
- P1-7, the acronyms gate: Done, #3567.
- P1-8, the names the release review meets: Done, #3805.
Decisions 1 and 2 and the two-way renames are built across the crate,
kernel/andsystem_tests/, with no alias of an old spelling, and every renamed name is ratified. - P1-9,
page_frames_intruncates: Done, #3567, withpage_frames_covering. - P1-10, the falsification patches drift: Done, #3521 for the regeneration and #3567 for the patches in the tree.
- P2-11,
#[must_use]: Done, #3567. - P2-12, a
freefor a run: Done, #3971, asfree_contiguous(provisional name). The two kernel loops call it. - P2-13, the alignment BUGS entry: Done, #3567.
- P2-14, a fallible
from_addr: Done, #3567, asPageFrame::try_aligned. - P2-15, the 64-bit
usize: Done, #3567, aconstassertion at the crate root. - P2-16, the
Name:paragraph: Done, #3567. - P2-17, the mutation exemptions: At the move. The move lane writes the three entries the
census argued equivalent into the new repository's
.github/mutants-exempts. - P2-18,
Hash: Done, #3567. - P2-19, the scan hint: Done, #3567.
- P2-20, the stale note: Done, #3567, and the note points at the README in #3971.
- Decision 1,
FRAME_SIZEorFRAME_BYTES: Done, #3805, asFRAME_BYTES, ratified. - Decision 2,
physical_addressandfrom_physical_address: Done, #3805, ratified.
Rulings
Ratify the public names
Ruled 2026-11-20 (UTC): A. The names in the package are the names that ship. The Name: blocks say
ratified.
Clear the review package and approve the repository
Ruled 2026-11-20 (UTC): A. Clear the package. The clearance creates the repository
nifeos/page_frames as publish = false, with no tag and no publish. The move lane
follows.
What was checked, and how
The tools run, the sources read and what was not run are in the appendix.
Prior art
The comparison with nearby work is in the appendix.
The items
Effort: XS is under an hour, S half a day, M a day or two, L longer. A door is one-way when somebody
outside the repository acts on it after a release (a public name, a published behavior, a layout, a
dependency). Everything else is two-way and the maintainer decides it. Line numbers are in
crates/page_frames/ at 75bb255a.
P0: blocks the move
-
The manifest does not stand alone. Finding:
standalone.pyon the staged tree reports nine lines. They are noLICENSE-MIT, noLICENSE-APACHE,licenseinherits the workspace, and norust-version. Also,lints.workspace = trueinherits a workspace that is not there, andpublish = false(allowed through the soak by theallow-unpublishedthat the dry run writes intoci.yml), and the three citation counts of item 3. The manifest also has nodescription,readme,keywordsorcategories, and thepublishcomment sends a reader tocrates/publish-allowlist.txt, a file the new repository will not have. The scaffold supplies no license files. A sibling prepared for its move carries both in its crate directory. Evidence:Cargo.tomllines 1 to 9.standalone.py --manifest-dir <staged>.crates/entropy_contract/for the shape a move-ready manifest takes. Change: in nife before the move, give the manifest adescription(one line: a physical page frame allocator over a borrowed bitmap, every frame used until declared RAM). Addrust-version,license = "MIT OR Apache-2.0",readme = "README.md",keywords = ["no-std", "allocator", "page-frame", "bitmap"],categories = ["no-std", "no-std::no-alloc", "memory-management"]anddocumentation = "https://docs.rs/page_frames". Copy the workspace lint set out explicitly (asentropy_contractdid, withcheck-cfg = ['cfg(kani)']). Write a self-containedpublishcomment and put the two license files beside it. Therust-versionis the lowest stable that hasu64::is_multiple_ofandusize::div_ceil. The review believes that is 1.87 (unverified) and the check isrustup toolchain install 1.87 --profile minimalthencargo +1.87 teston the staged tree. Door: two-way. Effort: S. -
The crate has no README, and the reasoning that would fill one stays behind in nife. Finding: the dry run stages the scaffold's README shape and reports "needs writing". The arguments a stranger needs (why a bitmap and not a free list, why everything starts used, why
mark_usedrounds outward) live innotes/physical-memory.md. That note does not move. It still namesFrameAllocator::newand aninitthat the crate no longer has. The template'sstandalonejob requires## EXAMPLESand## BUGS, the badge row and the proof subsections. Evidence: the dry run'sreadmeline.notes/physical-memory.mdlines 48 to 88.crate-workflows/scaffold/README-crate.md. Change: in nife before the move, writeREADME.mdin the scaffold's shape with the crate's own content: the one line.## EXAMPLESwith the bootstrap wiring already inlib.rslines 94 to 115. A## Designsection carrying the three arguments above in the stranger's words, with the kernel-image-tail example (an image ending at0x4009_7010owns the frame at0x4009_7000).## What is provenwith one line per harness and its bound (an 8-frame bitmap at base 0 or0x4000_0000; every address forcontaining; frame counts to 2^40 forbitmap_bytes; totals to 2^20 forindex_of). It also says what stays unproven until item 6 lands.## Building and testing(host-only tests, the three bare-metal--libbuilds).### Running the proofswith the measured 8 seconds and 169 MB.### Running one falsification patchusing thetwo_allocations_are_distinctpatch, whose header already explains the counterexample well.## BUGS(items 13, 15 and 19).## Minimum Rust version.## License. Door: two-way. Effort: M. -
The documentation cites this tree, and the move refuses it. Finding: the dry run counts 2 section citations (
src/lib.rsline 4, 342). It counts 6 milestone citations (src/lib.rsline 226, 259, 342,tests/allocator.rsline 221, 270, and a falsification patch header). It counts 6 paths into the nife tree (src/lib.rsline 5, 15, 86, 199, 348,tests/allocator.rsline 272).src/lib.rsline 261 names a nife program,tests/allocator.rsline 215 names an emulator board, andsrc/lib.rsline 10 names a sibling crate. The move strips theName:paragraph atsrc/lib.rslines 8 to 11 and leaves the rest. Evidence: the dry run'scitationslines.grep -n 'ยง\|milestone\|notes/' src/lib.rs tests/allocator.rs. Change: in nife before the move, rewrite each sentence to carry its reason instead of its pointer. "Milestone 107 (the socket contract learns to accept) found 137 frames free and no run of 128" becomes "a boot can hold 137 free frames and no run of 128, and a total-free reading alone cannot tell exhaustion from fragmentation". The[notes/mmu.md]link atsrc/lib.rsline 15 becomes a sentence. The falsification headers keep their defect and expectation text and lose the milestone numbers. Door: two-way. Effort: S.
P2: later
The P2 items are in the appendix.
P1: before the tag
The P1 items are in the appendix.
Decisions for the architect
Two decisions, each with a recommendation first. Both are two-way while nobody outside the tree uses the crate, so the maintainer rules them provisionally, and has ruled Decision 2 below. The names in items 8, 9 and 14 carry the ratification under "Rulings".
Decision 1: Whether FRAME_SIZE becomes FRAME_BYTES before the first release
Background. FRAME_SIZE is the crate's one constant, 4096, and the most used name it exports: about
sixty sites in kernel/ and system_tests/ multiply or mask by it. It is a length in bytes.
design/naming.md says a length or a limit carries its unit, spelled out, and gives
MAXIMUM_NAME_BYTES as the form. The tree's own precedent for the same quantity is PAGE_BYTES in
program_argument_contract. The constant has no Name: block, so no ruling covers it. A published
constant is a one-way door. A renaming after 0.1.0 breaks every dependent. The rule that a crate
carries no alias for this tree's earlier spelling before its first release means the old name cannot
stay as a redirect.
Recommendation: rename to FRAME_BYTES now, in the rename lane of item 8, with the two-way names in
the same sweep. The cost is one mechanical sweep inside a tree that is still the only user. The
alternative is a published name that fails the tree's own rule and that a future release review
reopens at a price nobody can pay then.
Prior art. x86_64 spells the quantity Size4KiB::SIZE through a type, which is a different shape.
Linux and the BSDs say PAGE_SIZE, the spelling this tree's rule refuses for its own names because
it names no unit. The tree already made the choice once for PAGE_BYTES.
Example. kernel/src/revoke.rs line 157 reads size_of::<LogPage>() == page_frames::FRAME_SIZE as usize
and would read page_frames::FRAME_BYTES as usize, which names the quantity the comparison measures.
Decision 2: Whether addr and from_addr become address and from_address
Background. PageFrame has three methods: from_addr, containing and addr. The first and last
carry addr, an abbreviation design/naming.md counts among those that need a
decoder, and the template's abbreviations report names it five times in this crate. The list of
words the gate refuses outright does not include addr yet, so nothing mechanical fails. The one
sibling accessor with the same meaning spells address (crates/page_tables/src/translation_lookaside_buffer_flush.rs line 41). The
kernel calls from_addr at about a dozen sites and addr() at more. Both are public methods, so
after 0.1.0 the names are a one-way door.
Recommendation: rename to address and from_address now, in the same lane as Decision 1.
containing stays. It reads well and x86_64 spells the same operation containing_address, which
this tree would shorten anyway because the receiver type already names what the frame contains.
Prior art. x86_64::PhysFrame has start_address and from_start_address; bitmap-allocator
and buddy_system_allocator work in frame numbers and have no accessor. No listed crate
abbreviates the word.
Example. kernel/src/memory.rs line 569 reads .is_used(PageFrame::from_addr(pa & !(FRAME_SIZE - 1)))
and would read .is_used(PageFrame::containing(physical_address)) after the rename lane also
takes the chance to use the method the crate already has for that rounding.
Decided on 2026-11-14 (UTC), built and ratified on 2026-11-20 (UTC). The names go one step past the
recommendation: physical_address and from_physical_address (src/lib.rs lines 48 and 62),
because design/naming.md asks every address to say which kind it is. The std rule
does not bind here: std's pointer addr returns a pointer's integer without its provenance, a
different meaning. containing (line 57) stays. The kernel and system_tests called from_addr and
addr() at 191 sites, all renamed, with no alias of the old spelling. Ratifying the names stays
the architect's.
Done when
The checks are in the appendix.
Follow-on
- Recorded. Item 17 is the move lane's, in the move table of the review package, which has its clearance.
BUGS
- Items 1, 2, 3, 7 and 10 describe what the template's gates report from the helpers run by hand
at the template's head and from one dry run at
v7, not from a workflow run. A lane checks each against the staged tree before acting. - The prior-art rows for Linux, FreeBSD, OpenBSD and
bootloader_apiare from memory and marked unverified where the function name or the rounding direction matters. A lane confirms the sources before a decision cites them. - The
rust-versionof item 1 is a belief, not a measurement; the item says how to measure it. - Item 10 names the regeneration helper by its role. The exact line that drops the blank context line was not located, and the lane that fixes it finds it.
- Nobody ran a mutation census; the figures are the tree's records. Items 4, 6, 9, 12 and 14 add branches the next census judges.
Index row
An outside review of page_frames before its move. The three items that gate the move are done: a
manifest that stands alone, a README that carries the design arguments, and documentation that
cites nothing of the tree. Seven land before the first release. Among them are mark_free rounding usable
memory outward against its own documentation and every comparable system, and proofs that leave the
rounding and the accounting unproven. Another is a malformed regenerated falsification patch that
stops the dry run, and two public names that fail the naming rules. Ten
follow later.