Skip to main content
← Lab

seqlock

confirmedcertificateC · Apple M4Systems & data structuresJuly 14, 2026

the question

Is the four-fence set for a single-writer multi-reader seqlock a minimal RC11 antichain under herd7, and what does a validated read cost on Apple M4?

what came out

herd7 under rc11.cat proves the four-fence set minimal: every single-fence weakening resurrects the torn-and-validated witness, and the acquire-only-s2 optimization is unsound. On M4 over-fencing costs about 37% uncontended (0.93 vs 0.68 ns); the dominant cost is true-sharing the counter, which cache-line padding cannot fix.

method & receipts

  • Result: confirmed
  • Pre-registered the prediction was written down and committed before the run.
  • Reproducible one script re-runs the whole thing from scratch.
  • Tested — a correctness/benchmark suite ships alongside the code.

→ read the code and re-run it

github.com/v-code01/seqlock