The simulation shows a warp of 32 threads hitting an if/else branch, visualizing the active lane mask during each serialized branch phase and the wasted, masked-off lane-cycles that result from divergence.
Adjust the fraction of threads taking each branch path and the relative cost of each branch, then step through execution to see the active mask change and the total serialized cycle count compared to a fully convergent warp.
Sliders for branch split ratio and per-branch cost, step/play controls, active lane mask visualization
A warp where just one thread out of 32 needs an expensive branch still forces all 32 lanes to wait through that entire branch, since the hardware cannot skip ahead for the other 31 idle lanes.
The simulation shows a warp of 32 threads hitting an if/else branch, visualizing the active lane mask during each serialized branch phase and the wasted, masked-off lane-cycles that result from divergence.
The simulation shows a warp of 32 threads hitting an if/else branch, visualizing the active lane mask during each serialized branch phase and the wasted, masked-off lane-cycles that result from divergence.
Adjust the fraction of threads taking each branch path and the relative cost of each branch, then step through execution to see the active mask change and the total serialized cycle count compared to a fully convergent warp.
A warp where just one thread out of 32 needs an expensive branch still forces all 32 lanes to wait through that entire branch, since the hardware cannot skip ahead for the other 31 idle lanes.