roadmap

Measured for the rulings: (d), (g) and (h)

Appendix to 784. Reuse what the tree wrote.

Items (d), (g) and (h) each took a §46 (thin primitives or whole subsystems) ruling that followed data. This page is that data, measured on 2026-10-21 (UTC) at base 810666a39 on patagonia (Apple M3) with the pinned nightly of 2026-10-20. Each section ends with the options, the lane's recommendation and calef's ruling. No dependency was added: every probe is generated outside the tree by probe.sh, and none of the crates below is in Cargo.lock.

Item (c) is not measured here. (c0) has its own probe, and (c1)'s trial is measured in the ruling that refused (c1) to (c4). Item (b) is held for milestone 705 (full-screen programs).

(d) user_mode_heap against talc 5.1.1

What each one is

user_mode_heap is a first-fit, address-sorted free list with coalescing. It keeps no header on an allocated block: dealloc gets the Layout back and recomputes the size on a 16-byte grid. Allocation walks the free list, so its cost grows with the number of free blocks.

talc 5.1.1 is a dlmalloc-style allocator with boundary tags and size-class bins, close to TLSF. Each allocated chunk carries a one-word tag above it. Its deallocate also takes the Layout and finds the tag from ptr + size, so allocation_cache's rule still holds: a block is freed under its class's layout, which the std PAL already does (class_layout).

Throughput and fragmentation

The benchmark in probe.sh gives each allocator the same 256 MiB arena and the same operation stream, 11 runs each. Figures are nanoseconds per operation (an allocation, a free or a grow), median with the range. Peak extent over live is the highest byte touched over the most bytes ever live at once: 1.00 would be no fragmentation and no per-chunk overhead.

case allocator median ns/op range extent / live
a 48-byte box, alloc then free, 200,000 times ours 8.9 7.0 to 11.1 n/a
talc 11.4 10.0 to 14.3 n/a
1,000 vectors doubled from 16 B to 64 KiB ours 28.2 28.0 to 32.3 1.14
talc 11.6 11.0 to 12.6 1.99
random churn, about 500 live, 2M ops ours 137.3 136.9 to 138.3 1.17
talc 15.7 15.5 to 15.8 1.31
random churn, about 5,000 live, 2M ops ours 738.3 731.2 to 751.8 1.12
talc 14.1 13.9 to 14.3 1.27
random churn, about 25,000 live, 1M ops ours 6,474.5 6,374.9 to 7,396.9 1.17
talc 13.4 13.1 to 15.1 1.30

The churn's sizes are 70% under 128 bytes, 25% up to 1 KiB, 4% up to 16 KiB and 1% up to 128 KiB, with one request in twenty 64-aligned. Frees pick a random live object.

What the numbers say:

What this leaves out. These are host figures, without the PAL's spinlock, the thread cache or the kernel's page mapping. The machine was shared with other lanes, at a load average of 8 to 14 during this run. Nothing here measures how many free blocks a real nife program holds. job_mix and std_heap_contention would put the allocators on target, and doing that needs talc in the tree, which is what the ruling decides.

Code size

The probe puts alloc, free and add-a-region behind extern "C" in a no_std static library for aarch64-unknown-none-softfloat, with LTO, and sums the text symbols those reach.

ours talc
alloc, free, add a region 484 bytes 1,944 bytes
with grow in place n/a 2,364 bytes
heap object 16 bytes 32 bytes
first-heap metadata none 1,575 bytes of bins

Every process carries one copy, so talc costs about 1.5 KiB of text and 1.5 KiB of heap more.

What would be lost, and what proves each

The cost the earlier rows did not name: std embeds the heap

cargo xtask std-src copies crates/user_mode_heap/src/lib.rs verbatim into std as sys/alloc/nife/user_mode_heap.rs, because std cannot depend on a crates.io crate. talc has no rustc-dep-of-std feature, and neither do its two dependencies. The core it would need, base/, node.rs, ptr_utils.rs and the Source trait, uses neither dependency outside docs and tests. So the generator could copy about 3,360 lines in several files and rewrite their crate:: paths, without patching the algorithm. That is still vendoring under §46, and every talc release would be a regeneration and a review.

