Fairy-Stockfish janggi (ponder Problem)

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 13 Oct 2020, 08:07

I sent you a PM with my e-mail address.

Was the Thinking Info you posted for the initial positions? It seems white is to move, as the odd moves all start at low coordinates, and the even moves at high coordinates. The output mentions rank 10 in some places, which shows rank numbering must be 1-10. I consider that wrong: the convention is that on boards with 10 ranks numbering is from 0-9. At least UCI Xiangqi engines do that; for Janggi there was of course no prior standard. But I think it would be very bad if Xiangqi and Janggi would have to be treated differently.

I consider this an engine problem: I tried Fairy-Stockfish in variant Xiangqi, and it also numbers ranks 1-10 there. This makes it incompatible with other UCI Xiangqi engines, such as Cyclone. I will report this on GitHub.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Fairy-Stockfish janggi (ponder Problem)

Postby janggi-korea » 13 Oct 2020, 14:53

I sent mail to two types of accounts,
your mail account is probably dormant. so couldn't send mail.

https://github.com/ianfab/Fairy-Stockfish/issues/192

I found a similar file.
engine file attached by the engine developer.
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby janggi-korea » 13 Oct 2020, 16:24

Have you checked my Google account sharing?
I find it difficult to send messages here. Perhaps sent several times.
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 13 Oct 2020, 22:49

OK, I got those now. Problem was that my inbox for PM here is full, so the messages were put on hold by the forum software.

I will try to see what I can do with the book and PGN tomorrow. I also downloaded the latest SF from GitHub. The bad news is that they apparently forked the standard for numbering ranks in UCI, so that SF cannot be used as UCI engine through UCI2WB. So for pondering you will have to wait until SF implements it in CECP mode.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Fairy-Stockfish janggi (ponder Problem)

Postby janggi-korea » 14 Oct 2020, 08:17

ok i see. That's bad news.

I will also GitHub participate.
i think it would be a bit daunting for the engine developer to officially change the coordinates. Because the pychess site is also need changing.

Anyway, I compile it by modifying the janggi coordinates of the engine, but an error occurred.
I will discuss with the engine developer how to modify the engine janggi coordinates with a custom version.
For any version of the protocol currently, it is not korean janggi coordinates, so anyway I will have to convert again.(The future)
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 14 Oct 2020, 09:22

IMO the protocol should never be made variant-dependent. This would be a very bad mistake. One consequence would be that configurable multi-variant engines, which by themselves know nothing about the variant, but have enough general support to allow the variant to be configured, can no longer be used, because of the protocol mismatch. Designing new or altering existing protocols should be considered a crime against humanity; it only causes eternal hardship and suffering. OTOH, in what form moves are presented to the user is only a matter between user and GUI. But engine-GUI communication protocols are not intended for human consumption.

I tried your PGN file. It was not really standard PGN, and because I do not have Korean code pages installed, much of the text in it shows up as mojibake. But apparently it resembles PGN close enough that WinBoard could load it, and see some 1092 games in it. I tried to load some of those (I had already switched WinBoard to Janggi, and was using it without engine), and this worked.

Then I tried "Save Game to Book". WinBoard started working on it, but unexpectedly produced hundreds of 'illegal move' popups in the process. Because I could no longer see which games had produced those, I restarted WinBoard, loaded the file again, and started selecting individual games from the game list until I found one that produced an illegal-move popup. Turned out WinBoard did not recognize that the move blocked a check from an Elephant. (I had Test Legality on; without that there would of course never be illegal-move complaints.) So there was a bug in the Elephant move. Turned out I had written if(A && B == EmptySquare) instead of if(A == EmptySquare && B == EmptySquare) for testing the free path of the Elephant. So I fixed that, and after that the PGN no longer produced any errors on Save Games to Book.

