What the review read and ran
An appendix to the milestone.
The crate
partsfoundry/file_system_contract at 05515061699d24510ddffa7ef561c9f344227333, version 0.1.0,
no tag, a fresh clone of main. The census of milestone 1129 (the combine review) counted it at
the same commit. The repository is a workspace of two crates. The review covers
file_system_contract/; of file_system_fixture/ the lane read the head of the manifest and of
the README, which say the crate is test data and never publishes.
The lane read in full: the root Cargo.toml and README.md, and in the crate Cargo.toml,
README.md, CHANGELOG.md and eleven source files: lib.rs, error.rs, block.rs,
file_system.rs, directory.rs, directory_entry.rs, volume_statistics.rs, nameset.rs,
verb.rs, grant.rs and extended_attribute.rs. It read the first three harnesses of
proofs.rs and the names of the other seven, the head of .github/mutants-exempts, the last
line of docs/stranger-test.md and the names of the five fuzz targets. It read no test file.
The commands
The lane ran each command on a Linux x86_64 host with rustc 1.100.0 and kept every build's
output in a CARGO_TARGET_DIR beside the clone, never in it. The clone's git status --short
was empty at the end. The first four commands ran at the workspace root.
cargo buildpasses.cargowarns thatpackage.homepagerepeatspackage.repository(P2-4).cargo testpasses: 81 unit tests and 7 doctests in the contract, and 23 tests and 1 doctest in the fixture.RUSTDOCFLAGS="-D warnings" cargo doc --no-depspasses with no warning.cargo clippy --all-targetspasses with no warning, under the root'sclippy.toml.cargo build -p file_system_contract --lib --targetpasses withx86_64-unknown-none, withaarch64-unknown-none-softfloatand withriscv64imac-unknown-none-elf.cargo package --list --allow-dirtyin the crate's directory lists 48 files: the sources, 15 falsification patches, the two licenses and no CI file.- The crate declares no features, so there is one feature combination.
grep -rc 'kani::proof' srccounts 15 harnesses: 10 inproofs.rs, 3 indirectory.rsand 2 inerror.rs(P1-4).grep -c 'pub fn\|pub const fn'over the library sources counts 66 public functions.grepfinds six# Examplesheadings, five# Panicsand no# Errors(P1-2).grep -n 'RedoxFS\|redoxfs'over the sources and the README finds nine lines (P1-3).grep 'derive'finds four: onOperand,Verb,PolicyandRights(P1-5).
A scratch program that depends on the crate by path printed, in a release build:
block::READ,file_system::READ,directory::rights::READandgrant::rights::READare 1, 2, 2 and 1. The fourWRITEconstants are 2, 3, 4 and 2 (P0-1).file_system::request(block::READ, 0, 4)has the operationOPEN(P0-1).Rights::root(grant::rights::WRITE)allowsdirectory::rights::READand notdirectory::rights::WRITE(P0-1).file_system::request(file_system::READ, 1024, 3)decodes as handle 1024 and length 3 (P0-1).file_system::request(257, 3, 10)has operation 1, andblock::request(0x102, 1)operation 2.request(0x1ff)has operation 255 (P0-2).block::request(block::READ, 4) | 0xabc << 8decodes as a count of 4 and operation 1 (P0-3).rename_destination(7, 5) | 0xff << 56decodes as handle 7 and length 5 (P0-3).- A request built with
MAXIMUM_LENGTH_BYTESdecodes as a length of 1099511627775, againstMAXIMUM_TRANSFER_BYTESof 65536 (P0-3). - A listing of three records, cut two bytes short, yields two entries. A record whose flags
byte is
0xfereads as not a directory (P0-3, P1-1). let t: [verb::Verb; 23] = verb::TABLEcompiles, and so does aVerbwritten as a struct literal with its seven fields (P0-4).verb::of(0),verb::of(24)andverb::of(file_system::BIND)areNone.- A store of three attributes holds 27 bytes and counts 3. With bit 31 of the second record's
kind set it counts 1.
store::setof the first name on that blob returns 9 bytes, and the third attribute is absent from the result (P1-1). store::setwith an empty name isErr(34),store::removeof an absent nameErr(61), andstore::setwith a kind of0x8000_0000Err(22)(P0-5).explain(95)is "this capability does not carry extended attributes".explain(71)andexplain(5)are "the filesystem refused" (P1-6).- A hand-built name set of ten records counts 8, and the tenth name is not in it.
grant::specification_len(0xff)is 255, andgrant::unpack_namewith a length of 255 returns 16 (P2-2).{:?}ofRights::root(REMOVE_TREE)isRights(49).Rightsis 8 bytes,Verb48 andPolicy8 (P1-5).
The contract layout, item by item
In the crate's spellings, for the contract-layout decision of milestone 1129:
- Two interfaces in one crate, each a module:
blockandfile_system. - Magic: none.
- Version:
VERSION: u32 = 1in each module. It is in no message. - Identity:
block::INTERFACE_ID: u64 = 14andfile_system::INTERFACE_ID: u64 = 15. - Opcodes: bare constants in the module (
file_system::OPEN), with noOPERATION_prefix.OPERATION_SHIFT: u32 = 56sits at the root. - Request builders:
request(operation)at the root,block::request(operation, blocks)andfile_system::request(operation, handle, len), withrename_destinationand twospecificationfunctions for a second word. - Decoders:
operation(w0)at the root and one function for each field. One of them,block::request_block_count, returnsOption. No function decodes a whole request. - Replies:
error::wordanderror::codefor the first word, andextended_attribute::replywith its two readers. - Beyond the words:
verb::TABLE, five record encodings, and the readiness wordsREADYandDESCENT_REFUSED.
The search for a comparator
On 2026-11-26 (UTC), https://crates.io/api/v1/crates?q=<words>&sort=recent-downloads&per_page=8
for each of: "9p protocol", "fuse protocol", "filesystem protocol no_std", "file server
protocol", "block device trait", "virtio blk", "capability filesystem" and "nfs protocol". The
lane also measured by name fuser, p9, rs9p, ninep, nine, fuse-backend-rs,
polyfuse, fuse3, nfsserve, russh-sftp, cap-std, virtio-drivers, embedded-sdmmc,
embedded-storage, block_device, zerocopy, vhost-user-backend and wasi.
Five crates publish the messages of a file service and draw more than 10,000 downloads in 90
days: russh-sftp (2,586,407), fuser (2,222,734), fuse-backend-rs (1,538,329), nfsserve
(1,041,355) and p9 (61,504). The first three rank. The lane read p9 as well, because 9P is
the nearest protocol in shape: handles a server checks, a walk by name, and no path from a
global root. rs9p 0.13.0 (220), ninep 0.6.0 (1,130) and nine 0.5.0 (220) fall under the
floor. No crate found puts rights on a handle.
The comparators read
The six crates are the .crate files static.crates.io serves for the versions in the
block's table, each unpacked alone in an empty directory.
russh-sftp4.0.0:src/lib.rs,src/error.rs, and insrc/protocol/the filesmod.rs,status.rs,handle.rs,name.rs,version.rsandinit.rs, with the heads offile.rs,open.rsandfile_attrs.rs. The moduleprotocolis public.Packetis an enum of 27 message structs withTryFrom<&mut Bytes>, built onserde.StatusCodeis an enum underthiserror, and itsFrom<u32>maps an unknown code toFailure.SftpHandleis a newtype overVec<u8>.OpenFlagsis abitflagstype.InitandVersioncarry a version number and a map of extensions.Errorhas five variants that each hold aString. The features areasync-traitandraw-string. It needsstd,tokio,serdeandbytes.fuser0.19.0:src/ll/mod.rs, the heads ofsrc/ll/fuse_abi.rsandsrc/ll/request.rs,src/access_flags.rsand the exports ofsrc/lib.rs. The wire structs and the opcode enum arepub(crate)infuse_abi. The public surface is typed:Errno(NonZeroI32)with a constant for each code andFrom<std::io::ErrorKind>,INodeNo(pub u64),FileHandle(pub u64),Generation(pub u64),Version(pub u32, pub u32), and abitflagstype for each flag word.RequestErroris private, has four variants, two of which carry lengths, and implementsDisplayandError. An unknown opcode isUnknownOperation(u32).fuse-backend-rs0.14.0: the head ofsrc/abi/fuse_abi_linux.rsand itsOpcode,InitInandDirent.KERNEL_VERSIONis 7 andKERNEL_MINOR_VERSION33.Opcodeis a public#[repr(u32)]enum whoseFrom<u32>maps an unknown number toMaxOpcode. The flag words arebitflagstypes.InitIncarriesmajorandminor.p90.3.2:src/lib.rs,src/protocol/mod.rs, and the heads ofsrc/protocol/messages.rsandsrc/protocol/wire_format.rs. The moduleprotocolis private, and the public surface is the server and one fuzzing entry point.Tmessageis an enum of message structs with named fields.WireFormat::decodetakes astd::io::Readand returnsstd::io::Result.P9Stringholds aCString, andTwalkaVec<P9String>.Rlerrorcarriesecode: u32.cap-std4.0.3: the head ofsrc/fs/dir.rs.Dirwraps an open directory, andopen,open_dir,create_dirandread_dirresolve beneath it. The one way in from a path isopen_ambient_dir.virtio-drivers0.13.0: the item list ofsrc/device/blk.rsandErrorinsrc/lib.rs.read_blocks(block_id, buf),write_blocks,flushandcapacity;SECTOR_SIZEis 512;RespStatusis a newtype overu8;Erroris one enum underthiserror.nfsserveandembedded-storage: measured, not downloaded, not read.
The systems outside Rust
Each file came from a public mirror at the named commit.
- 9front at
d7e009b7866219fa6b2302941b939759ef2c2b68,sys/man/5/versionandsys/man/5/walk.Tversioncarriesmsize, the largest message either side will send, and a version string; a server that does not know the string answersunknown.Twalkcarries at most sixteen names, the constantMAXWELEM. The lane fetchedsys/man/5/0introand did not read it. - Fuchsia at
8ff2539fd32def0c2b9ed84b8c8873c31af81d22,sdk/fidl/fuchsia.io/rights-abilities.fidland theFlagstype ofdirectory.fidl.Operationsisflexible bits : uint64with nine members,ENUMERATE,TRAVERSEandMODIFY_DIRECTORYamong them. A permission a connection lacks fails the request withZX_ERR_ACCESS_DENIED.PERM_INHERIT_WRITEasks for the parent's write rights where it has them, and each server must remove the flag where the parent lacks one.
The benchmark
A scratch crate outside the clone depends on file_system_contract by path and russh-sftp at
=4.0.0, with bytes 1.12.2, serde 1.0.229 and tokio 1.54.1 resolved. The command is
cargo build --release and then the binary. The host is Linux x86_64, an Intel Xeon Platinum
8160 at 2.10 GHz with 80 threads, rustc 1.100.0. The benchmark runs on one thread.
Each measurement starts at 64 calls and doubles the count until one pass lasts 50 ms. It then
runs seven passes and reports the lowest, divided by the count. black_box wraps the input
buffer and the sum of the results. The input is 100 names of 12 bytes, file-0000000 to
file-0000099.
| measurement | what a call includes | run 1 | run 2 |
|---|---|---|---|
directory_entry::iter |
a walk of 1,400 bytes that sums each name's length and flag | 204 ns | 215 ns |
Packet::try_from(&mut Bytes) |
a clone of the Bytes handle, the decode of one Name of 2,409 bytes into a Vec of 100 File, the same sum, and the drop |
13,904 ns | 13,711 ns |
directory_entry::encode, 100 times |
the fill of a zeroed 4,096-byte array | 918 ns | 609 ns |
Bytes::try_from(Packet::Name) |
100 String clones, the Vec, the encode into 2,413 bytes, and the drop |
9,580 ns | 6,773 ns |
The block's table gives run 1. Each SFTP file carries an empty long name and an attribute record with no field set, the smallest the message allows. The two write rows moved by a third between runs, and the lane did not find why.
A second scratch crate, on the crate alone, with the same loop:
| measurement | run 1 | run 2 |
|---|---|---|
file_system::request, then the three field readers |
2.26 ns | 2.56 ns |
verb::of, then two fields |
3.16 ns | 3.30 ns |
error::code |
2.91 ns | 3.46 ns |
store::get, the last of 16 attributes with 20-byte names and 60-byte values |
83 ns | 86 ns |
store::set, replacing that attribute |
227 ns | 241 ns |
The lane ran no comparison with fuser 0.19.0 or p9 0.3.2: fuser keeps ll::fuse_abi
pub(crate), and p9 keeps protocol private, so no outside crate can call either decoder.
What the lane did not run
- Kani and the falsification replay; the harness and patch counts are from the source.
- The five fuzz targets.
- Mutation testing.
- The build at the minimum Rust version, 1.88.
- Any server or client of the two protocols.
- The tests of the comparators.