Cuteswiss 1.0

Discussion of computer chess matches and engine tournaments.

Moderator: Ras

User avatar
Brunetti
Posts: 424
Joined: Tue Dec 08, 2009 1:37 pm
Location: Milan, Italy
Full name: Alex Brunetti

Cuteswiss 1.0

Post by Brunetti »

CUTESWISS 1.0 (Windows only)

Cuteswiss automates the process of running a continuous pseudo-swiss tournament between any number of engines, using cutechess-cli tool by Ilari Pihlajisto and Arto Jonsson. During the tournament it's always possible to add or remove engines on-the-fly, by just editing the engines.json reference file read by cutechess.cli.

Basic flow
Cuteswiss reads the engines list: these are the available players. Then it matches the games found in the tournament PGN file with available players, selecting the player with the least games played (randomly choosing in case of tie) and finding an optimal opponent from those that never played it: the one with the least games and, in case of a tie, the one with the closest % score, thus simulating a simple swiss pairing. There's no need to calculate complex pairings involving colors since engine matches (usually) consist of two games with reversed colors. Finally, a batch file suited to cutechess-cli is created.

Running a batch
The example batch file (go.bat) allows to run an automated "endless" tournament. Here is it with a few notes:

Code: Select all

:start
cutiswiss -m test_tourney.pgn // launches the tool (-m = mute)
call playmatch.bat // calls the batch file created with the tool
blat - -body "Best regards, Cutiswiss." -attacht test_tourney.pgn -to your@email.com -subject "Cutiswiss update" -server your.mail.server.com -f you@your.mailserver.com
// blat is a tool to send an e-mail after a mini-match between 2 engines is finished (for very maniac directors - like me :)
@goto start // cycle
That's all!

Automatic gauntlet for new engines
This is a very practical feature. If your tournament is running and x rounds have been played, adding a new engine to the json list automatically produces a gauntlet, since the new engine has to play x games to match the minimum number of games played by all other ones. By default, an engine with 0 games played has given a 50% score, so it will be matched first with a mid-range engine, then approaching its "natural" opponents by simply matching its percentage score, like a dicotomic search. This way, there's no need to know the strenght of the new engine to set up an adeguate opposition: it will be reached automatically.

Parameters
Most cutechess-cli options are controlled by Cuteswiss parameters, like time control, number of games and so on. Type cuteswiss -h for a detailed list.

The zip archive
The archive contains the following files:

cuteswiss.exe = This tool
cuteswiss.dpr = Delphi source code
cuteswiss_license.txt = GNU license

test_tourney.pgn = Example PGN where our tournament will be saved - Note: the file can't be empty; just a newline is OK.

go.bat = Example batch to run an automatic tournament

engines.json = Example engines file for cutechess-cli
opening.pgn = Example PGN with one starting position
blat.* = Utility to send e-mails via batch (warning: not working with SSL, so Gmail can't be used), by Pedro Mendes and Mark Neal
cutechess* & QtCore4.dll = The tool actually playing the games, by Ilari Pihlajisto and Arto Jonsson

Disclaimer
The tool has been tested for a while, but bugs are always hidden in almost all programs; the author is not responsible for anything bad could occur :)

I hope you can find useful this tool. Please report bugs and comments.


Download Cuteswiss from here: http://e4e6.com


Thanx, Alex
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: Cuteswiss 1.0

Post by Adam Hair »

Thanks Alex!
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Cuteswiss 1.0

Post by Ferdy »

The attached cutechess-cli version in the download is 0.5.1, but cuteswiss is using -openings... which is for cutechess-cli version 0.6.0, because of this the batch created by cuteswiss will not run.

How can I set the concurrency to more than 1?

Thanks for sharing.
User avatar
Brunetti
Posts: 424
Joined: Tue Dec 08, 2009 1:37 pm
Location: Milan, Italy
Full name: Alex Brunetti

Re: Cuteswiss 1.0

Post by Brunetti »

Ferdy wrote:The attached cutechess-cli version in the download is 0.5.1, but cuteswiss is using -openings... which is for cutechess-cli version 0.6.0, because of this the batch created by cuteswiss will not run.
It works fine with version 0.5.1-SF (0.6.0 is not stable), which is now included in the updated zip.
0.5.1 was mistakenly used.
Ferdy wrote:How can I set the concurrency to more than 1?
Please wait a few hours: an upgrade is almost ready and it allows to set any other cutechess parameter.

Thank you for testing.


Alex
User avatar
Brunetti
Posts: 424
Joined: Tue Dec 08, 2009 1:37 pm
Location: Milan, Italy
Full name: Alex Brunetti

