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
hash eval, hash pawn or twice ?
Moderator: Ras
-
- Posts: 772
- Joined: Fri Jan 04, 2013 4:55 pm
- Location: Nice
-
- Posts: 28361
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
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.
-
- Posts: 269
- Joined: Fri Jul 10, 2015 9:23 pm
- Location: Russia
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
-
- Posts: 772
- Joined: Fri Jan 04, 2013 4: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
-
- Posts: 2204
- Joined: Sat Jan 18, 2014 10:24 am
- Location: Andorra
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

-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
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
-
- Posts: 7251
- Joined: Mon May 27, 2013 10:31 am
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.
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
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.
-
- Posts: 772
- Joined: Fri Jan 04, 2013 4: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 ...

-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
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.