roadmap

ext4, read and write: the write oracle

The write half of milestone 190's oracle: what rsext4 writes, judged by e2fsck -fn and read back through debugfs. The read half is in the read-oracle appendix.

How it judges a write

tools/ext4_oracle/write_compare.py builds the read oracle's corpus, then runs each case in tools/ext4_oracle/write-cases.txt on a fresh copy of three of its images:

base block size sector size
default-4k 4,096 4,096
default-4k 4,096 512
default-1k 1,024 512

ext4_oracle_write (tools/ext4_oracle/src/bin/ext4_oracle_write.rs) mounts the copy read-write through rsext4, applies the case's operations, and unmounts. A failed operation stops the case there, and the writer still unmounts the volume, so the oracle judges what the failure left too. The data each write puts down is a xorshift64 stream of a seed that the case names, which the driver computes itself; nothing on the oracle side asks rsext4 what it wrote.

The oracle judges each run three ways:

The cases cover these operations:

What it measured

The writer is the rsext4 the read oracle names: partsfoundry/rsext4, upstream's 0.9.2 with the fixes its CHANGES.md lists. Measured on a Linux host with e2fsprogs 1.47.2, against 0.9.2 on 2026-11-22 (UTC) and against the fork on 2026-11-23. A run takes 100 seconds on a developer machine, about five minutes of processor time.

Against the fork, every operation applies and every readback equals the model. e2fsck calls 42 of the 48 images clean, and exits 0 on the other six, which offer to shorten a tree:

case 4 KiB on 4,096 4 KiB on 512 1 KiB on 512
directory-past-inline-extents exit 0, offers to narrow the tree the same the same
truncate-depth-2-inside-a-block exit 0, offers to shorten the tree the same the same

Against 0.9.2, 13 images were not clean. Two more bugs gave the difference, and the fork fixes both:

What it does not cover

Name: provisional. For the measurement the parent's phase 3 cites. calef names files.