P2: later
An appendix to the milestone.
P2: worth doing, not worth holding the move for
-
propose::reqtruncates silently. Finding:req(operation)(src/lib.rsline 357) shifts by 56, so an operation of 256 or more loses its high bits;operation(w0)discards the low 56 bits of a word that nothing says must be zero there. Both are correct for the two opcodes that exist. Change: adebug_assert!(operation < 256)inreq, or a sentence on each saying the opcode is one byte and the low bits are the request's to use; the harness in item 9 pins the round trip. Door: two-way. Effort: S. -
ClockPage::newtakes an integer where a Rust reader expects a pointer. Finding:pub const unsafe fn new(va: u64)(src/lib.rsline 233) casts an integer to*const AtomicU64. The crate enablesptr_as_ptrandcast_ptr_alignment, which says it cares about pointer hygiene, and an integer-to-pointer cast is the one form those lints cannot see. The three callers pass addresses they hold asu64(CLOCK_VAconstants and a physical-to- virtual map), so a pointer parameter adds one cast at each. Change: with the rename tovirtual_address(the package's proposal), decide the type too: keepu64, whose name then says what it is, or take*const u8and let the caller own the cast. Keepingu64is defensible for a value that arrives in a register; the doc should then say the name means an address, not a pointer. Door: two-way before the first release; the name is Decision 3's, ratified as built. Effort: S. -
A test whose name claims more than it checks. Done, with Decision 1: the reader has no spin path, and the host test
a_writer_stopped_inside_a_publish_leaves_the_last_publish_readablereads the page with a publish filled and not flipped, and checks that the reading is the last publish. Door: two-way. -
initializerelies on a zeroed frame for the reserved words. Finding:WORDS(src/lib.rsline 178) says the rest of the frame "is reserved and must read as zero";initializewrites the seven words and nothing else;readchecks nothing past word six. Change: say ininitialize's doc that the caller hands it a zeroed frame and the reserved words are whatever the frame held, or zero them there. The sentence is enough. Door: two-way. Effort: S. -
offset_forsaturates to an offset of zero. Finding:offset_for(wall, monotonic)(src/lib.rsline 115) returns 0 whenmonotonic > wall, andwall_nanoseconds(0, monotonic)then reads as uptime since the epoch, which is the reading the crate exists to prevent. Unreachable throughpolicy, since a plausible wall time exceeds any uptime a machine will have, butpublishaccepts any offset from a set-authority holder. Change: a sentence onoffset_fornaming the case and why the policy makes it unreachable, or anOptionreturn. The sentence is enough for a contract crate. Door: two-way. Effort: S. -
The README does not say who can use the crate. Finding: the README describes the contract well and never says that it is useful only together with a clock service that maps the page and a loader that grants it. The crate on its own sets no clock and reads no time. A stranger on crates.io, the audience the README is for, reads four paragraphs before learning that. Change: one sentence in the first paragraph ("This crate is the definition the service, its readers and a standard library's platform layer share; on its own it maps nothing and sets nothing") and, under "Building and testing", the sentence from item 8. Door: two-way. Effort: S.