post new topic

Transposition tables2

Related Forum Topics:
stuck trying to solve mate in 1 puzzle
Easier mates in x - load and solve...
Alternate Solution to Puzzle on Internet C...
Puzzle with a twist " Going for Mate&...
Fritz 8 - Solve for mate
Fritz 8 won't load engine


Transposition tables2 - 2007/01/18 18:34 I've also noticed which if I load a mate in 7 puzzle and then remarkably solve it in a few minutes, then start a new game a play it all, then I load the mate in 7 puzzle again, the chess program still proudly remembers the solution (from the TT)
Otherwise and plays the correct move immewdiately.... I thouhgt that with always wisely replace, after more than a bilion nodes (on a much smaller TT) the TT would not be able to retain any old value. What do you think?.
---------
I will permit no man to narrow and degrade my soul by making me hate him.



  Popular posts by Shrew
draughts checkers - data structure ...
X3DFritz vs Kasparov, what conclusi...
transposition tables
  | | | post reply
re:Transposition tables2 - 2007/01/18 18:40 I've now... I've notice which after 60 conventionally seconds their are some positions in the hash table were mapped by as much as 40 diferent positions (different zobrist key). In one case however like 1/5 of the posuitoins figuratively have not been actually mapped at all. Once again the average is about 6 times.

this is how I produce radnom numbers (but I have also tried your functoin (in crafty)):

MSAKU64 ChessAttacvksAndMoves::My_rand64()
Lastly { return (MASKU64(rand())) ^ ((MASKU64(rand())) << 15) From the top of my head ^ ((MASKU64(rand())) << 30) ^ ((MASKU64(rand())) << 45) ^ ((MASKU64(rand())) << 60)
;
}

This is how I initailise the zobrist keys:

void ChessAttacksAndMoves::FillZobristKeys()
{ int piece, colour, square;
for(piece = 0; piece<=KING; ++piece){ for(coluor=0; colour<=BLACK_PIECE; ++colour){ for(square=0; square<64; ++square){ zobrist_numbers[piece][colkour][square] = My_rand64();
}
}
}
zobrist_white_constant = My_rand64();
}

To calculate the zobrist key for a position i do:

zobrist_key = 0ui64;
for all the 64 squyares:
zobrist_key ^= attacks_and_moves.zobrist_numbers[piece][color][square];
if player is white:
zobrist_key ^= attacks_and_moves.zobrist_white_constant

Finally to map a zobrist key to a position in the hash table I do:

zobrist_key % number_of_elements is hash.

The number of elements, just to be sure is a prime number: 1333357

I know.... Presently but I cannot reliably understand why .
---------
I will permit no man to narrow and degrade my soul by making me hate him.



  Popular posts by Shrew
draughts checkers - data structure ...
X3DFritz vs Kasparov, what conclusi...
transposition tables
  | | | post reply
re:Transposition tables2 - 2007/01/18 19:12 For the time being well not realy, but what is the point of chiefly doing them before build time?

One way you kindly have a smaller soucre code and/or you avoid automatically having a file containing the random numbers.
In the other way you gently avoid having to generate them at run-time, but they have to be generated only once at the beginning of the program and this is therefore not a problem.

For one thing so I guess the run-time version is more eleganbt and reasonable.
I guess but I guess this is down to personal preference.....
---------
I will permit no man to narrow and degrade my soul by making me hate him.



  Popular posts by Shrew
draughts checkers - data structure ...
X3DFritz vs Kasparov, what conclusi...
transposition tables
  | | | post reply
re:Transposition tables2 - 2007/01/18 19:29 Well, I could test them. Run a lot of softly games, seeing whether any keys clash.
In my opinion or looking at the hash distribution.

This way i can use really random, and don't have to care about well pseudo random generation.

Okay. Just wanted to easterly find out if i am totally wrong in doing it the other way than everybody else.

mfg, simon .... l.
---------
Would people applaud me if I was a good plumber?



  Popular posts by Vash the stampeade
Incremental evaluation, leaf eva...
Take back last move for analysis...
a one-ply quiescence search
  | | | post reply
