Commit 5019fdf
[8/9] Add futility pruning
Implements futility pruning to skip quiet moves that can't improve alpha:
**Futility Pruning:**
- At low depths (1-2), compute static evaluation
- If eval + margin < alpha, quiet moves can't help
- Skip quiet moves (no capture, check, or promotion)
- Never prune the first move (might be the only good one)
**Margin Calculation:**
- Depth 1: 100 centipawns margin
- Depth 2: 200 centipawns margin
- Larger margin at deeper depths allows for more potential improvement
**Conditions for pruning:**
- Depth <= 2
- Not in check (check positions are critical)
- Static eval + margin < alpha
- Move is quiet (not capture/check/promotion)
- Not the first move in the list
This is a forward pruning technique that can miss some moves, but
the marginsare conservative enough to rarely affect results while
significantly reducing nodes searched.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 42d2d60 commit 5019fdf
1 file changed
+21
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
305 | 315 | | |
306 | 316 | | |
307 | 317 | | |
308 | 318 | | |
309 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
310 | 331 | | |
311 | 332 | | |
312 | 333 | | |
| |||
0 commit comments