At first I could not find the specified book file; it turned out it was created in the folder from which I had loaded the PGN (which was elsewhere). This could be a Windows quirk, where using the file-browse dialog (in this case for opening the PGN) automatically changes the current directory. Anyway, when I made an octal dump of the file it turned out to contain 8192 moves. I don't know if it contained all the moves of all games. Some of the games in the PGN appeared to have no result, and the book-building process is based on game results: moves in games that were lost will not go into the book, and games that are won contribute twice as much to the move weight as draws. Games without result might not go into the book either. PGN actually has redundant result reporting; there is a result after the last move, and there can be a Result tag in the header. I am not sure which of the two WinBoard uses, or whetre it uses both, and what would happen if they do not agree.

When I opened the Edit Book window in the initial position of the game, I saw no moves. Playing a move (in Edit Game mode) to get to another position did make some moves appear in the edit window, though. So the book seemed to have been successfully created. I still have to figure out what happened to the moves in the initial position, whether displaying doen't work there, or whether they were never written to the book. (Both these cases should be considered a WinBoard bug.)

[Edit] The book seems to be OK; when I let Fairy-Stockfish use it, it plays a move in the opening position without thinking. And I can see the book moves for the start position too, in the Edit Book window. Not sure what happened that I could not see them before. Anyway, this the automatic book creation seems to work well enough to be used. So I will concentrate on conversion of the existing book now.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 14 Oct 2020, 22:41

I made some progress, but I am not quite there yet. I made a special version of WinBoard, where the function to calculate the book key has an extra parameter, which decides whether the code for Marshall will be used for Pawns instead of their normal codes. I made the existing book-probe code request this substitution. As a result this version is able to use the book you made, even though the Pawns are internally represented as Pawns, and not as Marshalls. I checked this by opening the Edit Book window, and indeed I see all the moves there.

Then I wrote a small function that calls existing code to fetch all book moves for the current game position, and then loops over these moves to create a follow-up game position by playing them one by one, and after each recursively calls itself for that new position. This should walk through the entire opening tree, as long as there are no disconnected branches in it.

For each move it plays that way, it writes the move and weight, as well as the key for the current position, calculated without any substitutions, to a file. I changed the Save Games to Book menu to call this function for the start position. After I do that, I indeed get a file, which contains text that looks like:

Code: Select all
f458503dc8359c90  3184 3
6e7e8c975b34653b  4915 8
4d9e898ff7e239d7   110 2
f41b661c614c15e2  7445 4
7250031f25e0e7da  1732 4
68b6e96b88da0238  7989 1
68b6e96b88da0238  5827 4
40676cc00b2ec760  2820 1
ca5e608dacd893f7  5279 1
...


This basically is the converted book, as it uses the keys as they should be for the new Jangi implementation. Except that the moves are traversed in a totally different order as they originally appeared in the book, due to the recursive walk. But the order would be wrong anyway, as the book is supposed to be sorted by ascending hash key, and the keys are now totally different from what they were. There also could be duplicats, because the same position could have been reached multiple times through transposition of moves. I hope there were no loops in the book; this would cause infinite looping in the tree walk, but I guarded against that by aborting the tree walk after 16000 nodes. I hope this maximum was not reached.

My plan is now to take this file to Linux, where I can easily count the number of lines (to see if it stayed below 16000), and use the commands 'sort' and 'uniq' to sort them in key order and throw out duplicats. Then I can write a small program to read the remaining text file, and write it in binary format (8 bytes for the key, 2 for the move and weight, and 4 null bytes for padding). That shoud then be the converted bin book. I hope to be able to do that tomorrow.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Fairy-Stockfish janggi (ponder Problem)

Postby janggi-korea » 15 Oct 2020, 05:50

My book has movements connected by lines and movements not connected. There aren't many locations for line that are not connected. Do not worry.

I succeeded in making the book by running the same way as you described. It works fine.
thank you very much.
It's a milestone that saves a lot of my time in the future.
In "view or edit game file" mode, you cannot see the initial starting position. When I loaded the engine again in play mode, I was able to see the first move book edit. You will probably see it when you restart Winboard. And if you change the Book Depth number and make it, the number of book positions will change.

