The Store Buffer's Partial Store Forwarding Failure: Why a Byte Write Followed by a Word Read Stalls

2026-09-08

Store-to-load forwarding is the CPU's fast path: when a load's address matches an older store still sitting in the store buffer, the CPU forwards the store's data directly to the load without waiting for it to hit L1. This saves 4-5 cycles. But forwarding only works when the store fully covers the load. When it doesn't, you hit a partial store forwarding stall, and the penalty is brutal: 10-20 cycles on Intel, sometimes more.

The rule the hardware enforces: the store must be at least as wide as the load, and the load must be fully contained within the store's byte range. If the load reads bytes the store didn't write — even one byte — forwarding fails. The CPU has to drain the store to L1, then re-issue the load from cache. On some microarchitectures it's even worse: the load waits until the store retires, not just until it commits to cache.

Concrete example. This C code triggers it constantly:

The load needs 4 bytes; the store buffer only holds 1 byte of that range. Bytes 1-3 haven't been written yet (or were written by an even older store that already drained). The CPU can't assemble the load's value from mixed sources — the store buffer forwards whole values, not partial ones. Result: the load stalls until the byte store hits L1.

The opposite direction — wide store, narrow load fully contained — does forward cleanly. A 4-byte store followed by a 1-byte load of any byte inside it works fine. It's the narrow-store-wide-load pattern that dies.

Where this bites in real code:

Rule of thumb. A forwarded store saves ~5 cycles. A failed forward costs ~15. So partial forwarding is roughly 3x worse than no forwarding at all. If you're writing then immediately reading the same memory, either make the store wider than the load, or space them far enough apart that the store drains naturally before the load issues.

See it in action: Check out Super Mario Voice Generator AI Free — How to Get Nintendo Character Voice Text to Speech Online? by Abdel - AI Music Tools to see this theory applied.
Key Takeaway: Store-to-load forwarding requires the store to fully cover the load's byte range — a narrow store followed by a wider read of the same address triggers a 10-20 cycle stall while the store drains to L1.

All newsletters