"aborting engine think"

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: "aborting engine think"

Postby janggi-korea » 14 Jan 2021, 10:42

Thank you very much for your kind answer.
I now understand everything correctly,
Learned how to use only one side book in a tournament.
And I made some mistakes in my stereotypes.
Because I thought the symmetrical position was always the same.
However, when I made a book, the left and right positions were not always the same.
In the end, when mirroring is applied, it is applied only when there is no movement in symmetry or when the movement is the same.

Thank you again.^_^

ps. Oh, and the janggi engine developer actually applies the 50 movement rule to determine the engine test win or loss.
However, for the average user, the 50 move rule in chess is not very meaningful.
janggi-korea
 
Posts: 127
Joined: 18 Aug 2020, 12:12

Re: "aborting engine think"

Postby H.G.Muller » 14 Jan 2021, 11:08

Well, in engine matches you have to put some limit, otherwise a single game could go on forever. The engine is already not very intelligent, and the game-playing software knows even less, so it cannot conclude by reasoning that it is impossible to force a win in a given position. It can just try to do its best to win, and when it nevertheless does not make any progress for a long time, accept that it must be a draw. Whether 'a long time' here should be 50 moves or some other number is of course debatable.

Simple cases of 'dead draws' can of course be recognized, and adjudicated draw on that bases. WinBoard has an option for that, where it rules end-games like King + Rook vs King + Rook as a draw. But what is a 'trivial draw' is very much variant dependent. And it would of course always be preferable when the engine would know what is a trivial draw; then it can adapt its strategy to that, and avoid converting a winning advantage to a seemingly larger but in practice drawing advantage. (The infamous case in Chess for this is KNPPKN, where white would trade the two Pawns for a Knight when it doesn't know that KNK is a dead draw, because normally a Knight is worth more than 2 Pawns.)

And no matter how much knowledge you put in the engine, there will always be complex positions (i.e. with many pieces) where no progress is possible, which are not covered by the rules. The only options then are to play on forever, or declare draw after a number of moves. (In some of the Janggi flavors of course 'draw' would mean applying the counting rule.)
User avatar
H.G.Muller
 
Posts: 3376
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "aborting engine think"

Postby janggi-korea » 15 Jan 2021, 10:03

Currently I am doing game judgments with centipawns and moves control.

janggi also has a combination of pieces for which draws are determined. (Data exist)
Could you please add some code to "adjudicate trivial draws" if I give you these data?
But janggi has an important point here. Even combinations of pieces can be drawn or beat depending on the position of the pieces.
So, when there are simply pieces left, the judgment immediately seems to have a problem.
Of course, if it is a combination of king and rock, there is no problem to judge immediately. The same goes for janggi. Combinations of King and Soldier can never be beat.
Another issue arises here.
What if it is a point system? janggi has a rule that judges by score when there are draws pieces .
So these parts also require additional code.
Does Winboard recognize the scores of pieces?
Personally, I think it would be nice to express the score on the Winboard.
Humans always care about the pieces score while playing janggi.

PS. Anyway, some seem to overlap with the janggi-EGTB implementation.

i will find the open source janggi code you can refer to.
Of course, it is difficult to find open source in most Korea.
When Korean developers access janggi, they mostly edit open xiangqi code.
janggi-korea
 
Posts: 127
Joined: 18 Aug 2020, 12:12

Re: "aborting engine think"

Postby H.G.Muller » 15 Jan 2021, 16:28

If it depends on the details of the position, it might not be trivial. In Chess WinBoard adjudicates the trivial draws only 3 moves after the latest capture, to avoid adjudicating while tactics is still in progress. E.g. K+R vs K+R is a trivial draw, but there do exist positions where one Rook can check, and the other is far behind the King on the same rank, and there a player still gets time to convert to K+R vs K. For K+Q vs K+Q this is already a problem; WinBoard considers it a trivial draw, but in reality there are some rare positions where one player can win, and it can take more than 10 moves to do gain the opponent Queen. So it is better to adjudicate such games based on EGT.

Having WinBoard display the points would be a form of computer help. Players are supposed to keep track of such things by themselves. Of course using an engine for analysis is intended to be computer help. So it would be more logical if the engine showed the point count. Then it can also make that dependent on whether you play a sub-variant where the point count matters.

A more serious problem is that there are two kinds of wins in Janggi. So new notation would have to be invented for results in PGN. I suppose we could do 2-0 for a checkmate, and 1-0 for a victory on points. Or we could just leave it to the 'result message' to make the distinction between a winning draw and a losing draw.
User avatar
H.G.Muller
 
Posts: 3376
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "aborting engine think"

Postby janggi-korea » 15 Jan 2021, 20:05

That's right, I thought the same thing as you.. Judging after at least 3 moves is objectivity.
Personally, I don't like the points rule. In all board games, the ultimate goal of catching the king is important. And that's how we win. Stockfish only thinks about the final checkmate. If the engine follows the scoring rules, the intensity of play will be very low. The rules of scoring are only intended to produce results in a Human-to-Human battle. If the stockfish gets smarter, it will be a hybrid that can catch the king with scores. But I think its implementation method will be very complicated.
Anyway, I'm talking about the Korean implementation of janggi coordinates and the compatibility of Korean janggi files (*.gib) to make Winboard more compatible with janggi. gib files are also in text format. The only difference from pgn is that it does not use FEN, and some are displayed in Korean or Chinese characters (e.g. the name of the piece). The way to distinguish between wins and losses in the file is simply marked as score win/time win/checkmate win.
1 move= only my 1 move (chess = me and you move)
The names of the pieces are can displayed in Korean depending on the printing method.

[대회명 "온라인 카장"] => Means Event
[회전 "미상"] Means Round
[대국일자 "2020.01~2020.06"] Means Date
[대국장소 "장기 for Kakao"] Means Site
[초대국자 "수희짱쨩 9단"] Means White
[한대국자 "정마노 9단"] Black White
[초차림 "상마상마"] Means White FEN
[한차림 "마상상마"] Means Black FEN
[제한시간 "5분"] Means TimeControl
[총수 "106"] Means move count
[대국결과 "한 시간승"] Means Result

1. 79卒78 2. 12馬33 3. 08馬87 4. 32包35 5. 88包85 6. 18馬37
7. 02象74 8. 45兵44 9. 71卒72 10. 33馬45 11. 09車69 12. 49兵59
13. 69車68 14. 19車49 15. 75卒76 16. 47兵48 17. 68車62 18. 11車31
19. 62車32 20. 35包55 21. 32車22장군 22. 14士24 23. 85包89 24. 59兵58
25. 07象79 26. 55包59 27. 03馬84 28. 31車33 29. 82包85장군 30. 38包35
31. 04士94 32. 44兵54 33. 89包86 34. 54兵64 35. 86包04 36. 43兵53
37. 95將05 38. 64兵65 39. 94士95 40. 48兵47 41. 06士96 42. 59包54
43. 04包09 44. 49車48 45. 09包03 46. 65兵64 47. 72卒62 48. 54包14
49. 76卒75 50. 45馬66 51. 77卒76 52. 66馬78卒 53. 73卒63 54. 64兵74象
55. 75卒74兵 56. 14包74卒 57. 03包53兵 58. 13象45 59. 53包83 60. 33車31
61. 01車71 62. 45象22車 63. 71車74包 64. 31車34 65. 74車75 66. 17象45
67. 75車71 68. 34車44 69. 83包23장군 70. 25將15 71. 23包03 72. 78馬57
73. 76卒75 74. 58兵68 75. 87馬66 76. 47兵46 77. 03包06 78. 68兵67
79. 06包04 80. 44車42 81. 85包82 82. 42車43 83. 66馬54 84. 35包55
85. 75卒65 86. 57馬65卒 87. 84馬65馬 88. 67兵66 89. 05將06 90. 66兵65馬
91. 71車77 92. 37馬58 93. 77車73 94. 43車23 95. 79象07 96. 22象54馬
97. 73車74 98. 45象22 99. 63卒64 100. 65兵64卒 101. 74車64兵 102. 58馬77
103. 07象75 104. 77馬56 105. 82包22象 106. 54象22包

Lastly, I want to talk about game time control. janggi usually has a full match time. And there is an extra countdown time. The additional countdown time is 3 times 30 seconds.
For example, if you have a 15 minute game and 3 countdowns, your opponent and I each have 5 minutes of free time, and when 5 minutes are exhausted, you have to move the piece once every 30 seconds. There are 3 chances.

To summarize, it is 5 minutes of free time in incremental time and a fixed time fer move per unit.
chess is the increment is added to the time after 5 minutes of use, but the difference is that janggi is immediately converted to "fixed time per move" (30 seconds 1 move x 3).

Chess is controlled by the number of moves, but janggi is controlled by the total playing time.
And when the total playing time is exhausted, the score determines the win or loss.
The 30 second countdown time does not exceed the total game time.


PS. Summary
1. Korean janggi coordinate display (E.g -fSAN)
2. Compatible with Korean text janggi file (gib file)
3. Trivial judgment after 3 move (data)
- A combination of clearly and concisely applicable pieces that can cover various janggi rules.
4. time contol (initial number of minutes + maxium seconds per move)

(And if you tell me how we can donate, I'll post it on my cafe.)
janggi-korea
 
Posts: 127
Joined: 18 Aug 2020, 12:12

Re: "aborting engine think"

Postby H.G.Muller » 16 Jan 2021, 11:16

I uploaded a new WinBoard-AA package, which should refrain from declaring stalemate in Janggi. (I did not test it, but it was a trivial change.)

I would in any case be interested to know what the minimum requirement is to force checkmate in a few simple situations:
Bare King - Obviously no single piece has mating potential, and having extra Advisers does not help. A Cannon can 'emulate' a frontal Rook attack by standing behind its King, even when you have no Advisers. With Rook + any other attacker it should be easy. (Put the Rook in center of the Palace, protected by the other piece). No other pair of pieces can do it? How about two Horses + Elephant, or two Elephants + Horse? I suppose that with a Pawn plus two others it is easy. (Move the Pawn to the center of the Palace, protected by one, while using the other piece to prevent the King can sneak behind the Pawn when you advance the latter.) Does BikJang make a difference for any of the combinations that could force a mate without it?

King + Advisers - Is a single defending Adviser enough to draw against any of the winning combinations above? If so, what extra would you need to overcome the adviser?

King + Pawns - Do extra Pawns have any defensive use? I suppose they do, against a Cannon. But not against other pieces. And only if you have at least two. And if the Cannon already is on the central file, even two (or more?) would be useless when they are on the same side of the central file.

I am not going to support specific local game formats in WinBoard for saving, or local move notations for displaying. I am also not going to support PGN dialects that translate the names of the FEN tags into other languages. The whole idea of having a standard format is that it should be uinterchangeable all over the World. In general the FEN tags are not needed anyway when loading a game. WinBoard will treat keep tags it does not recognize as they are.

For input it could be another matter; the format you show seems trivial to parse, and it doesn't seem to cause any ambiguity with move notations the parser already understands, because the piece name is written adjacent to the numbers, and should be recognizable as a non-ascii character. This also would not cause any overhead when reading normal SAN; when it encounters a number there it would normally test for and skip the following dot (because it would be a move number); if there is no dot (which in normal SAN would never be the case) it can then start checking whether a non-ascii character following, and conclude it must be Janggi notation.

The problem is how these characters are encoded, though. Are these two-byte codes from some Korean Windows code page? Is it Unicode, and if so, is it encoded as UTF-8 or otherwise?

I don't see the point of implementing other time controls. It is not like WinBoard is going to participate in an official tournaments. People will either use it to analyze their games, which is done without timing, or play against the engine. And in the latter case, if the engine is Stockfish, it will be way to strong for them anyway, unless they reduce its thinking time to almost nothing on every move. It will certainly not need extra 'countdowns', apart from the fact that it would not know how to decide when to use them, and that the engine communication protocol doesn't support any mechanism for it to request extra time. Just set the engine to 30 sec/move in your example. If the user wants extra time to mimic an official match, rather than use any of the supported time controls (and I don't see why this would be useful for him), he can either use his own clock, or he can add the extra minutes to his time on WinBoard clocks by clicking on it with Shift pressed, whenever he wants to use a countdown.

[Edit] On second thoughts, it seems that Pawn + Horse or Pawn + Elephant should also be able to force mate, because a Horse or Elephant can attack the Palace center and the corner in which the bare King could creep behind the Pawn at the same time.
User avatar
H.G.Muller
 
Posts: 3376
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "aborting engine think"

Postby janggi-korea » 16 Jan 2021, 18:30

I have created basic win-loss data (if an advisor is included). I plan to add more data.

Janggi is largely in the opening, middle-game, end-game. Every part is important.
If the initial opening is weak, will not be able to show strength in the mid-game battle.
In addition, it is common for people to lose in the final war if they are pushed out of the mid-war battle.
Even if you look at the actual battle, there are many cases in which the janggi who can win if it moves incorrectly in the end of the game is advantageous to the middle, or even win enough match does not know how to deal with it.
Therefore, it is necessary to accurately grasp which pieces win and draw and learn its multiplier and defense methods.

1. Daesamneung (大三能): A type of janggi when there are 3 large pieces left on either side when there are two advisors in pairs

2. Sosamneung (小三能): A janggi type consisting of a combination of a small piece (soldier) and a large piece on either side when there are two advisors in pairs.

3. Chaineung (車二能): A type of janggi when there are only two advisors and a king on one side, and the other side has a rook and large piece left, and is a rook/cannon, rook/horse, rook/elephant.
It is a representative type, but in principle, all three are pieces of draw.

4. Chasamneung (車三能): With only two advisors and a king on one side, the other side including rooks
There is also a janggi type where two other pieces remain, and most of them win.

★ Bikjang: When the kings are in the same vertical line, there should be no piece between them. It is a situation where the kings on both sides are facing each other.
Anyone whose turn to move can draw while capturing his opponent's king as his king. Therefore, those who want to win must move their king, taking into account the opponent's bikjang's tactics. On the contrary, a disadvantaged person can play bikjang to draw the match in order to get the opponent off guard.

★ Piece marks and scores
Rook = R (13 points)
JanggiCannon = C (7 points)
Soldier= P (2 points)
Horse = H (5 points)
JanggiElephant = E (3 points)
Wazir = A (3 points)
King = K

1) Daesamneung's type and decision to win or lose
Attack pieces / defense pieces / win-loss decision
- KAACCH / KAA / Attacker win
- KAACCE / KAA / Attacker win
- KAACHH / KAA / Attacker win
- KAACHE / KAA / Attacker win
- KAACEE / KAA / draw
- KAAHHE / KAA / draw
- KAAHEE / KAA / draw
★Notes★
If there is a cannon, it is a complete win, and if there is no cannon, it is a draw.
"CEE" has a cannon, but it is an exceptionally draw piece.
In practice, the "CEE" type sometimes appears.
It is a JANGGI type that has a very difficult way to win.

2) Sosamneung's type and decision to win or lose
Attack pieces / defense pieces / win-loss decision
- KAACCP / KAA / Attacker win
- KAACHP / KAA / draw
- KAACEP / KAA / draw
- KAAHHP / KAA / draw
- KAAHEP / KAA / draw
- KAAHHE / KAA / draw
- KAAEEP / KAA / draw
★Notes★
In principle draw.
Exceptionally, "CCP" is the win. In the old days when JANGGI research was incomplete, it was considered draw, but it was established as a win through the research of leading masters.
"CHP" is a draw, but player can see that it reacts so easily that it often loses.
Sosamneung' without a cannon is a draw, Even if low level, you can draw it without difficulty.

3) Chaineung's type and decision to win or lose
Attack pieces / defense pieces / win-loss decision
- KAARP / KAA / draw
- KAARH / KAA / draw
- KAARE / KAA / draw
★Notes★
Draw unconditionally.
Many people know that it is a piece that wins unilaterally, but in principle, type of piece "draw".
Especially in the case of "RH", it is the most difficult to defend among the three types.
Janggi player can see a lot of cases where lose by making a mistake.

