Razoring is aggressive forward pruning: if static evaluation is far below
α,
even a strong capture sequence is unlikely to recover. Skip remaining main-search depth and jump to quiescence search,
or return a fail-low immediately. Complements conservative pruning (futility, null move) by handling clearly lost nodes early.Visual
Eval Far Below Alpha
Razor zone — staticEval + margin < α
staticEval −300α = +50hopeless band
Shallow razor (d ≤ 3)
staticEval + razorMargin[d] ≤ α → return qsearch(α, β) instead of full search.
Deep razor
At pre-frontier nodes, if eval very bad → reduce depth to 1 + qsearch. Stockfish-style tuned margins.
if (depth <= RAZOR_MAX && !pvNode && !inCheck) {
if (staticEval + razorMargin[depth] <= alpha)
return qsearch(alpha, beta);
}
| Technique | Trigger | Action |
|---|---|---|
| Razoring | staticEval + margin ≤ α | Jump to qsearch / shallow search |
| Futility | staticEval + margin ≤ α | Skip quiet moves at node |
| Null move | Pass still ≥ β | Cut whole node |
Safety guards
- Never razor PV nodes or when in check
- Disable when eval is mate score (unreliable margin)
- Margins depth-dependent — tighter at higher depth
- Pair with good qsearch — razor relies on tactical resolution at leaf
Related: Evaluation Function · Search Algorithm · All Blogs