Re: Cuteswiss 1.0

Post by Brunetti »

Version 1.1 is now available.

Changes:
-w (wait between games) option added;
-x option added, to allow more config to cutechess-cli;
bug in displaying number of discarded games;
"Cutiswiss" somewehere used instead of "Cuteswiss";
minor adjustments in the code;
-r switch to create an HTML rankings table.

An example HTML table is visible here: http://e4e6.com/test.html.
It should be possible to upload it in your website, live updating it, by adding the opportune ftp commands to the "go" batch file.


Alex
User avatar
Brunetti
Posts: 424
Joined: Tue Dec 08, 2009 1:37 pm
Location: Milan, Italy
Full name: Alex Brunetti

Re: Cuteswiss 1.0

Post by Brunetti »

Brunetti wrote:It should be possible to upload it in your website, live updating it, by adding the opportune ftp commands to the "go" batch file.
Just tested: write an ftp command file like this one:

Code: Select all

open ftp.your.site
your_username
your_password
cd wherever_needed
put yourfile.html
disconnect
quit
saving it e.g. as ftp.txt. Then add to the "go.bat" this line:

Code: Select all

ftp -i -s:ftp.txt
after the call to cuteswiss.

In my case, it updates the web table at http://e4e6.com/g6swiss.php after every match.

Alex
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Cuteswiss 1.0

Post by Ferdy »

Brunetti wrote:Version 1.1 is now available.

Changes:
-w (wait between games) option added;
-x option added, to allow more config to cutechess-cli;
bug in displaying number of discarded games;
"Cutiswiss" somewehere used instead of "Cuteswiss";
minor adjustments in the code;
-r switch to create an HTML rankings table.

An example HTML table is visible here: http://e4e6.com/test.html.
It should be possible to upload it in your website, live updating it, by adding the opportune ftp commands to the "go" batch file.


Alex
This works now.

I am looking for a feature where for example I have in my json file,

eng1
eng2
eng3
eng4

The games will be played only between
eng1 vs eng2
eng1 vs eng3
eng1 vs eng4

Then later if I have a new version say eng1.1, I will replace eng1 with eng1.1 then the tool will play

eng1.1 vs eng2
eng1.1 vs eng3
eng1.1 vs eng4

There is no need to play,
eng2 vs eng3
eng2 vs eng4
eng3 vs eng4
User avatar
Brunetti
Posts: 424
Joined: Tue Dec 08, 2009 1:37 pm
Location: Milan, Italy
Full name: Alex Brunetti

Re: Cuteswiss 1.0

Post by Brunetti »

Ferdy wrote:The games will be played only between
eng1 vs eng2
eng1 vs eng3
eng1 vs eng4

Then later if I have a new version say eng1.1, I will replace eng1 with eng1.1 then the tool will play

eng1.1 vs eng2
eng1.1 vs eng3
eng1.1 vs eng4
Well, that's not a swiss tournament but a selective gauntlet; anyway I've added the option (no need to replace the engine, just add it).

Version 1.2 is available.

Changes:
  • - very rough Elo estimate; example:

    Code: Select all

    cuteswiss -e "Fruit 2.1" 2600 -r tourney.html mygames.pgn
    computes ratings adjusted to Fruit's 2600 and writes them into tourney.html
    note: "Fruit 2.1" should be included into the tournament
    note: "-e" switch for "event name" has been changed to "-v";
  • - gauntlet mode; example:

    Code: Select all

    cuteswiss -u "Fruit 2.1" Fru gauntlet.pgn
    Fruit 2.1 will play vs. all other engines except those starting with "Fru";
  • - fixed a bug in finding opponents: sometimes a blank was selected;
  • - minor fixes in the code.
The continuous torunament at http://e4e6.com/g6swiss.php is still running fine on its own; I just add engines to the list from time to time.


Alex
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Cuteswiss 1.0

Post by Ferdy »

Thanks for the update :) .
User avatar
Brunetti
Posts: 424
Joined: Tue Dec 08, 2009 1:37 pm
Location: Milan, Italy
Full name: Alex Brunetti

Re: Cuteswiss 1.0

Post by Brunetti »

Version 1.3 is now ready.

What's new:
  • - opponent is now chosen (among those who played the least number of game) according to Elo difference and not anymore to % score difference;
  • - more compact, more info and better graphics for web table;
  • - switch -f to show FEN position(s) in the web page; more positions are allowed, just separate them with a semicolon;
  • - switch -l to write a log file;
  • - code cleaned and optimized.
The example tournament is still running at http://e4e6.com/g6swiss.php


Alex