Skip to main content
← Lab

unalign

confirmedshipC · Apple M4Systems & data structuresJuly 17, 2026

the question

On Apple M4, do unaligned scalar accesses incur a throughput penalty, and does an atomic that crosses a 16-byte boundary fault?

what came out

Unaligned 8-byte loads run at about 0.235 ns/load at every offset, including cache-line and page crossings, with no penalty. But an atomic that straddles a 16-byte boundary raises SIGBUS deterministically. An 8-byte atomic is fine only while its bytes stay inside one 16-byte block, and a 16-byte atomic needs full 16-byte alignment.

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/unalign