I have noticed that Hakkapeliitta 3.0, when playing black, if white starts with e4, seems to always play 1. e4 d5 2. exd5 c6, which is a bit of an unusual gambit.
Since Hakkapeliitta is a single-thread engine, and it always seems to play the same way, at least up to that point, this got me thinking:
If two engines are put to play each other several times in single-thread mode, with identical time controls, will they always play the same game? If not, where does the variation in play come from?
Playing variation in single-thread mode
Moderator: Ras
-
Guenther
- Posts: 4718
- Joined: Wed Oct 01, 2008 6:33 am
- Location: Regensburg, Germany
- Full name: Guenther Simon
Re: Playing variation in single-thread mode
Warp wrote:I have noticed that Hakkapeliitta 3.0, when playing black, if white starts with e4, seems to always play 1. e4 d5 2. exd5 c6, which is a bit of an unusual gambit.
Since Hakkapeliitta is a single-thread engine, and it always seems to play the same way, at least up to that point, this got me thinking:
If two engines are put to play each other several times in single-thread mode, with identical time controls, will they always play the same game? If not, where does the variation in play come from?
Code: Select all
1. not all programs are deterministic
a) some use a kind of randomizing for similar evals
b) other kinds of randomizing or other techniques
2. minimal time differences (clock frequency has a lower limit) add to:
(assuming the cpu will not be bothered with other tasks or erratic background tasks etc. and practically remains in the same 'state')
a) different hash entries - which accumulates with each move => sooner or later different moves
b) different moves(the lower the tc and the faster a program has to move the higher the chance you get a different move sometimes - even more true for slow
cpus when depth is smaller)
BTW how long will Hakkapeliitta 3.0 hold on 2... c6? I guess it will change
to another move later?
Guenther
-
bob
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Playing variation in single-thread mode
Not at all. In fact, if you play 100 games you will find it very unlikely to get the same two games. This is caused by time quantization since time is updated in chunks, and processor scheduling can change things.Warp wrote:I have noticed that Hakkapeliitta 3.0, when playing black, if white starts with e4, seems to always play 1. e4 d5 2. exd5 c6, which is a bit of an unusual gambit.
Since Hakkapeliitta is a single-thread engine, and it always seems to play the same way, at least up to that point, this got me thinking:
If two engines are put to play each other several times in single-thread mode, with identical time controls, will they always play the same game? If not, where does the variation in play come from?
For example, suppose you have a target time of 100ms, you sample the current time and get 1000000 as the current time. If you sample the time just before the time ticks over to 1000100, you will not have used 100ms yet so you keep going. If you sample the time just after it ticks over, you stop. The two searches were not the same, one was a full ms (or more) longer. This will affect move choice and it will compound as the game goes on.