The pgn sample file I gave you was made by manual(hand) work. It is the movement record of the "human janggi masters". before, I made about 30,000 games of PGN files. i will use this to test further. However, since it is the symbol and FEN value of the existing xiangqi variant, it will have to be converted back to the current janggi variant.

I have some questions.

1. What does {??/??} mean? In other words, does that mean 41 victorious moves in 60 games? In some cases, the number at the end is higher.
53.2% 41 ih3 {41/60}
13.0% 10 Hc2 {10/16}
6.5% 5 ab3 {5/13}
27.3% 21 Hg2 {21/33}
0.0% 0 ed3 {0/1}

2. How do we solve the left-right symmetric coordinate problem to increase efficiency?
(Essentially, the horizontal symmetry is the same moving coordinate, and it is classified separately in the pgn file. Depending on the characteristics of the people, the starting position is the content played by selecting left-right.
However, it would be better to enter the same in the book espectively.) To avoid repeating book making twice.

3. Is there a way to combine the existing book with the currently created book? (bin+bin=stronger bin)
Chess has many "pgn tools" to help with this. But there is no janggi currently, and I don't know how.

With your help, i am solving many problems. Thanks again.

Memo: If i currently make a book with pgn, it is just the probability of movement of human masters, but the book I gave you is a book that I analyzed by referring to it. Sometimes the engine movement is more efficient than human movement, and human movement is thought to be overvalued.
First of all, until protocol problems such as UCI, UCCI, etc.(Engine developer) are resolved,
me and my janggi members will play in CECP mode in janggi variant.

If security is necessary or important, please use my email or PM. cjssh1002@naver.com
And this is my janggi cafe site address. I am the administrator of this site. (Korean langeuage): https://cafe.naver.com/janggibogo
Last edited by janggi-korea on 15 Oct 2020, 07:04, edited 1 time in total.
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 15 Oct 2020, 07:03

janggi-korea wrote:My book has movements connected by lines and movements not connected. There aren't many locations for line that are not connected. Do not worry.

For the unconnected lines, would it be enough to do a look-head of one move to find them? That should still be feasible.

BTW, I did the 'sort' and 'uniq' now on the book data, and this leaves me with 292 moves. I was wrong about the original number of moves: the book was 8192 bytes, which is only 511 moves (as each move occupies 16 bytes, and there is one dummy entry to identify the end of the book). That means quite a few moves got lost in the process. I suspect these are the disconnected lines.

In "view or edit game file" mode, you cannot see the initial starting position. When I loaded the engine again in play mode, I was able to see the first move book edit.

By "not see" you mean the moves for it in the Edit Book window? I do see those (even for the starting position) with the WinBoard version that does the Pawn -> Marshall substitution. But in general the issue is not in which mode you start, but whether the engine (when you start it with an engine) succeeds in altering some of the game paramenters (such as switching back the parent variant to xiangqi, or replace the Pawns by Marshalls).

BTW, I noticed that I also need a second substitution to be able to read your original book, namely the King. In Xiangqi I use a different symbol for that, because the royal piece there does not move as a King in Chess, but as a the piece known as a Wazir. So WinBoard uses its Wazir symbol for it. When I implemented Janggi as a standard variant, I just copied this from the Xiangqi implementation. But now that I think about it, there isn't really any need for this. The board topology in the Palace for Janggi is irregular, so you cannot say that a piece has a certain move, and in the center and corners it actually does move like a King in Chess (confined to the Palace). So I wonder if it would not be better to switch back to using the conventional King symbol for Janggi.

The pgn sample file I gave you was made by manual(hand) work. It is the movement record of the "human janggi masters". before, I made about 30,000 games of PGN files. i will use this to test further. However, since it is the symbol and FEN value of the existing xiangqi variant, it will have to be converted back to the current janggi variant.

By using WinBoard with the additional option -pieceNickNames ".N....B..n....b." it should be able to recognize games with FENs that use the old notation.

