|
|
| Computer chess |
|
Kirr
Member #5,060
September 2004
|
Solving mate problems is counter-productive for improving engine strength, because mate solving depends on pure tactics and discourages any positional knowledge. Although it's OK to solve mates just for fun. Here is one much more interesting test suite: Strategic Test Suite. Evert said: Oh yes. The engine itself is just a few interface functions that manipulate a "game" or "board" object (one is everything to do with the current game, one is about the current position only). The interface (any interface) is deliberately decoupled from that.
Excellent! Naturally I am only interested in a UCI version. Evert said: Hmm... ok, I'll bear that in mind. My code still doesn't have an opening book (although it doesn't bodge things up as badly as it used to anymore) but since it's a UCI engine, I've taken the cheap way out and let the interface handle the opening for now (since I'm playing it against xboard engines under xboard, that means I'm running it through polyglot). With or without opening book code is both fine. Most chess interfaces provide book handling, as well as polyglot of course. If you'll decide to implement opening book, please provide a way to disable it, because many tournaments accept only engines that can play without own opening book. Evert said: Thanks! I'll have a look. My understanding of bitbases is that they only offer information on whether a position is "won", "lost" or "draw". While I'm sure that's useful information, I need to work out how to implement that in the alpha-beta framework of a chess engine, where I'd typically want to know more than simply "won"; for instance, won in how many moves. Exactly. Yes, bitbases only have "win/loss/draw" information, but it's often enough. On the upside, bitbases are small and fast, so you can probe them long before the exchange, to know which endgame to convert to. Although winning some won endings (like some kqpkq positions) with just bitbases may be tough or impossible. -- |
|
ReyBrujo
Moderator
January 2001
|
Evert said: In practice it doesn't really matter of course if you find a mate-in-N or a mate-in-N+a-bit, as long as you actually deliver the mate!
As long as your opponent doesn't have a mate-in-N-a-bit Once I arrive home I will post the most beautiful game I have ever read about, to demonstrate machines can't yet reach a human's inventive -- |
|
Evert
Member #794
November 2000
|
Kirr said: Solving mate problems is counter-productive for improving engine strength, because mate solving depends on pure tactics and discourages any positional knowledge. Although it's OK to solve mates just for fun.
Yes, and it should play them out properly after finding them. It's also useful to check if the engine will correctly detect deep combinations that may show up outside of the principle variation that it builds up. I haven't tried to write an efficient mate-solver though, mainly for the reason you mentioned: it's a waste of time in terms of actual playing strength. Quote: If you'll decide to implement opening book, please provide a way to disable it, because many tournaments accept only engines that can play without own opening book.
I think the UCI specification demands that you do that. ReyBrujo said: As long as your opponent doesn't have a mate-in-N-a-bit
In that case the position will not be scored as mate-in-N+a-bit in your favour. Quote: Once I arrive home I will post the most beautiful game I have ever read about, to demonstrate machines can't yet reach a human's inventive Oh, most computers play a horrible kind of chess, and perform very poorly in closed strategic positions. They've become a lot better and maybe the top engines these days can't be defeated by "anti-computer" tactics so easily anymore, but all of the weaker ones almost certainly can be. EDIT: Latest source attached. EDIT2: Oh, before I forget: to build the Allegro 5-based GUI, you'll need the latest (SVN) version of Allegro... |
|
Kirr
Member #5,060
September 2004
|
It compiled fine here under Windows, and I started some test matches with it. I only compiled UCI version. Some comments so far: More after some games are finished. -- |
|
Evert
Member #794
November 2000
|
Kirr said: It compiled fine here under Windows, Amazing! Quote: and I started some test matches with it. Cool. It'll be interesting to know how things run. Quote: I only compiled UCI version. Makes sense. Quote: 1. I had to add qsort.o into makefile.
Right. At the moment, it's only added on Linux. I should probably add it for MinGW as well, but better would be to detect when it's needed and when it isn't. Quote: 2. The engine does not print anything when it is thinking. That's odd. It should, and does for me when I run it under a UCI interface here (but it doesn't when I run it through polyglot in XBoard). Quote: When it moves, it sends no evaluation or ponder move. Right, as I said, the UCI implementation is somewhat incomplete. Not sending a ponder move is correct: at the moment, the engine cannot ponder. This is actually relatively easy to add using UCI (just make the next move from the principle variation and enter an infinite search), but I haven't got round to doing this. Quote: 3. An engine sais it's named "Jazz (i386)". It's better to specify its version there too. Releasing engine without version will result in a mess when people will try to run matches with it and report results.
It'll have a proper version when it's properly released. |
|
Kirr
Member #5,060
September 2004
|
I compiled it using cygwin so I did not expect too much trouble. Although cygwin is 32-bit only. Does Jazz benefit from 64-bit? Well the good news is that it works and did not crash or hang yet. The bad news: it's losing most of the games, probably because of broken time management. I use TC of 4 seconds for 40 moves, repeated. What Jazz does looks like this: at first all looks normal, then it starts thinking longer and longer on each move. Its time usage peaks at move 20, then the time is almost out, so it spends about a second on each move. On move 40 it receives another 4 minutes, so it starts thinking longer again. Then the time usage again peaks on move 60, and instant play after that. It is playing with "Gk 0.90 64-bit JA" and "WJChess 1.64". Evert said: Right. At the moment, it's only added on Linux. I should probably add it for MinGW as well, but better would be to detect when it's needed and when it isn't.
I would just add it for all cases. Evert said: Kirr said: 2. The engine does not print anything when it is thinking. That's odd. It should, and does for me when I run it under a UCI interface here (but it doesn't when I run it through polyglot in XBoard). Not sure what's wrong there, I may look into it in more detail if I have time. Evert said: Kirr said: When it moves, it sends no evaluation or ponder move. Right, as I said, the UCI implementation is somewhat incomplete. Not sending a ponder move is correct: at the moment, the engine cannot ponder. This is actually relatively easy to add using UCI (just make the next move from the principle variation and enter an infinite search), but I haven't got round to doing this. Usually UCI engines send a ponder move even in ponder off mode, and even when they can't ponder at all. This way an engine tells which move it expects from the opponent, which may be useful for things other than pondering. I don't mean you have to do it, but it's a good style. Anyway, it's just next move from the PV as you say. Evert said: It'll have a proper version when it's properly released.
Yeah, anything is good as long as it's different from one version to another. -- |
|
Evert
Member #794
November 2000
|
Kirr said: Although cygwin is 32-bit only. Does Jazz benefit from 64-bit?
Considerably. The 64 bit version is about twice as fast as the 32 bit version on my test machine. Note that I've done all of my development in 64 bit and haven't (yet) made any effort to speed up 32 bit. Quote: Well the good news is that it works and did not crash or hang yet. Good, it shouldn't. That's not saying it never will, of course, but I hope I've been careful about fixing things like that. Quote: The bad news: it's losing most of the games, probably because of broken time management. I use TC of 4 seconds for 40 moves, repeated. What Jazz does looks like this: at first all looks normal, then it starts thinking longer and longer on each move. Its time usage peaks at move 20, then the time is almost out, so it spends about a second on each move. On move 40 it receives another 4 minutes, so it starts thinking longer again. Then the time usage again peaks on move 60, and instant play after that.
That does sound similar to what I'm seeing. What it should do is divide the remaining time by the number of moves until the next time control and add half the increment (if there is one) and use that amount of time for each move. It's not particularly clever, but it should work nevertheless. I don't suppose you keep records of the individual games (PGN)? I'd be interested in checking some of them to work out where the problem lies. Major shortcomings I've noticed are in its idea of king safety (it'll castle and keep its pawn shield in tact after that, but it doesn't take much to have it wreck either before that, so it'll often either castle into a wide-open king side, or move the king on its own) and playing endgames. In particular rook endings, which is probably due to the very poorly tuned evaluation in the end game. And possibly the lack of bitbases for those cases as well. |
|
Kirr
Member #5,060
September 2004
|
OK, then I guess I or someone will have to try and build a 64-bit Windows binary when it's ready for prime time. Of course I keep all the games. I just checked that log-file and it only contains what engine received, but not what engine printed, so it does not help to understand why no engine output is shown when it's thinking. -- |
|
Evert
Member #794
November 2000
|
Kirr said: OK, then I guess I or someone will have to try and build a 64-bit Windows binary when it's ready for prime time. Yup. The new 64-bit GCC released for Windows the other day[1] looks interesting for that. Quote: (Most of tournaments are run under Windows for historical reasons). Interesting. I wonder what the main reason for that is, although I suppose most commercial engines being only available for Windows and most hobbyist programmers also (historically at least) using Windows has something to do with it. Crafty and GNUchess being obvious examples of engines that were born on different platforms. Quote: Of course I keep all the games. Ok, great! Quote: By the way, do you also need that log-file? Probably not; unless I know what I'm looking for exactly it's probably too large and unwieldy to work out which line in the file corresponds to which position in which game. Quote: I just checked that log-file and it only contains what engine received, but not what engine printed, so it does not help to understand why no engine output is shown when it's thinking. That's actually just a matter of un-commenting one line in the source and commenting another, but what I'd do (probably will do, when I get round to it) is just start ucijazz in a terminal and send it position and go commands from the log. That's also how I plan to debug the time management. EDIT Quote: position startpos moves c2c4 g8f6 d2d4 b8c6 g1f3 d7d5 f3e5 c6e5 d4e5 f6g4 d1d5 d8d5 c4d5 g4e5 c1f4 f7f6 b1a3 c7c6 f4e5 f6e5 d5c6 b7c6 a3c4 e5e4 e2e3 c8e6 c4e5 e6d5 a1c1 a8b8 b2b3 b8b6 f1c4 b6b8 c4d5 c6d5 e1g1 b8a8 (The last two lines of the logfile on my machine) I get Quote:
info depth 1 score cp 137 nodes 150 time 92
which seems right to me. References
|
|
Kirr
Member #5,060
September 2004
|
OK, here are some games (attached): Jazz (i386) - WJChess 1.64: 4.5 - 27.5 Not as bad as it looked from the beginning. Still it probably can do much better with fixed time allocation. Evert said: Interesting. I wonder what the main reason for that is, although I suppose most commercial engines being only available for Windows and most hobbyist programmers also (historically at least) using Windows has something to do with it. Crafty and GNUchess being obvious examples of engines that were born on different platforms. Somewhere in late 90's, thanks to the activity of Chessbase and other vendors of commercial software, Windows became de-facto standard for any serious chess (or computer chess) hobbyist. Then it entered an infinite loop - new authors and companies target Windows because 99% of potential users use Windows. Users keep using Windows because it can run about 100% of chess software. Evert said: However, it doesn't send a principle variation. I thought I made it do that, but maybe it only prints it in its "native" output (which is suppressed when using UCI). There are issues with it anyway, since now and then the principle variation will be truncated by the transposition table. I know how to fix that (if the new PV is shorter than the old one, but the moves that are there are the same, keep the old one - or alternatively and in addition, try to reconstruct the missing part from the transposition table) but I haven't got round to it yet... Sorry, yes, that's what I meant. It does not send the PV, so I can't see what move it preferring currently, when it is still thinking. -- |
|
Evert
Member #794
November 2000
|
Kirr said: OK, here are some games (attached): Jazz (i386) - WJChess 1.64: 4.5 - 27.5
Thanks! Quote: Users keep using Windows because it can run about 100% of chess software.
It's the same everywhere. Quote: Sorry, yes, that's what I meant. It does not send the PV, so I can't see what move it preferring currently, when it is still thinking. Right, I checked the code, and it indeed doesn't send the PV in UCI mode. I'll fix that once I have the code to "keep" the PV (what I described earlier) in place. By the way, I fixed a rather nasty bug late last night: when generating check evasions, Jazz will only generate moves that can eliminate the check (as opposed to generating all moves and discard the ones that don't eliminate check afterwards). It will generate captures (of the checking piece, if there is only one), legal king moves and (finally) moves that interrupt the line of sight of the checking piece. However, there was a bug where it would not generate these if the check was across a file. By ill luck, this didn't show up in any of the test positions I tested the new code on, but I found it yesterday when I used the same lookup tables for something else. |
|
S G
Member #10,564
January 2009
|
Hi Evert, Great to see there's still people with enough enthusiasm to write chess playing programs. I dedicated a huge amount of time to writing an engine back in the 1990's. It's a fun experience - as well as the programming side of things, I got to meet some interesting folk, and to travel around a bit to the world microcomputer chess championships. I haven't developed my program for a few years, though - kinda got burned out on that front. If your engine runs under Winboard, give it a whirl against mine? She's called Francesca. Anyhow, good luck and have fun with your computer chess developments |
|
Alianix
Member #10,518
December 2008
|
It crashed on me Evert, I attached the console output so maybe you can figure out why. Edit: Just happened again in a similar way...
|
|
Kirr
Member #5,060
September 2004
|
Evert said: I should check whether these blunders correlate with move number. The PGN includes thinking times, depth, evaluation and expected opponent's move (when it is different from the one played). BTW this is another downside of Jazz not sending a PV: there are no Jazz' evaluations or expected moves in the PGN. Sometimes they are very useful to see what happened in the game. Evert said: I'll check to what extent this may have damaged match results locally, then attach a new version later on.
Hopefully also with a time management fix. S G said: I haven't developed my program for a few years, though - kinda got burned out on that front. If your engine runs under Winboard, give it a whirl against mine? She's called Francesca. Hi S G! Francesca is doing fine in my tourney[1], but unfortunately she can't use external book (because of missing support for setting a position). So she has to play without any opening book at all which probably handicaps her considerably. References-- |
|
Evert
Member #794
November 2000
|
S G said: Great to see there's still people with enough enthusiasm to write chess playing programs.
There seems to be a fairly active community for it, although I can't really judge how large the influx of new people is. Quote: I dedicated a huge amount of time to writing an engine back in the 1990's. Cool. My first chess program was from 1996 or so. I can't run it now though, because it was written in Turbo Pascal mixed with assembly language (actually, almost everything was written in assembly). It played horrible though. Quote: It's a fun experience - as well as the programming side of things, I got to meet some interesting folk, and to travel around a bit to the world microcomputer chess championships. That would be fun to do - but I'm afraid finding the time for something like that will be hard... Quote: I haven't developed my program for a few years, though - kinda got burned out on that front. If your engine runs under Winboard, give it a whirl against mine? She's called Francesca. I'll give it ago! I decided to implement the UCI protocol (it's a bit simpler), but I can run through XBoard using a translator. Alianix said: It crashed on me Evert, I attached the console output so maybe you can figure out why.
Damn! Sorry about that... Kirr said: Hopefully also with a time management fix.
Heh. I'll do my best. |
|
Alianix
Member #10,518
December 2008
|
You must be tired Evert, for you forgot to read my post completely... Also the flickering is related to the compositor...I ran it from gdb but it froze my machine...rare on Linux but it did happen... i had to press the power button... I think it has to do with allegro and specifically the opensource ati driver...it's buggy. I was able to beat jazz after a couple of games, I think it plays a pretty good game at 5secs. It's weakness is the early middle game i believe.
|
|
Evert
Member #794
November 2000
|
Alianix said: You must be tired Evert, for you forgot to read my post completely... It was late, but I think I read everything: it crashed, you attached the console output, then it crashed again in the same (or a similar) way. In the log you showed, there is a segfault after a 7 ply search... but that knowledge alone isn't enough to debug the problem, I probably need at least the sequence of moves from the initial position if I'm going to try to reproduce it... Quote: Also the flickering is related to the compositor... Hmm. Do you see the same thing with the A5 examples or demo? Quote: I ran it from gdb but it froze my machine...rare on Linux but it did happen... i had to press the power button... Woops! Again, sorry about that... it doesn't do that for me, but that doesn't help you. If you have the core dump, you should also be able to get a backtrace from that (gdb jazz core). Quote: I think it has to do with allegro and specifically the opensource ati driver...it's buggy. Perhaps... still, would be good to sort out. Quote: I was able to beat jazz after a couple of games, I think it plays a pretty good game at 5secs. It's weakness is the early middle game i believe.
|
|
S G
Member #10,564
January 2009
|
Kirr - I checked out your website, what a fantastic effort. Evert - I look forward to some Jazz vs Francesca games. Have fun with your development! Greetz |
|
Alianix
Member #10,518
December 2008
|
I'm not able to save with F6, getting a zero length file.
|
|
Evert
Member #794
November 2000
|
Weird. Under which conditions? I'll see if I can reproduce it here. EDIT: |
|
|
|