Polyglot - merge-book oddity

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

Moderator: Ras

User avatar
Rebel
Posts: 7311
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Polyglot - merge-book oddity

Post by Rebel »

I did a stress test with 2 large equal books of 100Mb and the result was a 20Kb output book :D

With 5000 it was okay.
90% of coding is debugging, the other 10% is writing bugs.
User avatar
Rebel
Posts: 7311
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Polyglot - merge-book oddity

Post by Rebel »

Those who want to try the new Polyglot Merge-Books util - http://rebel13.nl/dl/Merge-Books.7z

book_merge.cpp included.
90% of coding is debugging, the other 10% is writing bugs.
User avatar
hgm
Posts: 28354
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Polyglot - merge-book oddity

Post by hgm »

Finding a trick to make the symptoms of an obviously bad problem go away does not automatically cure the problem.

I suppose an 'OK' result for merging two equal 100MB books would be a 100MB book (with just all weights doubled). That is 5000 times larger than the 20K result.

Don't you think it is suspect that by increasing the buffer size 10 times, it can retain 5000 times as many entries?
User avatar
Rebel
Posts: 7311
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Polyglot - merge-book oddity

Post by Rebel »

What I said, it's a stress test, nobody should do that, but I am pretty sure it saves me a couple of user complaints.
90% of coding is debugging, the other 10% is writing bugs.
Guenther
Posts: 4718
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: Polyglot - merge-book oddity

Post by Guenther »

Guenther wrote: Sun Mar 21, 2021 1:58 pm

Well, I uploaded the already compiled fixed version from HGM here:
https://drive.google.com/drive/folders/ ... E15NjVyY2M
I will remove this upload now, as HGM has done more essential fixes later anyway.
If there is still interest I could compile the newer fixes and upload again.
Just make a request here or via PM.
https://rwbc-chess.de

[Trolls n'existent pas...]
jefk
Posts: 956
Joined: Sun Jul 25, 2010 10:07 pm
Location: the Netherlands
Full name: Jef Kaan

Re: Polyglot - merge-book oddity

Post by jefk »

Guenther wrote
uploaded the already compiled fixed version from HGM here:
yep, and i tried it, but -besides the 'size' /duplicates issue another
flaw has risen, when i added two small books, in the new result
the percentages (of bookmoves) didn't add up to 100 pct, in fact much
smaller (it was ok in the previous -yet not perfect- version ...)
Same problem as 'Rebel reported i guess, so the latest update
doesn't have this issue anymore apparently (haven't tried it yet)

As for compiling, my code::blocks program doesn't read makefiles, guess i
have to download mingw and the 'make' program might do that later.
User avatar
hgm
Posts: 28354
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Polyglot - merge-book oddity

Post by hgm »

jefk wrote: Tue Mar 23, 2021 1:48 pmyep, and i tried it, but -besides the 'size' /duplicates issue another
flaw has risen, when i added two small books, in the new result
the percentages (of bookmoves) didn't add up to 100 pct, in fact much
smaller (it was ok in the previous -yet not perfect- version ...)
That cannot possibly be a result of any merge, as there are no percentages stored in bin books at all. The moves just have a weight (which during creation from PGN is set to the number of half-points scored with the move), and the weights of all moves from a given position can sum to anything. It is the task of the probing code to convert the weights as a percentage of the total weight.
Joost Buijs
Posts: 1635
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Polyglot - merge-book oddity

Post by Joost Buijs »

If I recall the weight-field is just 16 bit (unsigned), if you start merging books without taking this into account things will probably go wrong.

Most people want to throw tens of million games at it, so you always have to re-scale the weights to 16 bit.
User avatar
Rebel
Posts: 7311
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: Polyglot - merge-book oddity

Post by Rebel »

Joost Buijs wrote: Tue Mar 23, 2021 6:55 pm If I recall the weight-field is just 16 bit (unsigned), if you start merging books without taking this into account things will probably go wrong.
Previously, before the new version in this thread the weights in book-1 remained unchanged. With the new version they change. It's not such a big problem because:

With the POLY util you have several options to recalculate the weights. Secondly (and not everybody will agree) the weight is pretty much out-dated, relying on engine score is superior to the weight. Last, other testing has showed a Polyglot book based on WDL is also superior to the current Polyglot weight system of 2*win+draws, ignoring the losses. All in all, Polyglot by Fabien with all its features was ahead of its time but in the meantime it can use a serious update regarding strength.
90% of coding is debugging, the other 10% is writing bugs.
User avatar
hgm
Posts: 28354
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Polyglot - merge-book oddity

Post by hgm »

Weights purely from statistics are flawed anyway. You would have to minimax the opening tree in MCTS fashion to correctly judge the moves.