New version: Demolito 2017-08-26

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: New version: Demolito 2017-08-26

Post by Michel »

lucas wrote: You're wrong: longjmp is a goto. Just a goto that crosses function boundaries. You just abruptly restore the previously stored stack pointer, instruction pointer, and all registers. That's just what it does.
So you would regard the return statement also as a goto? In that case I agree with you. But most people would consider "goto" and "return" to be quite different conceptually.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
Modern Times
Posts: 3546
Joined: Thu Jun 07, 2012 11:02 pm

Re: New version: Demolito 2017-08-26

Post by Modern Times »

Damir wrote:How strong is Demolito? What is its elo ? Is it on a pair with Stockfish ? :o
Several hundred Elo behind Stockfish.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: New version: Demolito 2017-08-26

Post by lucasart »

mcostalba wrote:
lucasart wrote: So the only elegant and reliable solution is to use exceptions. That's in C++, at least.
Yes, in C++ the solution is to use exceptions.

I tried that in the past, at YBWC time, and it didn't worked, maybe now with lazy SMP is easier to implement...maybe a sub-project for some interested SF developer interested in trying something different and more structured than the usual search/evaluation tweaks :-)

Of course a good understanding of C++ and SF sources is required, definitely more than the average skill needed to submit a test into fishtest.
The way I do it in Demolito is as follows:
* Timer thread checks time at regular intervals (5ms)
* Timer thread sets a global variable abort when we ran out of time
* All searching threads check the abort flag at every search node
* When a searching threads sees the abort flag it throws an "exception" (well, a C exception, if we can call it that)
* Exception is caught in the thread that threw it, in the iterative deepening loop, amd breaks the loop.

At least, that's for the timer stopping part.

Now the complete logic is a bit more complicated, because Demolito also aborts useless iterations immediately, which causes selectively aborted thread(s) to go back to their ID loop and look for a useful iteration to work on (can be the next one, or may be higher, depends on what everyone else is doing). So it means my abort variable is a bit field, indicating which thread(s) should be aborted.

=> Once you use exceptions in SF, you can try that, and hopefully you'll get an elo gain as I did in Demolito with that.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.