polyglot book merging

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Jonathan003
Posts: 239
Joined: Fri Jul 06, 2018 4:23 pm
Full name: Jonathan Cremers

polyglot book merging

Post by Jonathan003 »

Can somebody help me with this.

The manual about book merging with polyglot says this.
Imagine that we've got 4 PGN files as follows:

w1.pgn: fixed white lines, all moves manually checked
w2.pgn: selected games (for random book as with PolyGlot 1.3)

b1.pgn and b2.pgn: same for black

The first step is to build 4 .bin files with appropriate options.
Lines starting with "> " indicate what is typed on the command line.

> polyglot make-book -min-game 1 -uniform -only-white -pgn w1.pgn -bin w1.bin

> polyglot make-book -min-score 50 -only-white -pgn w2.pgn -bin w2.bin

Let's now merge the white books.

> polyglot merge-book -in1 w1.bin -in2 w2.bin -out w.bin

Input files are not symmetrical, "in1" has priority over "in2".

"skipped xxx entries." message from PolyGlot means there were some
position conflicts. This is normal since we want to overwrite some
random moves with fixed lines instead.

Same for black:

> polyglot merge-book -in1 b1.bin -in2 b2.bin -out b.bin

Now we can finally merge the white and black books.

> polyglot merge-book -in1 w.bin -in2 b.bin -out book.bin

I would like to have an additional option for merging books.

In this exemple.

> polyglot merge-book -in1 w1.bin -in2 w2.bin -out w.bin

all fixed white lines from w1.bin will be in -out w.bin

I would like an additional option to not include fixed white lines from w1.bin in the merged w.bin book, when they are not part of the selected white lines in w2.bin

That would be interesting for creating opening repertoires for over the board games.

Than I would make a bin book w1.bin from my own games. And make a bin book w2.bin book from master games. If I merge the bin books this way w.bin would not contain weak white moves from w1.bin because they are not part of w2.bin

Maybe there is some way around to achieve this? Or is there someone ho can program this?
User avatar
Ozymandias
Posts: 1532
Joined: Sun Oct 25, 2009 2:30 am

Re: polyglot book merging

Post by Ozymandias »

Jonathan003 wrote: Wed Oct 23, 2019 1:48 amI would like an additional option to not include fixed white lines from w1.bin in the merged w.bin book, when they are not part of the selected white lines in w2.bin

That would be interesting for creating opening repertoires for over the board games.

Than I would make a bin book w1.bin from my own games. And make a bin book w2.bin book from master games. If I merge the bin books this way w.bin would not contain weak white moves from w1.bin because they are not part of w2.bin
Polyglot doesn't work with lines, it works with positions.

The closest you could achieve, would be to use master games for w1 and your games for w2, so that you'd avoid weak moves, when there're "strong" ones for a given position.