1097. intrusive_queue: what an outside maintainer would fix before its first release
Raised by a read-only outside review of crates/intrusive_queue, read the way a maintainer meeting
it on crates.io for the first time would read it. It changes nothing; it lists what the lanes that
move and release the crate change. The number is the recording lane's to assign.
The crate has no review package under notes/crate-reviews/; the accepted baseline is the ratified block in src/lib.rs (the crate name and Queue<T: Node>). It also holds the Unqueued token as the ruling on the drive-down-unsafe milestone recorded it, the Kani harness and its falsification patch, and the release survey's row that says the crate moves. None of those is reopened here. Where a later rule
(the naming page, the units rule, the standard-library-names rule) bears on the crate, the item says
so; the template's name checks refuse nothing in it.
Reuse: the template partsfoundry/crate-workflows and its scaffold, Kani, Miri, cargo-llvm-cov,
cargo-mutants. No new tool.
Finding status
Every finding not Done blocks the first crates.io publish, under the publishing hold.
- Item 1 (P0), the manifest is a workspace member's: Done, #3882. The manifest states its own
license,
rust-version = "1.85", description, keywords, categories and lint tables. - Item 2 (P0), the front page points into nife: Done, #3882 and #3892.
src/lib.rsno longer carries the notes pointers or the DECISIONS citation, the README holds the contract's fine print, and the repository carries noName:blocks. - Item 3 (P0), no repository skeleton: Done, partsfoundry/intrusive_queue#4. The crate lives in
partsfoundry/intrusive_queuewith the template's scaffold (#3892), pinned at crate-workflows v9 by partsfoundry/intrusive_queue#3, anddocs/stranger-test.mdrecords a passing stranger run. - Item 4 (P1),
Queue<T>isSendfor everyT: Done, #3795.Queue<T>isSendonly whenT: Send, with a compile-fail doctest (decision 1). - Item 5 (P1), the documentation teaches an aliasing minting shape: Done, #3523.
- Item 6 (P1), seven public names lack ratification: Done, #3795. The
Name:blocks read ratified 2026-11-19 (UTC) (decision 2), and the move stripped them. - Item 7 (P1), the compile-fail doctest accepts any error: Done, #3566.
- Item 8 (P1), no rule for dropping a non-empty
Queue: Done, #3566. - Item 9 (P2),
removeand anextract_if-shaped method: Done, partsfoundry/intrusive_queue#4 and #3970.Queue::removeandQueue::extract_ifcarry provisional names, each with a Kani harness and a falsification patch, and the five drain-and-rebuild loops ininter_process_communicationare calls to them. - Item 10 (P2), link hygiene after a pop: Done, #3566.
- Item 11 (P2), the standard traits: Done, #3566.
- Item 12 (P2), acronyms: Done, #3566.
- Item 13 (P2), one shared test node: Done, partsfoundry/intrusive_queue#4. The host tests and the
harnesses share one test node under
cfg(any(test, kani)). - Decision 1, the
Sendbound onQueue: Done, #3795. - Decision 2, the seven public names the release publishes: Done, #3795, ratified 2026-11-19 (UTC).
- Decision 3, review clearance and the repository: Done, #3892, ruled 2026-11-20 (UTC), option
A. The package
notes/crate-reviews/intrusive-queue.mdis cleared, andpartsfoundry/intrusive_queueholds the crate withpublish = false, no tag and no publish.
Open decisions
None.
Goal
A stranger who finds intrusive_queue on crates.io can tell in one screen what it is for. The stranger can build, test, prove and falsify it from the README alone. The stranger can mint a token without stepping on an
aliasing rule the documentation never stated. The stranger can also rely on the auto traits the crate publishes
being the ones a LinkedList user expects. The repository's gates are green for the crate's own
reasons and red only for the crate's own reasons.
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 for a lane, S is half a day, M is a day or two. A door is one-way when somebody outside the repository acts on it after the release (a public name, a published bound or behavior, a layout, a license, a dependency); everything else is two-way and the maintainer decides it.
P0: blocks any publish
-
The manifest is a workspace member's, not a crate's. Finding:
Cargo.tomlhas nodescription,repository,documentation,rust-version,keywordsorcategories;license.workspace = truehas no workspace to inherit from once the crate moves;publish = falsecarries a comment that points atcrates/publish-allowlist.txt, a file that will not be in the new repository.cargo package --listwarns about the missing metadata today. Evidence:crates/intrusive_queue/Cargo.tomllines 1 to 9. Change: take the template sample's manifest shape. It hasrust-version = "1.85"(verified to pass),license = "MIT OR Apache-2.0", a one-sentence description, the repository URL and the template's[lints.rust]block (missing_docs,unsafe_op_in_unsafe_fn,unexpected_cfgsnamingcfg(kani)). It also has apublish = falsecomment a stranger can act on until the release that publishes deletes the line. Door: two-way except publishing itself, which the publishing hold already governs. Effort: XS. -
The crate's front page points into nife. Finding: the crate root says "See notes/intrusive-queues.md" twice, cites "notes/overflow-checks.md" and "DECISIONS ยง14 (the project's direction: a verified-Rust capability microkernel that runs real workloads)", and carries two
Name:blocks, one of which names a person and a milestone round and asks a question the record never answers. The template'sstandalonecheck refuses all of it: three path lines, three provenance block lines, one milestone citation, two lines naming the architect, one section citation. A reader on docs.rs follows none of those pointers anywhere. Evidence:src/lib.rslines 3, 11, 62, 64 to 66, 219 to 220, 251. Change: the crate's README carries whatnotes/intrusive-queues.mdsays about the crate (the three rules, why the token exists and what it cannot carry, what the proofs cover and what they leave out, the aliasing fine print rewritten per item 5). The crate root's doc keeps the contract and loses the pointers. TheName:blocks go, per the rule that crate repositories carry no provenance and keep the name gates. The overflow comment onlensays what it means in the crate's own words. A plain+carries an overflow check in any profile that enables them, nife's release profile among them. A count of distinct live nodes of nonzero size cannot reachusize::MAX. So the wrapping form drops a check that can never fire from the path every push and pop takes. Door: two-way. Effort: S. -
No repository skeleton. Finding: no README, no
LICENSE-MITorLICENSE-APACHE, noCHANGELOG.md, no_typos.toml, nodocs/stranger-test.md, no caller workflows, no.github/accepted-words. The release gate refuses while the stranger run readsnone. Evidence:crates/intrusive_queue/holdsCargo.toml,src/lib.rsand one patch. Change: the scaffold, as every moved crate has taken it, with the README followingscaffold/README-crate.md. The README has anEXAMPLESsection (the run-queue example that is already a doctest) and a "What is proven" list of one line. It has "Building and testing" with the three bare-metal targets, the Kani install line on one line and the measured 16 seconds and 197 MB. It also has the one falsification command sequence with its real file name, andBUGS.FIFOandTCBgo inaccepted-wordsor expand at first use (item 12). Then a stranger run on record. Door: two-way. Effort: S.
P1: before the first release
-
Queue<T>isSendfor everyT. Finding:unsafe impl<T: Node> Send for Queue<T> {}has noT: Sendbound. The tree's audit accepted this while the crate was internal, on the premise that the kernel is the one user and the crate is not published; the move ends that premise. Every comparable container bounds it:std::collections::LinkedList<T>isSendonly forT: Send, andintrusive-collectionswritesunsafe impl<A: Adapter + Send> Send for SinglyLinkedList<A>(read from its source). Soundness today rests on rule 3 forbidding any other access while a queue holds a node, which is a contract a published crate cannot see its callers keep. The bound is satisfiable now:kernel::thread::Threadis alreadySend, and both consumers type-check with the bound added. Evidence:src/lib.rslines 160 to 163;kernel/src/thread.rsline 713; the audit's finding 9. Change:unsafe impl<T: Node + Send> Send for Queue<T> {}, and a doc sentence onQueuesaying why.Unqueued<T>stays!Sendby construction (NonNullis), which the doc can also say. Door: one-way. A bound added after release is a breaking change; one removed later is not. Effort: XS. Decision 1. -
The documentation teaches a minting shape that both aliasing models retire. Finding:
Unqueued::new's safety list and rule 3 ask only that no reference to the node be live across a queue operation. Every example in the crate mints the token from a reborrow:NonNull::from(&mut a)in theQueuedoctest,NonNull::from(&mut **n)in the test helper,NonNull::from(&mut nodes[i])in the harness. Under Miri, with Stacked Borrows and with Tree Borrows, one sequence has undefined behavior. The caller mints a token from a reborrow. A later&mutto the same node comes from its owner and drops before the next queue operation. The undefined behavior occurs at that operation. The later reborrow retires the one the token came from, and the queue's write through the token fails the retag. The same sequence with the token copied from the owning raw pointer (Box::into_raw, or the raw pointer a table stores) passes both models. So the rule the crate needs is stronger than the one it states: the token must carry the owner's provenance, and the program may not use a reference derived before a queue operation after that operation. The kernel mints the retiring shape:mint_tokentakesNonNull::from(&mut *t)withtfromget_mut, andget_mutruns again on queued threads as a matter of course.notes/intrusive-queues.mdrecords the tension in its aliasing paragraph. It namesUnsafeCelllinks as the eventual fix. This experiment suggests the problem is elsewhere: the provenance of the token is. Evidence:src/lib.rslines 7 to 9, 74 to 81, 136, 293 to 298, 369;kernel/src/sched/thread_table.rslines 253 to 258 and 100 to 104. The two Miri tests live in the review's scratch copy and appear in the appendix. Change, in the crate: a fourth clause inUnqueued::new's safety list ("nodeis the owner's pointer, or derived from it by raw-pointer operations; a pointer derived from a reference is retired by the next reborrow of that reference's parent"). The doctest and the test helper mint fromBox::into_rawor&raw mut. A Miri-run test of the table-walk pattern intests/so the template's weeklymirijob guards it. Change, in the kernel, as a follow-on the move does not wait for:mint_tokenmints from the stored raw pointer (self.table.get(entry).0), not fromget_mut. Considered and not recommended: a reference-freeNodetrait in the shape ofcordyceps::Linked(unverified), which would stop the queue forming&mut Tto a node. The experiment shows the token's provenance decides the outcome. A&mutheld across an operation has undefined behavior under either trait shape. Door: the documentation and the tests are two-way; the trait shape, had it changed, would count as one-way, and the review recommends against it. Effort: M across the crate and the kernel. -
Seven public names lack ratification or a record, and the move publishes them. Finding:
Unqueuedisprovisionaland crosses into both consumers (script/names --unratified); itsnew,as_ptrandas_non_nullare the lane's own;Node,next,set_next,push_back,pop_front,is_emptyandlencarry no block, and the ratified block covers the crate andQueue. The method names already follow the standard-library rule (VecDequespellspush_back,pop_front,is_empty,len;NonNullspellsas_ptr). Evidence:src/lib.rslines 11, 49 to 53, 64 to 66, 83, 90, 96. Change: one ruling on the list, then the blocks leave with item 2. The review proposes no rename. Door: one-way at the first release; decision 2 ratified the list. Effort: XS. -
The compile-fail doctest accepts any compile error. Finding: the
push_backdoctest carries```compile_failand statesE0382only in a comment, so a future edit that breaks the example some other way still passes. Rustdoc checks the code only when the attribute names it (compile_fail,E0382), and checks it on nightly only (unverified that stable still ignores it). Evidence:src/lib.rsline 192. Change:```compile_fail,E0382. Door: two-way. Effort: XS. -
The crate does not document dropping a non-empty
Queue. Finding:Queuehas noDropand says nothing about dropping it while it holds nodes. The nodes stay linked to one another and their tokens are gone, so queueing any of them again needs a freshunsafemint. A later push of a node still carrying a stalenexthas undefined behavior only if the mint lies; it is otherwise a quiet loss. The consumers rely on moving queues by value (core::mem::takethroughDefault,*bucket = kept), so a panickingDropwould be wrong. The documentation is the fix. Evidence:src/lib.rslines 154 to 158, 245 to 249;crates/inter_process_communication/src/futex.rslines 95 to 110. Change: a paragraph onQueue. Dropping a non-empty queue strands its nodes exactly as dropping a token does.Defaultexists so a caller can take a queue by value.#[must_use]onQueue::newadds nothing since#[must_use]sits on the token. Door: two-way. Effort: XS.
P2: later
The P2 items are in the appendix.
Decisions
The rules in force, each with its background and prior art, are in the appendix:
- Decision 1, the
Sendbound: the maintainer's provisional A, 2026-11-19 (UTC). - Decision 2, the seven public names: ratified by the architect, A, 2026-11-19 (UTC). The maintainer's provisional ruling of 2026-11-14 (UTC) preceded it.
- Decision 3, review clearance and the repository: ruled by the architect, A, 2026-11-20 (UTC). The maintainer's provisional A of 2026-11-19 (UTC) preceded it.
Follow-on
- Recorded. The soak. The crate keeps
publish = false, and the kernel andinter_process_communicationtake it byrev, a commit on the repository's main, checked inkernel/Cargo.toml; a tag moves the pin later.
Done when
The checks are in the appendix.
BUGS
- The kernel-side change of item 5 (
mint_tokenfrom the stored raw pointer) came from two Miri experiments on standalone nodes, not from a Miri run of the kernel, which has no Miri target. The crate's documentation change does not wait on it. - Item 9 reopens nothing the architect ruled: the note that chose drain-and-rebuild is a note, and
the timed-wait note already expects a
remove. The surface grows as a two-way door, withremoveandextract_ifprovisional until the crate's next name review. - The
cordycepsclaims in the prior-art table are from memory; its documentation pages did not resolve during the review. - This review ran no mutation census; the 19-mutant list is what
cargo mutants --listprints. The template'scheck / mutation-diffand the weeklymutationrun give the first figures after the move. unsafe_scancounts the#[cfg(kani)]blocks as shipped source, by its own design; the crate gets no fuzz opt-in either way, and that is the ruled outcome for a crate withunsafe.
Appendix: the two Miri experiments behind item 5
The two experiments are in the appendix.
Index row
An outside review of intrusive_queue before its first release. Every finding has landed, the
Send bound, the seven names, the repository's stranger run and Queue::remove among them. The
review package is cleared (2026-11-20 UTC), and the soak remains before a tag.