Cutechess-cli: A command line tool for engine-engine matches

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

Moderators: hgm, Rebel, chrisw

Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by Gian-Carlo Pascutto »

ilari wrote: Looks like the meta-object compiler wasn't used to create the moc files. Did you run qmake first in the root directory of Cute Chess?
I did. Deleting everything and staring with a clean checkout fixed it, though. Looks like a make or dependency problem.

Is it possible to get make install support? Or failing that, static linking to libchess would make this a lot easier to use...
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by ilari »

Gian-Carlo Pascutto wrote:
ilari wrote: Looks like the meta-object compiler wasn't used to create the moc files. Did you run qmake first in the root directory of Cute Chess?
I did. Deleting everything and staring with a clean checkout fixed it, though. Looks like a make or dependency problem.

Is it possible to get make install support? Or failing that, static linking to libchess would make this a lot easier to use...
Of course, but that's not a high priority for us because Cute Chess (unlike its command line version) is still so early in development.

BTW, I assume you already figured out that you need to run "export LD_LIBRARY_PATH=/home/pascuttg/git/cute-cli/projects/lib" to run cutechess or cutechess-cli? You can also put that in a startup script (see cutechess-cli.sh in my binary packages for Linux and OSX).
Last edited by ilari on Wed Apr 08, 2009 12:47 pm, edited 1 time in total.
Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by Gian-Carlo Pascutto »

ilari wrote: BTW, I assume you already figured out that you need to run "export LD_LIBRARY_PATH=/home/pascuttg/git/cute-cli/projects/lib" to run cutechess or cutechess-cli?
Yes, which is why I asked about having libchess linked statically :)

In this case, no scripts or anything are needed.
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by ilari »

Gian-Carlo Pascutto wrote:
ilari wrote: BTW, I assume you already figured out that you need to run "export LD_LIBRARY_PATH=/home/pascuttg/git/cute-cli/projects/lib" to run cutechess or cutechess-cli?
Yes, which is why I asked about having libchess linked statically :)

In this case, no scripts or anything are needed.
It's very simple to link to libchess statically if you want to: just run "qmake -config static" instead of "qmake", that's all you need to change. And remeber to run "make distclean" to clean things up before such big changes. Getting a new checkout of our repository should never be needed.
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by ilari »

Edsel Apostol wrote:Thanks a lot for this. By the way, I've noticed that the milliseconds increment doesn't reflect in the PGN file.
My bad. I'll fix that for the next version.
Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by Gian-Carlo Pascutto »

ilari wrote: It's very simple to link to libchess statically if you want to: just run "qmake -config static" instead of "qmake", that's all you need to change.
Seems to work, thanks!
Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by Gian-Carlo Pascutto »

Is it possible that the PolyGlot book selection is a bit weird?

I have a book from GM games and saw some 1. b4 openings :P Most games are also more quickly out of book than I would expect.

I also see a lot of:

1. e4 {book} e5 {book} 2. Nf3 {book} Nc6 {book} 3. Bb5 {book} a6 {book}
4. Ba4 {book} Nf6 {book} 5. Bxc6 {-0.26/10 0s} dxc6 {+0.11/10 0s}

Which is weird because this is mainline Spanish! How can it not be in book? I get this with the books on Leo's Winboard site and with mine.
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by ilari »

Gian-Carlo Pascutto wrote:Is it possible that the PolyGlot book selection is a bit weird?

I have a book from GM games and saw some 1. b4 openings :P Most games are also more quickly out of book than I would expect.

I also see a lot of:

1. e4 {book} e5 {book} 2. Nf3 {book} Nc6 {book} 3. Bb5 {book} a6 {book}
4. Ba4 {book} Nf6 {book} 5. Bxc6 {-0.26/10 0s} dxc6 {+0.11/10 0s}

Which is weird because this is mainline Spanish! How can it not be in book? I get this with the books on Leo's Winboard site and with mine.
I can confirm this. It was the castling encoding that was the problem (the king "captures" the rook). I just pushed a commit to our repo that fixes this. No binaries yet. But if you use Git you can just do "git pull" to update.

I don't know if I can help with the b4 openings. If your book has that move, and it's not a big book, then that move will be played occasionally. Here's the relevant code:

Code: Select all

BookMove OpeningBook::move(quint64 key) const
{
	BookMove move;
	
	// There can be multiple entries/moves with the same key.
	// We need to find them all to choose the best one
	QList<Entry> entries = m_map.values&#40;key&#41;;
	if &#40;entries.size&#40;) == 0&#41;
		return move;
	
	// Calculate the total weight of all available moves
	int totalWeight = 0;
	foreach &#40;const Entry& entry, entries&#41;
		totalWeight += entry.weight;
	if &#40;totalWeight <= 0&#41;
		return move;
	
	// Pick a move randomly, with the highest-weighted move having
	// the highest probability of getting being picked.
	int pick = qrand&#40;) % totalWeight;
	int currentWeight = 0;
	foreach &#40;const Entry& entry, entries&#41;
	&#123;
		currentWeight += entry.weight;
		if &#40;currentWeight > pick&#41;
			return entry.move;
	&#125;
	
	return move;
&#125;
So the moves with the biggest weights have the biggest chances of being played, but there's still a small chance that an unpopular move is played too.
Gian-Carlo Pascutto
Posts: 1243
Joined: Sat Dec 13, 2008 7:00 pm

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by Gian-Carlo Pascutto »

I'll pull your fix and have it dump the weights. Maybe it reveals something.
krazyken

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by krazyken »

Gian-Carlo Pascutto wrote:I'll pull your fix and have it dump the weights. Maybe it reveals something.
Scid has the ability to browse polyglot books and manually change weights.