bob wrote:Uri Blass wrote:bob wrote:Uri Blass wrote:bob wrote:mjlef wrote:Guetti wrote:I have to admit I became curious and had a look at the qsearch.
From looking at it, I had the impression that Strelka uses pseudo-legal move generation Crafty-style. Correct?
I have to say, I like the readability of the code. However, some stuff is to complex for me. i.e. What does the following code from qsearch achieve? It is some kind of delta pruning, but I dont understand it.
Code: Select all
else if (pos_info_entry->value < (alpha - 250)) {
// delta pruning: если оценка позиции хуже alpha,
// то из взятий убираем "слабые" взятия через маски mask_w и mask_b
best_value = pos_info_entry->value + 250;
mask_w ^= Board->mp[WhitePawn];
mask_b ^= Board->mp[BlackPawn];
// В оригинальной версии Стрелки исключались только взятия пешек
// Следующие исключения - Белка 1.8.12 (+13 пунктов !!!)
if (pos_info_entry->value < (alpha - 450)) {
best_value = pos_info_entry->value + 450;
mask_w ^= Board->mp[WhiteKnight];
mask_b ^= Board->mp[BlackKnight];
mask_w ^= Board->mp[WhiteBishop];
mask_b ^= Board->mp[BlackBishop];
if (pos_info_entry->value < (alpha - 650)) {
best_value = pos_info_entry->value + 650;
mask_w ^= Board->mp[WhiteRook];
mask_b ^= Board->mp[BlackRook];
if (pos_info_entry->value < (alpha - 1050)) {
best_value = pos_info_entry->value + 1050;
mask_w ^= Board->mp[WhiteQueen];
mask_b ^= Board->mp[BlackQueen];
}
}
}
}
Any suggestions?
It looks at what is the minimal materail needed to get the score above alpha. Any piece which has too little value to increase that score gets masked off the capture bitmap. Then only captures of those peices get generated. Simple and clever. And easy with a bitmap program.
Mark
That would seem to have a significant hole, in that sometimes removing a knight can raise the score beyond the value of a queen, assuming (say) that the knight being captured is the last opponent piece so that your passer is now free to run...
This is not a significant hole because the importance of knowledge of unstoppable passed pawns when the opponent has no pieces is very small
and it even does not mean throwing that knowledge but only that you may see unstoppable pawns later in the search.
Uri
Depends on your definition of "significant". I consider _anything_ that a human opponent can exploit to be significant. And this would fall into that category. A hole here and a hole there, and before long you have nothing but "hole"...
I think every weakness has to be fixed as it is exposed...
1)I see no way that an human can exploit that weakness.
It is not weakness in the evaluation but something that is only about the qsearch.
If the unstoppable passed pawns is small number of plies from the root
the relevant position is going to be in the search so this is not relevant and if it is big number of plies from the root the human will usually not be
able to calculate a trap that is so deep.
Just because _you_ don't see how to exploit it does not mean others can not. I did not say it was a flaw in the evaluation, so I have no idea where that comment comes from. But certainly not from what I wrote. I _clearly_ said it was a hole in the q-search, where you omit making a crucial capture that will suddenly illuminate a large evaluation term, but you failed to do so because you assume that just winning a knight will not get you back above alpha. Where knight + positional score will easily do so.
I think also that you think too much in past terms.
I think you think too much without actually _thinking_.
In the past knowledge about unstoppable pawns in the endgames was
important against humans.
Today things are different when the hardware is faster and the search is better and even without special knowledge it is harder for humans to get advantage from the fact that a program has no knowledge about unstoppable passed pawns.
Just remove the terms and see how you do against strong players. These terms would include unstoppable passed pawns, outside/distant passed pawns, outside/distant candidate passed pawns, some king safety terms that are heavily material dependent, and several others that scale up/down as material is removed.
reasons are:
1)It is easier for programs to win before the endgame relative to the past
2)It is easier for the search to detect problems with unstoppable passed pawns and avoid a mistake thanks to the fact that the search is deeper.
Uri
I probably play as many games against IM/GM players as anyone on the planet, if not more. _many_ GM games reach the endgame. In fact, _most_ reach the endgame. Not always king and pawns only, but close enough that endgame threats influence the outcome. I have no idea how many GM games you have actually seen with your program, but I know what I had to fix with mine to give it reasonable chances in endgames where GMs are _very_ difficult to deal with.
You have once again zeroed in on a minute detail. I gave unstoppable passed pawns as an _example_, and not the _only case_ where this is an issue. In crafty, outside passed pawns greatly increase in value when material comes off, particularly the last piece. Ditto for king safety which goes completely away when the last piece comes off. There are others including normal passed pawn scoring, majority scoring, etc. Try to think in general terms, rather than looking at one example phrase and saying "that by itself is not a big deal" when I never said it was the _only deal_...
1)I think that today the situation is different than the past and today if you are good at beating other programs then you are also good at the same time at beating humans(I do not know about a single program at toga's level or better than it that cannot beat every human most of the time).
I practically tested movei only against other programs because I believe that it is better to test against programs in order to learn about weaknesses of the program.
2)I can add that I plan to make a rewrite of movei to bitboards so I am probably not going to test movei in the near future because before rewriting it to bitboards I plan to try to understand more of strelka.
3)I decided to share some knowledge that I found about what I consider to be a bug in strelka when I tried to understand the exact meaning of
search_parm.
I found that strelka has no condition of not having more than one null move in a row and practically can play some null moves one after the other.
I am not sure if it can practically play 4 null moves in a row and return repetition score but I found that it can practically play 3 null moves in a row.
I guess that the programmer thought that it is impossible because of the condition eval>=beta but it does not work because strelka has a bonus
of 0.03 for the side to move so it is possible that
eval=100 beta=100 when later eval=-94 beta=-99 and in both cases eval>=beta
My conclusions about search_parm so far(I hope that I have no mistakes):
1)search_parm=7 after making a null move
2)search_parm is xored by 1 after making a move
3)search_parm=3 when starting iid
4)search_parm=0 after researching(can happen after reduced move failed high or in verification of null move.
5)search_parm=search_parm&6 after making move that improve the best score but does not fail high and it is not improving alpha because there is no alpha.
6)search_parm has to be 3 or 7 in order to allow null move
Note about the code of strelka:
It seems to me more simple to have
((search_parm&3)==3) and not
(search_parm & 1) && (search_parm & 2)
Uri