roadmap PARTIAL

813. file_allocation_table: a proven FAT crate, released on its own

(From calef's rulings on pull requests #1803 and #1806; the title and slug are drafts. On the customer path: milestone 140 (mount a drive this system did not create) needs it for its FAT32 stratum.)

calef's rulings, quoted from the maintainer comments of 2026-10-07 and 2026-10-22 (UTC):

The stages

Built in this order, by the #2580 ruling. Each lands on its own and leaves the installer working; fat-adopt-or-build.md prices them.

  1. The long-name writer in the existing mkfs: milestone 560, built.
  2. The sector interface, boot sector and BPB parse, and FAT type by cluster count, with a per-sector no-panic harness and the reader's first fuzz target. The oracle's dev-dependency pin is ruled here. Built: stage-2-the-reader-begins.md has what landed.
  3. FAT entry decode, the bounded chain walk, and directory slots read as stored, with the oracle tests in both directions. Built: stage-3-the-table-and-the-chain.md has what landed, the oracle's pin and its fsck check.
  4. Directories: long-name assembly with the checksum checked, and #1803's macOS images read to their recorded hashes. Built: stage-4-directories-and-long-names.md has what landed.
  5. File read and the MBR. Milestone 140's read-only stratum can start here. Built: stage-5-reading-files-and-the-partition-table.md has what landed.
  6. Allocation, write, extend, truncate and delete, with FSInfo and the dirty bit, and the round-trip harness. Built in two pull requests: stage-6-allocation-and-write.md has what landed.
  7. Make and remove directories, rename, and long-name creation with alias numbering. Built: stage-7-directories-and-long-names.md.
  8. The general format for FAT12, FAT16 and FAT32, folding the mkfs in, with FAT12 and FAT16 oracle images. Built: stage-8-the-general-format.md.
  9. Timestamps, attributes and the label, then script/crate-standalone and the README for release. Attributes, the label and the README landed (stage-9). Timestamps landed (2026-11-01 UTC): a writer supplies a Clock, NoClock means no time, the crate refuses an unstorable time, and a read takes no clock.

What exists, checked 2026-10-07 (UTC)

Reuse: written here, not taken, by calef's ruling on #1803 fork 2. Three reasons, all from that ruling. It parses hostile input (a stranger's USB stick), and §46 (thin primitives or whole subsystems) has nife write the crates Kani proves, because a model checker needs code we can restructure. Proofs are the point. And the main-line candidate, rust-fatfs, has not released since fatfs 0.3.6 (2023-01-17); that release writes subdirectories fsck_msdos rejects, the fix landed upstream on 2024-10-23 unreleased, and a release request has been open since 2023 (rafalh/rust-fatfs #81).

fatfs and embedded-sdmmc were measured against this block on 2026-10-22 (UTC), Kani included, in 784's FAT appendix. calef's #2580 ruling above settles it: this block builds the full crate, in the stages above.

References and oracles

Read for behavior and test against; copy no code unless its license allows it and the copy is recorded at the copied item with its source, commit and license.

crate license use here
rust-fatfs (main line), as lamfat 0.4.3 MIT the oracle: host tests read what this crate wrote, and this crate reads what it wrote
hadris-fat 3.0.0-rc.1 MIT a second reader, and the exFAT reference for the later crate
embedded-sdmmc 0.10.0 MIT or Apache-2.0 a reference for FAT16/32 without allocation. Its project bans AI-generated contributions, so per #1806 fork 8 it gets bug reports only
simple-fatfs 0.1.0-alpha.2 MIT a no_std reference; alpha, last updated 2025-09-14

The specification is Microsoft's "FAT: General Overview of On-Disk Format" (version 1.03), which the existing crate already cites.

The oracle's pin, ruled 2026-10-25 (UTC): lamfat = "=0.4.3" from crates.io is a [dev-dependencies] line of this crate only, pinned by checksum in Cargo.lock, outside the base graph. Its fsck condition held; the stage 3 appendix has the run.

Scope

Non-goals for the first release:

What is proven

The table names what is proved; the rest is this milestone's scope, not a step before it. Each row is a property this crate must prove before it publishes. The harness cell names the Kani harness that proves it, or says none yet; every named harness carries a falsification patch that makes it fail at its own assertion. Each patch sits at crates/file_allocation_table/falsifications/<module.path>.<harness>.patch, as §134 (a harness carries a machine-replayable falsification record) and script/falsifications require.

property harness
No panic and no out-of-bounds read on any image: every parse step (boot sector, BPB, FSInfo, FAT entry, directory entry, long-name run, partition table) takes a symbolic sector and returns a value or an error boot sector and BPB: boot_sector::verification::what_the_parse_accepts_lies_inside_the_volume, the_fat_type_is_the_cluster_counts, the_table_has_an_entry_for_every_cluster, only_a_data_cluster_has_sectors; FAT entry: table::verification::every_entry_lies_inside_the_table, an_entry_decodes_by_its_markers; directory entry: directory::verification::every_slot_parses_as_its_bytes_say, a_directory_reads_only_its_own_sectors; long-name run: long_name_assembly::verification::a_run_is_accepted_only_when_it_is_well_formed; partition table: master_boot_record::verification::every_sector_parses_to_a_sound_table_or_an_error; FSInfo: file_system_information::verification::every_sector_parses_to_hints_inside_the_volume
Cluster chains cannot loop: a walk from any start over any FAT contents ends within the volume's cluster count, at an end-of-chain marker or with an error reader::verification::no_chain_walk_outlasts_the_volume, on volumes of one to eight clusters; file reads: file::verification::a_file_read_stays_inside_its_size_and_its_clusters; partitions: master_boot_record::verification::a_partition_device_reads_only_its_partition
A table write changes only its entry, allocation takes one free cluster, a release never frees a bad or reserved cluster, a cut keeps exactly the head of the chain, and an FSInfo store changes only its two hints table::verification::a_stored_entry_reads_back_and_disturbs_nothing_else, encoding_inverts_decoding; allocation::verification::allocation_takes_one_free_cluster_and_nothing_else, a_release_frees_only_its_own_chain, a_cut_keeps_exactly_the_head_of_the_chain; file_system_information::verification::a_store_changes_only_the_two_hints
A format reads back as itself: its boot sector parses to the same type, clusters, table size and data start format::verification::a_geometry_parses_back_to_itself
Write then read round-trips on a small symbolic volume, byte for byte, with the chain as long as the size needs; the directory entry is the oracle tests' write_cursor::verification::a_partial_sector_write_keeps_the_head_and_zeroes_the_slack, a_write_extends_the_chain_to_the_size_and_stays_inside_it
Directory entries and long names are well formed: every short name is legal, every long-name run carries the matching checksum and ordinals, every alias carries its number, and the reader refuses a run that does not writer: long_name::verification::the_checksum_is_the_specifications_loop, every_long_name_run_is_well_formed, every_alias_is_a_legal_short_name, every_numbered_alias_carries_its_number; directory_writer::verification::the_run_finder_returns_the_first_run_of_free_slots; reader: long_name_assembly::verification::a_run_is_accepted_only_when_it_is_well_formed

Kani bounds its inputs, so whole-image coverage comes from composing per-sector proofs, with script/fuzz over whole images as the backstop. The block states that bound rather than claiming more. Not proven, by design: crash consistency (FAT has none), and the caller's sector interface.

Oracle tests

Parity

The crate is pure logic and its tests run on the host. It builds for aarch64-unknown-none-softfloat, riscv64imac-unknown-none-elf and x86_64-unknown-none in the tree's build, so nothing about it can work on one target and not another.

Release, by #1806's rulings

  1. The name is settled before anything leaves (857's Fork 5 as calef amended it on 2026-10-11 UTC). script/names file_allocation_table reports it ratified, crates.io answers 404 for it (or it is already ours), and partsfoundry/file_allocation_table does not exist yet. script/crate-standalone checks the first.
  2. In the tree, script/verify runs the harnesses, and Cargo.toml says publish = false.
  3. The package is version 0.1.0 with its own semver, states its minimum Rust version in rust-version, and ships its harnesses and falsification patches. cargo package --list shows them.
  4. At first publication, and not before, calef adds it to the lint-checked publish allowlist. The partsfoundry/file_allocation_table repository is created when the crate moves, for the soak (step 5), on the shared CI template (Kani through kani-github-action, lint, release). Its release workflow refuses to publish unless the proof job is green.
  5. Soak, as its own repository, until the soak's five end conditions in the runbook hold.
  6. Publish and consume the release by version, by the runbook's publication steps.

Standalone, measured 2026-10-11 (UTC)

script/crate-standalone file_allocation_table found, at base ae6b91e79, a workspace-inherited manifest, no README or license files, and 14 lines that cite this tree.

script/names reports the name file_allocation_table ratified (checked 2026-10-25).

Measured again on 2026-10-25 (UTC): with --no-kani the manifest, files and all four targets pass, and only Name: blocks still cite the tree. With Kani, every harness proves and every falsification patch fails its harness.

Review before release

Exit

cargo test -p file_allocation_table fails if any piece is missing. It reads both #1803 images to their recorded hashes, writes the tree above on FAT12, FAT16 and FAT32, and has rust-fatfs and fsck_msdos (or fsck.fat) accept each. It formats a FAT32 EFI system partition holding \EFI\BOOT\BOOTRISCV64.EFI, a name that needs long-name entries. script/verify proves the four properties, script/falsifications reports every harness replayable, and the crate builds for all three targets. Publication is the last step and not the exit, since it waits on calef. The five soak criteria of release step 5 hold before it publishes.

The name check of release step 1 passes first, by Fork 5 of milestone 857. Before the move, script/crate-standalone file_allocation_table exits 0 in nife, and every row of What is proven names a harness that stock Kani proves in the copy and whose falsification patch makes it fail. No crate publishes without the proofs milestone 857 (crates released on their own) requires.

Patents

Microsoft's long-name (VFAT) patents have all expired, per Google Patents, checked 2026-10-14 (UTC). Google Patents marks its status an assumption rather than a legal conclusion, and this record is not legal advice.

patent title priority expired
US 5,579,517 Common name space for long and short filenames 1993-04-01 2013-11-26
US 5,758,352 Common name space for long and short filenames 1993-04-01 2013-04-01
US 6,286,013 A common name space for long and short file names in an operating system 1993-04-01 2013-04-01
US 5,745,902 Accessing a file using file names having different file name formats 1992-07-06 2015-04-28

The first two were the ones asserted against TomTom in 2009 and upheld on reexamination. All four predate 1995, so none can still be in force. FAT12, FAT16 and FAT32 themselves date from 1977 to 1996. The search was for the known Microsoft families, not a freedom-to-operate opinion.

What the crate no longer cites

The crate's source cites nothing of this tree beyond its Name: blocks. This section keeps the links it carried, by milestone 857's provenance rule.

Follow-on

BUGS

Index row

nife's own FAT12/16/32 read-write crate with long file names, proven with Kani because a USB stick is hostile input, checked against rust-fatfs and fsck_msdos, and released on crates.io from its own nifeos repository. Milestone 140's FAT32 stratum is built on it. exFAT comes later.