Joerg Oster wrote: ↑Tue May 19, 2020 10:08 pm
I tried fixed depth, tournament tc and Fischer bonus time.
Fixed tournament tc: forgot to add the base time, after movestogo wraps aroung zero. what a dumbass...
Fixed Fischer clock as well. Rule says increment must be added before the move. Most chess UI do it wrong, adding the increment after the move, potentially after having flagged the engine. As a result, engine programmers conservatively assume that the GUI has this bug, and base their time management assumptions on it.
increment: 6.1. An amount of time (from 2 to 60 seconds) added from the start before each move for the player. This can be in either delay or cumulative mode
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Joerg Oster wrote: ↑Tue May 19, 2020 10:08 pm
I tried fixed depth, tournament tc and Fischer bonus time.
Fixed tournament tc: forgot to add the base time, after movestogo wraps aroung zero. what a dumbass...
Fixed Fischer clock as well. Rule says increment must be added before the move. Most chess UI do it wrong, adding the increment after the move, potentially after having flagged the engine. As a result, engine programmers conservatively assume that the GUI has this bug, and base their time management assumptions on it.
increment: 6.1. An amount of time (from 2 to 60 seconds) added from the start before each move for the player. This can be in either delay or cumulative mode
Great!
I also noticed you are sending a "isready" after "ucinewgame" which seems to be mandatory.
Most UIs don't.
That makes it easy e.g. for Linux distros to automatically determine package licences.
CppCheck flags out a lot of portability issues because "Passing NULL after the last typed argument to a variadic function leads to undefined behaviour." That's a problem with all these str_xxx defines.
Ras wrote: ↑Wed May 20, 2020 4:04 pm
CppCheck flags out a lot of portability issues because "Passing NULL after the last typed argument to a variadic function leads to undefined behaviour." That's a problem with all these str_xxx defines.
I want to write, for example, str_delete(&s1, ..., &sn), for arbitrary n >= 1. The "..." argument in C was designed for things like printf(), which have a format string. It's by parsing the format string, that the function discovers how many arguments there are, and of what type. Here there is no format string, we know the argument type (str_t *) but we don't know how many there are. The va_list itself doesn't know its own length. So the only way I found was to add a null pointer at the end.
How would you solve this problem ? (without C++11, just C99)
The C standard seems to suggest doing str_delete(n, &s1, ..., &sn). But it just sucks that the calling code has to supply the n, plus this could easily lead to unobvious errors, as code gets edited (you add/remove strings in the list, and forget to update n).
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
lucasart wrote: ↑Thu May 21, 2020 1:03 amSo the only way I found was to add a null pointer at the end.
I think the portability problem is that NULL is not necessarily defined as pointer in ((void *) 0) style, though it is under POSIX - but not guaranteed as per the C standard (that may be an integer 0 as well). If the arguments are passed on the stack, and the caller pushes an integer (e.g. 32 bit) while the callee expects a pointer (e.g. 64 bit), that might go wrong. With ordinary functions, this isn't an issue because of argument casting, but that requires typed function prototypes - variadic functions are pretty much an edge case.
An easy solution would be to replace NULL with (const char *) NULL in this context.
Just added a sampling feature to generate training data (= position + search result), fast and scalably (concurrency supported). This can be used to to teach a neural network to evaluate chess positions. https://github.com/lucasart/c-chess-cli/#sampling
Hopefully some people will be interested in designing and training their own NN eval, rather than copy/pasting NNUE into their engine.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
SlowChess Blitz Classic 2.1 <- ucinewgame
deadline set: SlowChess Blitz Classic 2.1 must respond by 55389187
SlowChess Blitz Classic 2.1 <- isready
SlowChess Blitz Classic 2.1 -> Error Error Loading Book openingBook/TestBook.scbreadyok
deadline passed: SlowChess Blitz Classic 2.1 responded at 55388281, 906ms before the deadline.
deadline passed: SlowChess Blitz Classic 2.1 responded at 55388381, 806ms before the deadline.
deadline passed: SlowChess Blitz Classic 2.1 responded at 55388481, 706ms before the deadline.
I wonder why "readyok" is stuck to the error message.
But the first problem (I believe) is that c-chess-cli doesn't seem to change current directory. Am I wrong?
Indeed, it doesn't change the current directory. So the path you give "openingBook/TestBook.scb" has to be either absolute, or relative to the current directory. I could make engine engine use their own directory as current directory, which is probably what users expect.
The fact that readyok is stuck to the error msg is not related to c-chess-cli, but rather SlowChessBlitz, which forgot to write a '\n' there.
The "deadline passed" is probably a poor choice of words. It's "passed" as in "pass/fail". Maybe "deadline ok" is better.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
lucasart wrote: ↑Fri Aug 21, 2020 3:03 pm
Indeed, it doesn't change the current directory. So the path you give "openingBook/TestBook.scb" has to be either absolute, or relative to the current directory. I could make engine engine use their own directory as current directory, which is probably what users expect.
Thank you for your answer. To be perfectly clear, I didn't give the path: it's the engine itself who searches automatically its book. I believe that many engines search books or other files like that, so IMHO it would be a good idea to do what you say (make engine use their own directory as current directory).
lucasart wrote: ↑Fri Aug 21, 2020 3:03 pm
The fact that readyok is stuck to the error msg is not related to c-chess-cli, but rather SlowChessBlitz, which forgot to write a '\n' there.
Yes, it was also my impression. I should report the bug to the author of SlowChess. Done.
lucasart wrote: ↑Fri Aug 21, 2020 3:03 pm
The "deadline passed" is probably a poor choice of words. It's "passed" as in "pass/fail". Maybe "deadline ok" is better.