You are right, and I wrote the explanation wrong. If stand-pat is > beta, you can bail immediately. Otherwise you try for the best score you can get, whether it is stand-pat or playing a capture...sje wrote:If the stand pat score is less than or equal to alpha, it might still be improved by some gainer (capture/promotion) move.bob wrote:First thing you do in quiesce() is compute the static eval. If it is >= beta, or <= alpha, you return instantly and don't look at any captures.
A better test at the start of a quiescence node would be:And for each quiescence node move:Code: Select all
if ((stand_pat_score + best_possible_gain(position)) <= alpha) then return alpha;
Code: Select all
if ((stand_pat_score + best_possible_gain(move)) <= alpha) then skip_move;
All time spent in quiescent search - why?
Moderators: hgm, Rebel, chrisw
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: All time spent in quiescent search - why?
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Re: Good vs Evil
When dealing with pawns Bozo has pre-calculated tables, each of which has at least one dimension indexed by color. In other cases, a table has a man index which includes pawns of both colors.Evert wrote:I originally wrote Jazz' evaluation entirely side-to-move neutral, and I liked it at first. But then I started adding things like king-safety and passer evaluation, and then you're dealing with pawns and suddenly you're not looking at "side to move" and "other side", but "white" and "black".sje wrote: The much better approach is to interpret all scores form the point of view of the player on the move. In my code, the structure describing a position has two components of type Color; these are good (for the player on the move) and evil (for the other player). When going up or down a ply, the values of the two are interchanged.
This really simplifies things when compared with the old, old textbook presentations of two player search!
Code: Select all
pawnadvdir: array [colorrtype] of dirtype; { Pawn advance directions by color }
pawnretdir: array [colorrtype] of dirtype; { Pawn retreat directions by color }
mantodir0: array [manrtype] of dirtype; { Map man to first attack direction }
mantodir1: array [manrtype] of dirtype; { Map man to final attack direction }
manatk0setvec: array [colorrtype, sweepdirtype] of mansettype; { Incoming attackers (start) }
manatk1setvec: array [colorrtype, sweepdirtype] of mansettype; { Incoming attackers (further) }
ptrackbbvec: array [colorrtype, sqtype] of bbtype; { Pawn forward track }
passerbbvec: array [colorrtype, sqtype] of bbtype; { Passed pawn forward test squares }
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: All time spent in quiescent search - why?
To be more clear:ZirconiumX wrote:If a value is higher than beta, then that move was brilliant. In fact, so brilliant that it has exceeded the opponents best score. We might as well return beta so that we can prove to our opponent this was a brilliant move for us. However, this value is negated, so that a high value for us is a low value for them, so that move does not improve alpha.
If a value is greater or equal than beta, then that move was good enough to refute the opponent's previous move, so that we can save the effort to find possibly an even better refutation - one refutation is always enough. That does not necessarily mean that our move was "brilliant", only that it was sufficiently good to state that the opponent's previous move was not hist best move (he already had another move that was better or at least equal to it).
Sven
-
- Posts: 27809
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: All time spent in quiescent search - why?
So in fact it means that (at least one of) the opponent's previous moves were stupid.Sven Schüle wrote:That does not necessarily mean that our move was "brilliant", only that it was sufficiently good to state that the opponent's previous move was not hist best move (he already had another move that was better or at least equal to it).
-
- Posts: 98
- Joined: Tue Jul 26, 2011 12:18 am
- Location: London
Re: All time spent in quiescent search - why?
I've been quiet simply because I'm working hard to implement this stuff. The following log shows the moves that are tried when looking at that initial position. The move order is what I would expect from MVV/LVA and it's white to move. Everything looks ok until we get to the part in red :
First moves tried with no initial best score (the 2m value) & it doesn't reorder bad exchanges (Nf3xe5 Pd6xe5) yet
Bg5xf6 Pg7xf6 Pd4xe5 Pf6xe5 Nf3xe5 Pd6xe5 Qd1xd8 Be7xd8 => -169 BETTER FOR BLACK THAN 2000000
This move gets a better score
Bg5xf6 Pg7xf6 Pd4xe5 Pf6xe5 Nf3xe5 Pd6xe5 Qd1xd8 Ke8xd8 => -170 BETTER FOR BLACK THAN -169
The -170 score is fed back down
Bg5xf6 Pg7xf6 Pd4xe5 Pf6xe5 Nf3xe5 Pd6xe5 Qd1xd8 => -170 BETTER FOR WHITE THAN -2000000
The -170 score is fed back down again
Bg5xf6 Pg7xf6 Pd4xe5 Pf6xe5 Nf3xe5 Pd6xe5 => -170 BETTER FOR BLACK THAN 2000000
and again
Bg5xf6 Pg7xf6 Pd4xe5 Pf6xe5 Nf3xe5 => -170 BETTER FOR WHITE THAN -2000000
Here we have a stand pat situation "." and the move Qd1xd6 is seen to be bad
Bg5xf6 Pg7xf6 Pd4xe5 Pf6xe5 Qd1xd6 Pc7xd6 . => -1160 Qd1xd6 REFUTED
Bg5xf6 Pg7xf6 Pd4xe5 Pf6xe5 Qd1xd6 => -1160
The -170 score is fed back down again
Bg5xf6 Pg7xf6 Pd4xe5 Pf6xe5 => -170 BETTER FOR BLACK THAN 2000000
but I just can't see why the following move is refuted
Bg5xf6 Pg7xf6 Pd4xe5 Pd6xe5 Qd1xd8 . => 1496 Pd6xe5 REFUTED
Bg5xf6 Pg7xf6 Pd4xe5 Pd6xe5 => 1496
The -170 score is fed back down again
Bg5xf6 Pg7xf6 Pd4xe5 => -170 BETTER FOR WHITE THAN -2000000
-
- Posts: 1334
- Joined: Sun Jul 17, 2011 11:14 am
Re: All time spent in quiescent search - why?
You have something deeply wrong with your search.
Do you have a function that looks for check? If you don't your program won't be able to find checkmates.
As a general rule, don't stand pat while in check.
Bg5xf6 Pg7xf6 Pd4xe5 Pd6xe5 Qd1xd8 . => 1496 Pd6xe5 REFUTED
is refuted because black loses his queen. Losing the queen is extremely bad for black.
Matthew:out
Do you have a function that looks for check? If you don't your program won't be able to find checkmates.
As a general rule, don't stand pat while in check.
Bg5xf6 Pg7xf6 Pd4xe5 Pd6xe5 Qd1xd8 . => 1496 Pd6xe5 REFUTED
is refuted because black loses his queen. Losing the queen is extremely bad for black.
Matthew:out
Some believe in the almighty dollar.
I believe in the almighty printf statement.
I believe in the almighty printf statement.
-
- Posts: 27809
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: All time spent in quiescent search - why?
You are right, after Qxd8 there should not be a refutation of dxe5. The eval in that positionis bad,because you are a Queen behind, but you have capture moves that gain the Queen back (Kxd8, Bxd8) with a neutral score. It is the stand-pat in that position which should be considered refuted by the 1496 score. Not the move 2 ply earlier.mike_bike_kite wrote:I just can't see why the move in red is refuted. Ideas? The extensions are behaving themselves at the moment but probably because it's pruning too much.
You might have prolbem in your move generator, somehow not generating the captures because it doesn't see they resolve the check.