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
EGTB not working for eligible variants #471
Comments
I wonder how strong SF twokings is in comparison to other engines & whether the code would be much simpler (and handle all single-king positions properly) were it a subvariant (of normal chess). I'm more than a bit nervous about making any changes before upstream official-stockfish@be382bb is merged since merging it will probably lose Elo. |
Syzygy add endgame strength. One way is to activate syzygy once one king on each side is captured. Maybe this can be added as patch, i don't know how much work this require. |
@ddugovic Since Two Kings is not that different from standard chess, I think that the few improvements to piece values and king danger evaluation might have already been sufficient to make it stronger than other engines. I thought about making it a subvariant of normal chess when I implemented it, but I thought that we would not gain much (only removing some array entries that might in some cases even be useful to optimize), but introducing a non-zero piece value for the king in standard chess would be ugly, and workarounds also do not seem more elegant either. The contempt change is no functional change for default contempt 0, so I do not see how it is related to twokings or how it affects playing strength. There are some merge conflicts, but the removal of @Nordlandia The gain from tablebases usually is not that much (maybe 10-20 Elo), but it would of course be a nice feature. From a first look at the code, it seems to require a couple of changes, but it would not add much additional logic, so it is not very problematic regarding code maintenance. |
Which value is used for non-royal king for the time being? Mann or Commoner piece is within a knights value. However in TwoKings having both monarchs is an valuable asset i think. @ianfab supporting syzygy is mainly intended for engine matches or for analysing endgames. Candidates
|
@Nordlandia The king values (same for royal and non-royal) for middlegame and endgame resulted from SPSA tuning and can be found in types.h. It is a bit less than a knight. Regarding syzygy, I currently only consider the second option as feasible. Adapting the syzygy generation and probing code requires far more work (and at least I am anyway not very familiar with that code). |
According wikipedia article the king surpasses knight in the endgame. Value of 780 might not be the best EG value. Perhaps 800-815 is more correct, narrowing the gap between king and knight endgame value. Better ask HGM. |
@Nordlandia In my experience, tuning usually finds better values than the ones estimated by humans, so human input is more useful for finding new evaluation terms than for optimizing their values. The optimal values can also differ between engines, so human estimates are mostly useful to find a reasonable starting value, afterwards automated tuning can take over. Please also note that the effective piece value for the king might be a bit higher than the raw piece value itself, because the piece-square table bonuses are quite high for the king. |
@Nordlandia The value of the king anyway only plays a role if there is a difference in the number of kings (since it otherwise cancels out), and a difference can only be in the situation of 2 vs. 1 kings if you are not playing with more than two kings. So the values should already be optimized for that case (and for SEE). |
@Nordlandia: I don't see why you would think humans would evaluate that position as 4+. I certainly would not do that, and despite everything I do consider myself human. In fact +3 seems already optimistic. This is an opening position, and a genuine Commoner usually performs already worse then a Knight there. Surely the fact that the second King would turn absolutely royal on part of the board would suppress its value even further. |
@HGMuller: in the opening the Commoner is inferior to the knight, that's true. What about the endgame? doesn't the Commoner gain strength in the endgame opposed to the opening. EG value for non-royal king is relatively high opposed to opening value, which indicate stronger EG capabilities. KingValueMgTwoKings = 526 Isn't SF slightly overoptimistic here? 0.33 advantage for black is trivial though. Maybe K-pair suffer from redundancy, Neither King does anything that the other one can't do. |
Why ask me, rather than trying it yourself by playing out that position a couple of hundred times? If Stockfish does not randomize enough you can give it a book with 20x20 start positions where one of the Pawns of each side is advanced one step. Then you would know who has the advantage here. I have only tested this with Fairy-Max, and Fairy-Max is not really smart w.r.t. mating potential (it thinks KNK = +3). So I cannot trust the results are 100% accurate. |
@Nordlandia Maybe start with SPSA and https://github.com/ddugovic/Stockfish/tree/tune_variant if you're unsure what parameter value(s) you wish to submit to a test. |
My experimental idea/suggestion was to increase endgame value of Commoner to 800. If you're satisfied with current piece values then everything is fine. I can launch 100 game match à la 3+2 time control in KK vs KN position and see which side is superior. I choose knight over bishop because Kn has limited mobility. |
@Nordlandia Feel free to change the king value and submit tests on fishtest (let me know if you need help). Ideas for improvements are very welcome, and I do not have any preference for a certain value except for the one that turns out to give the best performance Elo-wise. In my experience it is best to simply do tests and let the results decide to avoid overthinking ideas, because whether a certain idea or value works well in an engine also often changes over time as other changes are applied. |
The problem is that i have never submitted idea for test before. How do i proceed? |
@Nordlandia There is some documentation in the wiki regarding the three steps setting up the repository, creating the branches for testing and submitting a test. I do not know your experience with git, coding, or the fishtest test submission page, so let me know if there is a certain area where you need more detailed explanation. You do not need to be hesitant when using the test submission page if you are not familiar with it. Worst case something will be inconsistent, then I will not approve the test and it can be deleted (and maybe resubmitted). |
Maybe
|
@Nordlandia: Are you sure the games are independent enough, when you start them all from the same position? If Stockfish Variant does not randomize, it could be that you are basically playing the same game all the time (which ends in a draw), and that only occasionally another move is done at some point (because Stockfish happens to change move very close to a timeout that would force it to play a move), leading to two other games with low probability, one ending in a win, the other in a loss. When you say 13 wins. was it always the KK side that won? The result reports 7 wins and 6 losses. Is this just because you were alternating colors? Results are easier to interpret when you don't alternate colors. Or, when you cannot disable such alternation, alternate the starting position, so that even games are played with a pair of black Kings, ad odd games with a pair of white Kings. |
@HGMuller i had to abort 3+2 match because of repetition. All games were drawn. Maybe contempt is to be used in selfplay matches to avoid draw frequency. Kaufman encourages to use default contempt of 10 in K selfplay matches. Now since SF has updated contempt, maybe it's useful for selfplayˋ? Yes, i wish cutechess support alternate colors option. Also i requested cutechess to implement lock engine as white in engine matches. |
Late end-games tend to be drawish, (if nearly equal), not much can be done about that. But to prevent repetition. you can start every game from a different position. |
I have to use EPD for thar right? |
I don't know. I never used cute-chess. I don't know how you specify the start position now. With XBoard the start FEN would have to be in a file, and you can have 100 FENs in that file just as easily as you can have one. |
SPSA/SF suggest the commoner is overvalued (but not by much)! |
@ddugovic: my testing advocates the opposite. KK vs KN is not worse. |
@Nordlandia I don't disagree; I'm just saying the commoner seems overvalued. I'll try some testing from |
Interesting position, clearly only KK can win. |
Good point. I'll need to use |
Perhaps once https://github.com/syzygy1/Rustfish matures (or perhaps it has already?) I'll fork it and address this issue in Rust... |
Use standard tablebases for twokings (fixes #471)
In variant twokings probing syzygy does not work even if both sides extra king is removed from the board. Once both spare kings has vanished from the board, the variant is back to normal FIDE chess.
Doesn't it make sense to probe syzygy if PV results in classic FIDE position without extra kings?
The text was updated successfully, but these errors were encountered: