Skip to content

Conversation

@Vizvezdenec
Copy link
Member

@Vizvezdenec Vizvezdenec commented Apr 7, 2020

passed STC
https://tests.stockfishchess.org/tests/view/5e8c60d40ffd2be7f15e5470
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 23748 W: 4758 L: 4529 D: 14461
Ptnml(0-2): 421, 2712, 5400, 2899, 442
passed LTC
https://tests.stockfishchess.org/tests/view/5e8c72bf0ffd2be7f15e547f
LLR: 2.96 (-2.94,2.94) {0.25,1.75}
Total: 17330 W: 2415 L: 2190 D: 12725
Ptnml(0-2): 126, 1561, 5107, 1704, 167
This patch introduces heuristic that is similar to countermove based pruning but for captures - capture history pruning.
Idea is that we can (almost) safely prune really late captures with negative history if they don't give check so will most likely not produce some king-attacking tactic.
bench 4417023

bench 4417023
@Vizvezdenec
Copy link
Member Author

code is slightly cleaned up if (captureOrPromotion && !givesCheck) is squashed into if (!givesCheck) - since if it doesn't give check it's already captureOrPromotion according to previous if / else condition

@locutus2
Copy link
Member

locutus2 commented Apr 7, 2020

I personnaly would refactor the code by moving
CapturePieceToHistory& captureHistory = thisThread->captureHistory;
at the beginning of the search function and replace the occurances of captureHistory in line 902 and 957. So capture history is easier to use at further places in search.
And then use following:

            if (  !givesCheck
                && lmrDepth < 1 
                && captureHistory[movedPiece][to_sq(move)][type_of(pos.piece_on(to_sq(move)))] < 0)
                      continue;

But that is a matter of taste!

@Vizvezdenec
Copy link
Member Author

Vizvezdenec commented Apr 7, 2020

Well yes it will be shorter and easier to read.
The only reason why I did it this in a way it is in pr is to have patch in one place for easier tweaking, it's not close to be optimal in terms of style :)

@vondele vondele closed this in 195a4fe Apr 7, 2020
@vondele
Copy link
Member

vondele commented Apr 7, 2020

Thanks, added with cleanups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants