How does Monte Carlo analysis work?

Discussion of chess software programming and technical issues.

Moderator: Ras

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

Re: How does Monte Carlo analysis work?

Post by hgm »

bob wrote:I doubt that would work. Suppose you change the search. How would "self-play" be used to play the old against the new? Would be far harder than to just use a simple referee program as I do. Otherwise you introduce new bugs by trying to use two different searches, or two different evaluations in the same program/process...
First, I imagine they are doing this only for tuning eval parameters, or even for evaluating positions with totally identical opponents. And in micro-Max it was not difficult at all to make sure there were two different search routines each using its own hash table and recursively calling itself, the main program calling one for the white moves, and the other for the black.

Your referee program might be simpler, where it not that you admit yourself that it does not work reliably fos sub-second games. I am sure that if we drop the requirement that it should work, infinitely more simple solutions are possible...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: How does Monte Carlo analysis work?

Post by bob »

hgm wrote:
bob wrote:I doubt that would work. Suppose you change the search. How would "self-play" be used to play the old against the new? Would be far harder than to just use a simple referee program as I do. Otherwise you introduce new bugs by trying to use two different searches, or two different evaluations in the same program/process...
First, I imagine they are doing this only for tuning eval parameters, or even for evaluating positions with totally identical opponents. And in micro-Max it was not difficult at all to make sure there were two different search routines each using its own hash table and recursively calling itself, the main program calling one for the white moves, and the other for the black.

Your referee program might be simpler, where it not that you admit yourself that it does not work reliably fos sub-second games. I am sure that if we drop the requirement that it should work, infinitely more simple solutions are possible...
In what I read of Larry's quotes, he said they were doing this to test eval changes, search changes, etc... But even eval changes would be a royal pain in self-play as opposed to running two copies of the program using a simple program that relays moves back and forth.

I am not sure about the "reliably for sub-second games". The referee isn't the problem. The problem is that each engine is trying to measure time that is often inside the resolution of the accuracy of the system clock. That's not a referee issue at all...
User avatar
hgm
Posts: 28395
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: How does Monte Carlo analysis work?

Post by hgm »

Well, usually the referee is used to measure time, and then communication delays would add another uncertainty. If the engines measure time themselves, the problem becomes indeed smaller. (The games might become slow in wall-clock time if the OS scheduler is not good enough, though).

But, like I said, I did this in uMax before it was WB compatible, and it was a lot less work that writing the WB driver. Let alone a complete adapter.

Come to think about it, I might add a new mode to WinBoard (next to Machine White, Machine Black, Two Machines), for Machine Self Play. In this mode WinBoard would send 'go' to the first engine after every move, and accept moves from it for both black and white. One useful application would be if the engie ws not really an engine, but an adapter connecting to a remote server (such as www.gothic-chess.com). It could then be used to observe games going on at that server.