Skip to content
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

Closed

Conversation

locutus2
Copy link
Member

@locutus2 locutus2 commented Jul 19, 2018

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

@Stefano80
Copy link
Contributor

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)

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?

Copy link
Member Author

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)

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 :)

Copy link
Member Author

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!

@locutus2
Copy link
Member Author

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.

@locutus2 locutus2 changed the title Better evasion move sorting. Better check evasion move sorting. Jul 19, 2018
locutus2 referenced this pull request in protonspring/Stockfish Jul 19, 2018
@locutus2
Copy link
Member Author

@candirufish
I support running a regression test after this patch is merged. Its time!

@snicolet snicolet closed this in 12e79be Jul 19, 2018
@snicolet
Copy link
Member

snicolet commented Jul 19, 2018

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 :-)

goodkov pushed a commit to goodkov/Stockfish that referenced this pull request Jul 21, 2018
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
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.

None yet