Module A03 · concept player

Divergence, one branch split at a time

A wavefront hits an if / else. Some lanes take one side, the rest take the other. The hardware runs both sides in turn — so drag the split and watch which lanes sit idle move, while the total time refuses to.

Lockstep width
Lanes taking the if branch: 32
if body length: 8 cycles
else body length: 8 cycles
16cycles this branch costs
8cycles if every lane agreed
1024idle lane-cycles wasted
2.0×tax over the uniform case

What the hardware actually runs, in order

Phase 1 · if body

Phase 2 · else body

lane executing this phase lane idle, waiting for the other side

These are counts, not a measurement. Both phases always run to completion whenever at least one lane needs them — that is what "the sum of both paths" means. Real hardware can also predict a branch and skip a phase entirely if it turns out uniform after all, which this model does not represent. A03's deep dive traces this on AMD's 64-bit EXEC mask; a uniform branch (split at 0 or at the full width) skips the untaken phase entirely, which is the "cycles if every lane agreed" reading above.