Questions about TT and Qsearch.

Discussion of chess software programming and technical issues.

Moderator: Ras

RRr
Posts: 2
Joined: Thu Aug 03, 2023 1:12 am
Full name: Raoul Voetdijk

Questions about TT and Qsearch.

Post by RRr »

Hello, I have started making my own chess engine and have some questions about Transposition tables in combination with Qsearch.

I am planning to add a TT to my engine. On the internet I found mixed ideas/facts about having a TT with Qsearch.

On some sites I read that I should not use a TT in the qsearch, because fetching the memory will take to long and waste allot of CPU cycles.
On the other hand I read about engines with huge TT that do use the same transposition table for both the normal seach and qsearch. In my imagination having a big TT almost guarantees a cache miss, and thus waiting a long time for the memory to get fetched. Is this waste of CPU cycles still a significant problem?

I remember reading about using a seperate(small) TT for the qsearch and the normal search, but I cant find this information anymore. Also when searching about it I found very little, so that makes me think that doing so is not a good idea.

Is this indeed not a good idea? I have tried testing it, but my laptop has recently lost allot of RAM and now uses allot of virtual ram, which made me doubt my own test results. I would assume that this doesn't actually cause a problem, but I could not get positive results from using a TT in the qsearch. (My engine is still very simple and uses minimax with alpha-beta pruning and MVV-LVA for move ordering.)
User avatar
Fabio Gobbato
Posts: 219
Joined: Fri Apr 11, 2014 10:45 am
Full name: Fabio Gobbato

Re: Questions about TT and Qsearch.

Post by Fabio Gobbato »

In my engine I use the same TT for search and for qsearch but be careful that a qsearch node doesn't overwrite a search node.
If you think that a TT hit (also in qsearch) saves you from a lot of nodes being searched the time needed to get the score from the ram is always faster than search a complete subtree. When I added the TT also in qsearch I got a little elo boost.
User avatar
Steve Maughan
Posts: 1271
Joined: Wed Mar 08, 2006 8:28 pm
Location: Florida, USA

Re: Questions about TT and Qsearch.

Post by Steve Maughan »

In Maverick I have two QSearch routines: one for the first ply of QSearch (where I also search checks); and one for the remaining ply of QSearch. In the first ply search I store the results in the TT if it is a cutoff. The thinking there is the first ply of QSearch will be the last ply of regular search on the next iteration. YMMV

— Steve
http://www.chessprogramming.net - Juggernaut & Maverick Chess Engine