-
Notifications
You must be signed in to change notification settings - Fork 474
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
About KomodoChess #322
Open
Frosty54
wants to merge
11
commits into
master
Choose a base branch
from
NTB
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
About KomodoChess #322
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rewrite TB probing code to ovecome the main traditional TB artifacts: 1. Don't hide forever mate line in a winning position 2. Don't stick to odd sacrifices to simplify in a TB position This version mostly fixes the above 2 issues. In particular it keeps searching even in a winning position so that sooner or later a mate is found and reproted to user. Moreover, although in rare cases odd sacrifice moves could still be selected for a temporary and transitory time, keeping searching the engine always moves off form them. In both cases these phenomenons are greatly reduced compared to current version. This version is stronger than master of a large margin! Tested with 5-men tables at 10+0.01 Stockfish NTB vs Stockfish master: 2143 - 1736 - 6121 [0.520] Elo difference: 14.15 +/- 4.23 10000 of 10000 games finished. Bench: 5417521
We use WDL50 tables so the condition is needed to ensure the probed WDL score is always correct. In particular without this condition we could probe as a win a position that is indeed a draw because we are already near the 50 rule threshold.
The condition: VALUE_DRAW + 2 * wdl * drawScore can be selected only if not using TB::UseRule50 when wdl is 0 so that it is equivalent to: VALUE_DRAW + 2 * wdl * drawScore --> VALUE_DRAW + 2 * wdl Or if TB::UseRule50 is set when drawScore == 1 so that: VALUE_DRAW + 2 * wdl * drawScore --> VALUE_DRAW + 2 * wdl
Correctly take in account these rare cases.
In this case alpha != beta - 1 and we should take care of that.
Win or loss scores are reliable only if we are probing after a rule50 reset move. Instead, draw scores are reliable in any case. So take in account this to relax the condition on rule50. This is very sensible because with this patch SF will probe TB even if root position is a pawnless endgame and will play without mistakes without relying on DTZ. With this patch SF plays perfectly, even with short TC, this tricky endgame: 4q3/7R/8/4r2Q/8/4k3/8/2K5 w - - 0 1
Just cosmetic.
If rootPos is in TB and we can't rely on WDL score, then we have to use the big artillery to differentiate between a win/loss and a cursed/blessed draw. This is critical because search alone can detect it only at ply 101...too late. To avoid to probe DTZ at eevry iteration use a small cache. This is not needed in current master becuase moves are filtered before searching.
When we increase one ply, we correspondingly decrease remaining depth, so if no LMR exists then simply: RootDepth = ss->ply + depth In case of (recursive) LMR we have instead: RootDepth = ss->ply + depth + LMR From here: depth = RootDepth - ss->ply - LMR and repalcing it in the farFromRoot condition we have: ss->ply - (RootDepth - ss->ply - LMR)/2 >= 0 Hence: 3 * ss->ply >= (RootDepth - LMR) So a node it is far from root if ply >= (RootDepth - LMR)/3, and at a given ply, nodes with high LMR are considered farther from root than nodes near the PV line. No functional change. Conflicts: src/search.cpp
With this fix, starting from position fen 8/8/5N2/5K2/3p3k/3N4/8/8 b - - 71 36 best move h4g3 is correctly detected.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sorry if I write there.
@KomodoChess why u need Stockfish when you have your own engine?