Qsearch Delta Pruning Rate?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

smatovic
Posts: 2639
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Qsearch Delta Pruning Rate?

Post by smatovic »

Am working on a Delta Pruning implementation in Quiscence Search,
currently i reach a prune rate of 1 to 3 % in middle game,
is this low, should it be more?

Merry Christmas :)
Srdja
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Qsearch Delta Pruning Rate?

Post by lucasart »

smatovic wrote:Am working on a Delta Pruning implementation in Quiscence Search,
currently i reach a prune rate of 1 to 3 % in middle game,
is this low, should it be more?

Merry Christmas :)
Srdja
Can you clarify "Delta Pruning" with some pseudo-code ? Just so we make sure we are talking about the same thing (there are several ways prune in a QS).
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
smatovic
Posts: 2639
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Qsearch Delta Pruning Rate?

Post by smatovic »

Can you clarify "Delta Pruning" with some pseudo-code ?
sure

Code: Select all

iif &#40;incheck == false && capturescore > 0 && boardscore < alpha - capturescore && piececount >= 16&#41;
    return alpha;
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Qsearch Delta Pruning Rate?

Post by lucasart »

smatovic wrote:
Can you clarify "Delta Pruning" with some pseudo-code ?
sure

Code: Select all

iif &#40;incheck == false && capturescore > 0 && boardscore < alpha - capturescore && piececount >= 16&#41;
    return alpha;
OK so:
- capturescore is the immediate materail gain of the capture (including promotion and en-passant?), assuming no recapture.
- condition should be boardscore + capturescore + margin < alpha, no ? You have to allow for some margin at least for the position gain of pieces moving on the board (either a hardcoded margin, or better: something like Stockfish's History::maxGains[][] mechanism)
- piececount >= 16 is a strange precondition. Is that for both sides (white and blacn) and including the pawns, or just pieces ? It seems far too restrictive, although you're probably right about being careful when pruning enters an endgame (say if after the capture the opponent has no pieces and only pawns, then don't delta prune)

But yes, I would say that this pruning will not reduce massively your node count. I think what is far more impoerant is a good SEE pruning (I do it at both PV and non PV nodes and it reduces the node count massively for rather little tactical cost).
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
smatovic
Posts: 2639
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Qsearch Delta Pruning Rate?

Post by smatovic »

Thanks for the margin hint Lucas.
But yes, I would say that this pruning will not reduce massively your node count. I think what is far more impoerant is a good SEE pruning (I do it at both PV and non PV nodes and it reduces the node count massively for rather little tactical cost).
With SEE Pruning you mean SEE score < 0 for captures?

--
Srdja
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Qsearch Delta Pruning Rate?

Post by lucasart »

smatovic wrote:Thanks for the margin hint Lucas.
But yes, I would say that this pruning will not reduce massively your node count. I think what is far more impoerant is a good SEE pruning (I do it at both PV and non PV nodes and it reduces the node count massively for rather little tactical cost).
With SEE Pruning you mean SEE score < 0 for captures?

--
Srdja
Yes. I do SEE pruning when:
- not in check (obviously)
- move is not a discovered check (for disco checks consider the SEE meaningless)
- SEE < 0, capture or not. There are no evasions to consider (since we're not in check) but this also prunes stupid quiet checks at depth = 0 (I generate quiet checks at depth = 0, and this prunes the stupid ones where the checking piece is lest hanging).

As for "delta pruning", you basically prune the captures that won't raise alpha, even in the best case scenario where there's no recapture. For that I use a margin of value(Pawn, Endgame) / 2.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: Qsearch Delta Pruning Rate?

Post by elcabesa »

I wonder why it's called Delta pruning, it lloks to me very similar to Futility pruning, am I wrong?
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Qsearch Delta Pruning Rate?

Post by lucasart »

elcabesa wrote:I wonder why it's called Delta pruning, it lloks to me very similar to Futility pruning, am I wrong?
I don't call it delta pruning. Maybe it's something from the chess programming wiki. Although I remember that Fruit called it delta pruning. Futility pruning is a better name IMO.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: Qsearch Delta Pruning Rate?

Post by elcabesa »

thank you
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Qsearch Delta Pruning Rate?

Post by Sven »

lucasart wrote:
elcabesa wrote:I wonder why it's called Delta pruning, it lloks to me very similar to Futility pruning, am I wrong?
I don't call it delta pruning. Maybe it's something from the chess programming wiki. Although I remember that Fruit called it delta pruning. Futility pruning is a better name IMO.
Here is one possible explanation for the origin of the name "delta pruning".

Sven