4) Chasamneung's type and decision to win or lose
Attack pieces / defense pieces / win-loss decision
- KAARCC / KAA / Attacker win
- KAARCH / KAA / Attacker win
- KAARCE / KAA / Attacker win
- KAARHH / KAA / Attacker win
- KAARHE / KAA / Attacker win
- KAAREE / KAA / Attacker win
- KAARCP / KAA / Attacker win
- KAARHP / KAA / Attacker win
- KAAREP / KAA / Attacker win
- KAARPP / KAA / draw
★Notes★
In principle wins.
Pieces including Rook are pieces that easily win at a glance.
The exception to this is "RPP", which is a type of piece that is draw.
In the old days when janggi research was less, it was recognized as a win piece of "RPP"
In modern times, as a result of many studies by top experts,
It is a representative draw type.
"RPP" is a type of piece that comes out a lot, but it has a lot of change and defense As it is a very difficult high-level,
It is a JANGGI that is placed unilaterally from either side, so if take a pass or do something wrong, will lose.

PS. Windows (CR LF) ANSI Normal text file
Yes, pgn is an international standard.
I don't want to print korea janggi file on Winboard.( I just asked about the possibility of loading(Load game) Korean janggi files from Winboard.
janggi-korea
 
Posts: 127
Joined: 18 Aug 2020, 12:12

