P2: later
An appendix to the milestone.
P2: for later
-
The reader truncates an address on a target narrower than 64 bits. Finding:
va as *const u8turns au64into a pointer throughusize, so on a 32-bit target an address above 4 GiB reads a different page. No target the crate builds for breaks; the claim is wider than the test. Evidence: line 197. Change:usize::try_from(virtual_address)with a documented panic in the# Safetysection, or one sentence that the address must fit the target'susize. The siblingenvironment_contractshares the shape and should move with it. Door: two-way. Effort: XS. -
Nothing uses
ArgPage::EMPTYandparseduplicates its literal. Finding: no caller in the tree namesEMPTY;parsewrites the same struct literal instead ofSelf::EMPTY. Either the constant earns a use or it goes. Evidence: lines 155 to 167; a tree-wide search forArgPage::EMPTYfinds only the definition. Change:Self::check(page).unwrap_or(Self::EMPTY), and a test or documentation example that namesEMPTY; or remove it before the first release, which is the last cheap moment. Door: two-way. Effort: XS. -
The builder takes a fixed 4,096-byte array while the parser takes any slice. Finding:
PageBuilder::new(&mut [u8; PAGE_BYTES])forces a 4 KiB array on every test and proof, and the round-trip proof over it ran out of memory.parse(&[u8])already bounds its room by the slice length, capped at the page's content length. Evidence: lines 109 and 162 to 175. Change: one ofnew(page: &mut [u8]) -> Result<Self, Refused>(refusing a buffer shorter than the header) or a const-generic length, with the capacity read from the buffer and capped as the parser caps it. The shell keeps passing its frame. Unverified: that Kani then fits the round trip under 12 GiB over a 64-byte buffer. Door: a public signature, two-way before the first release. Effort: S. -
The layout arithmetic has a second copy in
grant_plan. Finding:grant_plan::check_wordssums4 + w.len()againstCAPACITYto refuse a line before any page exists, repeating the record cost the builder knows. A change to the prefix width would have to find it. Evidence:crates/grant_plan/src/parsing.rslines 70 to 80; line 120 here. Change:pub const fn record_bytes(argument_bytes: usize) -> usize(the four-byte prefix plus the bytes) andPageBuilder::remaining_bytes(), withcheck_wordssummingrecord_bytes. With it, add the pedantic lints a stranger runs. Put#[must_use]onparse,iter,len,is_emptyandcount. Addimpl IntoIterator for &ArgumentPage. AddDebugon the three public types. AddFusedIteratoronIter. Add an# Errorssection onpush. Putu32::try_fromor aconstassertionMAXIMUM_RECORDS_BYTES <= u32::MAX as usizebehind the twoas u32casts at lines 125 and 140. Door: two-way. Effort: S. -
The data bounds the record walk, and a proof reads that poorly. Finding:
for _ in 0..countruns up tocountiterations, wherecountis anyu32from the page. It stops early only because each record consumes at least four bytes of at most 4,080, so 1,021 iterations is the real bound. That is safe and finite. A model checker cannot see the bound without unwinding to it, which is part of why the round-trip proof is heavy. Evidence: lines 181 to 186. Change: walkrecordsuntil empty, counting, and compare the count walked withcount; the loop's bound then reads from the slice length, and the sameNoneanswers both disagreements. Door: two-way. Effort: XS. -
The file must stay one file, and nothing says so. Finding: the
stdport copiessrc/lib.rsby name intosys/pal/nife/argproto.rsand strips crate-level inner attributes. A lane that splits the crate into modules, or adds a#![forbid(unsafe_code)]-style attribute the port needs, breaks thestdbuild in nife, not in this repository. This repository's gates stay green. Evidence:xtask/src/farm/copied.rslines 90 to 94;xtask/src/farm/generate.rslines 61 and 87. Change: one READMEBUGSline stating the constraint, and a test in the crate thatsrc/holds exactly one file, so the constraint fails here first. Door: two-way. Effort: XS.