Starting with check extensions.

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Luis Babboni
Posts: 464
Joined: Sat Feb 28, 2015 4:37 pm
Location: Argentina

Re: Starting with check extensions.

Post by Luis Babboni »

I think I did right this:

Iteration p (full width search till p)
Find a move at depth p that gives check then full width search will be do now till p+1.
At depth p+1 the in check side could avoid it, and do it but not gives check (that could be possible for example by a "descubierto" in spanish that means for example that moving the king allow an own tower to atack the opposite king).
There is no more check extensions and enter in QS that search just for captures or promotions.

At the end, my check extension only allows the engine to search one ply depther when gives check but do not allow it to study sucesive checks with corresponding uniques moves as I thought "check extensions" will allow.

I hope I could made you understand me nevertheless my Apache like english. :oops:

1-I did it wrong?
2-I did it right and just is wrong what I understood by "check extension"?
3-I didn´t too bad but I must do it better?

Thanks!
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Starting with check extensions.

Post by AlvaroBegue »

Luis Babboni wrote:I think I did right this:

Iteration p (full width search till p)
Find a move at depth p that gives check then full width search will be do now till p+1. [...]
It's probably a good thing to stop thinking about search this way. You start searching the root at some depth-left of p. The children of a position with depth-left d will get depth-left d-1, except if the move was a check, in which case they will get depth-left d (this is what I understand as check extensions). When depth-left is 0, you call quiescence search.

I seem to remember you have a non-recursive implementation of minimax. There should still be a way to do this in your implementation. If it's not trivial, perhaps it's time for you to consider a recursive implementation.
User avatar
Luis Babboni
Posts: 464
Joined: Sat Feb 28, 2015 4:37 pm
Location: Argentina

Re: Starting with check extensions.

Post by Luis Babboni »

AlvaroBegue wrote:
Luis Babboni wrote:I think I did right this:

Iteration p (full width search till p)
Find a move at depth p that gives check then full width search will be do now till p+1. [...]
It's probably a good thing to stop thinking about search this way. You start searching the root at some depth-left of p. The children of a position with depth-left d will get depth-left d-1, except if the move was a check, in which case they will get depth-left d (this is what I understand as check extensions). When depth-left is 0, you call quiescence search.

I seem to remember you have a non-recursive implementation of minimax. There should still be a way to do this in your implementation. If it's not trivial, perhaps it's time for you to consider a recursive implementation.
I think I could exlain myself wrongly.
Suppouse this position:
k in A8, K in A1, N in d5 and P in h2 (this pawn is just to avoid stalemate cause not enough material to checkmate).

Regarding alpha beta, at iteration 1 my engine could anlyze moves in this order:

1-Ka2
2-Kb2
3 Kb1
4-Ne7
5-Nf6
6-Nf4
7-Ne3
8-Nc3
9-Nb4
10-Nb6+, 11-ka7 (here is where check extensions work)
............, 12-kb7
............, 13-kb8
14-Nc7+, 15-ka7
............, 16-kb7
............, 17-kb8
18-Ph3
19-Ph4
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Starting with check extensions.

Post by cdani »

This is a basic check extension, yes. Sure can be refined but its ok.
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Starting with check extensions.

Post by AlvaroBegue »

cdani wrote:This is a basic check extension, yes. Sure can be refined but its ok.
Actually, no, that's not an extension at all. If you didn't have this extension, you would be entering QS in check, and in that case QS should behave like a depth-1 search anyway (i.e., not allow stand-pat and search every legal move). So you'll end up with the same tree.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Starting with check extensions.

Post by cdani »

AlvaroBegue wrote:
cdani wrote:This is a basic check extension, yes. Sure can be refined but its ok.
Actually, no, that's not an extension at all. If you didn't have this extension, you would be entering QS in check, and in that case QS should behave like a depth-1 search anyway (i.e., not allow stand-pat and search every legal move). So you'll end up with the same tree.
I was not talking about the last ply before QS. I was talking in general for any ply, so yes, is an extension.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Starting with check extensions.

Post by cdani »

cdani wrote:
AlvaroBegue wrote:
cdani wrote:This is a basic check extension, yes. Sure can be refined but its ok.
Actually, no, that's not an extension at all. If you didn't have this extension, you would be entering QS in check, and in that case QS should behave like a depth-1 search anyway (i.e., not allow stand-pat and search every legal move). So you'll end up with the same tree.
I was not talking about the last ply before QS. I was talking in general for any ply, so yes, is an extension.
Also if you enter in the QS after this extension, in the first example of Luis:
10-Nb6+, 11-ka7 (here is where check extensions work)
and if ka7 was a check also (obviously not in this example), the first ply of QS will behave like you said of no stand-pat and such.
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Starting with check extensions.

Post by AlvaroBegue »

cdani wrote:
AlvaroBegue wrote:
cdani wrote:This is a basic check extension, yes. Sure can be refined but its ok.
Actually, no, that's not an extension at all. If you didn't have this extension, you would be entering QS in check, and in that case QS should behave like a depth-1 search anyway (i.e., not allow stand-pat and search every legal move). So you'll end up with the same tree.
I was not talking about the last ply before QS. I was talking in general for any ply, so yes, is an extension.
But if you read the description a couple of posts earlier, he is precisely talking about the last ply before QS. ("Find a move at depth p that gives check then full width search will be do now till p+1.")
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Starting with check extensions.

Post by AlvaroBegue »

cdani wrote:
cdani wrote:
AlvaroBegue wrote:
cdani wrote:This is a basic check extension, yes. Sure can be refined but its ok.
Actually, no, that's not an extension at all. If you didn't have this extension, you would be entering QS in check, and in that case QS should behave like a depth-1 search anyway (i.e., not allow stand-pat and search every legal move). So you'll end up with the same tree.
I was not talking about the last ply before QS. I was talking in general for any ply, so yes, is an extension.
Also if you enter in the QS after this extension, in the first example of Luis:
10-Nb6+, 11-ka7 (here is where check extensions work)
and if ka7 was a check also (obviously not in this example), the first ply of QS will behave like you said of no stand-pat and such.
I still don't see what the difference is between this and no extension.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Starting with check extensions.

Post by cdani »

AlvaroBegue wrote:
cdani wrote: I was not talking about the last ply before QS. I was talking in general for any ply, so yes, is an extension.
But if you read the description a couple of posts earlier, he is precisely talking about the last ply before QS. ("Find a move at depth p that gives check then full width search will be do now till p+1.")
Ok.
AlvaroBegue wrote:
cdani wrote: Also if you enter in the QS after this extension, in the first example of Luis:
10-Nb6+, 11-ka7 (here is where check extensions work)
and if ka7 was a check also (obviously not in this example), the first ply of QS will behave like you said of no stand-pat and such.
I still don't see what the difference is between this and no extension.
If standard search and QS behave similar, of course no difference. But most engines like Andscacs do different things.