I have some questions.

1. What does {??/??} mean? In other words, does that mean 41 victorious moves in 60 games? In some cases, the number at the end is higher.
53.2% 41 ih3 {41/60}
13.0% 10 Hc2 {10/16}
6.5% 5 ab3 {5/13}
27.3% 21 Hg2 {21/33}
0.0% 0 ed3 {0/1}

The 'official' meaning of those numbers in a Polyglot book is the 'learn information': number of times the move was played, and number of half-points scored with it. Polyglot books store 3 16-bit numeric items for each move, the weight, and this learn info. Normally books are created with the learn info at 0. Engines that use the book can keep record of the success they had with each opening, and thus learn which openings do not suit them, and then later avoid those. WinBoard does not implement such 'book learning', because the book there is meant for use with many different engines. So the learn fields are just ignored.

In the automatic book creation I use these fields to store the number of draws and losses (or something like that). This to allow the creation to be continued by adding more games. The weight of the moves is nrOfDraws + 2*nrOfWins, and doesn't allow full reconstruction of the W/D/L info (which is needed when constructing a book through 'Monte-Carlo book mode').

2. How do we solve the left-right symmetric coordinate problem to increase efficiency?
(Essentially, the horizontal symmetry is the same moving coordinate, and it is classified separately in the pgn file. Depending on the characteristics of the people, the starting position is the content played by selecting left-right.
However, it would be better to enter the same in the book espectively.) To avoid repeating book making twice.

Indeed, I see the problem. WinBoard doesn't have any special feature for this. Until now the only variant where such symmetry exists was Xiangqi; western variants tend to be asymmetric because of King/Queen placement or castling, most Shogi variants are asymmetric. I didn't think it was worth it to put in a feature that would be needed so rarely, and when I made a Xiangqi book I just did duplicate the book.

It should not be very difficult to add some code that would probe the book for the mirrorred position (and reflect the retrieved move) if the first probe failed. The problem is more to decide when this should be done. If I make it dependent on the (parent) variant being Xiangqi or Janggi, it would interfere with the use of asymmetric engine-defined variants that use Xiangqi or Janggi as a parent. So perhaps this feature should be switched on only explicitly by the user through a WinBoard option (e.g. -symBook).

3. Is there a way to combine the existing book with the currently created book? (bin+bin=stronger bin)
Chess has many "pgn tools" to help with this. But there is no janggi currently, and I don't know how.

Polyglot can 'merge' books. Normally Polyglot only understands orthodox Chess, but I don't think it tries to interpret the meaning of the move field when merging books. (It would be impossible to translate the hash key back to a position, so it has no clue about the position anyway.) So the merge function of it could be used to combine books for any variant.

Memo: If i currently make a book with pgn, it is just the probability of movement of human masters, but the book I gave you is a book that I analyzed by referring to it. Sometimes the engine movement is more efficient than human movement, and human movement is thought to be overvalued.

Beware that I discovered a problem with PGN games saved from WinBoard: it is not always able to read those back. In Janggi it can happen that two Pawns are able to move to the same square, and then giving only the target square is ambiguous. So the notation needs to use an extra 'disambiguator', like ab3 or cb3. This problem of course existed in Xiangqi as well, and WinBoard does properly disambiguate Pawn moves there. But only when they are across the River. For Janggi it would have to do it everywhere. I still have to fix that.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Fairy-Stockfish janggi (ponder Problem)

Postby janggi-korea » 15 Oct 2020, 08:12

1. [OK] Unconnected lines find most of the lines in one move. Also, that line is not long either.

2. [OK] The first movement of the EDIT BOOK pop-up window you talked about is visible again when I restart Winboard.

3. I shared the JANGGI FONT file and the "Font piece to char:"
same position as you. You need to check this. And even if the font is not used, a FEN error occurs. Certainly, because the existing FEN file and the current FEN file are different, the "Bad FEN POSITION IN FILE" pop-up window is created. And I can't read it. To confirm, I uploaded the TOTAL.PGN file to my Google account. All the PGN files containing the samples I gave you. sample is just one starting position.

