hash eval, hash pawn or twice ?
Moderators: hgm, Harvey Williamson, bob
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
-
Daniel Anulliero
- Posts: 624
- Joined: Fri Jan 04, 2013 3:55 pm
- Location: Nice
hash eval, hash pawn or twice ?
Hi all !
I've implemented hash eval in Isa , very easy to do and seems working very well .But I wonder if it's useful to implement hash pawns too , or it's better to implement hash pawns instead of hash eval ?
I've seen CPW have twice in his eval , I don't understand why it is useful to have twice in the eval , because in hash eval we have evaluation of pawn structure , right?
All the Bests
Dany
I've implemented hash eval in Isa , very easy to do and seems working very well .But I wonder if it's useful to implement hash pawns too , or it's better to implement hash pawns instead of hash eval ?
I've seen CPW have twice in his eval , I don't understand why it is useful to have twice in the eval , because in hash eval we have evaluation of pawn structure , right?
All the Bests
Dany
- hgm
- Posts: 22274
- Joined: Fri Mar 10, 2006 9:06 am
- Location: Amsterdam
- Full name: H G Muller
- Contact:
Re: hash eval, hash pawn or twice ?
The point is that the hashed evaluation is only valid for a single position, while the hashed Pawn evaluation would be shared by millions of positions. Evaluating Pawn structure is usually pretty expensive, so being able to fetch it from a table in 99% of the cases would give a significant speedup.
Re: hash eval, hash pawn or twice ?
I think both at onceDaniel Anulliero wrote:Hi all !
I've implemented hash eval in Isa , very easy to do and seems working very well .But I wonder if it's useful to implement hash pawns too , or it's better to implement hash pawns instead of hash eval ?
I've seen CPW have twice in his eval , I don't understand why it is useful to have twice in the eval , because in hash eval we have evaluation of pawn structure , right?
All the Bests
Dany
-
Daniel Anulliero
- Posts: 624
- Joined: Fri Jan 04, 2013 3:55 pm
- Location: Nice
Re: hash eval, hash pawn or twice ?
Aah yes true never thought about that ! 😊hgm wrote:The point is that the hashed evaluation is only valid for a single position, while the hashed Pawn evaluation would be shared by millions of positions. Evaluating Pawn structure is usually pretty expensive, so being able to fetch it from a table in 99% of the cases would give a significant speedup.
When the engine analyse 24 queen moves for exemple , the pawn structure never change (or just for a capture)
Ok I'll try that too
Thanks
Re: hash eval, hash pawn or twice ?
Also your pawn evaluation should be at least a bit complicated for you to win something relevant; I suppose is like this.Daniel Anulliero wrote:Aah yes true never thought about that ! 😊hgm wrote:The point is that the hashed evaluation is only valid for a single position, while the hashed Pawn evaluation would be shared by millions of positions. Evaluating Pawn structure is usually pretty expensive, so being able to fetch it from a table in 99% of the cases would give a significant speedup.
When the engine analyse 24 queen moves for exemple , the pawn structure never change (or just for a capture)
Ok I'll try that too
Thanks
In Andscacs the pawn hash if 2 MB. Seems enough for it.
Daniel José -
http://www.andscacs.com
Re: hash eval, hash pawn or twice ?
Pawn hash is worth it as you will see beyond 95% hits, where eval cache won't be anywhere near that (pawn hash would normally only use pawn positions to compute the signature, eval cache would use normal hash signature). This produces a far greater number of hits for pawns than for the full eval.Daniel Anulliero wrote:Hi all !
I've implemented hash eval in Isa , very easy to do and seems working very well .But I wonder if it's useful to implement hash pawns too , or it's better to implement hash pawns instead of hash eval ?
I've seen CPW have twice in his eval , I don't understand why it is useful to have twice in the eval , because in hash eval we have evaluation of pawn structure , right?
All the Bests
Dany
Re: hash eval, hash pawn or twice ?
For evaluation of passers it is worthless for pawn table does not tell if passed pawn is blocked by a knight.
Re: hash eval, hash pawn or twice ?
However it CAN store a record of which pawns are passed, so you don't have to do THAT part of the passed pawn evaluation...Henk wrote:For evaluation of passers it is worthless for pawn table does not tell if passed pawn is blocked by a knight.
-
Daniel Anulliero
- Posts: 624
- Joined: Fri Jan 04, 2013 3:55 pm
- Location: Nice
Re: hash eval, hash pawn or twice ?
Thanks to HGM, daniel josé and Bob for your answers !
Well I've implemented the pawn hash today and made some tests , the two versions , with and without pawn hash (too few tests for the moment , it take some time
)
In the first test I had 330 ms of speed gain
5 moves , one depth more
In the second only 65ms
12 moves , one depth more.
In the first test, 3 times (out of 41 moves), two diferents moves (collisions or search instability?)
In the second test , 6 times (out of 71 moves) two diférents moves (collisions or search instability?)
To be continued ...

Well I've implemented the pawn hash today and made some tests , the two versions , with and without pawn hash (too few tests for the moment , it take some time
In the first test I had 330 ms of speed gain
5 moves , one depth more
In the second only 65ms
12 moves , one depth more.
In the first test, 3 times (out of 41 moves), two diferents moves (collisions or search instability?)
In the second test , 6 times (out of 71 moves) two diférents moves (collisions or search instability?)
To be continued ...
Re: hash eval, hash pawn or twice ?
Pawn hash should change absolutely nothing but speed. If that's not true, you definitely have a bug. Node count should remain identical, as should the score, PV and everything else. You should see an improvement in speed proportional to the time spent in pawn evaluation. If pawn evaluation takes 10% of the execution time when you do a profile run, the pawn hash version should run 10% faster since the pawn eval will hardly ever be executed...Daniel Anulliero wrote:Thanks to HGM, daniel josé and Bob for your answers !
Well I've implemented the pawn hash today and made some tests , the two versions , with and without pawn hash (too few tests for the moment , it take some time
)
In the first test I had 330 ms of speed gain
5 moves , one depth more
In the second only 65ms
12 moves , one depth more.
In the first test, 3 times (out of 41 moves), two diferents moves (collisions or search instability?)
In the second test , 6 times (out of 71 moves) two diférents moves (collisions or search instability?)
To be continued ...
A simple debug test is to look up the pawn eval in hash, save it, then compute the REAL eval anyway and compare the two results. If they are not the same, fix the bug.

