branch-prediction-and-speculation
Installation
SKILL.md
Branch Prediction and Speculation
Purpose
Explain how modern CPUs predict branches, execute speculatively, recover on mispredict, and why speculation created side channels (Spectre/Meltdown) — linking performance tuning with security-aware low-level coding.
When to Use
- Hot loop branchy code underperforms expectations
- Evaluating
likely/unlikelyor branchless refactors - Understanding kernel
retpoline, IBRS, and similar mitigations - Secure coding around secret-dependent branches