I believe that Quiescence the slowest portion of my search. I think it is because of 2 reasons:
1. My Quiescence Search does not make use of Transposition Tables.
2. I call the Evaluate Function at every node.
My question(s) is how do I implement Transposition Tables for Quiescence Search? Is it the same as regular search? Do I create a separate Table for Quiescence so it does not pollute the main table? I am guessing it has to be different because can you really have exact entries?
Most engines use the same table for QS and main search (so you can get hits on deeper entries with QS probes). Exact values in QS are just as exact as any exact score from main search. Of course less depth means the scores are less accurate, but that is another matter.
(2) you are testing for black and white being in check at _every_ node in the case where whitecheck returns false. Also, further down, you call both after making the move? That doesn't make any sense. qsearch nodes make up > 75% of the nodes searched, you don't want to do _any_ unnecessary work there.
(2) you are testing for black and white being in check at _every_ node in the case where whitecheck returns false. Also, further down, you call both after making the move? That doesn't make any sense. qsearch nodes make up > 75% of the nodes searched, you don't want to do _any_ unnecessary work there.
The Killer Moves are used for sorting. If a move has caused a beta cut off I try this move first next time I enter Quiescence. Is this wrong?
About the Check test. This is just a boolean variable lookup not an evaluation. The first "Check Test" is to see if I should be looking at every move or just captures. If I am in check I evaluate all moves not just captures. I found this corrected some weird issues I was having before.
The second "Check Test" happens after a move is made. If the move caused a check then it is not a valid move so I do not want to persue it any further.
(2) you are testing for black and white being in check at _every_ node in the case where whitecheck returns false. Also, further down, you call both after making the move? That doesn't make any sense. qsearch nodes make up > 75% of the nodes searched, you don't want to do _any_ unnecessary work there.
The Killer Moves are used for sorting. If a move has caused a beta cut off I try this move first next time I enter Quiescence. Is this wrong?
In the q-search, yes. It is better to order the captures based on expected material gain. Most use SEE and eliminate captures that have a score < 0, but they we are using MVV/LVA to order the captures that SEE thinks does not lose material.
About the Check test. This is just a boolean variable lookup not an evaluation. The first "Check Test" is to see if I should be looking at every move or just captures. If I am in check I evaluate all moves not just captures. I found this corrected some weird issues I was having before.
The second "Check Test" happens after a move is made. If the move caused a check then it is not a valid move so I do not want to persue it any further.
Is what I am doing here correct? Please help.
Hard to say without seeing the rest of your code, but the guiding principle for q-search is to minimize work done because it is done so very often...
aberent wrote:I do already use MVV/LVA for move ordering. That happens in the EvaluateMovesQ method.
What is this: SEE you are talking about?
Also I am still not sure how to use Transposition Tables in my Quiescence Search, can someone give me a verbal description or a code example.
SEE == Static Exchange Evaluator
It just plays out captures on one square to see if a potential move loses material, wins material, or is neutral.
Hashing in q-search works exactly like hashing in normal search. You probe at the front of q-search before doing anything. After completing the q-search you store the result so that if you reach this position again, you can avoid repeating the search.
It's important to note that when "playing out" captures to a square to evaluate the exchange, the moves are not actually made on the board. That would be too slow. It's a crude (but effective) estimate of the value of the trade. It generally doesn't consider things such as if one of the capturing pieces is pinned ...
Something that has not been mentioned is that TT probes are slow. You would need to test to see if it made your program faster.
Also have you seen http://chessprogramming.wikispaces.com/?
It has much good information for beginning (or expert) chess programmers.