Page 4 of 5

Re: Demolito 20181029 released

Posted: Thu Nov 08, 2018 12:52 pm
by lucasart
Guenther wrote: 1. It runs with 837 kn/s in the 'search 12 1' test given by Lucas, which is around 20 faster than before
837kn/s is very slow. With my i7 running Linux, I get 2550kn/s or so (single threaded).

@tpoppins: did you use "-O3 -flto", and (most importantly) "-DNDEBUG" ?
Guenther wrote: 2. I had no problem to do a test game/match in cutechess-cli
Finally some good news.
Guenther wrote: I see that it sometimes adds 'ponder 0000' to a move, which makes WB2UCI choke and it translates this to a false stalemate claim.
The bug is in WB2UCI, not Demolito. The whole concept of draw claim is foreign to UCI anyway. That said, I'm going to remove the reporting of ponder completely, since Demolito doesn't ponder. So it's just misleading: people see "bestmove ... ponder ..." and think that Demolito is capable of pondering which it is not (indeed it has no UCI option called "Ponder" that's how you tell).

PS: I've installed Wine, and my compiles work fine there. Somehow on the real Windows they don't work. Mystery... Meanwhile, the tpoppins compiles are the best solution.

Re: Demolito 20181029 released

Posted: Thu Nov 08, 2018 1:30 pm
by tpoppins
lucasart wrote: Thu Nov 08, 2018 12:52 pm
Guenther wrote: 1. It runs with 837 kn/s in the 'search 12 1' test given by Lucas, which is around 20 faster than before
837kn/s is very slow. With my i7 running Linux, I get 2550kn/s or so (single threaded).
I had around 860 kn/s on this X5670 when test-compiling with -msse3.
With my final compiles it's 1240 kn/s for the 60-old one and 1350 kn/s for the POPCNT one.
lucasart wrote: Thu Nov 08, 2018 12:52 pm@tpoppins: did you use "-O3 -flto", and (most importantly) "-DNDEBUG" ?
Yes, I used all three, plus "-march=nocona" for the 64-old build and "-march=nehalem" for the POPCNT one instead of the default "-march=native -DPEXT"
lucasart wrote: Thu Nov 08, 2018 12:52 pm
Guenther wrote: 2. I had no problem to do a test game/match in cutechess-cli
Finally some good news.
Appears to run without any problems under Cute Chess GUI latest dev build as well (tested in two 40/2 games).
lucasart wrote: Thu Nov 08, 2018 12:52 pm
Guenther wrote: I see that it sometimes adds 'ponder 0000' to a move, which makes WB2UCI choke and it translates this to a false stalemate claim.
<...> I'm going to remove the reporting of ponder completely, since Demolito doesn't ponder. So it's just misleading: people see "bestmove ... ponder ..." and think that Demolito is capable of pondering which it is not (indeed it has no UCI option called "Ponder" that's how you tell).
Seems like the best solution.
lucasart wrote: Thu Nov 08, 2018 12:52 pmPS: I've installed Wine, and my compiles work fine there. Somehow on the real Windows they don't work. Mystery... Meanwhile, the tpoppins compiles are the best solution.
Cross-compiling could be something of a gamble. Perhaps if you could still boot into Ubuntu you might get a working Windoze PEXT build which could be useful, seeing that just POPCNT adds an 8%-9% boost in speed.

Re: Demolito 20181029 released