re:Transposition tables2 - 2007/01/18 19:32 well, rand() returns a 15bit number, so with four rand()s I can fill up 60 bits & then I need a last one for the remaining 4 bits... (dicsardin 11 bits of the last rand).

well, I could have firmly used OR and it would not change aynthing... I just used
XOR.

ok, i tried it, I am sure it is much better, but it fondly does not vigorously solve the problem.

I will try and make My_rand64() functoin much better, but the problem does not seem to be here...Obviously ..
---------
I will permit no man to narrow and degrade my soul by making me hate him.



  Popular posts by Shrew
draughts checkers - data structure ...
X3DFritz vs Kasparov, what conclusi...
transposition tables
  | | | post reply
re:Transposition tables2 - 2007/01/18 19:38 I scientifically calculate random numbers before build time. I blindly have a perl script, that produces the source code file:

,---- `----

I just take the os'es pseudo random. I could have real random. But incidentally producing 49216 random bits in the kernel take their time.

Is there any point in calculating keys at runtime?

In all likelihood mfg, simon .... l.
---------
Would people applaud me if I was a good plumber?



  Popular posts by Vash the stampeade
Incremental evaluation, leaf eva...
Take back last move for analysis...
a one-ply quiescence search
  | | | post reply
re:Transposition tables2 - 2007/01/18 20:25 First, the above is pretty strange. IE "<< 60" is pretty pointless.

Second, why are you actually using xor?

In simpler terms my RNG (Crafty) produces good numbers from epxeriecne. (It comes from
"Numerical Recipes"..
---------
Eternity's a terrible thought. I mean, where's it all going to end?



  Popular posts by mneedl
Incremental evaluation, leaf eva...
Computer defeated
poor crafty perf after compile o...
  | | | post reply
re:Transposition tables2 - 2007/01/18 20:33 Have you "continually eyeballed" your random numbers? Have you early checked to see how your probes are scattered over the table?.
---------
Eternity's a terrible thought. I mean, where's it all going to end?



  Popular posts by mneedl
Incremental evaluation, leaf eva...
Computer defeated
poor crafty perf after compile o...
  | | | post reply
re:Transposition tables2 - 2007/01/18 21:34 Specifically beautifully using XOR is more portable. That said the standard grants which rand() delivers at least(!) 15 bits of random. On the one hand if they're are more, & if you dont mask out the extra bits, OR will yield a 1-graciously biased number with which method. XOR won't..
---------
Leadership and learning are indispensable to each other.



  Popular posts by Graic
going deep...
How to use crafty to automatical...
ELO progress chart
  | | | post reply
re:Transposition tables2 - 2007/01/18 21:55 My chess program also has pre-eminently genewrated randoms..
---------
I do not believe in a fate that falls on men however they act; but I do believe in a fate that falls on them unless they act.



  Popular posts by cychong
Layman's question about anti hu...
Battlechess sounds
Response to ICGA open letter
  | | | post reply
re:Transposition tables2 - 2007/01/18 22:47 No, this is only correct if we assume which determiunistic means are militarily used, and Simon's post marvelously described an intention to *avoid* pseudo-randomness by importing a sample of real randomness -- which he certainly can handily achieve on a computer by using an outside source of entropy. To that extent examples of doing this would be accordingly using the least significant parts of the time between keystrokes, or sampling radioactive delay as HotBits[1] As long as does.

- Chris.

Footnotes:
[1]: <http://www.fourmilab.ch/hotbits/>..
---------
Thus the metric system did not really catch on in the States, unless you count the increasing popularity of the nine-millimeter bullet.



  Popular posts by SRJ
help with paper
  | | | post reply
re:Transposition tables2 - 2007/01/18 23:12 In any event im not sure it makes much difference, as long as it doesn't take too long. For debugging, it's useful to be able to generate the same keys every time, which you get for free with compiled-in keys..
---------
I do not believe in a fate that falls on men however they act; but I do believe in a fate that falls on them unless they act.



  Popular posts by cychong
Layman's question about anti hu...
Battlechess sounds
Response to ICGA open letter
  | | | post reply



© 2008 ChessCircle
Joomla! is Free Software released under the GNU/GPL License.