THE FOLD / CO-OP / THE HANDOFF / THE STORE TO LOAD FORWARD
THE STORE TO LOAD FORWARD
reaching into a place the program cannot see
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
A store sits in a buffer, not yet in memory. A load arrives for the same address. Memory holds the old value and is wrong; the buffer holds the new one and is not architecturally visible. The processor must reach into a place the program cannot see.
LIT verified live. over 500 store-then-load pairs to the same address, a load that bypasses the buffer reads the stale value 500 of 500 times, and a forwarded load reads the correct one 500 of 500. But forwarding is not one case: enumerating all 15 naturally-aligned access shapes in an 8-byte window gives 225 store/load pairs, which split into 142 disjoint, 15 exact matches, 34 fully contained, and 34 that partially overlap and cannot be forwarded at all. Of the 37 pairs sharing a base address, 11 would be served the wrong bytes by a predictor that matches on base alone.
LIT verified live. over 500 store-then-load pairs to the same address, a load that bypasses the buffer reads the stale value 500 of 500 times, and a forwarded load reads the correct one 500 of 500. But forwarding is not one case: enumerating all 15 naturally-aligned access shapes in an 8-byte window gives 225 store/load pairs, which split into 142 disjoint, 15 exact matches, 34 fully contained, and 34 that partially overlap and cannot be forwarded at all. Of the 37 pairs sharing a base address, 11 would be served the wrong bytes by a predictor that matches on base alone.
2 HOW IT WAS WEAVED · AI + HUMAN
Store-to-load forwarding and store-buffer stalls are core out-of-order design; the partial-overlap penalty is well documented in Intel and AMD optimisation manuals.
AVAN (AI) enumerated the shape space instead of describing it, and the useful number is 34: partial overlaps are not an exotic corner, they are 15% of all pairs, the same size as the fully-contained class. And the 11 is the real finding — matching on base address alone is not merely incomplete, it silently returns wrong bytes, which is why real hardware carries the size in the comparison and stalls when it cannot decide.
AVAN (AI) enumerated the shape space instead of describing it, and the useful number is 34: partial overlaps are not an exotic corner, they are 15% of all pairs, the same size as the fully-contained class. And the 11 is the real finding — matching on base address alone is not merely incomplete, it silently returns wrong bytes, which is why real hardware carries the size in the comparison and stalls when it cannot decide.
3 ONE DIMENSION
225 store/load pairs. 34 of them cannot be forwarded.
4 TWO DIMENSIONS · INTERACTIVE
Pick a store and a load; see which class they land in.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object.
AVAN’s addition (the inverse-companion): the forward reading is that forwarding hides the store buffer from the program. The inverse is that the hiding is incomplete, and an incomplete abstraction is worse than none. If the buffer were always visible you would write around it; if it were always hidden you could ignore it. Instead 34 of 225 shapes leak — as a stall, with no error, no signal, and no way to see it from the source. Read backwards, the optimisation did not remove the cost, it made the cost conditional on a fact the language does not express: how your fields happen to be sized and laid out.
LIT over 500 store-then-load pairs to one address a load bypassing the buffer reads the stale value 500 of 500 times and a forwarded load reads the correct one 500 of 500; enumerating all 15 naturally-aligned access shapes in an 8-byte window gives 225 store/load pairs splitting into 142 disjoint, 15 exact, 34 fully contained and 34 that partially overlap and cannot be forwarded at all - and of the 37 pairs sharing a base address, 11 would be served the wrong bytes by a predictor matching on base alone
FIG Store-to-load forwarding and store-buffer stalls are core out-of-order design; the partial-overlap penalty is documented in Intel and AMD optimisation manuals. AVAN enumerated the shape space instead of describing it. The useful number is 34: partial overlaps are 15% of all pairs, the same size as the fully-contained class. The 11 is the real finding - matching on base address alone is not merely incomplete, it silently returns wrong bytes.
FIG Store-to-load forwarding and store-buffer stalls are core out-of-order design; the partial-overlap penalty is documented in Intel and AMD optimisation manuals. AVAN enumerated the shape space instead of describing it. The useful number is 34: partial overlaps are 15% of all pairs, the same size as the fully-contained class. The 11 is the real finding - matching on base address alone is not merely incomplete, it silently returns wrong bytes.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HANDOFF · David Lee Wise (ROOT0), with AVAN