Skip to content

Commit

Permalink
Simplify LMR condition
Browse files Browse the repository at this point in the history
Apply LMR on captures the same way it is applied on quiets

Hit rate of removed condition (!ss->ttPv || !capture || (cutNode && (ss - 1)->moveCount > 1))
Total 1253801 Hits 1228904 Hit Rate (%) 98.0143

Hit rate of previous LMR (depth >= 2 && moveCount > 1 + rootNode && ...)
Total 1253801 Hits 727234 Hit Rate (%) 58.0023

Hit rate of simplified LMR (depth >= 2 && moveCount > 1 + rootNode)
Total 1201839 Hits 713540 Hit Rate (%) 59.3707
  • Loading branch information
gab8192 authored and PikaCat-OuO committed Feb 4, 2024
1 parent 14fe55c commit a93d637
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pikafish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:
shell: bash
sde: /home/runner/work/Pikafish/Pikafish/.output/sde-temp-files/sde-external-9.27.0-2023-09-13-lin/sde -future --
- name: MacOS
os: macos-14
os: macos-latest
shell: bash
- name: Windows
os: windows-latest
shell: msys2 {0}
ext: .exe
sde: /d/a/Pikafish/Pikafish/.output/sde-temp-files/sde-external-9.27.0-2023-09-13-win/sde.exe -future --
arch: ["-vnni512", "-avx512", "-avx512f", "-avxvnni", "-bmi2", "-avx2", "-sse41-popcnt", "-ssse3", "apple-silicon"]
arch: ["-vnni512", "-avx512", "-avx512f", "-avxvnni", "-bmi2", "-avx2", "-sse41-popcnt", "-ssse3"]
exclude:
- arch: -avxvnni
config: {os: ubuntu-20.04}
Expand Down
6 changes: 1 addition & 5 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1031,11 +1031,7 @@ Value Search::Worker::search(
r -= ss->statScore / 12254;

// Step 16. Late moves reduction / extension (LMR, ~117 Elo)
// We use various heuristics for the sons of a node after the first son has
// been searched. In general, we would like to reduce them, but there are many
// cases where we extend a son if it has good chances to be "interesting".
if (depth >= 2 && moveCount > 1 + rootNode
&& (!ss->ttPv || !capture || (cutNode && (ss - 1)->moveCount > 1)))
if (depth >= 2 && moveCount > 1 + rootNode)
{
// In general we want to cap the LMR depth search at newDepth, but when
// reduction is negative, we allow this move a limited search extension
Expand Down

0 comments on commit a93d637

Please sign in to comment.