Showing posts with label exotherm. Show all posts
Showing posts with label exotherm. Show all posts

Tuesday, July 16, 2019

Exotherm - Need a new host

Mercuric lost connection with FICS some time today. To see if it crashed from a Python exception, I looked at the log, but the file was empty. Previously I had suspected that the OS was terminating it to reclaim memory, but then I wondered if some management service was terminating long-running processes since this kind of server is usually just used for web hosting. I did some research and discovered that the hosting company does not like standalone long-running processes, which is fair since their plans are designed for web sites. I shut the bot down for now and will need to find a new home for it - so far PythonAnywhere looks promising.

Monday, July 15, 2019

Exotherm - Can't investigate disconnection when it doesn't disconnect

Mercuric usually disconnects from FICS after about a day, but it's somehow still up after I added logging yesterday. Looks like I'll have to wait a little longer before I can determine whether the random disconnects are due to crashes.

Sunday, July 14, 2019

Exotherm - Investigating disconnection

For quite a while, I've been planning to look more into why Exotherm (deployed as "mercuric") disconnects from the FICS after a few hours. Today I finally did something about it: in case the disconnection is due to a crash, I added a bit of code to log any errors to a file before exiting. The bot will probably have fallen over by morning - then I can check the log to see if a bug is causing it to crash.

Saturday, June 29, 2019

Exotherm - New best rating achieved

Mercuric, the current FICS deployment of Exotherm, reached a new best rating of 1683 yesterday. It lost a few games after that peak, including one by disconnection, and is now at 1665. Once I find a way to fix the disconnections in the middle of games its rating should increase more.

Sunday, June 9, 2019

Exotherm - Mercuric's rating rising

Today Mercuric once again improved its highest-achieved rating. It peaked at 1673 this afternoon, but is now at 1660. I suspect its disconnections may be from using too much memory and getting terminated, so I just tried launching it with the PYPY_GC_MAX environment variable set at 0.7 GB in order to keep away from my virtual server's capacity of 1 GB. I'll see if it's still up in the morning.

Thursday, June 6, 2019

Exotherm - Established rating

Mercuric has played enough games that the FICS no longer considers its rating provisional/estimated. It's currently at 1640, moderately higher than my atomic rating! That figure is probably lower than it should be because the PyPy process has an unfortunate tendency to stop in the middle of a game (probably due to running out of memory), so it forfeits by disconnection.

Saturday, June 1, 2019

Exotherm - Mercuric getting some games

I haven't yet set up a watchdog for the mercuric Python process on my server, so I've just been periodically checking whether it's online and restarting it if it disconnected. Despite the poor uptime, a few people have seen its seeks and played it. Its rating is currently 1568, higher than I expected!

Thursday, May 30, 2019

Exotherm - Mercuric

This morning I got emails saying that a FICS computer account had been created for me. It's named "mercuric", my second choice because "exotherm" wasn't available. (It appears available to me, and I've logged in as guest with it even today, but maybe there's something else going on.) I added the ability to post seeks and set appropriate variables, then uploaded it to my server. It can successfully log in and play games, though it eventually loses connection - I'll need to set up some way to automatically restart it when needed.

Wednesday, May 29, 2019

Exotherm - Evaluator tweaks

I recently adjusted Exotherm's position evaluator a little more. To help it avoid losing in preventable ways in the endgame, I made it value check by rook or queen, which tend to lead to explosions. To encourage it to develop more pieces in the opening, I made it slightly value the possibility of targeting more open squares. I also adjusted the pawn balance evaluator to be less likely to needlessly sacrifice a rook for a pawn.

There's still no updates on FICS's provisioning of a computer account for Exotherm.

Tuesday, May 28, 2019

Exotherm - Memory conservation

The virtual server that I'll hopefully be able to run Exotherm on has only 1 GB of RAM. I've noticed that Exotherm uses a sizable fraction of that, so if I want my server to be able to continue doing more important things, I'll need to be careful about memory usage. I noticed that the "think" module keeps board objects for all positions in the tree even after they've been evaluated, stopping the GC from collecting them. So I adjusted it to set them to None when no longer needed, allowing the GC to make progress even in the middle of a think if necessary.

Monday, May 27, 2019

Exotherm - Preparing for deployment

My previous attempt at making Exotherm note positions that led to loss worked poorly because the information was rediscovered a half move too late. Today I added similar logic to the part of the bot that relays the decided move to the server. If the evaluator found that the bot is doomed, the outer code records that the previous move the bot made is bad. This measure has no depth limit because it will only add at most one entry per game, so I'm not too worried about storage space.

