Delta pruning test

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

bctboi23
Posts: 20
Joined: Fri Feb 07, 2020 2:48 am
Location: United States
Full name: Tom R

Delta pruning test

Post by bctboi23 »

So, I just added 3 lines of code to my engine, CeeChess, for delta pruning, following the chessprogramming wiki.

Code: Select all

Delta = 1000; // queen value
if (Score + Delta < alpha) {
	// if no move can improve alpha, return
	return alpha;
}
After the addition to quiescence, it searches MORE nodes, and yet after doing testing at short time control, it is a +80ELO win! (500 games at 15"+0.3")
This seems super odd to me, and I think it is either a bug in the qSearch that is somehow fixed with that code, or this code helps the Razoring pruning be more effective. Either way though, it is really weird to me.

Is this normal for what people get when implementing delta pruning, or am I missing something in my code?
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Delta pruning test

Post by Henk »

If a move gives check mate it certainly improves alpha
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Delta pruning test

Post by mar »

adding qs will make you search more nodes, but it should improve the strength a lot. how much have you gained by adding qs?
other that that, I can only say that delta pruning is certainly not worth 80 elo, that's way too much
did it hold for more games (say 5k?)
Martin Sedlak
bctboi23
Posts: 20
Joined: Fri Feb 07, 2020 2:48 am
Location: United States
Full name: Tom R

Re: Delta pruning test

Post by bctboi23 »

I did already have a qSearch, that's why this seems really weird. (my first release already had qSearch implemented, so I'm not sure how much elo it added)
I will run more games, but my computer is not the fastest lol
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Delta pruning test

Post by xr_a_y »

did the same last week and delta pruning is losing elo in Minic.

One thing for sure is that you don't want to do that when in check !
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Delta pruning test

Post by hgm »

Why would you not do that when in check? It seems to me that when you are in check you should do this even with a smaller threshold, namely the value of the checker. Because you will surely not be able to capture more than that, even when there would still be Queens around. As you cannot capture the latter, as you must resolve the check. When you are not in check you can always hope that one of the captures hits a Queen.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Delta pruning test

Post by xr_a_y »

hgm wrote: Tue Feb 25, 2020 4:30 pm Why would you not do that when in check? It seems to me that when you are in check you should do this even with a smaller threshold, namely the value of the checker. Because you will surely not be able to capture more than that, even when there would still be Queens around. As you cannot capture the latter, as you must resolve the check. When you are not in check you can always hope that one of the captures hits a Queen.
Make sense ! I didn't think this through. In Minic delta pruning is a crazy Elo drop if applied when in check. I'll try to understand why...
bctboi23
Posts: 20
Joined: Fri Feb 07, 2020 2:48 am
Location: United States
Full name: Tom R

Re: Delta pruning test

Post by bctboi23 »

@xr_a_y my quiescence is only captures, and I extend checks before qsearch, so there isn't likely to be checks in the qsearch (although adding checks and promotions sounds like a good idea, I will think about doing that)

Also, turns out I messed up one of the parts of the test (namely, only one of the engines was playing moves from the book), so now I am getting what I think is a more reasonable 25 Elo jump. Still kind of weird, but not 80 Elo weird. (of course, only 100 games have been played yet, but we shall see)
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Delta pruning test

Post by hgm »

Even without adding anything: some of the captures in QS can be checks.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Delta pruning test

Post by Joost Buijs »

hgm wrote: Tue Feb 25, 2020 4:30 pm Why would you not do that when in check? It seems to me that when you are in check you should do this even with a smaller threshold, namely the value of the checker. Because you will surely not be able to capture more than that, even when there would still be Queens around. As you cannot capture the latter, as you must resolve the check. When you are not in check you can always hope that one of the captures hits a Queen.
Is this really true? I can imagine positions in which the king can capture a rook when for instance checked by a pawn, knight or bishop.