-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better check evasion move sorting. #1685
Conversation
Congratulations! |
@@ -73,8 +73,8 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHist | |||
|
|||
/// MovePicker constructor for quiescence search | |||
MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHistory* mh, | |||
const CapturePieceToHistory* cph, Square rs) | |||
: pos(p), mainHistory(mh), captureHistory(cph), recaptureSquare(rs), depth(d) { | |||
const CapturePieceToHistory* cph, const PieceToHistory** ch, Square rs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove the double indirection here (const PieceToHistory**
-> const PieceToHistory*
) and just pass (ss-1)->contHistory
to the constructor below (only the first member of the array is used by MovePicker
). Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that would be possible. But in the Movepicker object only a pointer to the array of the counter move histories is currently used (const PieceToHistory** contHistory;). There itself is no array of the four cmh pointers defined.
We would have to define it there like PieceToHistory* contHistory[4]; and modify both constructors. That seems not so elegant for me (but is debatable).
But an important reason is that we could easy test using the other histories (which i have already started)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, now I see that I missed that other constructors use the same pattern already and that in other places more elements of the array are used. You can disregard my previous comment then :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have looked at this more and we can simply fake the array by using in the second Movepicker constructor contHistory(&ch) in the initiliazer list (so only the first index exists but the others are not used). But i would rewrite this only after a period where we have tested out the possibilities of the other histories.
Thanks for the inspiration!
We should improve the bench extraction for travis and appveyor checking because if a number other than from bench is in the commit message this goes wrong. So i have added new commits with a correct parseable bench. |
@candirufish |
Merged via 12e79be, congrats! :-) I have renamed "contHistory" to "continuationHistory" to ease the newcomers understanding of this part of the codebase. And I also agree that time is up for a regression test :-) |
Use in addition the counter move history table for sorting quiet check evasion moves in main and quiecence search. Also rename "contHistory" to "continuationHistory" while there. STC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 73284 W: 16433 L: 15938 D: 40913 http://tests.stockfishchess.org/tests/view/5b4f526e0ebc5902bdb7a401 LTC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 12135 W: 2171 L: 1997 D: 7967 http://tests.stockfishchess.org/tests/view/5b4fc0ef0ebc5902bdb7ae0e Closes official-stockfish#1685 Bench 4817583
Use in addition the counter move history table for sorting quiet check evasion moves in main and quience search.
STC
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 73284 W: 16433 L: 15938 D: 40913
http://tests.stockfishchess.org/tests/view/5b4f526e0ebc5902bdb7a401
LTC
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 12135 W: 2171 L: 1997 D: 7967
http://tests.stockfishchess.org/tests/view/5b4fc0ef0ebc5902bdb7ae0e
Bench 4817583