Re: "aborting engine think"

Postby H.G.Muller » 16 Jan 2021, 18:55

Very interesting. Do you also have such data for when the defender has only a single Advisor, or none at all?

And does the attacker really need his Advisors in any of these examples, or would those that are won also be won if only the defender had Advisors? And when that is the case, would one Advisor for the attacker not be enough (to shield his King from Bikjang)?

I suppose all this applies to the case where the BikJang rule is used. Does the attacker ever need any Advisors at all when the BikJang rule is not used? I suppose that without Cannons Advisors for the attacker have no use at all, if the BikJang rule doesn't apply. I am not sure you would need them even with Cannons, as the King can be used as a Cannon mount. (In Xiangqi that is pointless, as the King there acts as if it has a forward attack anyway.)

As to the understanding of the other move format: I would need a file from you that contains a game in that format, to see what codes are used for the various pieces. There is no guarantee I get the same as what you started with when I copy it from the forum, as we are on different 'locales', and the forum might convert text to UTF-8, while originally it was a Windows encoding.

[Edit] One more question: How can de game notation do without FEN, if the initial position is not fixed? Is the swapping of E and H indicated as a move?
User avatar
H.G.Muller
 
Posts: 3376
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "aborting engine think"

Postby H.G.Muller » 17 Jan 2021, 11:44

