P2: later
An appendix to the milestone.
P2: after the first release, or in it if cheap
-
The method surface against what the consumer needs. Finding:
inter_process_communicationwrites the same drain-and-rebuild loop five times (Rendezvous::remove_sender,remove_receiver,Notification::remove_waiter,Futexes::remove, andFutexes::takeas a filter), each popping every node and pushing the survivors back, which writes every surviving link twice where a targeted unlink writes one. The tree's notes record that the choice keeps the crate's contract at push and pop and its proved invariants the only ones in play. The timed-wait note already says aQueue::removeis the shape the next feature wants. It also says the proofs move with the crate.STAILQ_REMOVE,cursor_mut_from_ptrandlist_delare what a reader expects to find. Evidence:crates/inter_process_communication/src/rendezvous.rslines 214 to 244,notification.rslines 216 to 230,futex.rslines 90 to 128;notes/inter-process-communication.md("Taking a thread back off a queue");notes/timed-wait.mditem 1. Change:remove(&mut self, victim: NonNull<T>) -> Option<Unqueued<T>>(O(n) from the head, one link write, the victim never dereferenced beyond its link). Add anextract_if-shaped method takingimpl FnMut(NonNull<T>) -> booland returning the matches as aQueue<T>. Each gets its own Kani harness against the array model and its own falsification patch. Then the five loops become calls.front() -> Option<NonNull<T>>anditer()overNonNull<T>are the other two a reader expects; add them only when a consumer asks. Door: two-way (additive). Effort: M. -
The harness does not check link hygiene. Finding: the proof checks order, loss, length and emptiness; that a popped node leaves with
next == Nonegets a check only from a host test. One assertion in the pop arm covers it for every interleaving to the bound, and a second falsification patch (drop theset_next(None)inpop_front) shows it red. Evidence:src/lib.rslines 320 to 334, 449 to 458. Change:assert!(unsafe { (*token.as_ptr()).next() }.is_none())after the tag check; the patch. Door: two-way. Effort: XS. -
UnqueuedandQueueare thin on the std traits a reader reaches for. Finding:Unqueued<T>compares only againstNonNull<T>and only from the left; two tokens do not compare, andNonNull<T> == Unqueued<T>does not compile.Queue<T>has noDebug, so a struct holding one cannot derive it (the consumer'sRendezvousandNotificationwould want it for hang dumps). Evidence:src/lib.rslines 101 to 111, 154. Change:PartialEqandEqbetween tokens, the mirror impl onNonNull<T>, and aDebugforQueueprintinghead,tailandlenwithout walking (a walk would read nodes under the caller's contract). Door: two-way (additive). Effort: XS. -
Prose checks a stranger's README will meet. Finding: the crate root's first sentence uses
FIFOunexpanded, which the template's acronym report flags on the crate root and the README;TCBandIPCappear in the harness and test comments only. The#[doc(alias = "fifo")]onQueueis right and stays: the alias is the term a reader searches for, and the spelled-out list refusesfifoonly in a name. Evidence:src/lib.rslines 1, 153. Change: "first in, first out (FIFO)" at first use, or the words in.github/accepted-words. Door: two-way. Effort: XS. -
The tests and the harness each define their own
N. Finding: two identicalNodeimplementations for a test node, one undercfg(kani)and one undercfg(test), with the sameSAFETYcomment. A shared#[cfg(any(test, kani))]module halves the duplication and gives the Miri test of item 5 a node to use. Evidence:src/lib.rslines 259 to 273, 345 to 358. Change: onetest_supportmodule gated onany(test, kani). Door: two-way. Effort: XS.