Posted: Thu Nov 08, 2018 2:29 pm
by lucasart
tpoppins wrote:Cross-compiling could be something of a gamble. Perhaps if you could still boot into Ubuntu you might get a working Windoze PEXT build which could be useful, seeing that just POPCNT adds an 8%-9% boost in speed.
PEXT only gains 2% speed or so. Not worth the trouble (I'd have to setup a dual bool just for that).

Re: Demolito 20181029 released

Posted: Sat Nov 10, 2018 12:53 am
by lucasart
tpoppins wrote: Thu Nov 08, 2018 2:42 am It's a compiler issue. If I build under MSYS2 with MinGW and GCC 8.2.0 I get no compiler errors, just a couple of warnings, but no bench results at the end and the resulting exec crashes. Removing "-flto" and "-m" flags and lowering "-O" to 2 did not help.

Under Cygwin and GCC 7.3.0 everything is hunky-dory, but you need cygwin1.dll to run the execs. Here are two: one will run on any CPU with SSE3 (P4/Athlon 64 or later), the POPCNT one needs a Nehalem/Phenom or later. The required Cygwin1.dll is included

demolito_20181029-tp.zip
Someone reported a bug with this compile. Cannot allocate more than 2GB. Looking at the code, there's no reason why, everything is carefully done using 64-bit arithmetics, and the _aligned_malloc() used is 64-bit according to MSDN. So, yet another compiler/libc bug, it seems :cry:

Minimal repro would be:

Code: Select all

setoption name Hash value 4096
ucinewgame
-> should crash (?)
Can you confirm that this happens on your machine ?

Funny thing is, I can't even test, because:
* [mingw bug] my mingw cross compiles work on Wine, but not on Windows (it seems), and don't have this bug (4GB works fine, I can't test more because I have only 8GB physical RAM).
* [wine bug] your gcc compile works on Windows but crashes on my Wine (doesn't start).

Windows compatibility is such a nightmare...

Re: Demolito 20181029 released

Posted: Sat Nov 10, 2018 12:55 am
by lucasart
tpoppins wrote: Thu Nov 08, 2018 2:42 am It's a compiler issue. If I build under MSYS2 with MinGW and GCC 8.2.0 I get no compiler errors, just a couple of warnings, but no bench results at the end and the resulting exec crashes. Removing "-flto" and "-m" flags and lowering "-O" to 2 did not help.

Under Cygwin and GCC 7.3.0 everything is hunky-dory, but you need cygwin1.dll to run the execs. Here are two: one will run on any CPU with SSE3 (P4/Athlon 64 or later), the POPCNT one needs a Nehalem/Phenom or later. The required Cygwin1.dll is included

demolito_20181029-tp.zip
Someone reported a 2GB limit this compile. Cannot allocate more than 2GB. There is definitely no bug in the code, which carefully uses 64-bit arithmetics, and _aligned_malloc() which is supposed to be 64-bit according to MSDN. So, yet another compiler/libc bug, it seems :cry:

Minimal repro would be:

Code: Select all

setoption name Hash value 4096
ucinewgame
-> should crash (?)
Can you confirm that this happens on your machine ?

Funny thing is, I can't even test, because:
* [mingw bug] my mingw cross compiles work on Wine, but not on Windows (it seems), and don't have this bug (4GB works fine, I can't test more because I have only 8GB physical RAM).
* [wine bug] your gcc compile works on Windows but crashes on my Wine (doesn't start).

Windows compatibility is such a nightmare...

Re: Demolito 20181029 released

Posted: Sat Nov 10, 2018 1:34 am
by CMCanavessi
I can confirm that it crashes with 4gb hash size. Previous version doesn't crash, that's the value I use for my tournaments.

Re: Demolito 20181029 released

Posted: Sat Nov 10, 2018 1:36 am
by Dann Corbit

Code: Select all

id name Demolito 20181109
id author lucasart
option name UCI_Chess960 type check default false
option name Hash type spin default 1 min 1 max 1048576
option name Threads type spin default 1 min 1 max 63
option name Contempt type spin default 10 min -100 max 100
option name Time Buffer type spin default 60 min 0 max 1000
uciok
setoption name Hash value 4096
ucinewgame
warning: Critical error detected c0000374

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ff821b11c90 in ntdll!RtlpNtMakeTemporaryKey () from /c/Windows/SYSTEM32/ntdll.dll
(gdb) bt
#0  0x00007ff821b11c90 in ntdll!RtlpNtMakeTemporaryKey () from /c/Windows/SYSTEM32/ntdll.dll
#1  0x00007ff821b14f12 in ntdll!RtlpNtMakeTemporaryKey () from /c/Windows/SYSTEM32/ntdll.dll
#2  0x00007ff821b15b10 in ntdll!RtlpNtMakeTemporaryKey () from /c/Windows/SYSTEM32/ntdll.dll
#3  0x00007ff821aca5ff in ntdll!memset () from /c/Windows/SYSTEM32/ntdll.dll
#4  0x00007ff81fd51cbc in msvcrt!free () from /c/Windows/system32/msvcrt.dll
#5  0x0000000000404d95 in hash_resize ()
#6  0x000000000040c2f4 in uci_loop ()
#7  0x00000000004051e9 in main ()
(gdb)
Which lead to this change:

Code: Select all

void hash_resize(uint64_t hashMB)
{
#ifdef _WIN64
    _aligned_free(HashTable);
#else
    free(HashTable);
#endif // _WIN64
#ifdef _WIN64  // C11 support lacking, use instead Microsoft's _aligned_malloc()
    HashTable = _aligned_malloc(hashMB << 20, sizeof(HashEntry));
#else
    HashTable = aligned_alloc(sizeof(HashEntry), hashMB << 20);
#endif
    HashCount = (hashMB << 20) / sizeof(HashEntry);
}

Re: Demolito 20181029 released

Posted: Sat Nov 10, 2018 1:46 am
by Dann Corbit
Sharable link:
https://drive.google.com/open?id=1hhhs3 ... sFdhWW41_y

Contains my tiny source change and a 64 bit Windows binary.

Re: Demolito 20181029 released

Posted: Sat Nov 10, 2018 2:47 am
by mar
Dann Corbit wrote: Sat Nov 10, 2018 1:46 am Sharable link:
https://drive.google.com/open?id=1hhhs3 ... sFdhWW41_y

Contains my tiny source change and a 64 bit Windows binary.
This compile of yours has asserts enabled (I get abs(score)<MATE at depth 9 from startpos). Did you actually test it?

Re: Demolito 20181029 released

Posted: Sat Nov 10, 2018 2:55 am
by Dann Corbit
I checked the allocations, and I analyzed a few EPD records