I uploaded a new version now, with a primitive parser for moves in Janggi notation. It ignores the piece names; it just assumes that any byte code > 127 is part of some encoding of a kanji, (which would certainly be true in UTF-8 encoding) and skips it. It just detects the presence of such codes between numbers to conclude it is a Janggi move, and then interprets the numbers. There is no legality checking.

I included a file janggi.gam, which contains the moves of the game you posted above, saved from NotePad in UTF-8 encoding. This game can be successfully loaded through the File -> Load Game menu. For some reason I don't understand, WinBoard ignores the first line of such files, though. (Probably there is some code there to indicate it is UTF-8 format, on which the parser chokes.) So I had to start with an empty line.

Pasting the game in WinBoard doesn't work for me; apparently the Windows cut/paste software converts all the non-ascii codes to question marks...
User avatar
H.G.Muller
 
Posts: 3376
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "aborting engine think"

Postby janggi-korea » 17 Jan 2021, 19:21

Defense pieces
one advisoror or no advisor -> lose

An attacker can win with just one advisor.
However, if a cannon is included, two advisors are required.
Because If there is one advisor, can't create a winning position.
In other words, from the attacker's point of view, if a cannon is included, two advisors are required.
e.g)
-KACCP / KAA / -> draw
-KCCP / KAA / -> draw

