606. A directory walk costs what it does on Linux
calef, 2026-09-26 (UTC), on the walk figures of milestone 121 (ripgrep on nife: enumeration as
a capability): "20x slower is unacceptable." Raised
the same day for lane milestone/606-walk-cost. (Number and title provisional: the integrator
mints the number at merge, and the title is a draft until an architect names it.)
Index row
A recursive std::fs walk on nife was about 68x slower than Linux on the same machine. The FS
server now keeps what it read, so a warm walk never reaches the device, and a subtree grant the
server enforces itself brings it to 0.85x Linux.
The goal
Parity with Linux on the same hardware tier for the walk ripgrep's ignore crate performs: list
every directory, read every file. The instrument is milestone 121's (walk_pricing over
file_system_contract::fixture::walk), through the grant a confined rg pattern src/ will hold.
What is built
- The measurement.
fs_walkinscript/bench --real --release --smp(the release kernel, HVF) runsstd_exerciser's priced walk and prints it split bystd::fscall.bench/host/run_linux_walk.shruns the same walker as PID 1 of an Alpine kernel on the samevirt,accel=hvfmachine.redoxfs_server/examples/walk_replay.rsreplays the walk's requests against the server core and counts device reads and server time. - The fix inside the contract. The FS server remembers listings, names and small files until a
mutating verb forgets them (
redoxfs_server/src/memo.rs). Its block cache is 256 slots, allocated as they fill, without the header ring.OPENandCLOSEskip the engine's transaction when the memo answered, and thestdPAL copies its shared page withmemcpy. - The gates.
redoxfs_server/tests/walk_cost.rsasserts a warm walk reads nothing from the device. Host tests inredoxfs_serverprove every namespace change, write and truncate is seen through the memo. The kernel suite's walk test asserts the newwalk splitline.
Warm walk, release kernel, HVF, 2026-09-26: 27.0 to 29.5 ms before, 0.76 to 0.82 ms after; Linux 0.41 to 0.42 ms. notes/walk-cost.md has the split, the method and the caveats.
The wire changes, ruled 2026-09-27
calef ruled on #1387. Each option was prototyped and measured first; the note has the table.
- A (07:04Z), built on
milestone/606-open-path:OPENandOPENDIRtake a relative path, resolved per step on the server with the rights the hop-by-hop walk would get. 0.58 to 0.61 ms. - B (07:06Z, second form), built on the same branch:
OPEN's reply carries the size, and the std overlay sizes whole-file reads from it. With A, 0.515 to 0.53 ms, about 1.26x Linux. - D (07:17Z, option 2), built for RedoxFS on
milestone/606-scope: an eligible server narrows a subtree grant itself, keyed on the badge milestone 599 (a frame per filesystem client channel) added. Every path and handle goes throughcrates/subtree_scope, whose Kani harnesses prove it. 0.347 to 0.355 ms, about 0.85x Linux. Caretakers stay the default. - T1 (15:22Z), built on
milestone/606-progenitor: the server says it is eligible in a second ELF note, andscript/lintchecks it against a package field. The progenitor gives a directory grant a bound badge when the note is there and a caretaker otherwise. - E, not built and not asked: a 64 KiB channel for
std, whichstd_runtime_contractfixes at one page.
Follow-on
- Done.
UNBINDat reap. The progenitor takes a bound window's grant back whenjob_undertaker's "reaped" message arrives (milestone 685 (a job is finished when its memory is back)). A window whose job never started is unbound at once. Only then does the window go back to the pool:Windows::takeingrant_plan::job_windowsskips a window still bound, andtake_never_hands_out_a_bound_windowfails if the unbind moves back to reuse. - Recorded. A cold walk on both sides, with Linux on ext4 over virtio rather than tmpfs, is a
limitation in
notes/walk-cost.md.
BUGS
fs_walkwaits forever on astd_exerciserthat aborts, because an aborting program never sends its end-of-stream marker (the kernel suite'sdrain_sinkrecords the same gap).- Under load the host sometimes runs the guest on an efficiency core, and every figure in the run moves about 1.55x at once. The ranges quoted are the fast mode, from three boots.