Zobrist free

Discussion of chess software programming and technical issues.

Moderator: Ras

jdart
Posts: 4420
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Zobrist free

Post by jdart »

Empirically, "almost legal" move checking (sanity checks) is sufficient - that is what I do. No legal move checking is not sufficient even with a full 64-bit hashcode.

--Jon
User avatar
Ras
Posts: 2735
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Zobrist free

Post by Ras »

jdart wrote:Empirically, "almost legal" move checking (sanity checks) is sufficient - that is what I do.
Do you have some kind of output in case the sanity check fails? Did you ever see that happen?
User avatar
hgm
Posts: 28456
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Zobrist free

Post by hgm »

jdart wrote:No legal move checking is not sufficient even with a full 64-bit hashcode.
To get a stronger key, you can make a 64-bit signature by XORing the key with the (incremental) evaluation. This makes the low-order bits (from which the index is supposed to be derived) also relevant.
jdart
Posts: 4420
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Zobrist free

Post by jdart »

I have a lot of asserts. So if I run the code in debug mode, it will check for all kinds of conditions (out of range square, no piece on start square for a move, etc.) and stop on any error. And I have run it in debug mode for extensive periods of time.

--Jon
User avatar
Ras
Posts: 2735
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Zobrist free

Post by Ras »

jdart wrote:stop on any error. And I have run it in debug mode for extensive periods of time.
OK, and how many of these errors with qualified hash collision did you get? Or is the question pointless because you are using much longer hashes anyway?
jdart
Posts: 4420
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Zobrist free

Post by jdart »

I don't know what you mean by qualified hash colllision.

I am getting no errors, using a 64-bit hash and the Crafty "lockless hashing" method.

--Jon
User avatar
Ras
Posts: 2735
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Zobrist free

Post by Ras »

jdart wrote:I don't know what you mean by qualified hash colllision.
That it is not only an index collision, but the full 64 bit hash collides.
I am getting no errors, using a 64-bit hash
Then strictly speaking, this suggests that move checking is not necessary.
jdart
Posts: 4420
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Zobrist free

Post by jdart »

Definitely full hash collisions are possible, although rare.

And yes, what I am saying is that full legal move checking is not needed, but sanity checks on retrieved moves are.

--Jon
Dann Corbit
Posts: 12817
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Zobrist free

Post by Dann Corbit »

Ras wrote:
jdart wrote:I don't know what you mean by qualified hash colllision.
That it is not only an index collision, but the full 64 bit hash collides.
I am getting no errors, using a 64-bit hash
Then strictly speaking, this suggests that move checking is not necessary.
What happens if someone is using Arasan to play correspondence chess at 24 hours per move?
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
Ras
Posts: 2735
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Zobrist free

Post by Ras »

Dann Corbit wrote:What happens if someone is using Arasan to play correspondence chess at 24 hours per move?
He might lose in case his opponent is using Stockfish? ;-)

It all depends on what the goal is. Is the performance sacrificed for the checks worth the overall Elo or not? That's subjective. I myself would also opt for the additional checking because a clean loss feels better to me than a crash.