Attack pieces : If there is no cannon, for other pieces, even if there is only one advisor, it will win according to the rules above. (Defense bikjang)
* The case of winning pieces

ps.
First of all, the default starting position in the Korean janggi file should match the location of the Winboard FEN and the Korean janggi file.
Winboard must be able to recognize Korean fen.
So, I'll make rule these soon for you. (Korean language FEN <-> winboard FEN)
The coordinates, as you say, are fine if only the coordinates match, regardless of the display of the piece.

I can't figure out how the other starting positions were implemented. Because it is made for commercial use.
I think I'll have to give up loading other start positions.
Anyway, because the file name extension of the different starting location is different, it is easy to distinguish.
Please tell me your email address again (PM)
I will send you a file for reference
janggi-korea
 
Posts: 127
Joined: 18 Aug 2020, 12:12

Re: "aborting engine think"

Postby H.G.Muller » 17 Jan 2021, 20:36

janggi-korea wrote:Defense pieces
one advisoror or no advisor -> lose

Surely you will not lose against King + Pawn, even with no Advisor at all? I am not even sure you would lose against two Horses.

What about 'perpetual Bikjang'? Is this forbidden? E.g. in the position

9/4k4/9/9/9/p7p/9/9/9/3K5 w 0 1

When white plays Ke0, (BikJang) black must move his King, as the Pawns will always be too far away. Can white now keep repeating the BikJang forever, to prevent the Pawns can approach and checkmate him?

Anyway, because the file name extension of the different starting location is different, it is easy to distinguish.