I also made the bot willing to accept draws in some circumstances. It now keeps track of how many moves have occurred since an explosion or pawn move. When its opponent makes a draw offer, it will accept if no progress has been made for several moves and there is little material still existing.

These are the last changes I wanted to make to Exotherm, so after testing them I sent in my application for a computer account. They've approved the deployment of my engine - now I'm waiting for the username to be approved and the account provisioned.

Sunday, May 26, 2019

Exotherm - Hardcoded responses

After some testing today I determined that Exotherm's new ability to record the moves that led to unexpected certain doom is not working as well as I hoped. It seems like the doom is detected a half-move too late in the very common 1. Nf3 trap. It looks like I would need something more sophisticated for Exotherm to make any progress in the general case. As a temporary measure, I added a configuration section for "hardcoded" responses to recognized positions. Currently I'm only manually configuring 1. ...f6 as the response to the knight threat, but once Exotherm is deployed I would monitor for other repeatable traps.

Friday, May 24, 2019

The Exotherm draw problem

I'm hoping to deploy Exotherm to the FICS relatively soon. There is a problem I'd like to address first, though. It plays poorly in the endgame and usually thinks it's doing much better than it is. It walks various pieces all around the board without making any progress. I would like to have it accept draws if it detects no progress has been made after some time. Playing it would be much more enjoyable if one didn't have to go all the way to draw by repetition or 50 moves when the bot can't figure out what to do.

Thursday, May 23, 2019

Exotherm - Learning

Previously Exotherm tended to fall for opening traps because a move looked good to it but actually led to certain doom deeper in the tree. Before releasing it, I wanted to make it avoid at least the most common mistakes. Today I added some code to the evaluator that uses and maintains a list of positions known to be won/lost. These notes are limited to a certain depth from the start of the game to avoid clogging up the list with deep positions that will never be seen again. The main bot code saves the list as part of the configuration file.

Monday, February 18, 2019

Exotherm - Quiet

I've been leaving Exotherm running (unregistered) on my computer recently. I noticed that I get an audible ding when a move occurs in one of its games. I suspect the FICS is including bell characters in move messages, which Windows plays when Exotherm prints the line to the terminal. I tweaked the script to strip bell characters out of received messages before printing them, so Exotherm is quiet now.

Saturday, February 9, 2019

Exotherm - Automatic rematch

To make sure changes are actually improving Exotherm's strength, I sometimes have a modified version of the engine play against an older version. I connect both to the FICS as guests, have one challenge the other, and watch to see which version wins more often. To make this a little smoother, I recently added an INI configuration option to have the bot automatically issue a rematch offer after the game ends. That way, the two versions will keep playing each other over and over without my needing to poke them again each time.

Saturday, February 2, 2019

Exotherm - Evaluation tweaks

Today I tried to improve Exotherm's strength by adjusting the evaluation function. First I made pawns increase in value as the amount of material on the board decreases; this way Exotherm should be more inclined to sacrifice a minor piece to help promote. (My first attempt at the math made the value boost way too big in some cases, ironically causing the bot to avoid promotion because the resulting queen was valued less than the pawn.) This turned out to be a smaller strength improvement than I expected, but maybe there's still tweaking to do.

I also changed the threat part of the evaluation function to highly value queens next to the opposing king because that arrangement nearly always leads to checkmate. Ideally that case would be handled by the normal tree search, but sometimes the checkmate is just over the edge of what the bot can see in time, so this pushes the bot towards the mate even if it doesn't yet know for sure that the game is over.

Sunday, January 27, 2019

Exotherm - Connection maintenance is working

When I hibernated my computer last night, I had Exotherm running and connected. When I started back up this morning, I found that it quickly reconnected to the server without my intervention. It was also able last night to remain online for a long time without getting confused about its connection state. So it looks like the connection keep-alive code is working.

Saturday, January 26, 2019

Exotherm - Maintaining connection

I previously found that Exotherm tended to lose its connection to the FICS after a while of idling. That wasn't even due to the automatic one-hour idle log-out; the bot and the FICS just disagreed about whether it was online. Today I rearranged its FICS interface some more so that it will try to reconnect if it finds that the connection was lost. Also, after 5 minutes of no input or output, it will send a chat to itself through the server just to keep the connection alive. These changes should make it suitable for deployment as a long-running process on my server.

Sunday, January 20, 2019

Exotherm - Running on a server

When I'm ready to deploy Exotherm as an official computer on the FICS, I'll need a place to run it  continuously. I already had some Namecheap shared hosting, but when I tried to run my script there, it failed to connect because port 5000 was being blocked. Today I got in touch with support and asked for port 5000 to be opened. To my pleasant surprise, they did so right away.I successfully ran Exotherm from there for a bit, so it looks like this will work.