4. The king expression is "Font piece to char:" so you can adjust the order of the king.

5. Please tell me more about the -symBook option. And please tell me how to use it.

6. [OK] Can I overwrite the book merge method additionally? This is what I'll find out.

please google drive check: Font piece to char.txt / Janggi_07-Regular.ttf / TOTAL.pgn
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 15 Oct 2020, 09:08

The following thought occurred to me: because of the possibility to swap Elephants and Horses at the start of the game, does your book also contain opening lines starting from such positions? My current tree-walk starts only from the Xiangqi-like start position, and would not find those.

(3) Use of the font should not have any effect on FEN / PGN reading; it is only used in the routines that draw the board on the screen. I grabbed the files, and will check to see what the problem is for reading the games.

(4) I don't understand what you mean here at all. Perhaps some explanation makes it clearer: each position in the (font) pieceToCharTable corresponds to a symbol of the build-in piece theme; the first is a Pawn, then a Knight, etc. In the normal pieceToCharTable (which an engine can send to WinBoard to redefine it) the letter you write in a position will be used in FEN and move notation for the piece with the corresponding symbol. In the fontPieceToCharTable the letter you write there will be used to select the character from the piece font that will be used for displaying the piece with the corresponding symbol. There is nothing against defining letters in the fontPieceToCharTable for pieces with symbols that do not participate in the game (which would be indicated by a point in the normal pieceToCharTable); these will simply never be used. It is also not an error to define the same font character for two different symbols; it just means that both pieces would look the same. So if you define tour fontPieceToCharTable such that both the Pawn symbol and the Marshall symbol would use the font character for Pawn, it would geve correct display for both the old and the new implementation.

(5) The -symBook option does not exist yet; it was just a proposal. Now that I think about it, there might be better solutions; we could adopt a convention that WinBoard decides whether it should also probe for the mirror image of the position based on the name of the book. It seems to me that the need to do this is an intrinsic property of the book, and it would just be inconvenient if you had to alter a separate option when you change to another book (e.g. from Xiangqi to Chess). So we could decide that book names that end in "-sym" will also be probed for mirror images, while other books would just be probed once. Another issue is if we want to support other kinds of symmetry as well, like color-reversing. This can in theory even happen in Chess, when white wastes a tempo.

(6) I also don't understand what you mean here. Overwrite how? By hand editing with Edit Book? You can use Edit Book on any book, no matter how it is made.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 15 Oct 2020, 09:49

OK, my mistake: it turns out the -pieceNickNames option only works in the variant that WinBoard was started in. This makes sense, as different variants in general employ different pieces. But I had forgotten all about that. So the -pieceNickNames we specify are completely ignored if we do not start WinBoard in Janggi, but switch to it later. The proper procedure would thus be to start WinBoard (preferably in game viewer mode, i.e. without engine) with 'Additional options'

-variant janggi -pieceNickNames ".N....B..n....b."

This exposed yet another problem: WinBoard refused -variant janggi as a starting option, even though it is possible to switch to it later. Turns out I had forgotten to add Janggi to the list of allowed variants for local play. (Some variants can only be played through an Internet Chess Server, such as Bughouse.) After I fixed that, starting WinBoard with the above options will allow loading of the games in the TOTAL.pgn file.

I will upload a fixed version of WinBoard later; the version I am using now was adapted for the book conversion, and is not suitable for general use.

[Edit] I see that you definitely have opening lines in the book that start from other Horse-Elephant setups. This explains why so many moves were missing. I will have to re-do the process for all of the 16 initial setups.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Fairy-Stockfish janggi (ponder Problem)

Postby janggi-korea » 16 Oct 2020, 05:20

You're welcome.

OK, I See. -pieceNickNames Use of this option i will be deferred for the time being.

