roadmap BUILT

136. One decision path, and a gate that keeps it that way

Raised and closed 2026-08-18, out of milestone 135's own BUGS section, which named this as the one of its three recorded limitations worth a milestone: "a later lane could reintroduce a second decision path in untyped.rs and no check would notice." The gate is two halves of script/lint plus two compile_fail doctests, and it was verified against seven hand-made regressions, one of which it originally missed. That miss is the most useful thing this milestone produced and is recorded below rather than quietly fixed.

In brief

Milestone 135's value is one sentence: the thing loom searches is the thing the kernel runs. It lifted the region table and every decision over it out of kernel/src/untyped.rs into crates/regions, so script/interleaving-check searches the real claim protocol rather than a paraphrase of it. That sentence is worth exactly as much as it stays true, and when 135 landed nothing checked it.

135 proposed the mechanism as milestone 113's shim shape applied to loom crates. It does not transfer, because that work is already done and was done by 135 itself. 113 built helpers/kani-lint-shim/ because cfg(kani) code is written against intrinsics a plain rustc cannot resolve, so making the proof harnesses visible to clippy needed a fake kani crate. Loom has no such problem: it is an ordinary crates.io dependency behind [target.'cfg(loom)'.dependencies], so the whole of 113's benefit costs one flag, and script/interleaving-check already carries it:

RUSTFLAGS="--cfg loom -D warnings" cargo test --release ...

That script's own comment cites 113 and says why the shim is unnecessary. So the blind spot 135 pointed at is closed. The property 135 actually named is a different one that no lint against harness code could ever have reached. Linting a loom model says nothing about whether the kernel still calls it.

So this milestone gates the real property, in three pieces:

The regression the first draft missed, which is the whole reason to write this down

The first version of the lint pinned only the set of functions that free region pages. It was green against this, pasted over untyped::destroy:

pub fn destroy(region: u64) {
    if REGIONS.lock().has_children(region) { return; }
    let Some((base, size)) = REGIONS.lock().bounds(region) else { return };
    crate::revoke::revoke_region(base, size);
    for i in 0..(size / FRAME_BYTES) {
        memory::free(Frame::from_physical_address(base + i * FRAME_BYTES));
    }
}

That is pull request #316's double free, rebuilt: read under one hold, release, revoke, free, and never remove the slot, so two callers both pass the read and both reach the loop. It compiles, and it needed no edit to crates/regions at all, because has_children and bounds are public and are enough. So the surface pin could not have caught it either: nothing about the surface changed.

Two things follow, and both are now in the gate. The set of freeing functions is the wrong unit, because destroy was already in it; the right unit is whether a free site took its warrant. And a public &self observer on the table is a live hazard rather than a theoretical one, which is why the pin comments name the three that exist and ask a fourth to argue for itself.

The gate was then verified against seven regressions and catches all seven, each naming what is wrong rather than that something is:

Regression Caught by Message
the rebuilt gap above warrant pin destroy() frees region pages without calling claim_for_destroy() first
a third free site (trim) site pin trim() releases region pages and is not a recorded free site
pub fn may_destroy(&self, ..) -> bool added to the table surface pin RegionTable::may_destroy (&self) is public and is not pinned
claim_for_destroy respelled &self surface pin reported as both an unpinned &self and a missing &mut self
has_children made private surface pin is pinned and is no longer public
#[derive(Clone)] on DestroyClaim doctest the duplication snippet compiles, so the compile_fail fails
DestroyClaim's fields made pub doctest the forging snippet compiles, so the compile_fail fails

The doctests carry error codes (compile_fail,E0451) rather than a bare compile_fail, because a bare one passes when the snippet fails to compile for any reason, including a typo. That is how a compile-fail test rots into an assertion nobody has watched fail. That the codes are enforced was itself checked: changing E0451 to E0308 fails with "Some expected error codes were not found".

Why it matters

An ungated lift decays into a paraphrase, and the decay is invisible. Every other outcome of milestone 135 is protected by something: the arithmetic by Kani, the interleavings by loom, the lock rank by script/lint. The claim that the kernel still calls the modeled code was protected by nobody having got around to changing it. That is rung zero of the ladder, and the tenet is explicit that "somebody will notice" belongs on no list.

This is the failure mode that costs the most and shows the least. A model checker that searches code the kernel no longer runs reports success, forever, on a question nobody is asking. The tree would keep 1,364 green executions and a notes/interleaving.md row while the double free came back, and the first evidence would be a corrupted page on a customer's backup target.

A gate nobody has watched fail is the thing this tree keeps deleting (milestone 62 removed two such assertions this week). The seven-regression table above is the price of not adding an eighth, and the one that got through the first draft is the argument for paying it.

Prior art

The shape is this repository's own, and the two closest neighbors are worth naming because the gate is deliberately built from their parts rather than from a new idea. script/lint's "the SMB server cannot compute a proof" check pins a dependency's section in a manifest, in both directions, with a message that says what to do instead; this pins an API surface the same way. Milestone 113's Kani shim is the ancestor 135 pointed at, and the finding here is that its problem does not exist for loom.

Outside the tree, pinning a public surface to catch semantic drift is cargo-semver-checks and Rust's own rustdoc-JSON API snapshots. The reason not to reach for either is that both answer "did the API break compatibility", where the question here is "did the API grow a way to observe a decision without taking it", which no general tool can know.

Scope note

No system call surface, no wire format, no new dependency, and no DECISIONS.md section: nothing here decides anything global. It adds one check to script/lint, two doctests, and this block. The kernel and the crate are byte-identical apart from the doc comment carrying the doctests.

BUGS

Follow-on

Index row

Milestone 135's value is that the thing loom searches is the thing the kernel runs, and nothing checked it: a later lane could hand the decision back to untyped.rs and every gate would stay green. 135 proposed milestone 113's Kani shim shape; it does not transfer, because 135 already did it in one flag (RUSTFLAGS="--cfg loom -D warnings"), loom being an ordinary dependency where kani is not. The real property needed a different gate. Pin the claim protocol's public surface with receivers (claim_for_destroy taking &mut self IS the mechanism), require every region free site to have taken its warrant. Carry two compile_fail doctests with error codes so the claim cannot be forged or duplicated. The first draft was green against a rebuilt double free that needed no edit to crates/regions at all, because has_children and bounds are public and enough; that miss is why the unit is the warrant rather than the set. Verified against seven regressions, all seven caught