Hi,
"Edit Book" - "add next move" allows to add a move that is already in
the list. I think this behavior has negative consequences for move
selection. see user session below. A workaround is to manually delete
duplicate row(s). There are some other quirks with saving/editing the
book but those are for a separate topic.
## := quirk
#### := issue being reported
--
Alan
$ xboard --version
xboard version 4.9.1
configure options: prefix=/usr; datarootdir=/usr/share;
datadir=/usr/share; gamedatadir=/usr/share/games/xboard;
desktopdir=/usr/share/applications; mimedir=/usr/share/mime/packages;
iconsdir=/usr/share/icons/hicolor/48x48/apps;
svgiconsdir=/usr/share/icons/hicolor/scalable/apps;
infodir=/usr/share/info; sysconfigdir=; update_mimedb=yes; NLS=yes;
GTK=yes; Xaw3d=no; Xaw=no; ptys=pipes; zippy=yes; sigint=yes
$ grep -e "[Pp]olyglot" -e "[Bb]ook" ~/.xboardrc
-saveOutOfBookInfo true
-adapterCommand 'polyglot -noini -ec "%fcp" -ed "%fd" -uci
NalimovCache=%defaultCacheSizeEGTB -pg ShowTbHits=true'
-polyglotDir ""
-usePolyglotBook true
-polyglotBook "/home/REDACTED/chesspgbook/book.bin"
-bookDepth 12
-bookVariation 50
-discourageOwnBooks false
$ ls -Gg --time-style=+%Y.%m.%dT%H%M -Gg ~/chesspgbook/
total 1456
-rwxr-xr-x 1 1487264 2023.03.03T1358 Performance.bin
$ cat ~/Documents/tmp/test.pgn
[White "fischer"]
[Result "1-0"]
e4 e5 Nf3 1-0
[White "spassky"]
[Result "1-0"]
d4 Nf6 c4 1-0
[White "kramnik"]
[Result "1-0"]
Nf3 d5 d4 1-0
$ xboard &
[1] 21626
GUI | File | Load Game | Recently Used | test.pgn
GUI | File | Save Games as Book
## success here because 3 games
## but if only 1 game in PGN ,
## xboard complains "Game list not loaded or empty"
$ ls -Gg --time-style=+%Y.%m.%dT%H%M -Gg ~/chesspgbook/
total 1456
-rw-r--r-- 1 0 2025.10.23T1454 book.bin
-rwxr-xr-x 1 1487264 2023.03.03T1358 Performance.bin
## 0-byte file, xboard does not commit the book until Quit
## at this moment GUI | Edit | Edit Book does nothing
GUI | File | Quit
$ ls -Gg --time-style=+%Y.%m.%dT%H%M -Gg ~/chesspgbook/
total 1460
-rw-r--r-- 1 64 2025.10.23T1456 book.bin
-rwxr-xr-x 1 1487264 2023.03.03T1358 Performance.bin
[1]+ Done xboard
$ hexdump -e '1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1
"%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x " 1/1 "%.02x" 1/1 "%.02x "
1/1 "%.02x" 1/1 "%.02x " 1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1 "%02x "
"\n"' ~/chesspgbook/book.bin
463b96181691fc9c 031c 0001 00000001
463b96181691fc9c 02db 0001 00000001
463b96181691fc9c 0195 0001 00000001
ffffffffffffffff 0000 0000 00000000
## only 3 moves in the book, should be 9
## i am going to investigate
## and maybe send another report
$ xboard &
[1] 21795
GUI | Edit | Edit Book
33.3% 1 e4 {1/0}
33.3% 1 d4 {1/0}
33.3% 1 Nf3 {1/0}
GUI | manually edit the weights (1,1,1) to (2,3,4)
33.3% 2 e4 {1/0}
33.3% 3 d4 {1/0}
33.3% 4 Nf3 {1/0}
GUI | commit changes
22.2% 2 e4 {1/0}
33.3% 3 d4 {1/0}
44.4% 4 Nf3 {1/0}
GUI | add next move | c2c4
22.2% 2 e4 {1/0}
33.3% 3 d4 {1/0}
44.4% 4 Nf3 {1/0}
0.0% 1 c4
GUI | commit changes
20.0% 2 e4 {1/0}
30.0% 3 d4 {1/0}
40.0% 4 Nf3 {1/0}
10.0% 1 c4
GUI | add next move | d2d4 #### d2d4 already in list
20.0% 2 e4 {1/0}
30.0% 3 d4 {1/0}
40.0% 4 Nf3 {1/0}
10.0% 1 c4
0.0% 1 d4
#### i think xboard should give an ERR instead of adding the duplicate
GUI | commit changes
18.2% 2 e4 {1/0}
27.3% 3 d4 {1/0}
36.4% 4 Nf3 {1/0}
9.1% 1 c4
9.1% 1 d4
$ hexdump -e '1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1
"%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x " 1/1 "%.02x" 1/1 "%.02x "
1/1 "%.02x" 1/1 "%.02x " 1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1 "%02x "
"\n"' ~/chesspgbook/book.bin
463b96181691fc9c 031c 0002 00000001
463b96181691fc9c 02db 0003 00000001
463b96181691fc9c 0195 0004 00000001
463b96181691fc9c 029a 0001 00000000
463b96181691fc9c 02db 0001 00000000
ffffffffffffffff 0000 0000 00000000
GUI | manually delete the row " 9.1% 1 d4 "
## if delete just the weight, xboard does some weird math
18.2% 2 e4 {1/0}
27.3% 3 d4 {1/0}
36.4% 4 Nf3 {1/0}
9.1% 1 c4
GUI | commit changes
20.0% 2 e4 {1/0}
30.0% 3 d4 {1/0}
40.0% 4 Nf3 {1/0}
10.0% 1 c4
$ hexdump -ve '1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1
"%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x " 1/1 "%.02x" 1/1 "%.02x "
1/1 "%.02x" 1/1 "%.02x " 1/1 "%.02x" 1/1 "%.02x" 1/1 "%.02x" 1/1 "%02x "
"\n"' ~/chesspgbook/book.bin
463b96181691fc9c 031c 0002 00000001
463b96181691fc9c 02db 0003 00000001
463b96181691fc9c 0195 0004 00000001
463b96181691fc9c 029a 0001 00000000
ffffffffffffffff 0000 0000 00000000
ffffffffffffffff 0000 0000 00000000
GUI | File | Quit
$