Taking advantage of the extra bit
Posted: 13 Oct 2008, 05:12
I have three questions so please bare with me.
Question 1) Taking advantage of the extra bit
I currently store 4 positions to one byte mapping in bitbases. Theoretically it is possible to
store 5 positions in one byte. There are 13 unused values (256 - 3^4 = 13)
with the former. So I wanted to check it out and to my dismay the database
produced after compression is larger!! I don't know what the reason is but
I am suspecting the follwong
* pattern produced by the first method is better for compression.
Also usually the square enumerations result in a database which is divisible by 4??
So in short I am thinking there is more entropy introduced in the second case.
I sue LZ + Huffman btw.
The broken positions are replaced in such a way that they continue the previous run for both cases.
Next I tried to use prediction for both. For the first one I used the fourth value
to indicate whether the result is correctly predicted or not.
For the second case the 13 remaning values are used to indicate from correct prediction for
all positions ---> to correct prediction for all but one of the positions. That is the maximum
allowed by the 13 remining values. So I guess that the predictor should predict correctly
at least 80% of the time (1 - 1/5 = 0.8). After that the results became much closer but still the first one is better!
So I am deciding to choose the first one, apparently not only for its simplicity!
Also I think that for 6 men and above prediction will be a lot more harder, in that
case I want to use the extra bit to indicate if the WDL is achieved by more than 50 moves.
Many such positions occur even in some 5 men, so if the table has that info engines can use
that information to choose between moves which lead to longer WDLs with in the 50 move rule.
What is your experience with it?
Question 2) is left over from the previous thread.
I am ashamed to stay I did not figure out the way to go back for the 3 similar pieces
from the formula given for the 2 pieces. So I am still using the table.
The rule given for the 2 similar pieces is
which works by the way. The enumeration I got from the paper tries to count from
the bottom of the pascal triangle which makes it dependent on the chosen N (64, 63 48 47 etc)
Question 3)
Is it possible to generate 6 man bitbases on 32 bit pcs.
There are 2 ^ 31 = 2147483648 possible indices. Maximum table size is 462 * 62 * 61 * 60 * 59 = 6185385360 = S.
So it is not possible to generate dtm tables if we use one byte per position. But it will turn out
to be just safe if we store 4 or 5 positions per byte (which I intend to use during generation as well) like in the bitbases.
2 ^ 31 - S/4 = 601137308
2 ^ 31 - S/5 = 910406576
The only problem I see is generation methods that keep track of *number of visits* need one byte so
I 've to use the forward retrograde method I guess.
thanks in advance
Daniel Shawul
Question 1) Taking advantage of the extra bit
I currently store 4 positions to one byte mapping in bitbases. Theoretically it is possible to
store 5 positions in one byte. There are 13 unused values (256 - 3^4 = 13)
with the former. So I wanted to check it out and to my dismay the database
produced after compression is larger!! I don't know what the reason is but
I am suspecting the follwong
* pattern produced by the first method is better for compression.
Also usually the square enumerations result in a database which is divisible by 4??
So in short I am thinking there is more entropy introduced in the second case.
I sue LZ + Huffman btw.
The broken positions are replaced in such a way that they continue the previous run for both cases.
- Code: Select all
case ILLEGAL:
# ifdef FIVE_IN_ONE
if(q >= 1) myval |= (COMPT[*(v - 1)] & (3 << (r << 1)));
# else
if(q >= 1) myval |= (*(v - 1) & (3 << (r << 1)));
# endif
break;
q,r-> quotient and remainder. v is the qth byte which has the values for the positions.
Next I tried to use prediction for both. For the first one I used the fourth value
to indicate whether the result is correctly predicted or not.
- Code: Select all
00 - draw
01 - win
10 - loss
11 - predicted
For the second case the 13 remaning values are used to indicate from correct prediction for
all positions ---> to correct prediction for all but one of the positions. That is the maximum
allowed by the 13 remining values. So I guess that the predictor should predict correctly
at least 80% of the time (1 - 1/5 = 0.8). After that the results became much closer but still the first one is better!
So I am deciding to choose the first one, apparently not only for its simplicity!
Also I think that for 6 men and above prediction will be a lot more harder, in that
case I want to use the extra bit to indicate if the WDL is achieved by more than 50 moves.
Many such positions occur even in some 5 men, so if the table has that info engines can use
that information to choose between moves which lead to longer WDLs with in the 50 move rule.
What is your experience with it?
Question 2) is left over from the previous thread.
I am ashamed to stay I did not figure out the way to go back for the 3 similar pieces
from the formula given for the 2 pieces. So I am still using the table.
The rule given for the 2 similar pieces is
- Code: Select all
q1 = Q;
q2 = 1;
while (q1 >= q2) {
q1 -= q2;
q2++;
}
which works by the way. The enumeration I got from the paper tries to count from
the bottom of the pascal triangle which makes it dependent on the chosen N (64, 63 48 47 etc)
Question 3)
Is it possible to generate 6 man bitbases on 32 bit pcs.
There are 2 ^ 31 = 2147483648 possible indices. Maximum table size is 462 * 62 * 61 * 60 * 59 = 6185385360 = S.
So it is not possible to generate dtm tables if we use one byte per position. But it will turn out
to be just safe if we store 4 or 5 positions per byte (which I intend to use during generation as well) like in the bitbases.
2 ^ 31 - S/4 = 601137308
2 ^ 31 - S/5 = 910406576
The only problem I see is generation methods that keep track of *number of visits* need one byte so
I 've to use the forward retrograde method I guess.
thanks in advance
Daniel Shawul