Pruning in Quiescence search

Discussion of chess software programming and technical issues.

Moderator: Ras

m24gstevens
Posts: 4
Joined: Fri Jul 15, 2022 12:18 am
Full name: Matthew Stevens

Pruning in Quiescence search

Post by m24gstevens »

Hi all,

I'm developing improvements to my chess engine (Source code for original version https://github.com/m24gstevens/Chess/tr ... /m24gc/1.0). In my latest (test) version, I wrote a specialized capture generator for the quiescence search, and used PeSTO's evaluation function (Temporary, for testing). Finally, I implemented a basic "delta pruning" procedure in the quiescence search:

Code: Select all

 int quiesce(int alpha, int beta)	// Quiescence, in the "fail hard" framework
 ...
 static_eval = evaluate()
 if (static_evaluation >= beta)		// Fail high
 	return beta
 // This is the "delta pruning"
 int delta = 975 	// Queen value
 if (pawn_might_promote())
 	delta += 775
 if (static_evaluation < alpha - delta) 	// I.e. a "hopeless" position
 	return alpha 
 ...
 < rest of quiesce>
 ...
I tested the new version of the engine against my original, and noticed the playing strength actually decreased when the delta pruning was used, compared to being not used.
What could be the reason for this shortcoming? Does it indicate some error in the evaluation function?
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Pruning in Quiescence search

Post by hgm »

I suppose it is a typo that you have static_eval instead of static_evaluation in one place?

I would say that this proves your testing is not accurate, as your delta is so large that the condition in the added statement should virtually never be satisfied. So it should not have a measurable effect on playing strength.
m24gstevens
Posts: 4
Joined: Fri Jul 15, 2022 12:18 am
Full name: Matthew Stevens

Re: Pruning in Quiescence search

Post by m24gstevens »

Thanks for the heads up. I'll re-implement and then come back with the results :D
m24gstevens
Posts: 4
Joined: Fri Jul 15, 2022 12:18 am
Full name: Matthew Stevens

Re: Pruning in Quiescence search

Post by m24gstevens »

Looks like the earlier issues were just some other bugs - Works like a charm now.

I'll post the skeleton code which might be helpful to someone

Code: Select all

#define DELTA 200

int quiesce(int alpha, int beta) {
	static_evaluation = evaluate()
	if (static_evaluation >= beta)
		return beta;
	...
	generate_captures();
	score_moves();
	for (move in move list)   {
		if (!in_endgame() && !is_promotion(move) && (static_evaluation + piece_value[piece_captured(move)] + DELTA < alpha))
			continue;		// This capture isn't worth searching
	}
	...
	return alpha;
}