Commit aa2d0a7
[7/9] Add Late Move Reductions (LMR) and Principal Variation Search (PVS)
Implements two key search optimizations:
**Late Move Reductions (LMR):**
- Reduce search depth for late quiet moves (move_index >= 3)
- Only apply when: depth >= 3, not in check, move is quiet
- Quiet moves = no capture, no check, no promotion
- Simple reduction of 1 ply (more aggressive formulas tested but hurt accuracy)
- Re-search at full depth if reduced search finds promising score
**Principal Variation Search (PVS):**
- First move: search with full alpha-beta window
- Later moves: search with zero window (alpha, alpha+1)
- If zero window search beats alpha, re-search with full window
- Saves time when first move is best (which is often true with good ordering)
Both techniques work together:
- PVS assumes first move is best (good with TT/killer/MVV-LVA ordering)
- LMR reduces work on moves unlikely to be best
- Combined, they significantly reduce nodes searched
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 6e50edb commit aa2d0a7
1 file changed
Lines changed: 61 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
312 | 314 | | |
| 315 | + | |
| 316 | + | |
313 | 317 | | |
314 | 318 | | |
315 | 319 | | |
316 | 320 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
327 | 377 | | |
328 | 378 | | |
329 | 379 | | |
| |||
0 commit comments