What first, hash tables or tablebases?

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Luis Babboni
Posts: 464
Joined: Sat Feb 28, 2015 4:37 pm
Location: Argentina

What first, hash tables or tablebases?

Post by Luis Babboni »

I´m doing my final tests of my engine against other engines and tomorrow I´ll put the version with QS in its web.
Is not as better as I think than version without it but better, I think around 30 ELO points.

The question is what next? Make my engine could use Hash tables or to use tablabases?

Thanks.
Robert Pope
Posts: 570
Joined: Sat Mar 25, 2006 8:27 pm
Location: USA
Full name: Robert Pope

Re: What first, hash tables or tablebases?

Post by Robert Pope »

Hash tables without a question.
AlvaroBegue
Posts: 932
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: What first, hash tables or tablebases?

Post by AlvaroBegue »

Hash tables, by a mile. The improvement from tablebases might be something like 25 Elo. The improvement from hash tables is probably something like several hundred Elo.
User avatar
Luis Babboni
Posts: 464
Joined: Sat Feb 28, 2015 4:37 pm
Location: Argentina

Re: What first, hash tables or tablebases?

Post by Luis Babboni »

Thanks guys!! :D

Just be prepared for read a lot of question about it!! :P
PK
Posts: 913
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: What first, hash tables or tablebases?

Post by PK »

hash tables are definately more important (by an order of magnitude), but in terms of effort to result ratio I'd recommend going for null move first.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: What first, hash tables or tablebases?

Post by bob »

Luis Babboni wrote:I´m doing my final tests of my engine against other engines and tomorrow I´ll put the version with QS in its web.
Is not as better as I think than version without it but better, I think around 30 ELO points.

The question is what next? Make my engine could use Hash tables or to use tablabases?

Thanks.
hash tables will gain you much more than endgame tables. You get better move ordering, smaller trees, deeper searches.
User avatar
Ras
Posts: 2758
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: What first, hash tables or tablebases?

Post by Ras »

Endgame tables might even cost ELO, that depends on the implementation.

Sometimes, you can cache relevant parts of the relevant endgame table files. But not all, and a disk cache miss then translates into doing actual file I/O. That is extremely slow compared to memory access. If that happens a lot, then it can slow down the overall search. Means, you get less search depth because the engine is too busy with file I/O.

Obviously, this isn't a problem if you only look up positions once they are on the board. But in this case, you'd miss the opportunity to get the game towards such a position beforehand.

This is a difficult tradeoff.

Elementary mates against the lone king are possible with static eval plus search tree, i.e. without tables.
CheckersGuy
Posts: 273
Joined: Wed Aug 24, 2016 9:49 pm

Re: What first, hash tables or tablebases?

Post by CheckersGuy »

As pretty much everyone else said. Hash Tables is the right answer. HashTables give you much more at almost every stage of the game (Obviously much better if there are a lot of transpositions). Tablebases on the other hand only help you with endgames. Additionally, you should try out different replacements chemes when using H-Tables(always replace vs storing only if detph>entry.depth and so on)