If you run one match from book e.g position.bin. Is the starting book line always same or is it randonly selected?
If is always the same is there a way to force cutechess-cli by some seed value to give different book line?
cutechess-cli
Moderators: hgm, Rebel, chrisw
-
- Posts: 750
- Joined: Mon Mar 27, 2006 7:45 pm
- Location: Finland
Re: cutechess-cli
Book moves (from Polyglot books) are always selected randomly, the highest-weighted move having the highest probability of getting picked. The random number generator is seeded at startup with the current time.
-
- Posts: 1243
- Joined: Sat Dec 13, 2008 7:00 pm
Re: cutechess-cli
By the way, there is a serious "bug" in the Qt random number generator when you start it with small seeds: the random numbers that come out are predictably always at the very low end of the range. This is due to an improper initialization of the linear congruential generator with a very small multiplier.
If you want to have reproducible openings, this will hit you because the moves played will not reflect the book statistics at all.
If you do not give the seed yourself, this doesn't affect you.
If you want to have reproducible openings, this will hit you because the moves played will not reflect the book statistics at all.
If you do not give the seed yourself, this doesn't affect you.
-
- Posts: 198
- Joined: Thu Mar 09, 2006 2:44 am
- Location: Helsinki, Finland
Re: cutechess-cli
How do give the seed in cutechess-cli?
What is the seed range?
What is the seed range?
-
- Posts: 750
- Joined: Mon Mar 27, 2006 7:45 pm
- Location: Finland
Re: cutechess-cli
You can't give the seed by yourself unless you modify the source code. The random number generator is seeded with QTime::currentTime(), and the range of the seed is 0 - 86400.jarkkop wrote:How do give the seed in cutechess-cli?
What is the seed range?
-
- Posts: 198
- Joined: Thu Mar 09, 2006 2:44 am
- Location: Helsinki, Finland
Re: cutechess-cli
Could you add that as an optional parameter in next release?
-
- Posts: 750
- Joined: Mon Mar 27, 2006 7:45 pm
- Location: Finland
Re: cutechess-cli
Interesting. I'll run some tests to see if there's a problem. We only use Qt's random numbers for picking book moves.Gian-Carlo Pascutto wrote:By the way, there is a serious "bug" in the Qt random number generator when you start it with small seeds: the random numbers that come out are predictably always at the very low end of the range. This is due to an improper initialization of the linear congruential generator with a very small multiplier.
If you want to have reproducible openings, this will hit you because the moves played will not reflect the book statistics at all.
If you do not give the seed yourself, this doesn't affect you.
-
- Posts: 1243
- Joined: Sat Dec 13, 2008 7:00 pm
Re: cutechess-cli
Ah you're right, I added this seed option to cutechess myself.
I checked the latest Qt sources and there it's just a thread safe wrapper around the system rand(). But I saw this on GNU libc, so this could hit others easily. The moral is: don't use small seeds.
I checked the latest Qt sources and there it's just a thread safe wrapper around the system rand(). But I saw this on GNU libc, so this could hit others easily. The moral is: don't use small seeds.