Demolito 20181029 released

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

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
lucasart
Posts: 3014
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Demolito 20181029 released

Post by lucasart » Thu Nov 08, 2018 11:52 am

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.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

tpoppins
Posts: 773
Joined: Tue Nov 24, 2015 8:11 pm
Location: upstate

Re: Demolito 20181029 released

Post by tpoppins » Thu Nov 08, 2018 12:30 pm

lucasart wrote:
Thu Nov 08, 2018 11:52 am
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 11:52 am
@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 11:52 am
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 11:52 am
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 11:52 am
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.
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.
Tirsa Poppins
CCRL

User avatar
lucasart
Posts: 3014
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Demolito 20181029 released

Post by lucasart » Thu Nov 08, 2018 1:29 pm

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).
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

User avatar
lucasart
Posts: 3014
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Demolito 20181029 released

Post by lucasart » Fri Nov 09, 2018 11:53 pm

tpoppins wrote:
Thu Nov 08, 2018 1: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...
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

User avatar
lucasart
Posts: 3014
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Demolito 20181029 released

Post by lucasart » Fri Nov 09, 2018 11:55 pm

tpoppins wrote:
Thu Nov 08, 2018 1: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...
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

User avatar
CMCanavessi
Posts: 761
Joined: Thu Dec 28, 2017 3:06 pm
Location: Argentina

Re: Demolito 20181029 released

Post by CMCanavessi » Sat Nov 10, 2018 12:34 am

I can confirm that it crashes with 4gb hash size. Previous version doesn't crash, that's the value I use for my tournaments.
Follow my tournament and some Leela gauntlets live at http://twitch.tv/ccls

Dann Corbit
Posts: 9051
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Demolito 20181029 released

Post by Dann Corbit » Sat Nov 10, 2018 12:36 am

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);
}
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

Dann Corbit
Posts: 9051
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Demolito 20181029 released

Post by Dann Corbit » Sat Nov 10, 2018 12:46 am

Sharable link:
https://drive.google.com/open?id=1hhhs3 ... sFdhWW41_y

Contains my tiny source change and a 64 bit Windows binary.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

mar
Posts: 1884
Joined: Fri Nov 26, 2010 1:00 pm
Full name: Martin Sedlak

Re: Demolito 20181029 released

Post by mar » Sat Nov 10, 2018 1:47 am

Dann Corbit wrote:
Sat Nov 10, 2018 12: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?
Martin Sedlak

Dann Corbit
Posts: 9051
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Demolito 20181029 released

Post by Dann Corbit » Sat Nov 10, 2018 1:55 am

I checked the allocations, and I analyzed a few EPD records
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

Post Reply