Ratio of Transposition Hash to Eval Hash

Discussion of chess software programming and technical issues.

Moderator: Ras

JVMerlino
Posts: 1404
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Ratio of Transposition Hash to Eval Hash

Post by JVMerlino »

Since GUIs (as far as I'm aware) only request a single amount of hash memory from an engine, how do engines allocate that amount between transposition hash and eval hash? I'm playing around with different ratios and I have a suspicion that the faster the time control is, the more eval hash you want (particularly if your engine uses NN).

Perhaps a better way of asking the question is "what is the ratio of the number of buckets for the two hash types". My (so far inconclusive) testing is showing that having twice as many eval hash buckets performs the best at typical engine testing tc (I use one minute with no increment). No idea if that would be detrimental at the longer tcs that CCRL uses, for example.

Thoughts?
User avatar
flok
Posts: 603
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: Ratio of Transposition Hash to Eval Hash

Post by flok »

JVMerlino wrote: Mon Sep 22, 2025 8:18 pm Since GUIs (as far as I'm aware) only request a single amount of hash memory from an engine, how do engines allocate that amount between transposition hash and eval hash? I'm playing around with different ratios and I have a suspicion that the faster the time control is, the more eval hash you want (particularly if your engine uses NN).

Perhaps a better way of asking the question is "what is the ratio of the number of buckets for the two hash types". My (so far inconclusive) testing is showing that having twice as many eval hash buckets performs the best at typical engine testing tc (I use one minute with no increment). No idea if that would be detrimental at the longer tcs that CCRL uses, for example.

Thoughts?
(what is the difference between transposition hash and eval hash?)
JVMerlino
Posts: 1404
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Ratio of Transposition Hash to Eval Hash

Post by JVMerlino »

flok wrote: Mon Sep 22, 2025 8:20 pm
JVMerlino wrote: Mon Sep 22, 2025 8:18 pm Since GUIs (as far as I'm aware) only request a single amount of hash memory from an engine, how do engines allocate that amount between transposition hash and eval hash? I'm playing around with different ratios and I have a suspicion that the faster the time control is, the more eval hash you want (particularly if your engine uses NN).

Perhaps a better way of asking the question is "what is the ratio of the number of buckets for the two hash types". My (so far inconclusive) testing is showing that having twice as many eval hash buckets performs the best at typical engine testing tc (I use one minute with no increment). No idea if that would be detrimental at the longer tcs that CCRL uses, for example.

Thoughts?
(what is the difference between transposition hash and eval hash?)
https://www.chessprogramming.org/Transposition_Table
https://www.chessprogramming.org/Evaluation_Hash_Table
Joerg Oster
Posts: 982
Joined: Fri Mar 10, 2006 4:29 pm
Location: Germany
Full name: Jörg Oster

Re: Ratio of Transposition Hash to Eval Hash

Post by Joerg Oster »

JVMerlino wrote: Mon Sep 22, 2025 8:18 pm Since GUIs (as far as I'm aware) only request a single amount of hash memory from an engine, how do engines allocate that amount between transposition hash and eval hash? I'm playing around with different ratios and I have a suspicion that the faster the time control is, the more eval hash you want (particularly if your engine uses NN).

Perhaps a better way of asking the question is "what is the ratio of the number of buckets for the two hash types". My (so far inconclusive) testing is showing that having twice as many eval hash buckets performs the best at typical engine testing tc (I use one minute with no increment). No idea if that would be detrimental at the longer tcs that CCRL uses, for example.

Thoughts?
If you also save the static eval of a position into the Transposition Table, you don't need a separate eval hash.
Almost everybody is doing it this way nowadays ...
Jörg Oster
JVMerlino
Posts: 1404
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Ratio of Transposition Hash to Eval Hash

Post by JVMerlino »

Joerg Oster wrote: Mon Sep 22, 2025 11:17 pm
JVMerlino wrote: Mon Sep 22, 2025 8:18 pm Since GUIs (as far as I'm aware) only request a single amount of hash memory from an engine, how do engines allocate that amount between transposition hash and eval hash? I'm playing around with different ratios and I have a suspicion that the faster the time control is, the more eval hash you want (particularly if your engine uses NN).

Perhaps a better way of asking the question is "what is the ratio of the number of buckets for the two hash types". My (so far inconclusive) testing is showing that having twice as many eval hash buckets performs the best at typical engine testing tc (I use one minute with no increment). No idea if that would be detrimental at the longer tcs that CCRL uses, for example.

Thoughts?
If you also save the static eval of a position into the Transposition Table, you don't need a separate eval hash.
Almost everybody is doing it this way nowadays ...
Ok, I'll give that a try. Thanks Joerg!