(3)(4)
=> Yes I understand. However, all Koreans use "Janggi font". And I used Winboard's xqboard.bmp file. And I was hoping you would see what is represented using janggi fonts and boards like me. I'm welcome if switching to the traditional King's symbol has no problem with font and order. also the king of the existing xaingqi variant could be expressed as the king of janggi font using pieceToCharTable.

(5)
=> Seems like a very good option. And it will be the option we need.

(6)
=> I meant "bin tools". For example "polyglot book Creator"
I'll try this.

** my book included in each of the 16 starting positions.

I can collectively change the FEN value to the current Winboard version in TOTAL.pgn. This is a relatively easy task for me.
So, if you think that it takes unnecessary time for this problem, I will change the FEN value and create BIN file.(test for other start possion)

The important point is that i can make a Janggi book with winboard.
(Of course, have to test it in other starting positions.)

So about 25,000 games became important. Before that, it was not available at all.

============================

Oh, I have one question.

When loading the engine, it is automatically selected as the xiangqi variant. so I switch back to the janggi variant. In this part, the "Test legality" check option must be selected to change to the janggi variant.

I think the first problem with the xiangqi variant is that the engine developer hasn't changed it yet, but you should always check the Test legality when switching to the janggi variant. Is it intended?
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 16 Oct 2020, 08:46

You can indeed solve the PGN reading problem by using a text editor to replace the N and B in FEN by H and E. But I will have to fix the use of Janggi as initial variant (which would make the -pieceNickNames usable) anyway, and this is a very easy change (just adding one more 'case' in a 'switch' statement). And it is probably better you wait with creating any books until I made a new WinBoard version, as I have decided to change the King symbol, which would again affect the position encoding in the book. Yesterday I was a didn't have time to work much on it, but I hope to be able to finish the book conversion and new WinBoard version today.

About your question: What you describe happens when you first swictch WinBoard to Janggi without engine, and then use the Load 1st Engine dialog to load Fairy-Stockfish? If you just start WinBoard with Fairy-Stockfish selected from the Startup Dialog, I would expect it to start as Chess, not Xiangqi.

Loading a new engine should only change the current variant when the engine does not support that. In that case WinBoard would switch to the first variant that the engine says it does support. But for Fairy-Stockfish that would certainly not be Xiangqi.

When the currently selected variant is an engine-defined variant, the engine would switch WinBoard to the 'parent variant' specified by the engine, and make the rule modifications (like piece moves or board size) that the engine requests. But in a standard variant engine requests to change the rules are only executed when legality testing is off, as WinBoard considers it not legal to alter the rules of a game. So it sounds as if you are running a SF version that defines Xiangqi as parent variant to Janggi. The old SF indeed did that (out of necessity, as WinBoard did not know what Janggi was), but this should have been changed. The latest FS is supposed to specify parent variant Janggi for all four rule flavors.

If you want to see what is going on, you can start WinBoard with the Additional option -debug. The created file winboard.debug will then show (amongst others) all communication between GUI and engine, and you could see how the 'setup' command looks that SF sends when WinBoard switches it to Janggi, and wheher that mentions xiangqi.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 16 Oct 2020, 11:00

OK. I had some success in converting the book, and have uploaded a new WinBoard-AA package.

* It contains the converted book, with the name book-sym.bin .
* It fixes the problem with Janggi as start variant (and thus with -pieceNickNames).
* It fixes the problem of disambiguating Pawn moves in SAN notation.
(It turned out the code to do this had accidentally be enclosed in a code section that only became active when the Pawn move was redefined.)
* I kept the same symbol for King as in Xiangqi;
I found it would be a lot of work to change that, and the move is not always that of an orthodox King anyway. And like you say, Koreans would use a font.
* If an engine probes a book with a name that ends on -sym, and doesn't find the position, it now also probes for the mirror image of that position.
This is untested, as I have no idea how I can test it.

