Fast command line UCI match program?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Fast command line UCI match program?

Post by mjlef »

I am looking for a very fast way to run matches on programs. I would like to do very fast games, perhaps a few seconds a game, or limit games by nodes. GUIs liek Arean are great, but very slow resetting between games. Is there a very fast, simple match player that handles this? Maybe something run from the command line and smart enough to use ucinewgame instead of restarting everything between games?

If it did UCI and Wonboard that would be great too.

Thanks.
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Fast command line UCI match program?

Post by hgm »

Wonboard? :shock: I did not know it was passée. :lol: :lol: :lol:

But seriously: after Uri, you are now the second person demanding such a thing. It seems Bob has one, but it is not public domain, and it might be tailored too much for Crafty anyway.

I would be interested to have something like that too, in particular resetting the engines between games rather than starting a new engine process all the time. I would like to run under Windows, but alas, my knowledge of Windows API is next to zero.

My main interest would be to not only play normal (linear) games, but also 'branched' games, comparing two engines A and A' by playing them against B, and each time that A and A' deviate, let both of them finish the match for each of the two suggested moves. And so on, recursively. This sounds complicated, but it is actually just a small addition to the functionality that would be needed anyway for playing normal games. Just include a routine somewhat like this:

Code: Select all

float ScoreDif;

float TreeMatch(Board p, Engine OldVersion, Engine NewVersion, Engine Opponent)
{
    Engine NewVersion2;
    float Score1, Score2;

    while(!GameEnd())
    {
        move1 = GetMove(Opponent);
        MakeMove(move1);                   // update position p
        if(GameEnd()) return GameResult(); // Opponent finishes game
        
        SendMove(move1, OldVersion);
        SendMove(move1, NewVersion);
        move1 = GetMove(OldVersion);       // Move played old version
        move2 = GetMove(NewVersion);       // move played by new version
        Make(move1);
        SendMove(move1, Opponent);
        if(move1 == move2) continue;       // play on while the are they same

        // Old and New versions diverge. Make each of them try both moves.

        // play move of old version, and create a new engine process
        // playing the new version from that position too.
        NewVersion2 = StartNewEngine(p, NewEngine);
        Score1 = TreeMatch(p, OldVersion, NewVersion2, Opponent);
        UnMake(move1);

        // now play move of the new version, and create an engine process
        // playing the old version from that move, plus a new opponent
        // (as the original opponent process finished its game already)
        Make(move2);
        Opponent   = StartNewEngine(p, GauntletEngine);
        OldVersion = StartNewEngine(p, OldEngine);
        Score2 = TreeMatch(p, OldVersion, NewVersion, Opponent);

        // Award the different moves according to their respective results
        ScoreDif += Score1 - Score2;
        return (Score1 + Score2)/2.; // And keep track of average result.
    }
    return GameResult(); // Both tested versions finish with same score
}
(This is not completely optimal, as it does start new processes at branching points. Perhaps it would be smarter to just 'undo' the last ply of the NewVersion, and force it to accept the move given off by the OldVersion, so that the same process would continue to play along the first branch. And then at the end of that game just reset the engines, and feed them the moves from the beginning upto and including the move already given by the NewVersion.)
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Fast command line UCI match program?

Post by hgm »

Has anyone tried winboard for this in blindfold mode? In this mode, (with animateMoving=false, to make sure), there seems to be very little to do, graphically speaking, so I cannot imagine that this would slow down play significantly. And then play a match.
So

Winboard /xanimate /xhighlight /blindfold=true /reuse /reuse2 /mg=100

should play 100 games, only starting up the engines once. I wonder how fast you could go with this.