You mean the start position is encoded in the extension? That has the disadvantage a file can only contain games for one position. And it would not help when you copy-paste a game. (For me that did not work, because Windows seems to remove all the non-ascii characters when I paste into WinBoard. But on a Korean computer it will perhaps work. Even if it always converts the piece names to question marks, I could still have WinBoard accept those as moves, as it doesn't really look at the piece names anyway. But it would be a problem if the start position is not known.)
User avatar
H.G.Muller
 
Posts: 3376
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "aborting engine think"

Postby janggi-korea » 18 Jan 2021, 05:44

Repetitive bikjang: Repetitive bikjang is prohibited in janggi competitions to keep the game running smoothly. So, the score Judgment win or loss. However, the original janggi rules allow this. In the FEN location you posted, you have no choice but to use bikjang over and over again. So in this case it is a draw.

When there is no advisor or one~2 advisor, the decision is as follows.
1. K(+A or AA)P / K(+A or AA) / draw
2. KPP / K / Win or draw depending on position (Defend Bikjang => win)
3. KPPP / K(+A) / Win or draw depending on position (Defend Bikjang => win)
4. KPPPP / K(+A) / Win or draw depending on position (Defend Bikjang => win)
5. KPPPPP / K(+A) / Win or draw depending on position (Defend Bikjang => win)

6. KA(+A)PP / K / Attacker win
7. KA(+A)PPP / K(+A) / Attacker win
8. KA(+A)PPPP / K(+A) / Attacker win
9. KA(+A)PPPPP / K(+A) / Attacker win

10. K(+A or AA)PP / KAA / draw
11. K(+A or AA)PPP / KAA / draw


When the stockfish janggi engine is unable to avoid bikjang, the score will determine the win or loss. Prohibit perpetual bikjang. (janggi variant)

And it draws when bikjang cannot be avoided. (janggitraditional variant)
janggi-korea
 
Posts: 127
Joined: 18 Aug 2020, 12:12

Re: "aborting engine think"

Postby H.G.Muller » 18 Jan 2021, 11:01

OK, I received your files. When I open the .gib file with NotePad, I get to see this:

Image

That looks like a file with multiple games, with moves in the expected format. When I tried to load it in WinBoard, it was considered as a single game, however. Because WinBoard did not recognize the things between brackets [] as PGN tags starting a new game when they contained non-ascii characters. When I replaced these all by question marks in the parser, WinBoard crashed; it turned out the code that interprets the PGN tags crashes if there isn't at least one ascii letter in the tag name. So now I replace all the non-ascii by the letter o instead. This worked. WinBoard can load the .gib file, shows a game list with many games, from which you can then select one to be loaded as the current game.

I uploaded a new WinBoard-AA that does this.

Remaining problems: the games do not specify a result. So they still cannot be used directly for creating a book.

Then the .pan file. This seems to have a completely different format. Opening it in NotePad shows me:

Image

I don't recognize any moves there. So I don't know what to do with that file.

[Edit] On second thoughts, the occurrence of the slashes suggest that this could be a collection of FENs with non-ascii names for the pieces and colors.
User avatar
H.G.Muller
 
Posts: 3376
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "aborting engine think"

Postby janggi-korea » 18 Jan 2021, 15:58

Thanks for the update.

There are two problems here.
1. PGN cannot display Korean.
- When loading a game with a previously written PGN, all of the Korean language is broken and displayed.
In addition, even if i create a new PGN, all of the Korean language is broken and displayed.

2. Currently, Winboard recognizes movement only in the default starting position.
-only -> rhea1aehr/4k4/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/4K4/RHEA1AEHR w 0 1
Pieces with different movements are also forced to move from the default starting position.
The currently referenced game list contains many different starting positions.
So, winboard need to be prepared to recognize the starting position of the game.

PS. The pan file has a different position on one horizontal line, and there is no movement.
The important point is that Winboard can recognize Korean coordinates, which is at least convenient in writing and editing pgn.
First of all, we must focus on the Korean language display.
Converted to UTF-8, ANSI, etc., but also could not display Korean.
janggi-korea
 
Posts: 127
Joined: 18 Aug 2020, 12:12

Re: "aborting engine think"

Postby H.G.Muller » 18 Jan 2021, 17:24

janggi-korea wrote:There are two problems here.
1. PGN cannot display Korean.
- When loading a game with a previously written PGN, all of the Korean language is broken and displayed.
In addition, even if i create a new PGN, all of the Korean language is broken and displayed.

I suppose you mean it is all replaced by strings of 'o'. As for creating new PGN: there is not supposed to be any Korean language in PGN created by WinBoard, as WinBoard will only save games in standard PGN format. I suppose that Korean language in the value of the tags (between the quotes) could be allowed, but tags should not have Korean names. My original plan was to ignore the tags completely, and only look at the moves. But it turned out that WinBoard does not see the moves in a file as different games when there isn't at least one PGN tag separating them.

This problem could be solved by recognizing a single tag that is always present (e.g. the Result tag), and have the parser translate it to a standard result tag before handing it to WinBoard for further processing. And simply ignore all the other tags.

2. Currently, Winboard recognizes movement only in the default starting position.
-only -> rhea1aehr/4k4/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/4K4/RHEA1AEHR w 0 1
Pieces with different movements are also forced to move from the default starting position.

Indeed, as I said there currently is no legality checking on the moves. I could make that, but it would just lead to the remaining part of the game being clipped off, as WinBoard doesn't read games beyond the first illegal move.

The currently referenced game list contains many different starting positions.
So, winboard need to be prepared to recognize the starting position of the game.

But how is that encoded in the games? I see nothing that could be a FEN in the Korean texts above the move lists in the .gib file.

PS. The pan file has a different position on one horizontal line, and there is no movement.
The important point is that Winboard can recognize Korean coordinates, which is at least convenient in writing and editing pgn.
First of all, we must focus on the Korean language display.
Converted to UTF-8, ANSI, etc., but also could not display Korean.

It would have no problem to display it, (e.g. in comments), but I intentionally remove it on input from the PGN tags, because WinBoard did not like tags with all-Korean names. When it was still thinking the tags were comments, the Korean displayed fine.
User avatar
H.G.Muller
 
Posts: 3376
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "aborting engine think"

Postby janggi-korea » 18 Jan 2021, 18:26

Of course, the standard PGN is written in English. However, the characters between the tags ""can be edited for convenience by Koreans. So the Korean between the tags "" should not be broken. Currently, the Korean language of the tag is not displayed.

about FEN
In the GIB file I sent, the Korean word for included between the tags.(mean FEN) Winboard can recognize it as a starting position. To do that, you need to know what FEN the Korean between the tags means.
So I can organize its data for you.
I will give it to you tomorrow. FEN DATA in Korean

First of all, please resolve the Korean language between tags"".
janggi-korea
 
Posts: 127
Joined: 18 Aug 2020, 12:12

Re: "aborting engine think"

Postby H.G.Muller » 18 Jan 2021, 21:30

Well, never mind, I figured out the encoding. I uploaded a new WinBoard-AA now, which recognizes the Result / White / Black and EH-placement tags. It converts the latter into Setup and FEN tags as required for PGN, and it leaves the value of White and Black untouched. (So that it stays Korean if it was Korean.) Only for the Result tag things might not be satisfactory: I just put 1-0 or 0-1 as a result depending on whether the first Korean character (actually the first half of the first Korean character) there says 'white' or not. All other Korean tags are discarded.

The whole thing is very fragile, as most tags are just recognized from one of their half-characters, and if the format isn't exactly as expected (e.g. if there would be extra spaces between name and value) it would fail miserably. But it reads the .gib file you sent me without problems. I can also copy-paste individual games in the file (after loading it into NotePad) to WinBoard. I cannot do that with games from the internet (like posted in this forum), because these are apparently copy-pasted as UTF-8, and not as plain text. (Of course for me Korean plain-text files, unlike UTF-8, show up as 'mojibake', but on your computer they probably look normal, and are the standard way of storing text.)

We just have to decide how we should handle draws or victory by count, and how to recognize that from the Korean tags.

As to the winning piece combinations: you showed what various numbers of Pawns would do against one or no defending Advisers, but not what other pieces do. E.g. what is the result for:

KAHH / K
KAEE / K
KAHE / K
KACP / KA
KRP / KA
...
User avatar
H.G.Muller
 
Posts: 3376
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: "aborting engine think"

Postby janggi-korea » 19 Jan 2021, 08:37

thank you. Works fine so far.

Please check your email for final confirmation.

For the final check, I have attached 2 of the same games to the gib file. And for tag recognition, the last game translated into English what the tags mean.
In addition, I also attached an encoding (Korean) which means a draw. (Recognize the rest of the tag)
If Winboard recognizes the meaning of the excluded tag and the draw, the Korean notation coordinates load is perfect.
It is perfect if the two games are displayed identically when loading the game from Winboard. (game list)

The recognition method of white win and black win is enough that currently applied to Winboard.


About the combinations of pieces that can win...
My janggi level is near master and grand master. So for some winning combinations I have to look up the data and refer to the book to confirm the win.
There are currently no organized internet resources available. However, I will keep updating it.
janggi-korea
 
Posts: 127
Joined: 18 Aug 2020, 12:12

Re: "aborting engine think"

Postby janggi-korea » 19 Jan 2021, 09:29

Attach additional data

KA(+A)HH / K / draw
KA(+A)EE / K / draw
KA(+A)HE / K / draw
KA(+A)CP / K / draw

* If the attacker does not have an advisor. Attacker wins even if advisor is added (1~2)
KPPH / KP / Attacker win
KPPH / K / Attacker win
KPHE / K / Attacker win
KHP / KP / Attacker win
KPHH/ K / Attacker win
KCPP / KA / Attacker win
KCPP / K / Attacker win

*Even if Attacker one more advisor, will eventually win.
KARCC / KCCP / Attacker win
KARR / KAAP / Attacker win
KARCC / KACC / Attacker win

KAARH / KAAP / Attacker win

* Even if Attacker one more advisor, it eventually draws.
KAHHE / KAA / draw
KAHEP / KAA / draw
KACEP / KAA / draw
KAHHP / KAA / draw
KAEEP / KAA / draw
KACHP / KAA / draw
KARE / KAA / draw
KARH / KAA / draw
KARPP / KAA / draw
KARP / KA / draw
KAEPP / KAA / draw

* Etc
KAACP / K / draw
KAAPP / KC / draw
KCCE / K / draw
KAEP / KC / draw
KAARC / KAAC / draw
janggi-korea
 
Posts: 127
Joined: 18 Aug 2020, 12:12

Re: "aborting engine think"

Postby H.G.Muller » 19 Jan 2021, 13:41

I uploaded a WinBoard-AA version that recognizes the draw result. The Event and Date tags are sort of useless; I never display those in the Game List. (You can control what is displayed there through the View -> Game List Tags menu.) PlyCount is not a standard tag anyway, and since it follows from the move list, it doesn't seem very useful.

There is the possibility to display the 'result message' in the Game List. Which is not a tag, but the comment next to the game result after the last move, in PGN. E.g. something like

{black resigns} 0-1

Now the Janggi format doesn't seem to have an equivalent, not even for the result (for which we are entirely dependent on the Result tag). It doesn't even indicate whether a move delivers checkmate (there seems to be a suffix that indicates checks, though). So during game load it cannot really see when a game ends in checkmate, or was resigned.

What happens to 'win by counting'? Are these stored as draws in this format?

I still have some questions about what you said earlier about the end-games:

Repetitive bikjang: Repetitive bikjang is prohibited in janggi competitions to keep the game running smoothly. So, the score Judgment win or loss. However, the original janggi rules allow this. In the FEN location you posted, you have no choice but to use bikjang over and over again. So in this case it is a draw.

The competition rule you referred to would be what Stockfish uses in 'variant janggi', right? And the 'original Janggi rules' would be variant janggitraditional? It seems there are that actually 6 rule flavors would be possible: you can ignore BikJang completely (variant janggicasual), and then the attacking player would never need any Advisers. Or you can recognize BikJang, and athen there still is the possibility to allow it perpetually, or forbid it just like perpetual checking is forbidden. (In fact BikJang can be considered a kind of delayed check, which becomes operational with a delay of one move.) And these three different treatments of BikJang can all be combined with material counting as tie breaker for draws.

I was a bit surprised by your remark that the judgement of whether KAARPP / KAA is a win or draw depended on the judgement of top experts. Surely that question should have been decided through an End-Game Table? As far as EGT go it doesn't seem that difficult: the defending KAA has 333 possible 'constellations' (9*8*7/2 = 252, plus 9*8 = 72 with single A and 9 with bare King, to which you can convert). The KAA of the attacker need not be considered. The attacking pieces can be confined to the last 5 board ranks, which they can always reach, and have no reason to ever leave once they are there. That makes for 45*45*45*333 ~30M positions. For comparison, a Chess 4-men end-game has 16M positions. And nowadays people do 7-men EGT for Chess. Even when the attacker has no Advisers, so that BikJang could be a concern, the role of the attacking King would be limited to the file it is on, and thus multiply the number of positions only by 3.
User avatar
H.G.Muller
 
Posts: 3376
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 10 guests