std programs are where the large heaps are (ripgrep, mdr), so taking talc for the no_std programs alone would leave the slow case where it matters.

Decision (d), and the options

Recommendation: A. The 483-times figure decides it: ours fails on a workload that is ordinary for a server, and talc is maintained, Miri-checked and fuzzed. The memory and size costs are measured and small. B would be choosing to write what exists, and I would not choose it at equal effort. The vendoring is a real cost, and the ruling should say whether it is acceptable here.

Ruled: A. calef, 2026-10-21 (UTC), on #2490: "A sounds right." Vendoring talc's core into std is accepted as part of A.

(g) portable_executable against object 0.40.0

What object would replace

portable_executable has 386 code lines outside its tests. By section:

part code lines with object
reading the ELF header, program headers, dynamic section 118 object::read::elf replaces most of it
the image and the relocations applied into it 63 stays: converter policy
one section per PT_LOAD 39 stays
writing the PE headers and .reloc 134 object::write::pe::Writer replaces most of it

At most about 250 lines retire; the 102 lines of policy stay. That is an estimate by section, not a prototype.

What object costs

With the narrowest features a converter needs (read_core, elf, write_core, pe, no defaults), object resolves to 8 crates. Two are new to Cargo.lock, crc32fast and foldhash, besides object itself. The rest (memchr, indexmap, hashbrown, equivalent, cfg-if) are already there at the same versions. object is 68,616 lines; write/pe.rs is 858 of them. It is MIT or Apache-2.0, released 2026-08, with no advisory.

Milestone 821, which the options turn on

Milestone 821 (portable_executable: an ELF-to-PE converter, proven, then released on its own) would have proven the crate with Kani and published it. A crate a model checker must reach in full cannot have object inside it. No ELF-to-PE converter exists on crates.io; object writes PE but converts nothing.

Decision (g), and the options

Recommendation: A. The only consumer is xtask on its own build product, so B buys little exposure, and it reverses a ruling that has a milestone behind it. I would choose A at equal effort.

Ruled: B. calef, 2026-10-21 (UTC), on #2490: "B". object, with minimal features, does the ELF reading and the PE writing, and the conversion policy stays ours. Milestone 821 is refused: its input is nife's own build product, so its proofs would protect no known user.

(h) uutils for the coreutils programs

Does it build for nife?

The probe builds each uu_* 0.12.0 crate unmodified, with a main that calls its uumain, against this worktree's patched std for all three nife targets.

utility builds aarch64 riscv64 x86_64 ours on x86_64
printenv yes, all three 376,496 366,880 415,440 20,656
date yes, all three 1,522,304 1,526,864 1,610,232 25,768
wc no: errno n/a n/a n/a 20,304
rm no: errno, console n/a n/a n/a 21,032

Sizes are bytes. The uu_* builds are stripped, opt-level = "z", with LTO. Ours are the tree's release profile, unstripped. On aarch64 and riscv64 our four measure 82 to 101 KB, page-aligned segments included, so x86_64 is the fairer column. Building is not running: nothing here ran a uu_* program under nife.

Why two fail

What it would change

Decision (h), and the options

Recommendation: A. The demo value is real, so the candidate stays recorded with these numbers. The capability shape decides it for base: a wc that needs a filesystem grant is worse than ours on the property nife exists to show. At equal effort I would still choose A.

Ruled: A. calef, 2026-10-21 (UTC), on #2490: "A".

Rerunning

cargo xtask std-src
design/roadmap/0784-reuse-what-the-tree-wrote/probe.sh heap
design/roadmap/0784-reuse-what-the-tree-wrote/probe.sh object
design/roadmap/0784-reuse-what-the-tree-wrote/probe.sh uutils

Each needs the network. WORK names the directory the probes are generated in.