Buckets for pawn hash?
Moderators: hgm, Rebel, chrisw
-
- Posts: 778
- Joined: Sat Jul 01, 2006 7:11 am
Buckets for pawn hash?
Do people use multiple buckets for pawn hash? Why or why not?
-
- Posts: 2204
- Joined: Sat Jan 18, 2014 10:24 am
- Location: Andorra
Re: Buckets for pawn hash?
No because I have not tried. But also at some point I doubled the hash size and if this has improved the engine was so little that I returned to the previous hash size. So I doubt that buckets can add anything, but of course I cannot be sure.
Daniel José - http://www.andscacs.com
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Buckets for pawn hash?
The idea of buckets is that it would make a smaller table give the same performance as a bigger one without buckets. I would be surprised if using buckets of 4 with LRU replacement wouldn't allow you to halve the table size to achieve the same hit rate. The question is how much code complexity it is worth to you to halve the table size. If it would make the table fit in a cache in which it otherwise would not fit,it might be an incentive to try it.
-
- Posts: 892
- Joined: Sun Nov 19, 2006 9:16 pm
- Location: Russia
Re: Buckets for pawn hash?
I personally doubt that pawn hash is good idea from the beginning.
-
- Posts: 686
- Joined: Thu Mar 03, 2011 4:57 pm
- Location: Germany
Re: Buckets for pawn hash?
It is the hash with the highest hitrate (by far) and saves you to collect all those backward, passed, isolated pawns over and over again.I personally doubt that pawn hash is good idea from the beginning.
Because the hitrate is so high the pawn hash size can be small so using buckets is probably not worth it or would further improve it.
-
- Posts: 892
- Joined: Sun Nov 19, 2006 9:16 pm
- Location: Russia
Re: Buckets for pawn hash?
1) How much is pawn evaluation from scratch cost comparing to total evaluation cost? How often it is actually needed when lazy evaluation shortcut active?tpetzke wrote:It is the hash with the highest hitrate (by far) and saves you to collect all those backward, passed, isolated pawns over and over again.I personally doubt that pawn hash is good idea from the beginning.
Because the hitrate is so high the pawn hash size can be small so using buckets is probably not worth it or would further improve it.
2) It is always O(1) savings, while regular transposition table can save magnitude of whole search time.
3) Pawn cache "table" with just 1 record would have decent hit rate.
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Buckets for pawn hash?
The purpose for buckets is to provide better replacement decisions. With a reasonable sized pawn hash and probing just one entry, 99% hit rates are typical. So the effort of searching through a bucket for maybe a 1% hit improvement is almost certainly not worth it...jwes wrote:Do people use multiple buckets for pawn hash? Why or why not?
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Buckets for pawn hash?
It depends. If doing the Pawn eval is 100 times more expensive than doing the probe, increasing the hit rate from 99% to 99.5% shaves 25% off your average Pawn-eval time.
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Buckets for pawn hash?
Not quite. 99% of the time it has no effect at all, so we are only talking about 1% of the cases.hgm wrote:It depends. If doing the Pawn eval is 100 times more expensive than doing the probe, increasing the hit rate from 99% to 99.5% shaves 25% off your average Pawn-eval time.
In the above,
average_time = .99 * 0 + .25 * C * 0.01
where C is the computational cost for a full pawn eval. 25% of 1% is not very big for any reasonable C. And then there is that 0 value for 99% which will go up a bit to manage the buckets. So 99% of the hits are now slower, to speed up 1/4 of the remaining 1%.
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Buckets for pawn hash?
Not sure where your 0.25 comes from. The correct calculation would be
0.99 + C*0.01 = 1.99 (C = 100)
0.995 + C*0.005 = 1.495
1.495/1.99 = 75% = 100% - 25%.
0.99 + C*0.01 = 1.99 (C = 100)
0.995 + C*0.005 = 1.495
1.495/1.99 = 75% = 100% - 25%.