I did not manage to retrieve the disconnected lines yet. This was more problematic than I thought, because a disconnected position in the book might have to be reached by a move from a position that does have other moves in the book. And hunting for disconnected positions then should exclude the moves that are in book, (or all book moves would be tried twice, which really makes the tree explode), which is not easy to test. And I wonder if it is worth it: now that I also tried all opening tries from positions with swapped H-E, some 93% of all the moves is in the converted book.

This whole idea of symmetric books is still somewhat problematic, which makes me wonder if this is such a good idea. For instance, if both positions would be in the book, and the book moves would be divided amongst them, the way I did it now would only see the moves of the first one it tries. And it seems this situation can easily occur when you create the book from a collection of games. There really should be some objective criterion to decide which version of a symmetric pair goes into the book. WinBoard could for instance scan the left half of the board in a prescribed order (e.g. a horixontal raster scan starting at the lower left corner) until it finds a difference with the right half, and maps it such that the piece with the highest internal code is on the right. This test could then be used both when probing and when creating / editing the book, so that you can be sure the book would never accumulate any mirror images.

[Edit] Oops! The symmetry probing code is still wrong. I forgot to mirror the move it retrieves from a mirror image back to the proper orientation.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Fairy-Stockfish janggi (ponder Problem)

Postby janggi-korea » 16 Oct 2020, 12:34

thank you.
i will review and test the horizontal symmetry problem. (Practical)
The book-sym.bin file doesn't seem to be attached. Can't find There is only janggi_book.bin file.
Please upload it to my Google Drive. I set it up for editing.
I don't need to see all the movements of bilateral symmetry.
only check the opening in the current movement.. but symmetry can be guessed.

Anyway, I think I need a test. I'm not sure now.
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 16 Oct 2020, 13:23

If the book is not there, there must be a mixup of versions, and you will also not have the latest winboard.exe. I am sure the book-sym.bin is in the zip file, and that that zip file now is on my server. Unfortunately I did not update the version number of WinBoard, so you cannot check it from there. But perhaps you can see it from the 'last modified' date of the winboard.exe in the zip file: it should be today 11:22 Amsterdam time.

Perhaps your browser is still caching a previous version. Try to flush the browser cache.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Fairy-Stockfish janggi (ponder Problem)

Postby janggi-korea » 16 Oct 2020, 13:37

ok.. i got it
thanks

i will test tomorrow.
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby janggi-korea » 16 Oct 2020, 15:03

1. Mirror move has not yet been applied. Need to change current move back to mirror.
2. Only one default location has been restored in the opening book. There are no other 15 starting positions.
=> For this problem, I'll use 25,000 games.
My plan was to combine my analysis book and a 25000 game book.

but..I don't want,,, you to spend time on this problem right now.
Because first you have to make a decision with the engine developer about Protocol.

ps. New file "binpack.exe" What is this?
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 16 Oct 2020, 18:17

janggi-korea wrote:2. Only one default location has been restored in the opening book. There are no other 15 starting positions.


For me there are: If I start WinBoard in "View or edit games" mode, then switch it to Janggi through the New Variant menu, and open the Edit Book window, I see 4 opening moves for the opening position appear in it. If I then switch to Edit Position mode, and swap the white Horse and Elephant in the g- and h-file, and then switch back to Edit Game, I do see one move (ab3) in the Edit Book window for that alternative start position. So there are not as many moves, but they are there.

=> For this problem, I'll use 25,000 games.
My plan was to combine my analysis book and a 25000 game book.

Polyglot should be able to do that. That these are Janggi books should make no difference to it. That would only matter for operations that involve PGN. But I am not really an expert on Polyglot use for book creation.

ps. New file "binpack.exe" What is this?

Ah, I accidentally left that in. It is a small program I used to perform the final step of the book conversion: it reads a text file book3.dat, and interprets any 3 numbers on it as a (hexadecimal) hash key and decimal move code and weight. It then writes these on a file book.bin in binary format, 8 bytes for the key, 2 for the move and weight each, and 4 bytes of zero padding.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

PreviousNext

Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 6 guests