## Delta pruning test

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Pio
Posts: 184
Joined: Sat Feb 25, 2012 9:42 pm
Location: Stockholm
Contact:

### Re: Delta pruning test

Joost Buijs wrote:
Tue Feb 25, 2020 6:05 pm
hgm wrote:
Tue Feb 25, 2020 3: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.
Yes you are right, but it is not likely that you can force a position where the best move of the opponent is a checking move that looses material. Of course it exists for instance when you want a stalemate but it is not common.

hgm
Posts: 24730
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

### Re: Delta pruning test

OK, I was a bit sloppy about that, but then the marging could be 550 instead of 1000. The point is that if the King can capture a Queen, that Queen was also checking him. So in any case you could lower the margin when in check by a non-Queen.

(Umm, I guess there still also is the case where you are checked by, say, a Rook, and could capture that Rook with a Pawn that promotes in the process. But then the margin 1000 would also not be enough when you were not in check.)

Daniel Anulliero
Posts: 705
Joined: Fri Jan 04, 2013 3:55 pm
Location: Nice

### Re: Delta pruning test

bctboi23 wrote:
Tue Feb 25, 2020 2:12 pm
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?
Hello
Did you test the change vs an old version of Ceechess?
If so, you must retest vs a set of engine because I've tested a change in Isa this week : I've got +70 elo vs the previous version and .. +2 elo vs engines ... so ...
Best
Dany

bctboi23
Posts: 17
Joined: Fri Feb 07, 2020 1:48 am
Location: United States
Full name: Tom Reinitz

### Re: Delta pruning test

Daniel Anulliero wrote:
Wed Feb 26, 2020 10:36 am
bctboi23 wrote:
Tue Feb 25, 2020 2:12 pm
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?
Hello
Did you test the change vs an old version of Ceechess?
If so, you must retest vs a set of engine because I've tested a change in Isa this week : I've got +70 elo vs the previous version and .. +2 elo vs engines ... so ...
Best
Dany
Yeah, turns out it was about a +10 Elo jump cuz of a bug in testing conditions. I will definitely keep that in mind tho, I need to get some new engines around CeeChess level

bob
Posts: 20916
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

### Re: Delta pruning test

This is one of the keys of testing. If one copy of your program has some sort of knowledge or search feature that the other one does not, then that gets highlighted and inflates the difference between the two. Using a gauntlet of opponents makes it less likely that will happen, except for the cases where you actually come up with a new idea no one has tried...

nionita
Posts: 163
Joined: Fri Oct 22, 2010 7:47 pm
Location: Austria

### Re: Delta pruning test

bob wrote:
Wed Feb 26, 2020 6:25 pm
This is one of the keys of testing. If one copy of your program has some sort of knowledge or search feature that the other one does not, then that gets highlighted and inflates the difference between the two. Using a gauntlet of opponents makes it less likely that will happen, except for the cases where you actually come up with a new idea no one has tried...
But this effect of inflating the ELO difference is benefical! Otherwise there would be a lot of small ELO wins which need even more thousands of games to be verified. Of course there should be some tests against other engines too, but in first place, I think, what we want to see, is just if the new version is better or not, not the exact ELO difference.

bob
Posts: 20916
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

### Re: Delta pruning test

You CAN add something to your program that makes it score better than the version without. And you can also do this where it scores slightly worse against other programs, as they handle the circumstance you are working on a little better than you do. Testing against yourself is not a bad idea, but you have to test against others every now and then to make sure you are not running down a rabbit hole.