cutechess-cli

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
jarkkop
Posts: 197
Joined: Thu Mar 09, 2006 1:44 am
Location: Helsinki, Finland

cutechess-cli

Post by jarkkop » Wed Sep 01, 2010 9:03 am

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?

User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 5:45 pm
Location: Finland
Contact:

Re: cutechess-cli

Post by ilari » Wed Sep 01, 2010 3:41 pm

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.

Gian-Carlo Pascutto
Posts: 1166
Joined: Sat Dec 13, 2008 6:00 pm
Contact:

Re: cutechess-cli

Post by Gian-Carlo Pascutto » Thu Sep 02, 2010 8:21 am

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.

jarkkop
Posts: 197
Joined: Thu Mar 09, 2006 1:44 am
Location: Helsinki, Finland

Re: cutechess-cli

Post by jarkkop » Thu Sep 02, 2010 1:35 pm

How do give the seed in cutechess-cli?

What is the seed range?

User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 5:45 pm
Location: Finland
Contact:

Re: cutechess-cli

Post by ilari » Thu Sep 02, 2010 2:25 pm

jarkkop wrote:How do give the seed in cutechess-cli?

What is the seed range?
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
Posts: 197
Joined: Thu Mar 09, 2006 1:44 am
Location: Helsinki, Finland

Re: cutechess-cli

Post by jarkkop » Thu Sep 02, 2010 2:38 pm

Could you add that as an optional parameter in next release?

User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 5:45 pm
Location: Finland
Contact:

Re: cutechess-cli

Post by ilari » Thu Sep 02, 2010 2:39 pm

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.
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
Posts: 1166
Joined: Sat Dec 13, 2008 6:00 pm
Contact:

Re: cutechess-cli

Post by Gian-Carlo Pascutto » Sat Sep 04, 2010 1:59 pm

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.

Post Reply