syzygy wrote:diep wrote:Of course it goes too far for someone who posted a few beginner questions to really go into details, yet i want to post the small remark that if you extend check giving moves in mainsearch rather than check evasions, that you will search in general more nodes.
The simple insight to see why already comes when taking a look at how transpositiontable works.
If we are at position P depthleft D , we give a check get in position Q and extend then we are still at depthleft D.
So we have {P,D} and {Q,D}
In contradiction to that the check evasion manner of extending we end up having {P,D} and {Q,D-1}
the latter will of course get easier a transpositiontable cutoff.
As far as I can see, in both cases you get exactly the same cutoffs. Whenever the search gets to position Q, it will be by a move giving check leading to in-check position Q. Either you store such positions as {Q,D} and look for tt entries {Q,E} with E>=D, or you store such positions as {Q,D-1} and look for tt entries {Q,E-1} still with E>=D.
There are 2 problems with your assumption.
First of all you assume a correct manner to detect checks.
This where the cheapest way to see whether you are in check is to
check the previous move made and just check whether it attacks the king's square.
This goes with a quick table and only in a part of the cases you need to call a function to check this.
That's the fastest way to detect most checks and for fast beancounters it would be nonsense to do it in a different manner.
So it doesn't detect all checks simply.
If you do it in a different manner, your program is slower of course.
That's first flaw in your assumptions.
Secondly it's nonsense to extend all checks with the same amount of plies.
Fractional extensions huh?
Third The King for example used to extend with 2 plies. Yet it's better then to do those extensions when getting out of check as then it's easier to check whether you give the extension.
The path leading to the extensions there is total crucial and determines the extensions - so doing all this in the same manner is not efficient.
In 2 out of those 3 cases we can prove it's faster more efficient nodewise to extend solely check evasions and in the third case it's more convenient.
Diep's evaluation function does not evaluate when being in check to give one example and if you check ICCA publications you'll find an article of Chrilly Donninger about how to extend in an effective manner. The ideal moment for that would be for example the ply after the check. Those extensions are difficult to trigger when being in check.
Of course one difference is that that {Q,D-1} will be overwritten more easily than {Q,D} by other positions. The question is then which of D-1 and D correlates best with the actual work involved in searching position Q.