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

evaluation algorithm and mate #11

Closed
tissatussa opened this issue Nov 17, 2021 · 10 comments
Closed

evaluation algorithm and mate #11

tissatussa opened this issue Nov 17, 2021 · 10 comments
Assignees

Comments

@tissatussa
Copy link

tissatussa commented Nov 17, 2021

hi, i just stumbled upon this position and i did some tests with several engines, including Bagatur :

bagatur_mate5_diagram

8/5q2/1p1K3p/7P/2k3P1/8/8/8 b - - 0 48

Black to move : Qf6+ is mate in 5. Many engines find this very fast, even some simple engines, often within ten seconds -SF 14 finds mate-in-5 within one second- but Bagatur seems struggling to find best move (i used MPV 7 and 1 in SCID) :

bagatur_mate_eval

bagatur_mate5_eval

@bagaturchess
Copy link
Owner

This is again interesting finding - thanks a lot!

I tested this position with many runs and it is reproducible on Dev version as well.
In very rare cases Bagatur finds the mate in less than 10 seconds.
In most cases it takes a long time - there was one run, where 700 seconds were necessary.

I found the main reason - the Late Move Reduction (LMR).
It is quite "aggressive" in Bagatur.
The formula gives 1 or even 2 moves reduction more than what I have seen in articles and other engines.

Such positions are very nice, because they are boundary positions, which well show if there is an heuristic in the engine, which is not adjusted well.

I could reduce the LMR reduction to find this mate in 5 moves but also fit in 10 seconds.

Is this ok from your perspective?

Best regards,
Krasimir

@tissatussa
Copy link
Author

In texts of chess engines i often read the term "LMR" .. i have only a vague understanding what this means, but i can imagine ..

What can be a good solution for Bagatur to solve this mate-in-# problem and other "boundary positions" ?
I don't know, i'm not into engine programming .. if adjusting the LMR helps, it's OK with me .. but such change should not influence other functionality too much, i think. I leave it up to you. I can test the resulting new Bagatur version, and i can post other "irregular" position when i find them.

@bagaturchess
Copy link
Owner

bagaturchess commented Dec 7, 2021

Ok, thanks, I will decrease the LMR it in order to find this mate in up to 10 seconds each time.

The background: I find the reason relatively fast, because in the past I also found similar issues with LMR formula.
I just prefer to see Bagatur going in bigger depths without decreasing its ELO rating and this is set to the possible maximum.
My own explanation is that it perform bad in given positions but better in others and all these balances in regards to ELO.

But with this position and your tests it looks like only Bagatur cannot find the mate in up to 10 seconds - this has to be fixed.

P.S. This is a description of LMR, which looks short and well explained https://www.chessprogramming.org/Late_Move_Reductions

@bagaturchess
Copy link
Owner

I have just push my final changes for LMR.
Everything looks fine from the last tournament with these changes:

image

@tissatussa
Copy link
Author

honestly, i understand only 50% of these stats : is -7 the max ELO loss ? Not much then.

@bagaturchess
Copy link
Owner

Yes, we can fully ignore it, as it is below the standard error out of 95 games.

@bagaturchess
Copy link
Owner

bagaturchess commented Dec 9, 2021

I forgot to mention how this looks like from depth perspective: now Bagatur goes 3-5 moves shallower. I have to live with this :-)

image

@bagaturchess
Copy link
Owner

Hi, this needs more small adjustments and tests, because with more games the strength difference becomes -21 ELO.
I have decrease it too much and now gave to shift it back a little bit. :-)

@bagaturchess
Copy link
Owner

bagaturchess commented Dec 13, 2021

This looks better, now it is only 1-2-3 moves shallower, doesn't have ELO decrease and solves the +5 mate position:
image

@bagaturchess
Copy link
Owner

Happy New Year 2022! I wish good health and good mood!
P.S. the version 3.0 is released and your feedback is welcome! ;-) I will close this issue.

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

No branches or pull requests

2 participants