Mehdi Akiki

Posts tagged "testing"

  • Published on

    Investigation · Part 13 of 20 · When the benchmark lies

    Compare Two Versions by Interleaving the Runs

    I compared a program with an identical copy of itself, and in 3 of 5 experiments the copy was significantly faster or slower. Running the two versions in blocks measured the moment, not the version. Interleaved runs found no difference, and found a real 4% change every time.
  • Published on

    Investigation · Part 11 of 20 · What survives a crash

    Recovery Code Must Survive a Crash Too

    A recovery that writes files can crash too, and then a second recovery must give the same result. I killed my store 500 times during its own recovery: one design always recovered correctly, the other doubled a counter 53 times. The fix is one number in the snapshot.
  • Published on

    Investigation · Part 9 of 20 · What survives a crash

    Write-Ahead Logging From Scratch

    I built a tiny key-value store in Rust with a write-ahead log: append, fdatasync, apply, and only then say ok. My crash simulator checks every crash point, and it finds the bug that kill -9 never shows: an ok printed one fdatasync too early.