Measure lazy parent promotion reads on independent filesystems

Merged
VA
2d ago
+102-66

Summary

lazy_workspace::tests::mount::source_parent_promotion_reads_only_the_record has failed on every clean-main run since #788 (6556f96ae), always with left 0, right 2.

Root cause: a stale measurement assumption, not a production regression. #788 shares one decoded-page cache across every LogicalObjectStore clone of an Fs. The test measured its record-only control first and then promotion, both on the same filesystem. As a result:

  • the promotion lookup was served entirely from that cache and made 0 backend reads;
  • the control had already made 2 backend reads for the same pages.

Promotion still reads only the record. The cache made the second measurement free, which is the behavior #788 intended.

Why CI missed it: CI does not run the acyclic-fs lib test binary, so nothing exercised this test after #788 merged.

Change (test only)

  • Each variant now runs on its own Fs::memory(), so neither measurement warms the other.
  • The comparison covers backend reads, object bytes read and page reads. Page reads count every authenticated frontier page, whether or not it was served from cache.

Controls

  • Negative control: promotion plus one extra child lookup has to fail the same (backend_read_operations, object_bytes_read, page_reads) comparison.
  • Cause witness: a repeat of the record lookup on one filesystem is pinned at 0 backend reads. This documents the #788 cache behavior that broke the old test.
  • Both the published and the unpublished source-parent paths are covered: 2 reads / 233 bytes each, equal to the record-only control.

Validation (bb1)

GateResult
Build (cargo test --locked -p acyclic-fs --lib --features model-checking --no-run)654 s
Target testpass
lazy_workspace:: filterpass, 0.229 s
Windows GNU compile proof (cargo check --locked -p acyclic-fs --lib --tests --features model-checking --target x86_64-pc-windows-gnu)exit 0, 67.7 s

🤖 Generated with Claude Code


Summary by cubic

Fixes the flaky source_parent_promotion_reads_only_the_record test, which failed on every clean-main run since #788.

Since #788, all stores of a filesystem share one decoded-page cache. The test measured its record-only control and then the promotion on the same filesystem, so the second lookup was served entirely from that cache and made 0 backend reads. Each measurement now runs on its own Fs::memory(), and the comparison also covers page reads (which count cached pages too). A negative control that adds one child read must fail the same comparison, and a witness pins the warm repeat at 0 backend reads so the cause stays documented.