Skip to content

Conversation

@mcostalba
Copy link
Contributor

Currently Zobrist::castling[] are not properly zeroed
and rely on the compiler to do this at startup, but this
makes Position::init() to set different values every time
it is called!

This is a bit odd, and although not impacting normal usage,
can yield to subtle misbehavior, very difficult to track
down, in case we happen to call it more than once for some
reason. I found this while developing tuning support and
it took me a while to track it down.

So properly init Zobrist::castling[]

No functional change.

Currently Zobrist::castling[] are not properly zeroed
and rely on the compiler to do this at startup, but this
makes Position::init() to set different values every time
it is called!

This is a bit odd, and although not impacting normal usage,
can yield to subtle misbehaviour, very difficult to track
down, in case we happen to call it more than once for some
reason. I found this while developing tuning support and
it took me a while to track it down.

So properly init Zobrist::castling[]

No functional change.
@zamar
Copy link

zamar commented Apr 10, 2015

approved.

@glinscott
Copy link
Contributor

Looks good!

@mcostalba mcostalba closed this in a66c73d Apr 10, 2015
@mcostalba mcostalba deleted the pos_init branch April 13, 2015 07:06
niklasf pushed a commit to niklasf/Stockfish that referenced this pull request Apr 25, 2017
Additional term for king danger in atomic chess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants