notes

SMB: the network file service a Mac mounted, and why it is no longer here (milestone 54)

The code this note describes was removed from the tree on 2026-08-30, on calef's decision. Every present tense below is the tree as it stood at commit 685900ec, which is the last commit that holds it; nothing described here can be built or run from main any more. The note is kept, and kept in full, because the thing it records is evidence rather than documentation. Milestone 54 (network) is the only time this project's first principle was realized end to end: a real customer's real machine running a real workload against this kernel. And AGENTS.md's own rule is that a finding worth keeping lands in notes/ rather than in a commit nobody will check out. Read it in the past tense. It is a record of what this system did.

What was demonstrated, and when

date what a machine did, not what a test asserted
2026-08-15 A real Mac mounted it. macOS 26's own mount_smbfs against the QEMU guest: the share mounted, ls listed it, both fixture files read back byte-correct, the volume arrived read-only (macOS honored READ_ONLY_VOLUME and refused a write client-side), a clean unmount worked, and a second mount proved the listener re-armed for a real client rather than only for the test prober.
2026-08-15 The file_system_contract-backed share: bytes a different in-guest process had put on RedoxFS came back over TCP, so the chain RedoxFS -> file_system_contract -> Share -> SMB2 -> TCP was checkable rather than asserted.
2026-08-16 The write path, gated on both ISAs by a file the host wrote over SMB2 and a different in-guest process read back through the FS server. Never met a real Mac (see BUGS).
2026-08-16 file_system_contract grew GET_VOLUME_STATISTICS (op 18); subdirectories, with smb_proto::path parsing a share-relative path once at the wire's edge.
2026-08-17 The AAPL create context and the FULL_SYNC Time Machine flag. Never met a real Mac.
2026-08-17 Identity: an NTLMv2 proof verified against milestone 65's credential service, with the kernel reading the shared frame through the direct map afterwards and requiring the key to be absent.
2026-08-19 Throughput measured through a real SMB client: write 4.8x, read 2.4x from raising the file transfer from 4 KiB to 64 KiB. See the throughput section.
2026-08-24 The session/connection split (milestone 152's first buildable piece), the shape session_reviver still carries.

The one number that survives the removal is there because it was measured rather than argued. Raising file_system_contract's transfer from one page to sixteen took an SMB write from 0.065 to 0.31 MiB/s and a read from 0.15 to 0.36 MiB/s, debug build under QEMU. The ratio transfers; the rate does not, and the note refused to convert it into a backup's wall clock for that reason. That refusal is still the right call and is worth copying.

The scale of what was deleted

Counted from the tree at 685900ec, by the lane that removed it:

piece lines
crates/smb_proto/ (10 modules: framing, server state machine, share, path, ntlmssp, spnego, create_context, apple, authenticator, a client) 7,218
user/src/smb_server.rs (the adapter program) 1,279
bench/smb-throughput.sh 100
crates/ntlm/ (removed in the same pass; 10 host tests, all [MS-NLMP] published vectors) 469
the host prober and smb-serve subcommand in xtask/src/main.rs ~226 referencing lines
the two-ISA QEMU gate wiring in kernel/src/user/ ~170 referencing lines

86 #[test] host tests in smb_proto and 10 in ntlm went with it, plus one QEMU check per ISA and the assert_smb_write_landed / assert_smb_held_no_key kernel-side assertions. Four external dependency crates left the graph: md4, md-5, hmac and digest, each of which had ntlm as its only consumer.

Why it was removed

The customer moved. Milestone 55's premise was a Time Machine target for the family's Macs, served by this kernel. That customer now backs up with borg over SSH on cordoba, so journey 2 is retired and the workload SMB existed to serve does not exist. calef ruled on 2026-08-30 to remove the implementation. The maintainer argued for keeping the working core as evidence and he reaffirmed. What that argument was reaching for is this note, which is the cheaper form of the same thing. 8,600 lines of protocol code carried on main cost every future refactor, every dependency audit and every parity sweep, where the record of what it proved costs a file.

What was deliberately kept, and why, because the boundary is the interesting part of a removal:

The NTLM half went with it, and that is the transferable lesson

crates/ntlm, the NTLM path through crates/credentialer, two credential_contract opcodes, and md4, md-5, hmac and digest were removed in the same pass. DECISIONS §79 (holding password-equivalent material) had approved them, and two known-broken hash functions, for NTLMv2 compliance. That reason was sound and entirely contingent on there being a protocol to comply with. Once the SMB implementation was gone, the tree carried a password equivalent and broken hashes for a consumer that no longer existed, and every gate stayed green. The lesson: re-check a dependency when the reason it was taken changes. A decision record that names its own premise is where that check can happen, and §79's premise is now stale and wants an architect's amendment. The removal was safe because nothing was ever stored and the opcode spaces are not positional. smb/ntlm-removal.md has the full list and both facts.

What never worked, and it is the honest half

Recorded here rather than lost with the code, because a future reader deciding whether to build this again should know what the last attempt did not reach:

Everything else the implementation did not do is still listed in the BUGS section below, unedited, which is where a reader should go for the full list.

The note as it stood before the removal

The rest of the original note is kept, unaltered in substance, in smb/. Read every present tense in it as "as of 685900ec".

BUGS

Every limitation of the removed program, kept in full, is smb/limitations.md. It is where to start if anyone builds a Mac-mountable share here again. The headline entries: