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 janggi-korea » 26 Oct 2020, 03:06

NO !, Hash can never give up. It has to do with strength. One of our goals is playing strength. Currently we can use the hash even if we run the new game. It couldn't be used before.
Previously, the hash was cleared after a new game.

As of now, I can use the hash even if I run it again after exiting Winboard. Right?
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 26 Oct 2020, 09:44

Not unless you mean something completely different with 'hash' than its usual meaning. When one talks about 'hash table' in a chess engine this usually refers to the 'Transposition Table', a large chunk of working memory used by the engine to shortly remember positions in the search tree it has already evaluated, but which might be reached again in the same tree by playing the same moves in another order, or moving a piece to the same destination through a different path. As this is in working memory, and not in a file on disk, the info will always be completely gone as soon as the program terminates.

If you refer to some other feature of Stockfish of which I am unaware (which is very possible, because I hardly know anything about Stockfish), which stores information on disk in a file, then it is of course possible for any instance of Stockfish started later to use that same information. That would then of course also apply when restarting Stockfish for a new game. A restart is a restart, and if Stockfish is programmed to load some file with useful information at startup, it will do that.

I have never seen such a file in the SF directory, though.
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 » 26 Oct 2020, 10:01

Well, when I tested it, I can definitely use the hash if I don't restart the winboard.
However, I'm not sure if I can use the hash if I restart after winboard shutdown. I thought it was possible.
Perhaps you are right. Because I am not familiar with FS code.
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 26 Oct 2020, 10:37

What do you mean by 'using the hash'?

As I said, engines use hash tables for speeding up the search, preventing they would have to search the same position multiple times. But even with today's memory sizes, the number of positions they search per second is so large that the table will be completely filled in a minute or so. After that anything they want to add must push some other position out of the table. To minimize the negative impact of that they preferably throw out positions which are no longer occurring in the search tree. After some pieces are traded, positions that still have those pieces on the board will never occur anymore, and are then flushed out of the table for storing positions that are relevant. At the end of the game there are no positions left in the table that would occur in a search of an opening position, which still nearly has all pieces.

So keeping the info in the table from one game to the next is completely pointless. Unless there were no pieces captured at all in the previous game.

Some engines have what they call "persistent hash", which is a file where info on positions that have been searched very thoroughly can be stored. This is a feature that can be useful in interactive analysis, where correspondence players sometimes spend days on analyzing one particular position to see what they should move. They can then switch off the computer, and continue later with the same position. But this is not more useful for increasing general playing strength as an opening book; it is in fact very similar; you could in theory make an opening book by making an engine searching the initial position, and storing its search tree.

Usually engines that support persistent hash then have an option where you can specify the name of that file. (So that you can use separate files for analyszing different positions.) I see no such option in Fairy-Stockfish.

BTW, I could not find anything suspect in the 'new' command. It doesn't refer to ponderMove at all, so it should make no difference whether that is cleared or not. This worries me a bit: it seems that the starting and stopping of ponder searches somehow leaves Stockfish in a corrupted state. And there is no knowing whether the corruption would affect the quality of the moves. I always dislike it when things happen for which I have no explanation.
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 » 26 Oct 2020, 12:26

OK got it. Thank you. Now I understand clearly about hash. I fixed the bug by adding your code. I will give up the hash.
Now we can fix the openingbook problem again.

ps. How much hash memory size in Winboard's for Best strength? Also, make sure the core and thread settings?
I use 16 ram 4 cores 8 threads.
I will upgrade my computer to do research with more accurately.
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 26 Oct 2020, 13:45

It depends entirely on your hardware, and how many copies of Stockfish you run simultaneously. It is in general unwise to use more than half your computer's memory for the total of all hash tables of all engines. Also note that the search speed (and thus playing strength) is only very weakly dependent on hash size; to double the speed (and gain some 50 Elo, typically), you need about 4000 times larger hash. And increasing hash size is not completely free even if you have the memory, because the CPU uses caches for the memory mapping, which start to overflow if too much memory is used in quick succession (which a hash table typically does). Which makes the individual memory accesses slower. Personally I always use 256MB for my engines, but I guess that by today's standard's that is much smaller than needed. But who cares about 5 or 10 Elo more or less; those are basically unmeasurably small differences, that you can only detect after tens of thousands of games.

As for the threads it depends on how many cores your CPU has. Nowadays all CPUs use 'hyper-threading', which doubles the number of 'virtual cores' compared to the number of 'physical cores'. So if you have a quad-core CPU, Windows will indicate 8 cores. Some people say you should not use more threads as you have physical cores, so that all cores can work at maximum speed. But others claim that letting one core do the work of 2 does make Stockfish a little bit stronger, and say you should use as many threads as you have virtual cores, minus 1. (The latter to keep some processing power for other tasks; making the engine very fast is not helpful if that leaves no computing power for entering moves.)

BTW, from discussions at GitHub I got the impression that the SF Janggi implementation is weak because of poor evaluation. This usually cannot be solved by speeding up the search. Actually it can backfire. The better you search, the more likely it becomes that the engine finds a clever way to realize a counter-productive goal, where it mis-evaluates it as being good, while in fact it is very bad (like keeping Cannons in the end-game rather than Pawns). Search (i.e. speed) is not the answer to 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 » 26 Oct 2020, 17:18

Okay. I understood correctly. Thanks.

I found 3 bug.

1. In three variations, if i double-click the "King", the "King" disappears, and the king can be moved in place regardless of the Test Legality check. (/variant=janggi is normal.)
/variant=janggimodern
/variant=janggicasual
/variant=janggitraditional

2. When I use "move now/Retract Move" the highlight dragging disappears and I can't move the piece. If I do movement by dragging with the mouse,(Forced movement) the game stop and the engine continue to run ponder.

3. Engine vs. Human When playing, sometimes the engine does not move and only pondering. And when I use the "edit game", the engine does not search for itself, it searches for my play movement.
I copied the FEN and started the game again. And the engine searched itself again normally.
Please check and solve it.

** Engine- "Hint / book" If i Use the menu the ponder stops. And I can't use Hint and Book.
But after that, i can start game and ponder normally again with one move.
I think this is probably because the stockfish engine doesn't support it. right?
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 27 Oct 2020, 13:24

janggi-korea wrote:1. In three variations, if i double-click the "King", the "King" disappears, and the king can be moved in place regardless of the Test Legality check.

I see. It appears that Stockfish internally encodes turn passes as a non-move of the King, so that the King itself gets highlighted when you select it. Such highlighting can be suppressed by changing (in xboard.cpp) the line
Code: Select all
              if (is_ok(from) && UCI::square(pos, from) == token)

to
Code: Select all
              if (is_ok(from) && UCI::square(pos, from) == token && from != to)

2. When I use "move now/Retract Move" the highlight dragging disappears and I can't move the piece. If I do movement by dragging with the mouse,(Forced movement) the game stop and the engine continue to run ponder.

The 'retract move' works through a CECP command "remove", and Stockfish apparently does not support that. You can add support for this by adding (in xboard.cpp, e.g. just before the comment "// Bughouse commands":
Code: Select all
  else if (token == "remove")
  {
      if (moveList.size() > 1)
      {
          if (pondeMove != "")
          {
              Threads.stop = true;
              Threads.main()->wait_for_search_finished();
              undo_move(pos, moveList, states); // take back ponder move
          }
          undo_move(pos, moveList, states);
          undo_move(pos, moveList, states);
      }
  }

3. Engine vs. Human When playing, sometimes the engine does not move and only pondering. And when I use the "edit game", the engine does not search for itself, it searches for my play movement.
I copied the FEN and started the game again. And the engine searched itself again normally.
Please check and solve it.

Hmm, this sounds like a bad problem. The engine is not supposed to search at all in 'Edit Game' mode. What you describe sounds like a failure to terminate the ponder search by a move that you entered. I cannot imagine now why that would happen. Can you make a debug log of a situation where it happens? If it is long, just post the last 2 or 3 searches of the log here.

** Engine- "Hint / book" If i Use the menu the ponder stops. And I can't use Hint and Book.
But after that, i can start game and ponder normally again with one move.
I think this is probably because the stockfish engine doesn't support it. right?

Hint and Book also use commands not supported by SF. 'Book' is for requesting the content of Stockfish' own opening book, but it does not have one. But it seems it would be best to recognize these commands (and perhaps a few others) as commands that should be ignored without disturbing the ponder search, even if they are meaningless to SF. (And Hint could simply print the ponder move, even when pondering is off.)

I will think of a patch to do this. For now, just don't use the commands.
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 » 27 Oct 2020, 15:25

1. Solved. thank you.

2-1. Retract Move: Solved.
2-2. move now: still I can't use highlight dragging after the engine moves. And the engine keeps pondering, ignoring any commands.(e.g edit game)

3. keeping ponder... and The engine stops when using the "edit game" mode. And I had to run the engine again. (machine WHITE/B). After that, the engine analyzed my movements.and engine does not move. Occurs very occasionally. I will make a debug file to make sure it is correct.
(Not sure currently. I'll check exactly.)


else if (token == "remove")
{
if (moveList.size() > 1)
{
if (ponderMove != "")
{
Threads.stop = true;
Threads.main()->wait_for_search_finished();
undo_move(pos, moveList, states); // take back ponder move
}
undo_move(pos, moveList, states);
undo_move(pos, moveList, states);
}
}
// Bughouse commands
else if (token == "partner")
Partner.parse_partner(is);
else if (token == "ptell")
{
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 28 Oct 2020, 10:51

'Move now' also works through a CECP command ('?') that Stockfish apparently does not implement.

I discovered a general flaw in the way Stockfish handles unknown commands in CECP; it handles those like they are moves, and when a move is illegal, it prints an 'Unknown command' error message, rather than 'Illegal move' even if it was a true move that happened to be illegal. Now that we added extra code in the move-processing part to handle pondering (to determine hit or miss) this flawed method has become even more undesirable, as unknown commands would be considered ponder misses.

To fix this, please replace the code (in xboard.cpp)

Code: Select all
  else
  {
      // process move string
      if (token == "usermove")
          is >> token;

by
Code: Select all
  else if (token == "usermove")
  {
      // process move string
      is >> token;

and the line
Code: Select all
          sync_cout << "Error (unknown command): " << token << sync_endl;

by
Code: Select all
          sync_cout << "Illegal move: " << token << sync_endl;

Finally, at the very end of the file, replace
Code: Select all
  }
}

} // namespace XBoard

by
Code: Select all
  } else
          sync_cout << "Error (unknown command): " << token << sync_endl;}

} // namespace XBoard

This should prevent unknown commands from aborting pondering. Illegal moves still would, but with legality testing on it should be impossible to enter legal moves. So at the moment I don't see a great need to fix that. (The solution would be to move the test whether the move was legal to before testing whether it is a ponder miss and aborting the ponder search. But this again would run into the problem that during pondering the wrong side is on move, so that any move would probably be considered illegal.)

If you do want 'move now' to work, you would have to add code to handle the '?' command, like:

Code: Select all
  else if (token == "?" && ponderMove == "" && !Options["UCI_AnalyseMode"])
{
          Threads.stop = true;
          Threads.main()->wait_for_search_finished();
}

e.g. before the "// Bughouse commands" comment again.
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 » 28 Oct 2020, 13:20

Thanks, I will test more about the problem of "Ponder" stopping during the game.

2-2. move now: Not resolved yet. After the engine moves, I still can't use highlight dragging, and if I force move => engine ignores all commands and only Ponder.

>> option Contempt=0
>> option UCI_Elo=2850
>> memory 1284
>> cores 7
>> new
>> random
<< Error (unknown command): random
>> variant janggimodern
<< setup (PH.R.AE..K.C.ph.r.ae..k.c.) 9x10+0_janggi rnba1abnr/4k4/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/4K4/RNBA1ABNR w - - 0 1
>> level 40 5 0
>> post
<< Error (unknown command): post
>> hard
>> ping 3
<< pong 3
>> accepted setboard
>> accepted usermove
>> accepted time
>> accepted memory
>> accepted smp
>> accepted colors
>> accepted draw
>> accepted highlight
>> accepted reuse
>> accepted name
>> accepted sigint
>> accepted ping
>> accepted myname
>> accepted variants
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted option
>> accepted done
>> lift a3
<< highlight 9/9/9/9/9/Y8/1Y7/9/9/9
>> put b3
>> time 30000
>> otim 30000
>> usermove a3b3
<< info string classical evaluation enabled
<< 1 32 0 261 1 130500 0 b9c7
<< 2 50 0 530 2 265000 0 b9c7 a0a1
<< 3 84 0 912 3 456000 0 b9c7 a0a1 b7e7
<< 4 116 0 1370 4 685000 0 b9c7 i0i1 b7e7
<< 5 148 0 2447 5 611750 0 b9c7 i0i1 i6h6
<< 6 38 1 15069 6 1076357 0 b9c7 b0c2 h9g7 e1d1 i9h9 h0g2
<< 7 67 1 15864 7 1057600 0 b9c7 b0c2 b7g7 i3h3 g6h6
<< 8 0 3 35548 12 1077212 0 i6h6 b0c2 b9c7 h0g2 h9g7 h2e2 h7e7 g3h3
<< 9 15 6 68724 12 996000 0 b9c7 h0g2 h9g7 h2e2 h7e7 b0c2 c6d6
<< 10 21 13 123999 12 932323 0 h9g7 h0g2 i6h6 h2e2 c6d6 c3c4 h7e7 e1e0 g9i6 g3f3
<< 11 13 25 239808 18 955410 0 b9c7 h0g2 h9g7 i3h3 e8e9 e1e0 d9e8 b0c2 c6d6 f0e1 b7d7 e0f0 g6f6
<< 12 13 26 249653 13 952874 0 b9c7 h0g2 h9g7 i3h3 e8e9 e1e0 d9e8 b0c2 c6d6 f0e1 b7d7 e0f0 g6f6
<< 13 16 54 521985 18 961298 0 b9c7 i3h3 h9g7 h0g2 e8e9 e1e0 f9e8 b0c2 h7e7 d0e1 g6f6 @@@@ e7i7 i0h0
<< 14 13 80 768303 20 960378 0 i6h6 h0g2 b9c7 b0c2 h9g7 h2e2 h7e7 a0a4 b7d7 a4c4 e6d6 b2b4 e8d8 g3f3 d9e8
<< 15 23 100 966534 19 961725 0 b9c7 b0c2 e8e9 i3h3 h9g7 e1e0 f9e8 h0g2 h7e7 c3d3 b7d7 d0e1 g6f6 h2h7
<< 16 17 164 1567799 23 953069 0 b9c7 i3h3 e8e9 h0g2 h9g7 e1e0 f9e8 b0c2 h7e7 d0e1 c6d6 h2e2 i9i8 c3d3 g6f6 i0h0 i8f8 b2b4
<< 17 20 233 2196018 22 940881 0 i6h6 h0g2 b9c7 b0c2 h9g7 h2f2 e8e9 e1e0 c6d6 f0e1 i9i5 e3f3 d9e8 a0a4 b7e7 c0e3
<< 18 20 287 2701530 23 939009 0 i6h6 h0g2 b9c7 b0c2 h9g7 h2f2 e8e9 e1e0 c6d6 d0e1 a6a5 g3f3 f9e8 c3c4 h7e7 c4c5 b7d7 b2b8 d9d8
<< 19 21 341 3192344 25 935348 0 i6h6 h0g2 b9c7 b0c2 h9g7 e3f3 e8e9 g0e3 c6d6 a0a4 a6a5 a4c4 d9e8 e1e0 g6f6 f0e1 a9a8 i0f0 a8c8 h2f2 h7h2
>> ?
<< 20 21 354 3311876 25 934766 0 i6h6 h0g2 b9c7 b0c2 h9g7 e3f3 e8e9 g0e3 c6d6 a0a4 a6a5 a4c4 d9e8 e1e0 g6f6 f0e1 a9a8 i0f0 a8c8 h2f2 h7h2
<< feature GOTMOVE=1
<< move i6h6
<< Hint: h0g2
<< info string classical evaluation enabled
<< 1 12 0 295 1 295000 0 b9c7
<< 2 24 0 638 2 638000 0 b9c7 b0c2
<< 3 24 0 1027 3 513500 0 b9c7 b0c2 h9g7
<< 4 12 0 1774 4 887000 0 b9c7 e1e0 b7g7 h2e2
<< 5 12 0 2211 5 1105500 0 b9c7 e1e0 b7g7 h2e2 g7a7
<< 6 12 0 2711 6 1355500 0 b9c7 e1e0 b7g7 h2e2 g7a7 b0a2
<< 7 12 0 3276 7 1092000 0 b9c7 e1e0 b7g7 h2e2 g7a7 b0a2 h9g7
<< 8 12 0 4042 9 1347333 0 b9c7 e1e0 b7g7 h2e2 g7a7 b0a2 h9g7 b2b7 h7e7
>> rejected GOTMOVE
<< 9 25 0 5571 13 1392750 0 b9c7 e1e0 b7g7 h2e2 g7a7 b0a2 h9g7 b2b7
<< 10 16 0 8948 12 1491333 0 b9c7 b0c2 h9g7 e3f3 e8e9 g0e3 b7e7 h2f2 d9e8 e1f1 e7a7
<< 11 23 1 19705 13 1515769 0 b9c7 b0c2 h9g7 e3f3 e8e9 g0e3 b7e7 h2f2 d9e8 e1f1 e7a7 a0b0 a6b6
<< 12 20 1 25770 17 1431666 0 b9c7 b0c2 h9g7 e3f3 e8e9 g0e3 b7e7 h2f2 e7a7 a0b0 a6b6 b2e2 d9e8 e3g6 h6g6 i0g0
<< 13 20 2 29341 17 1333681 0 b9c7 b0c2 h9g7 e3f3 e8e9 g0e3 b7e7 h2f2 e7a7 a0b0 a6b6 e1f1 a7e7 d0e1 d9e8 b0b1 a9a2
<< 14 21 6 73161 19 1143140 0 b9c7 b0c2 h9g7 e1e0 e8e9 f0e1 f9e8 g3f3 c6d6 a0a4 a6a5 a4c4 i9i5
<< 15 17 32 304400 19 948286 0 b9c7 b0c2 h9g7 e3f3 e8e9 g0e3 c6d6 a0a4 a6a5 a4f4 a9a8 e1f1 d9e8 f0e1 b7e7
<< 16 28 63 601580 21 947370 0 b9c7 b0c2 h9g7 e3f3 e8e9 e1f1 f9e8 g0e3 e6d6 h2f2 g9e6 b2e2 b7e7 f0e1 e6g3 e3c6 d6c6 c0e3 c9e6 e3c6
<< 17 26 135 1239210 22 915898 0 b9c7 b0c2 h9g7 e1e0 e8e9 f0e1 c6d6 g3f3 d9e8 i0i1 a6a5 f3f4 h7e7 e3e4 e7i7 i1h1 i7i0 h2h0 b7e7
<< 18 17 163 1485191 22 908929 0 b9c7 b0c2 h9g7 e1e0 e8e9 f0e1 c6d6 g3f3 d9e8 i0i1 a6a5 a0a1 i9i5 i3i4 i5g5 i4h4 b7e7 i1i9
>> lift h0
<< highlight 9/9/9/9/9/9/9/9/9/9
<< 19 18 271 2452358 22 904929 0 b9c7 b0c2 h9g7 e3f3 e8e9 g0e3 b7e7 h2f2 e7a7 a0b0 c6b6 b2e2 a7e7 e1e0 d9e8 e2a2 e7a7 b0b1 h7e7 f0e1
<< 20 26 346 3122435 26 900356 0 b9c7
>> lift h0
<< highlight 9/9/9/9/9/9/9/9/9/9
<< 20 24 373 3351985 26 898655 0 b9c7 h2e2 h9g7 b0c2 e8e9 e1e0 d9e8 e2i2 i9h9 i3h3 c6d6 f0e1 h7f7 i2e2 g6f6 c3d3 b7e7 i0i3 a9a7 d0d1 f7d9 b2b4
>> put g2
>> time 29645
>> otim 29346
>> usermove h0g2
<< Illegal move: h0g2
<< 21 24 760 6724726 26 884250 0 b9c7 h2e2 h9g7 b0c2 e8e9 e1e0 b7e7 f0e1 d9e8 a0a4 i9i5 e3f3 e6d6 i3i4 i5c5 b2b8 g9e6 b8g8 f9f8 g0e3
<< 22 21 1014 8906687 27 877679 0 b9c7 e1e0 b7e7 a0a4 h9g7 f0e1 e8e9 b0c2 d9e8 h2f2 h7f7 d0d1 f9f8 f2d0 e6d6 i3i4 f7d9 b2e2 c7e6 g3f3 e7i7
<< 23 18 1844 16077522 27 871504 0 h9g7 e1e0 b9c7 f0e1 e8e9 g3f3 d9e8 i3i4 b7e7 a0a1 g6g5 b0c2 a9a7 b2e2 h7h5 h2f2 c6d6 a1d1 h5c5
<< 24 19 2294 19891770 29 866819 0 h9g7 e1e0 b9c7 f0e1 e8e9 a0a4 b7e7 b0c2 d9e8 i3i4 h7f7 g3f3 a9a7 b2e2 c6d6 h2f2 f9f8 d0d1 f7f9 i0i3 d6d5 a4c4 e6e5 f2d0
<< 25 27 3115 26829341 31 861129 0 b9c7
<< 25 25 3220 27777791 31 862610 0 h9g7 e1e0 b9c7 f0e1 e8e9 a0a4 d9e8 b0c2 b7e7 g3f3 f9f8 i3i4 h7f7 h2f2 a6a5 a4b4 c6d6 b2e2 f7f9 b4c4 a9a7 d0d1 a5b5 f2d0
<< 26 22 4217 36267983 30 860042 0 b9c7 e1e0 h9g7 f0e1 e8e9 a0a4 d9e8 b0c2 b7e7 i3i4 h7f7 h2e2 a9a7 g3f3 c6d6 a4c4 i9i8 b2d2 f7d9 d0d1 a6b6 i4i5 b6c6 d2f0 g6g5 i0i3 a7a0
<< 27 24 4596 39561297 32 860664 0 b9c7 e1e0 h9g7 f0e1 e8e9 a0a4 d9e8 b0c2 b7e7 b2d2 a9a7 i3i4 h7f7 g3f3 g6g5 h2e2 h6h5 d0d1 f9f8 g0i3 a6b6 a4a7 e7a7 i4h4 h5h4 g2h4 i9h9
<< 28 20 5972 51459869 31 861671 0 b9c7 e1e0 h9g7 f0e1 e8e9 a0a4 d9e8 b0c2 b7e7 b2d2 h7f7 d2f0 a9a7 h2e2 f9f8 d0d1 f7f9 i0i1 h6h5 g3f3 c6d6 a4i4 g6g5 i4i9 f9i9 i1h1
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 28 Oct 2020, 13:59

I don't understand what happens here:

The ? command aborts the search, as intended, and the search thread prints a "feature GOTMOVE=1" as a result. So far so good. But then, after having processed the ? command, the input thread is supposed to wait until it gets a new command before doing anything. (In this case, wait for the "rejected GOTMOVE" response of the GUI, which would prompt it t send the move.) But instead it sends the move and starts a new ponder search immediately. Then, when the "rejected GOTMOVE" arrives, it tries to do that again, and this causes the trouble. It seems SF prceives a spurious input command after '?'.

To get a better idea of what is going on here, can you put an extra statement
Code: Select all
 sync_cout << "# command: '" << token << "'" << sync_endl;

directly after
Code: Select all
void StateMachine::process_command(Position& pos, std::string token, std::istringstream& is, StateListPtr& states) {

and then repeat this test, so we can see which mysterious command SF imagines that wrecks things.
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 » 28 Oct 2020, 14:12

edit..

ok.. i see
I added a line like this.
void StateMachine::process_command(Position& pos, std::string token, std::istringstream& is, StateListPtr& states) {
sync_cout << "# command: '" << token << "'" << sync_endl;


I did upload 1028.exe/xboard.cpp to google drive.

for solution I suggest to you (simple).
How about stop the "ponder" for a while when using "now move"?
This is because the ponder works normally when not in use.

>> lift a3
<< # command: 'lift'
<< highlight 9/9/9/9/9/Y8/1Y7/9/9/9
>> put b3
<< # command: 'put'
>> time 30000
<< # command: 'time'
>> otim 30000
<< # command: 'otim'
>> usermove a3b3
<< # command: 'usermove'
<< info string classical evaluation enabled
<< 1 32 0 279 1 139500 0 b9c7
<< 2 50 0 567 2 283500 0 b9c7 a0a1
<< 3 84 0 757 3 378500 0 b9c7 a0a1 b7e7
<< 4 116 0 1213 4 404333 0 b9c7 i0i1 b7e7
<< 5 148 0 2305 5 576250 0 b9c7 i0i1 i6h6
<< 6 162 0 5463 6 780428 0 b9c7 i3h3 b7g7 i0i2 g6h6
<< 7 38 1 16014 7 1067600 0 h9g7 b0c2 b9c7 h0g2 h7e7 e1d1 i9h9
<< 8 18 2 23842 8 1083727 0 b9c7 h0g2 h9g7 b0c2 h7e7 h2e2 i9h9 e1e0 c6d6
<< 9 32 4 47493 13 989437 0 b9c7 b0c2 b7e7 a0a4 e6d6 b2e2 g9e6 a4b4 h9g7
<< 10 9 8 77731 12 959641 0 b9c7 b0c2 h9g7 h0g2 b7e7 b2e2 e7a7 c0a3 a7a4 a0b0 h7e7
<< 11 6 21 198870 15 920694 0 b9c7 h0g2 h9g7 b0c2 b7e7 g3f3 e8e9 e1e0 i6h6 h2f2 e7a7 a0b0
<< 12 12 26 250355 13 930687 0 b9c7 b0c2 i6h6 h0g2 h9g7 g3f3 e8e9 h2f2 d9e8 e1e0 g6f6 d0e1 c6d6
<< 13 16 36 338527 15 940352 0 b9c7 h0g2 i6h6 b0c2 h9g7 g3f3 e8e9 h2f2 c6d6 e1f1 d9e8 f0e1 i9i5
<< 14 16 48 463201 17 949182 0 b9c7 h0g2 h9g7 b0c2 i6h6 g3f3 e8e9 h2f2 c6d6 e1f1 d9e8 f0e1 b7d7
<< 15 8 92 883456 18 953026 0 b9c7 h0g2 e8e9 i3h3 b7e7 b0c2 h9g7 e1e0 h7f7 a0a4 f7i7 i0h0 i6h6 f0e1 f9e8 h2e2 c6d6
<< 16 13 146 1343876 21 919832 0 i6h6 h0g2 b9c7 e1e0 h9g7 d0e1 e8e9 b0c2 d9e8 g3f3 c6d6 a0a4 a9a7 c3d3 b7e7
<< 17 21 183 1700932 19 927949 0 i6h6 h0g2 b9c7 e1e0 h9g7 d0e1 e8e9 b0c2 f9e8 h2f2 b7d7 a0a4 h7e7 i0h0 d7a7 a4f4 a7a0 f2d0
<< 18 14 234 2181272 24 929387 0 i6h6 h0g2 b9c7 e1e0 h9g7 h2e2 e8e9 b0c2 d9e8 b2d2 c6d6 f0e1 i9i5 d2f0 b7e7 g3f3 h7h2
<< 19 25 297 2760864 23 929583 0 i6h6 h0g2 b9c7 e1e0 h9g7 b0c2 e8e9 f0e1 d9e8 e3f3 e6d6 c0e3 c9e6 d0d1 i9i8 h2f2 b7d7 e3c6
<< 20 16 324 3017626 24 929072 0 i6h6 h0g2
<< 20 15 372 3474413 27 931977 0 i6h6 h0g2 h9g7 e1e0 b9c7 h2e2 e8e9 b0c2 d9e8 f0e1 h7e7 e2i2 i9h9 g3f3 e6d6 i2e2 c9e6 b2d2 f9f8 d2f0 b7b2 a0a4 a9a7
>> ?
<< # command: '?'
<< 21 15 389 3628806 27 931657 0 i6h6 h0g2 h9g7 e1e0 b9c7 h2e2 e8e9 b0c2 d9e8 f0e1 h7e7 e2i2 i9h9 g3f3 e6d6 i2e2 c9e6 b2d2 f9f8 d2f0 b7b2 a0a4 a9a7
<< feature GOTMOVE=1
<< move i6h6
<< Hint: h0g2
<< info string classical evaluation enabled
<< 1 17 0 327 1 327000 0 h9g7
<< 2 17 0 668 2 334000 0 h9g7 e1e0
<< 3 17 0 1012 3 506000 0 h9g7 e1e0 b9c7
<< 4 16 0 1398 4 699000 0 h9g7 e1e0 b9c7 f0e1
<< 5 15 0 1804 5 902000 0 h9g7 e1e0 b9c7 f0e1 e8e9
<< 6 15 0 2611 6 1305500 0 h9g7 e1e0 b9c7 f0e1 e8e9 b0c2
<< 7 15 0 3294 7 1098000 0 h9g7 e1e0 b9c7 f0e1 e8e9 b0c2 d9e8
<< 8 15 0 4076 8 1358666 0 h9g7 e1e0 b9c7 f0e1 e8e9 b0c2 d9e8 h2e2
>> rejected GOTMOVE
<< # command: 'rejected'
<< 9 21 0 5952 10 1488000 0 h9g7 e1e0 b9c7 a0a4 e8e9 b0c2 d9e8 g3f3 i9i5 f0e1
<< 10 15 0 7124 12 1424800 0 h9g7 e1e0 b9c7 f0e1 e8e9 b0c2 d9e8 h2e2 b7e7 e2i2 i9h9 i3h3
<< 11 15 0 8492 13 1415333 0 h9g7 e1e0 b9c7 f0e1 e8e9 b0c2 d9e8 h2e2 b7e7 e2i2 i9h9 i3h3 e7a7
<< 12 15 0 10344 15 1477714 0 h9g7 e1e0 b9c7 f0e1 e8e9 b0c2 d9e8 h2e2 b7e7 e2i2 i9h9 i3h3 e7a7 a0b0 c6b6
<< 13 22 1 21514 19 1434266 0 h9g7 e1e0 b9c7 d0e1 e8e9 b0c2 d9e8 h2f2 b7e7 f0f1 c6d6 g3f3 e7a7 a0b0
<< 14 15 7 76205 21 1088642 0 h9g7 e1e0 b9c7 f0e1 e8e9 b0c2 d9e8 h2e2 b7e7 b2d2 e7a7 a0b0 i9i5 d2f0 c6d6 e3f3 a7e7 g2e3 h7h1
<< 15 20 14 142192 21 954308 0 h9g7 e1e0 b9c7 f0e1 e8e9 b0c2 d9e8 h2e2 i9i5 a0a4 a6a5 a4f4 c6d6 f4f1 a5b5 b2d2
<< 16 18 30 270293 24 880433 0 h9g7 e1e0 e8e9 f0e1 b9c7 b0c2 d9e8 h2e2 e6d6 e2i2 i9h9 i3h3 h7f7 i2e2 c9e6 e3f3 b7e7 b2d2
<< 17 15 42 386803 22 903745 0 h9g7 e1e0 e8e9 f0e1 b9c7 b0c2 d9e8 h2e2 i9i5 a0a4 b7e7 b2d2 c6d6 d2f0 h7f7 a4c4 a9a7 g3f3 i5g5 i0i2 f7d9
<< 18 18 83 761223 23 913833 0 h9g7 e1e0 e8e9 f0e1 d9e8 b0c2 b9c7 h2e2 i9i5 i0i2 h7e7 a0a4 b7d7 g3f3 a9a7 b2d2 c6d6 a4f4 i5g5
<< 19 15 161 1484426 22 918580 0 h9g7 e1e0 e8e9 b0c2 d9e8 h2e2 b9c7 f0e1 f9f8 a0a4 b7d7 g3f3 h7e7 e2i2 i9h9 i0i1 c6d6 a4c4 a9a7 b2b8
>> lift h0
<< # command: 'lift'
<< highlight 9/9/9/9/9/9/9/9/9/9
<< 20 27 309 2853547 23 923179 0 h9g7 h2e2 b9c7 b0c2 e8e9 e1e0 d9e8 f0e1 b7e7 a0a4 h7f7 b2d2 f9f8 d0d1 e6d6 g3f3 i9i5 i0i2 i5d5 i3h3
<< 21 19 514 4689501 24 911467 0 h9g7 h2e2
>> lift h0
<< # command: 'lift'
<< highlight 9/9/9/9/9/9/9/9/9/9
>> lift h0
<< # command: 'lift'
<< highlight 9/9/9/9/9/9/9/9/9/9
>> put g2
<< # command: 'put'
>> time 29610
<< # command: 'time'
>> otim 29185
<< # command: 'otim'
>> usermove h0g2
<< # command: 'usermove'
<< Illegal move: h0g2
<< 21 27 876 7844876 28 895329 0 h9g7
<< 21 24 934 8353915 28 893849 0 h9g7 e1e0 b9c7 f0e1 b7e7 b0c2 e8e9 d0d1 c6d6 g3f3 i9i5 i3i4 i5d5 i4h4 h7f7 a0a4 d9e8 h2f2 f7d9 a4c4
<< 22 21 1925 17105140 26 888301 0 h9g7 e1e0 b9c7 f0e1 b7e7 b0c2 e8e9 d0d1 c6d6 h2e2 d9e8 i0i2 i9i5 b2d2 h7f7 g3f3 f9f8 a0a4 a9a7 a4c4 i5g5 i3h3 f7f9
<< 23 13 2252 19943243 15 885579 0 h9g7 h2c2
<< 23 21 2320 20522516 15 884286 0 h9g7
<< 23 22 3862 33942625 29 878727 0 h9g7 e1e0 b9c7 h2e2 e8e9 f0e1 d9e8 a0a4 b7e7 b0c2 i9i5 b2d2 f9f8 d2f0 h7f7 i3h3 i5i0 f0i0 a6a5 a4c4 e6d6 i0f0 f7d9 d0d1
<< 24 22 3941 34655822 27 879276 0 h9g7 e1e0 b9c7 h2e2 e8e9 f0e1 d9e8 a0a4 b7e7 b0c2 h7f7 b2d2 c6d6 d0d1 i9i5 d2d0 f9f8 i3i4 i5g5 e3f3 a9a7 g0e3 f7d9 i0i3
<< 25 21 4083 35922651 29 879702 0 h9g7 e1e0 b9c7 h2e2 e8e9 f0e1 d9e8 a0a4 b7e7 b0c2 h7f7 b2d2 f9f8 d0d1 f7d9 i0i1 a9a7 d2f0 c6d6 f0d0 i9i5 i1f1 d9f9 e3f3 i5b5




>> option Contempt=0
<< # command: 'option'
>> option UCI_Elo=2850
<< # command: 'option'
>> memory 1284
<< # command: 'memory'
>> cores 7
<< # command: 'cores'
>> new
<< # command: 'new'
>> random
<< # command: 'random'
<< Error (unknown command): random
>> variant janggimodern
<< # command: 'variant'
<< setup (PH.R.AE..K.C.ph.r.ae..k.c.) 9x10+0_janggi rnba1abnr/4k4/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/4K4/RNBA1ABNR w - - 0 1
>> level 40 5 0
<< # command: 'level'
>> post
<< # command: 'post'
<< Error (unknown command): post
>> hard
<< # command: 'hard'
>> ping 2
<< # command: 'ping'
<< pong 2
>> accepted setboard
<< # command: 'accepted'
>> accepted usermove
<< # command: 'accepted'
>> accepted time
<< # command: 'accepted'
>> accepted memory
<< # command: 'accepted'
>> accepted smp
<< # command: 'accepted'
>> accepted colors
<< # command: 'accepted'
>> accepted draw
<< # command: 'accepted'
>> accepted highlight
<< # command: 'accepted'
>> accepted reuse
<< # command: 'accepted'
>> accepted name
<< # command: 'accepted'
>> accepted sigint
<< # command: 'accepted'
>> accepted ping
<< # command: 'accepted'
>> accepted myname
<< # command: 'accepted'
>> accepted variants
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted done
<< # command: 'accepted'
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 28 Oct 2020, 15:15

This is weird. After it received the '?' and stopping the search, it sends a move without passing the output command we just added. While the only place where it would print a move is ner the top of the routine, after that output command. There should be no way execution should be able to reach the code that prints the move from the point where it stopped the search without passing that print command. But it apparently does, as nothing gets printed.

Can you post the program code of the routine process_command we are using here, everything from the line
Code: Select all
void StateMachine::process_command(Position& pos, std::string token, std::istringstream& is, StateListPtr& states) {

to the end of the xboard.cpp file?
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 » 28 Oct 2020, 15:25

The ponder stopped again during the game. You need to check the debug file. I used "edit game" to recreate the game, but it marked illegal moves.







>> option Contempt=0
<< # command: 'option'
>> option UCI_Elo=2850
<< # command: 'option'
>> memory 1284
<< # command: 'memory'
>> cores 7
<< # command: 'cores'
>> new
<< # command: 'new'
>> random
<< # command: 'random'
<< Error (unknown command): random
>> variant janggimodern
<< # command: 'variant'
<< setup (PH.R.AE..K.C.ph.r.ae..k.c.) 9x10+0_janggi rnba1abnr/4k4/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/4K4/RNBA1ABNR w - - 0 1
>> level 30 5 0
<< # command: 'level'
>> post
<< # command: 'post'
<< Error (unknown command): post
>> hard
<< # command: 'hard'
>> ping 4
<< # command: 'ping'
<< pong 4
>> force
<< # command: 'force'
>> setboard rhea1aehr/4k4/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/4K4/REHA1AEHR w 0 1
<< # command: 'setboard'
>> usermove i3h3
<< # command: 'usermove'
>> usermove h9g7
<< # command: 'usermove'
>> usermove h0g2
<< # command: 'usermove'
>> usermove h7e7
<< # command: 'usermove'
>> usermove h2e2
<< # command: 'usermove'
>> usermove e7e5
<< # command: 'usermove'
>> usermove i0i4
<< # command: 'usermove'
>> usermove b7i7
<< # command: 'usermove'
>> usermove i4c4
<< # command: 'usermove'
>> usermove a6b6
<< # command: 'usermove'
>> usermove b0d3
<< # command: 'usermove'
>> usermove i7a7
<< # command: 'usermove'
>> usermove a0b0
<< # command: 'usermove'
>> usermove c9a6
<< # command: 'usermove'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> time 24756
<< # command: 'time'
>> otim 24589
<< # command: 'otim'
>> go
<< # command: 'go'
>> accepted setboard
<< # command: 'accepted'
<< info string classical evaluation enabled
<< feature GOTMOVE=1
<< move a9a7
>> accepted usermove
<< # command: 'accepted'
>> accepted time
<< # command: 'accepted'
>> accepted memory
<< # command: 'accepted'
>> accepted smp
<< # command: 'accepted'
>> accepted colors
<< # command: 'accepted'
>> accepted draw
<< # command: 'accepted'
>> accepted highlight
<< # command: 'accepted'
>> accepted reuse
<< # command: 'accepted'
>> accepted name
<< # command: 'accepted'
>> accepted sigint
<< # command: 'accepted'
>> accepted ping
<< # command: 'accepted'
>> accepted myname
<< # command: 'accepted'
>> accepted variants
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted done
<< # command: 'accepted'
>> rejected GOTMOVE
<< # command: 'rejected'
>> force
<< # command: 'force'
>> ping 5
<< # command: 'ping'
<< pong 5
>> time 24756
<< # command: 'time'
>> otim 24589
<< # command: 'otim'
>> go
<< # command: 'go'
<< info string classical evaluation enabled
<< 1 120 0 285 1 142500 0 c0d2
<< 2 144 0 466 2 233000 0 c0d2 @@@@
<< 3 168 0 849 3 283000 0 c0d2 i9i8 b2e2
<< 4 155 0 1651 4 412750 0 c0d2 a6b6 b2e2 i9i8
<< 5 186 0 2647 5 529400 0 c0d2 a6b6 b2g2
<< 6 68 1 10247 7 853916 0 c0d2 b9c7 b2g2 b7e7 g2g4 e6f6 e3f3
<< 7 91 1 10806 8 900500 0 c0d2 b9c7 b2g2 b7e7 g2g4 e6f6 e3f3
<< 8 46 4 36088 13 902200 0 c0d2 b9c7 h0g2 b7e7 e1d1 a6b6 i0i4 h9g7 i4d4
<< 9 46 5 51043 10 895491 0 e1e0 h9g7 c0d2 a6b6 f0e1 i6i5 h0g2 b9c7
<< 10 66 12 107646 12 897050 0 h0g2 h9g7 a3b3 b9c7 c0d2 b7e7 e1e0 c6b6
<< 11 50 27 236874 16 870860 0 h0g2 b9c7 a3b3 b7e7 c0d2 h9g7 e1e0 h7f7 d0e1 g6f6 i0i4 c6b6 i4g4
<< 12 40 35 308137 15 860717 0 h0g2 b9c7 a3b3 h9g7 c0d2 b7e7 e1e0 h7f7 d0e1 e8e9 g3f3 d9e8 h2h7 c6d6 b2e2
<< 13 34 40 349573 14 865279 0 h0g2 b9c7 a3b3 h9g7 c0d2 b7e7 e1e0 h7f7 d0e1 f7i7 i0h0 g6h6 e3e4 c6b6
<< 14 36 58 510780 19 874623 0 h0g2 b9c7 c0d2 h9g7 e3e4 h7f7 g0e3 b7e7 a3b3 c6b6 e1e0 g6f6 i0i4 a7a8 i4g4
<< 15 28 98 845141 18 862388 0 h0g2 b9c7 c0d2 h9g7 e3e4 a6b6 e1e0 h7e7 f0e1 e8e9 g0e3 d9e8 c3b3 g6f6 i0f0
<< 16 25 150 1286670 23 853229 0 h0g2 b9c7 c0d2 h9g7 e3e4 b7e7 g2e3 h7f7 a3b3 e6f6 h2h4 e8e9 f0f1 f9e8 e1e0 f7i7 i0h0
<< 17 25 200 1693642 23 846397 0 h0g2 b9c7 e3e4 b7e7 c0d2 h9g7 a3b3 h7f7 g2e3 e6f6 e1e0 a7a8 d0e1 e7a7 b3a3 a8d8 h2c2
<< 18 24 300 2508602 21 835087 0 h0g2 b9c7 e3e4 b7e7 c0d2 h9g7 a3b3 h7f7 g2e3 e6f6 e1e0 a7a8 b2b4 a8d8 d0e1 e8e9 b4g4 i9i7 h2a2
<< 19 32 373 3100865 22 829995 0 h0g2
<< 19 32 390 3231744 23 827591 0 h0g2 b9c7 e3e4 b7e7 c0d2 h9g7 a3b3 h7f7 e1e0 g6f6 d0e1 e8e9 i0i4 i6i5 i4g4 i9i7 g4g5 d9e8 g0e3 f7d9
<< 20 24 548 4532158 28 825680 0 h0g2 b9c7
<< 20 32 587 4850498 28 826179 0 h0g2
<< 20 28 718 5919568 28 823878 0 c0d2 h9g7 h0g2 b9c7 e1e0 e8e9 a3b3 d9e8 f0e1 h7f7 a0a4 f7i7 i0h0 g6h6 e3e4 b7e7 g0e3 i7i4 h2h4
<< 21 37 1098 8966001 28 816204 0 h0g2
<< 21 38 1122 9156458 28 815502 0 h0g2 b9c7 a3b3 b7e7 c0d2 h9g7 e3e4 e8e9 g2e3 g6f6 b2g2 c7e8 e1e0 a7d7 a0a2 a6b6 f0e1 c9a6 i0h0 e7a7
<< 22 30 1272 10343711 25 812929 0 h0g2 b9c7
<< 22 38 1299 10571733 25 813272 0 h0g2
<< 22 38 1305 10616987 27 813250 0 h0g2 b9c7 a3b3 h9g7 e1e0 b7e7 f0e1 e8e9 c0d2 h7f7 a0a4 g6f6 e3f3 d9e8 g0e3 c6c5 a4g4 i9i7 d2e4 c5d5 e4g5
<< feature GOTMOVE=1
>> rejected GOTMOVE
<< # command: 'rejected'
<< move h0g2
<< Hint: b9c7
<< info string classical evaluation enabled
<< 1 38 0 267 1 267000 0 a3b3
<< 2 38 0 558 2 558000 0 a3b3 h9g7
<< 3 38 0 1024 3 1024000 0 a3b3 h9g7 e1e0
<< 4 38 0 1497 4 1497000 0 a3b3 h9g7 e1e0 b7e7
<< 5 38 0 2047 5 1023500 0 a3b3 h9g7 e1e0 b7e7 f0e1
<< 6 38 0 2709 6 1354500 0 a3b3 h9g7 e1e0 b7e7 f0e1 e8e9
<< 7 38 0 3399 7 1699500 0 a3b3 h9g7 e1e0 b7e7 f0e1 e8e9 c0d2
<< 8 38 0 4252 8 1417333 0 a3b3 h9g7 e1e0 b7e7 f0e1 e8e9 c0d2 h7f7
<< 9 37 0 5958 9 1986000 0 a3b3 h9g7 e1e0 b7e7 f0e1 e8e9 c0d2 h7f7 a0a4
<< 10 37 0 7279 10 1819750 0 a3b3 b7e7 e1e0 h9g7 f0e1 e8e9 c0d2 h7f7 a0a4 g6g5
<< 11 37 0 9618 13 1923600 0 a3b3 b7e7 e1e0 h9g7 f0e1 e8e9 c0d2 h7f7 a0a4 g6g5 e3e4 d9e8 a4c4
<< 12 37 0 12274 13 1753428 0 a3b3 b7e7 e1e0 h9g7 f0e1 e8e9 c0d2 h7f7 a0a4 g6g5 e3e4 d9e8 a4c4
<< 13 40 2 34391 20 1185896 0 a3b3 b7e7 e1e0 h9g7 f0e1 e8e9 c0d2 h7f7 a0a4 g6g5 e3e4 d9e8 a4c4 c6d6 g2e3 f7i7
<< 14 33 5 60450 20 1119444 0 a3b3 b7e7 e1e0 h9g7 f0e1 e8e9 c0d2 h7f7 a0a4 g6g5 e3e4 d9e8 i0h0 c6d6
<< 15 28 7 83489 19 1056822 0 e1e0 b7e7 c0d2 h9g7 f0e1 e8e9 a3b3 h7f7 a0a4 g6g5 e3e4 d9e8 i0h0 c6d6 h2h4 i9i7 h4c4 a7a9 g0e3
<< 16 40 18 182310 21 990815 0 a3b3 b7e7 e1e0 h9g7 f0e1 e8e9 a0a4 g6g5 c0d2 h7f7 e3f3 c6d6 g2e3 f7i7 i0h0
<< 17 38 30 291224 21 948612 0 a3b3 b7e7 e1e0 h9g7 f0e1 e8e9 c0d2 h7f7 a0a4 g6g5 e3f3 e6d6 g0e3 d9e8 b0d3 f7d9 i0f0 f9f8 h2e2
<< 18 32 39 367417 25 932530 0 a3b3 b7e7 e1e0 h9g7 f0e1 e8e9 a0a4 g6g5 b0d3 h7f7 e3f3 e6d6 h2e2 c7e6 d3g5 e6g5 g0e3 g5e6 a4g4 f7i7 i0f0
<< 19 27 67 605320 23 902116 0 a3b3 b7e7 e1e0 h9g7 f0e1 e8e9 a0a4 g6g5 b0d3 h7f7 c0d2 f9e8 a4c4 c6d6 e3e4 g5f5 g0e3 d6d5 i0h0 i9i7 h2h4
<< 20 28 151 1317232 26 868886 0 a3b3 b7e7 e1e0 h9g7 f0e1 e8e9 c0d2 h7f7 a0a4 d9e8 e3f3 e7e5 b2e2 g6g5 g0e3 c6d6 a4f4 f7d9 e0f0
<< 21 34 290 2474797 27 853084 0 a3b3 h9g7 e1e0 e8e9 d0e1 h7f7 e3f3 b7e7 g0e3 e6d6 a0a4 g6h6 c0d2 d9e8 b0d3 i9i7 h2e2 f7d9 a4f4
<< 22 36 581 4860115 29 835214 0 a3b3 h9g7 e1e0 h7e7 f0e1 e8e9 e3f3 c6d6 g0e3 e7i7 i0g0 i6h6 h2c2 b7d7 c0d2 i7e7 c2c5 a7a9 a0a4 f9e8 c5c8 e7e5 a4e4
<< 23 44 1564 12650578 32 808395 0 e1e0
<< 23 32 1827 14798168 32 809749 0 e1e0 h9g7 a3b3 e8e9 e3f3 h7e7 g0e3 c6d6 f0e1 g6g5 h2c2 b7d7 c0d2 f9e8 c2c5 a7a9 a0a1 e7e5 e0f0 d7i7 i0h0 g5f5 b2f2 d9d8 c5c1
<< 24 28 2860 22864265 33 799449 0 e1e0 h9g7 a3b3 h7f7 f0e1 e8e9 e3f3 b7e7 c0d2 d9e8 g0e3 e6d6 b0d3 g6g5 h2e2 c7e6 d3f6 f7d9 e2c2 g5f5 c2c4 a7a9 b2e2 a9b9 c4c1
<< 25 37 3469 27580774 30 794880 0 a3b3
<< 25 39 3576 28398262 30 794001 0 a3b3 h9g7 e3f3 c6d6 g0e3 b7e7 e1e0 g6g5 d0e1 e8e9 h2c2 e7e5 c0d2 f9e8 d2e4 g5f5 e4c5 d6c6 c5d3 e5g5 i0g0 c6d6 c2c5 c7d5 b2b9
<< 26 31 4300 34089337 30 792775 0 a3b3 h9g7
<< 26 39 4342 34408133 30 792394 0 a3b3
<< 26 39 4474 35422868 30 791696 0 a3b3 h9g7 e3f3 c6d6 g0e3 b7e7 e1e0 g6g5 c0d2 e8e9 a0a4 e7e5 f0e1 f9e8 a4h4 h7e7 h4h8 g5f5 d2c4 e5g5 i0g0 g5c5 b0e2 f5e5 h8g8
<< 27 47 5140 40691982 31 791565 0 a3b3
>> force
<< # command: 'force'
<< 27 47 6241 49138249 31 787257 0 a3b3
<< feature GOTMOVE=1
>> ping 6
<< # command: 'ping'
<< pong 6
>> rejected GOTMOVE
<< # command: 'rejected'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> usermove i7a7
<< # command: 'usermove'
<< Illegal move: i7a7
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> usermove b0d3
<< # command: 'usermove'
>> usermove i7a7
<< # command: 'usermove'
<< Illegal move: i7a7
>> time 26049
<< # command: 'time'
>> otim 26157
<< # command: 'otim'
>> go
<< # command: 'go'
<< info string classical evaluation enabled
<< 1 47 0 214 1 107000 0 b9c7
<< 2 0 0 483 2 241500 0 b9c7 c0d2
<< 3 54 0 805 3 402500 0 b9c7 c0d2 h9g7
<< 4 64 0 1052 4 526000 0 b9c7 c0d2 h9g7
<< 5 32 0 4360 5 872000 0 b9c7 c0d2 b7e7 h0g2 c6d6
<< 6 42 0 5327 6 887833 0 b9c7 c0d2 h9g7 h0g2 b7e7
<< 7 46 0 8163 7 907000 0 b9c7 c0d2 h9g7 a3b3 b7d7 h0g2 h7e7
<< 8 32 2 21648 14 801777 0 b9c7 h0g2 h9g7 a3b3 i6h6 c0d2 c6d6 e1e0 h7h5
<< 9 28 7 55293 15 789900 0 b9c7 h0g2 h9g7 a3b3 i6h6 g3f3 h7e7 h2e2 c6d6
<< 10 12 9 74635 13 811250 0 b9c7 c0d2 h9g7 h0g2 h7e7 i3h3 c6d6 a3b3 g6h6
<< 11 7 11 93889 12 816426 0 b9c7 c0d2 h9g7 h0g2 b7e7 a3b3 i6h6 e1e0 e7a7 a0c0 h7e7 h2e2
<< 12 15 21 179403 17 838331 0 b9c7 h0g2 h9g7 i3h3 b7e7 c0d2 h7f7 e1d1 f7i7 i0h0 g6h6 a3b3
<< 13 0 45 382147 18 843591 0 h9g7 i3h3 h7f7 h0g2 b9c7 a3b3 b7e7 e1e0 e7a7 a0b0 f7i7 i0h0 i6h6 f0e1
<< 14 14 53 450595 18 842233 0 h9g7 i3h3 h7f7 h0g2 b9c7 e1e0 e8e9 c0d2 f9e8 a3b3 b7e7 d0e1 f7i7 i0h0 @@@@
<< 15 19 121 1016462 22 834533 0 h9g7 c0d2 b9c7 i3h3 h7e7 h0g2 b7d7 h2e2 e8e9 i0i4 d9e8 i4c4 e6d6 a3b3 g7e6
<< 16 26 149 1249077 20 837744 0 h9g7 h0g2 i6h6 h2c2 e6d6 a3b3 b9c7 c2c4 c7e6 g3g4 e8e9 c0d2 d9e8 e1d1 a6a5 c4i4 h7h1 i0h0 h1h8
<< 17 35 320 2662461 25 830980 0 i6h6 c0d2 h9g7 g3f3 e6d6 h0g2 b9c7 e1e0 g9e6 a3b3 e8d8 d0e1 f9e8 h2f2 h7h2 a0d0 b7e7 b2e2
<< 18 24 371 3066524 21 825666 0 i6h6 h0g2
<< 18 26 375 3094770 21 825272 0 i6h6 h0g2 h9g7 h2c2 e6d6 a3b3 c9e6 c2i2 h7e7 e1f1 g9i6 c0d2 b9c7 e3f3 e8d8 i2i5 i9h9 d0e1 f9e8
<< 19 26 388 3207913 23 825292 0 i6h6 h0g2 h9g7 h2c2 e6d6 c2i2 i9h9 i2e2 e8d8 i3h3 b9c7 a3b3 h7e7 c0d2 d9e8 e1e0 c9e6 f0e1 b7d7 b2b7 a9a7
<< 20 21 456 3762948 23 823762 0 i6h6 h0g2 h9g7 h2c2 e6d6 c2i2 i9h9 i2e2 e8d8 i3h3 b9c7 a3b3 h7e7 c0d2 d9e8 e1e0 c9e6 f0e1 @@@@ g3f3 b7d7 a0a4 d6d5
<< 21 28 552 4530580 23 820757 0 i6h6 h0g2 h9g7 a3b3 e6d6 e1e0 b9c7 d0e1 c9e6 g3f3 e8d8 a0a4 d9e8 h2d2 b7d7 a4b4 a9a8 d2i2 i9h9 b4b8 a8b8 b2b8
<< 22 20 600 4925536 28 820102 0 i6h6 h0g2
<< 22 28 661 5408322 28 818203 0 i6h6
<< 22 20 681 5574437 28 817965 0 i6h6 h0g2 h9g7 e1e0 e6d6 a3b3 b9c7 d0e1 e8d8 h2c2 b7d7 c2i2 i9h9 c0d2 h7h1 i3h3 d9e8 i2e2 d7a7
<< 23 28 756 6175881 26 816267 0 i6h6
<< 23 21 908 7398096 27 814409 0 i6h6 h0g2 h9g7 a3b3 e6d6 e1e0 b9c7 d0e1 d6d5 c0d2 g7e6 h2e2 c6c5 g3h3 e8d8 e2i2 i9h9 e3e4 b7e7 a0a4 e6g7
<< feature GOTMOVE=1
>> rejected GOTMOVE
<< # command: 'rejected'
<< move i6h6
<< Hint: h0g2
<< info string classical evaluation enabled
<< 1 21 0 272 1 272000 0 h9g7
<< 2 27 0 574 2 574000 0 h9g7 a3b3
<< 3 27 0 2724 3 1362000 0 h9g7 a3b3 b9c7
<< 4 27 0 3181 4 1060333 0 h9g7 a3b3 e6d6 e1e0
<< 5 27 0 3553 5 1184333 0 h9g7 a3b3 e6d6 e1e0 b9c7
<< 6 27 0 4104 6 1368000 0 h9g7 a3b3 e6d6 e1e0 b9c7 d0e1
<< 7 21 0 4644 7 1548000 0 h9g7 a3b3 e6d6 e1e0 b9c7 d0e1 b7e7
<< 8 21 0 5706 10 1426500 0 h9g7 a3b3 e6d6 e1e0 b9c7 d0e1 d6d5 h2e2 g9e6 g3f3
<< 9 19 0 9714 12 1619000 0 h9g7 a3b3 b9c7 e1e0 e6d6 d0e1 e8d8 h2c2 i9i5 c2c4
<< 10 21 0 10952 11 1564571 0 h9g7 a3b3 b9c7 e1e0 e8e9 d0e1 d9e8 h2c2 e6d6 c2c4 c7e6
<< 11 21 0 12102 11 1512750 0 h9g7 a3b3 b9c7 e1e0 e8e9 d0e1 d9e8 h2c2 e6d6 c2c4 c7e6
<< 12 21 1 14751 13 1475100 0 h9g7 a3b3 b9c7 e1e0 e8e9 d0e1 d9e8 h2c2 e6d6 c2c4 c7e6 c0d2 h7h2
<< 13 21 1 19317 15 1287800 0 h9g7 a3b3 b9c7 e1e0 e6d6 d0e1 e8e9 h2e2 g9e6 g3f3 f9e8 e2e4 b7e7 c0d2 i9f9
<< 14 23 3 35997 16 1058735 0 h9g7 a3b3 b9c7 e1e0 e8e9 d0e1 d9e8 h2c2 e6d6 c2c4 c7e6 g3g4 a6a5 c4i4
<< 15 21 6 61399 17 1023316 0 h9g7 a3b3 e6d6 e1e0 b9c7 d0e1 e8e9 c0d2 g7e6 e3f3 d6d5 h2e2 b7e7 g0e3 h7h5 e2i2 i9h9
<< 16 17 25 235389 23 937804 0 h9g7 a3b3 e6d6 e1e0 b9c7 d0e1 g9e6 g3f3 b7e7 e0d0 e8e9 a0b0 i9i8 c0d2 f9e8 b2b7
<< 17 24 30 280692 20 932531 0 h9g7 a3b3 b9c7 e1e0 e6d6 d0e1 d6d5 c0d2 g7e6 e3f3 e8d8 h2e2 d9e8 e2i2 i9h9 a0a4 h7h2 g2e3 d5d4
<< 18 24 32 304060 19 932699 0 h9g7 a3b3 b9c7 e1e0 e6d6 d0e1 d6d5 c0d2 g7e6 e3f3 e8d8 h2e2 d9e8 e2i2 i9h9 a0a4 h7h2 g2e3 d5d4
<< 19 24 49 450330 22 904277 0 h9g7 a3b3 b9c7 e1e0 e6d6 d0e1 d6d5 c0d2 g7e6 e3f3 e8d8 h2e2 d9e8 e2i2 i9h9 a0a4 h7h2 g2e3 d5d4 g3h3
<< 20 24 168 1428335 26 847676 0 h9g7 a3b3 e6d6 e1e0 b9c7 d0e1 c9e6 g3g4 i9i5 h2c2 b7e7 c0d2 e6g3 e0d0 i5f5 c2c4 e7a7 a0b0
<< 21 29 258 2169513 25 838621 0 h9g7 a3b3 e6d6 e1e0 b9c7 d0e1 c9e6 g3g4 i9i5 h2c2 b7e7 c0d2 i5d5 g4f4 h7h2 c2e2 h2h8 e2e4 e8d8 d2f3
<< 22 28 490 4075042 30 831132 0 h9g7 a3b3 e6d6 e1e0 b9c7 d0e1 c9e6 g3f3 i9i5 h2c2 e8d8 i3i4 i5g5 c0d2 h7e7 c2c4 g5c5 f3f4 b7d7 f4e4 d9e8 c4g4
<< 23 20 928 7559347 29 814584 0 h9g7 a3b3
<< 23 28 1118 9076449 29 811193 0 h9g7 a3b3 b9c7 e1e0 e6d6 d0e1 c9e6 g3f3 i9i5 h2c2 b7e7 c0d2 h7h2 i0h0 h2h8 i3h3 e8d8 c2c4 i5c5 f3f4 e6c3 b3c3 d9e8 e3e4
<< 24 27 1360 10936599 29 803984 0 h9g7 a3b3 b9c7 e1e0 e6d6 d0e1 e8e9 h2c2 b7e7 c2i2 i9h9 c0d2 d6d5 i0i1 c6c5 b2e2 h7h5 g3g4 a9a7 i1f1 f9e8 e3e4 g9e6
>> force
<< # command: 'force'
<< 25 27 1517 12135866 29 799727 0 h9g7 a3b3 b9c7 e1e0 e6d6 d0e1 e8e9 h2c2 b7e7 c2i2 i9h9 c0d2 d6d5 i0i1 c6c5 b2e2 h7h5 g3g4 a9a7 i1f1 f9e8 e3e4 g9e6
<< feature GOTMOVE=1
>> ping 7
<< # command: 'ping'
<< pong 7
>> rejected GOTMOVE
<< # command: 'rejected'
>> undo
<< # command: 'undo'
>> usermove i7a7
<< # command: 'usermove'
<< Illegal move: i7a7
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> undo
<< # command: 'undo'
>> usermove i4c4
<< # command: 'usermove'
<< Illegal move: i4c4
>> undo
<< # command: 'undo'
>> usermove a6b6
<< # command: 'usermove'
<< Illegal move: a6b6
>> quit
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby janggi-korea » 28 Oct 2020, 15:34

process_command ???

What do you mean? Please explain in detail exactly what I need to post.
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 28 Oct 2020, 15:54

I am understanding less and less of what goes on here. In the latest debug log you sent me, the GUI at some points sends an 'accepted setboard', which seems to come out of nowhere. (There was no immediately preceding "feature setboard=1" to which this this should be the reply.) The arrival of this command while SF already started thinking triggers it to send a move that should never have been sent.

The only think I can think of is that the previous debug output line "# command: 'setboard'" somehow triggers this behavior. I was assuming that lines starting with # should always be completely ignored by WinBoard. But this guarantee only exists if the engine sends feature debug=1 at startup. And I now see that SF does not do that. So it could be that WinBoard considers this non-compliant input, and gets upset by it.

So please replace the line

Code: Select all
                << "highlight=1 name=0 sigint=0 ping=1 myname=\""

by
Code: Select all
                << "highlight=1 name=0 sigint=0 ping=1 debug=1 myname=\""

to make sure that WinBoard will ignore the engine messages we added for debugging.

And don't forget to post the source code I asked for here!
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 » 28 Oct 2020, 16:27

reuse=0 Exclude this?




reuse=0 I included this.

>> option Contempt=0
<< # command: 'option'
>> option UCI_Elo=2850
<< # command: 'option'
>> memory 1284
<< # command: 'memory'
>> cores 7
<< # command: 'cores'
>> new
<< # command: 'new'
>> random
<< # command: 'random'
<< Error (unknown command): random
>> variant janggimodern
<< # command: 'variant'
<< setup (PH.R.AE..K.C.ph.r.ae..k.c.) 9x10+0_janggi rnba1abnr/4k4/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/4K4/RNBA1ABNR w - - 0 1
>> level 30 5 0
<< # command: 'level'
>> post
<< # command: 'post'
<< Error (unknown command): post
>> hard
<< # command: 'hard'
>> ping 2
<< # command: 'ping'
<< pong 2
>> accepted setboard
<< # command: 'accepted'
>> accepted usermove
<< # command: 'accepted'
>> accepted time
<< # command: 'accepted'
>> accepted memory
<< # command: 'accepted'
>> accepted smp
<< # command: 'accepted'
>> accepted colors
<< # command: 'accepted'
>> accepted draw
<< # command: 'accepted'
>> accepted highlight
<< # command: 'accepted'
>> accepted reuse
<< # command: 'accepted'
>> accepted name
<< # command: 'accepted'
>> accepted sigint
<< # command: 'accepted'
>> accepted ping
<< # command: 'accepted'
>> accepted debug
<< # command: 'accepted'
>> accepted myname
<< # command: 'accepted'
>> accepted variants
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted option
<< # command: 'accepted'
>> accepted done
<< # command: 'accepted'
>> lift b0
<< # command: 'lift'
<< highlight 9/9/9/9/9/9/9/Y1Y6/9/9
>> put c2
<< # command: 'put'
>> time 30000
<< # command: 'time'
>> otim 30000
<< # command: 'otim'
>> usermove b0c2
<< # command: 'usermove'
<< info string classical evaluation enabled
<< 1 2 0 244 1 244000 0 b9c7
<< 2 20 0 490 2 245000 0 b9c7 a0a1
<< 3 69 0 862 3 431000 0 b9c7 a0a1 b7e7
<< 4 94 0 1420 4 710000 0 b9c7 b2d2 b7e7
<< 5 68 0 5072 6 1014400 0 h9g7 i0i1 a6b6 b2g2 h7c7
<< 6 -2 1 13802 7 1061692 0 b9c7 i3h3 h9g7 b2e2 g6f6 h0g2 b7e7
<< 7 -2 1 14719 7 1051357 0 b9c7 i3h3 h9g7 b2e2 g6f6 h0g2 b7e7
<< 8 1 1 18284 8 1015777 0 b9c7 i3h3 h9g7 b2e2 g6f6 a3b3 h7e7 h0g2
<< 9 12 5 53036 11 964290 0 b9c7 i3h3 h9g7 h0g2 b7e7 e1e0 h7f7
<< 10 15 8 80194 10 954690 0 b9c7 a3b3 h9g7 h0g2 e8e9 i3h3 d9e8 b2e2 g6f6 c0a3
<< 11 6 16 146337 14 914606 0 b9c7 h0g2 h9g7 a3b3 e8e9 i3h3 d9e8 e1e0 g6f6 f0e1 c6b6
<< 12 16 25 231306 13 921537 0 b9c7 h0g2 a6b6 e1e0 e8e9 i3h3 h9g7 i0i1 b7b5 f0e1 g6f6 c3d3
<< 13 9 60 551015 18 915307 0 b9c7 i3h3 e8e9 e1e0 f9e8 d0e1 e6f6 b2e2 h9g7 e3f3 b7e7 h0g2
<< 14 13 76 698716 18 913354 0 b9c7 i3h3 a6b6 e1e0 h9g7 d0e1 g6f6 b2e2 e8e9 e2a2 a9b9 c3b3 b7e7 h0g2 d9e8
<< 15 19 107 974003 20 902690 0 i6h6 h0g2 b9c7 a3b3 e8e9 e1e0 h9g7 h2e2 d9e8 d0e1 c6d6 e2i2 i9h9 i3h3 h9h8
<< 16 13 178 1628737 20 913993 0 i6h6 a3b3 h9g7 h0g2 e8e9 h2e2 b9c7 e1e0 d9e8 a0a4 c6c5 d0e1 i9i5 i0i2 b7e7 i3h3 i5i2
<< 17 14 234 2139635 21 913983 0 b9c7 i3h3 a6b6 h0g2 h9g7 e1e0 e8e9 d0e1 f9e8 c3d3 e6f6 h2e2 g9e6 a3a4 h7h2 i0h0 h2h8
>> ?
<< # command: '?'
<< 18 14 295 2693005 21 912573 0 b9c7 i3h3 a6b6 h0g2 h9g7 e1e0 e8e9 d0e1 f9e8 c3d3 e6f6 h2e2 g9e6 a3a4 h7h2 i0h0 h2h8
<< 18 14 295 2693005 22 912573 0 i6h6 a3b3 b9c7 h0g2 e8e9 e1e0 h9g7 f0e1 f9e8 h2e2 e6d6 b2d2 g9e6 g3f3 b7b2 d2f0 h7h2
<< feature GOTMOVE=1
<< move i6h6
<< Hint: a3b3
<< info string classical evaluation enabled
<< 1 14 0 319 1 319000 0 b9c7
<< 2 22 0 885 2 885000 0 b9c7 h0g2
<< 3 22 0 1237 3 1237000 0 b9c7 h0g2 e8e9
<< 4 14 0 1778 4 889000 0 b9c7 e1e0 b7g7 h0g2 g7g3 b2b7
<< 5 14 0 2544 5 1272000 0 b9c7 e1e0 b7g7 h0g2 g7g3
<< 6 21 0 3278 6 1639000 0 b9c7 h0g2 e8e9 e1e0 h9g7 f0e1
<< 7 22 0 4211 7 1403666 0 b9c7 h0g2 e8e9 e1e0 h9g7 f0e1 f9e8
<< 8 22 0 4864 8 1621333 0 b9c7 h0g2 e8e9 e1e0 h9g7 f0e1 f9e8 h2e2
<< 9 22 0 6293 11 1573250 0 b9c7 h0g2 e8e9 e1e0 h9g7 h2e2 f9e8 d0e1 e6d6 g3h3 g7e6
>> rejected GOTMOVE
<< # command: 'rejected'
<< 10 22 0 10748 11 1194222 0 b9c7 h0g2 e8e9 e1e0 h9g7 h2e2 f9e8 d0e1 e6d6 g3h3 g7e6
<< 11 23 1 17706 14 1264714 0 b9c7 h0g2 h9g7 e1e0 e8e9 h2e2 f9e8 a0a4 e6d6 f0e1 g9e6 a4f4 b7e7 b2b7
<< 12 17 4 46951 18 1117880 0 b9c7 h0g2 h9g7 e1e0 e8e9 f0e1 d9e8 h2e2 i9i5 a0a4 b7d7 a4c4 e6d6 b2b7 g9e6
<< 13 12 6 68028 18 1062937 0 h9g7 h0g2 b9c7 e1e0 e8e9 h2e2 d9e8 d0e1 b7e7 g3f3 c6d6 a0a4 e7a7 a4c4 a7a0 e1d0 i9i5
<< 14 17 9 98574 18 1048659 0 b9c7 h0g2 h9g7 e1e0 e8e9 h2e2 d9e8 d0e1 b7d7 b2b8 d7a7 a0b0 a6b6 g3f3 a7e7
<< 15 23 13 128139 19 949177 0 b9c7 h0g2 h9g7 e1e0 e8e9 h2e2 d9e8 d0e1 b7e7 g3f3 e7a7 a0b0 a6b6 e2i2 i9h9 b0a0
<< 16 26 68 620246 22 904148 0 b9c7 h0g2 h9g7 e1e0 e8e9 h2e2 d9e8 a0a4 e6d6 e2i2 i9h9 i3h3 c9e6 i2e2 h7f7 f0e1 h9h8 g3f3 f7d9
<< 17 26 75 680818 20 900552 0 b9c7 h0g2 e8e9 e1e0 h9g7 f0e1 d9e8 h2e2 i9i5 i3i4 i5d5 e3f3 g6f6 g2i3 c6d6 i3g2 h7h1
<< 18 24 237 2114070 23 890134 0 b9c7 e1f1 e8e9 h0g2 h9g7 f0e1 e6d6 h2f2 c9e6 e3f3 i9i5 a0a4 f9e8 a4f4 a6b6 b2e2 b7e7 i3i4 i5d5 c2e3
<< 19 21 294 2616214 25 888357 0 h9g7 h0g2 e8e9 e1e0 b9c7 f0f1 a6a5 h2e2 f9e8 d0e1 c6d6 b2d2 b7b2 a0a1 h7e7 d2f0 a9a6 a1a2 b2b8
>> lift h0
<< # command: 'lift'
<< highlight 9/9/9/9/9/9/9/9/9/9
>> put g2
<< # command: 'put'
>> time 29704
<< # command: 'time'
>> otim 29563
<< # command: 'otim'
>> usermove h0g2
<< # command: 'usermove'
<< Illegal move: h0g2
<< 20 29 616 5450657 25 884129 0 h9g7
<< 20 20 659 5823283 25 883520 0 h9g7 e1e0 b9c7 h0g2 b7d7 d0e1 a6a5 f0f1 e6d6 h2f2 e8d8 b2e2 g9e6 g3h3 i9i5 f2i2 i5g5
<< 21 24 777 6881873 25 884673 0 h9g7 e1e0 b9c7 h0g2 a6a5 d0e1 b7d7 f0f1 e8d8 b2d2 c6d6 d2f0 d9e8 h2e2 i9i5 i3h3 i5i0 f0i0 h7e7 i0f0
<< 22 27 1124 9895212 28 880200 0 h9g7 e1e0 b9c7 h0g2 e8e9 f0e1 d9e8 i3i4 c6d6 g3f3 a6a5 c3c4 f9f8 c4c5 b7f7 e1e2 f7f9 b2b7 h7e7 d0e1
<< 23 27 1489 13068412 31 877427 0 h9g7 e1e0 b9c7 h0g2 e8e9 i3i4 d9e8 g3f3 c6d6 f0e1 a6a5 a0a1 f9f8 i0i1 h7f7 h2d2 a9a6 d2f0 b7e7 d0d1 f7d9
janggi-korea
 
Posts: 130
Joined: 18 Aug 2020, 12:12

Re: Fairy-Stockfish janggi (ponder Problem)

Postby H.G.Muller » 28 Oct 2020, 17:10

Well, same behavior. It prints a move directly after receiving the '?' command, without waiting for the "rejected GOTMOVE".

Wait! I have an idea! The search doesn't stop because of the processing of the '?' command at all. There is also code in the process_command routine to stop the search just before a move is printed, executed for any command (except ptell) that comes in while the engine is thinking. That would already handle the '?' command. So we should not have put in our own code to do that.

For now, you can try to prevent that duplicate execution of '?' by changing the line

Code: Select all
  if (moveAfterSearch && token != "ptell")

to
Code: Select all
  if (moveAfterSearch && token != "ptell" && token != "?")

This does not solve the problem for other commands that would arrive while the engine is thinking, though. I will devise a more fundamental solution tomorrow (as this will be complex).
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 » 28 Oct 2020, 21:42

OK, I cooked up something. Try to replace the initial part of the routine process_command upto and including the line with "protover" in xboard.cpp by this:
Code: Select all
void StateMachine::process_command(Position& pos, std::string token, std::istringstream& is, StateListPtr& states) {
  if(token == "rejected")
  {
      is >> token;
      if(token != GOTMOVE) return; // [HGM] all other feature rejections are ignored
  }
  if (token == GOTMOVE && ponderMove == "") // [HGM] a search for thinking announces its termination
  {
      // abort search in bughouse when receiving "holding" command
      bool doMove = token != "holding" || Threads.abort.exchange(true);
//      Threads.stop = true;
//      Threads.main()->wait_for_search_finished();
      if (doMove)
      {
          Move m = Threads.main()->bestThread->rootMoves[0].pv[0];
          if(m != MOVE_NONE)
          {
              sync_cout << "move " << UCI::move(pos, m) << sync_endl; // print move
              do_move(pos, moveList, states, m);                     // and do it ourselves
              moveAfterSearch = false;
              if(Options["Ponder"] &&
                 (Threads.main()->bestThread->rootMoves[0].pv.size() > 1 ||
                  Threads.main()->bestThread->rootMoves[0].extract_ponder_from_tt(pos)))
              {
                  m = Threads.main()->bestThread->rootMoves[0].pv[1]; // ponder move
                  ponderMove = UCI::move(pos, m);                     // remember it (indicates we are pondering)
                  sync_cout << "Hint: " << ponderMove << sync_endl;   // print it
                  do_move(pos, moveList, states, m);                  // perform it
                  limits.startTime = now(); // As early as possible!
                  Threads.start_thinking(pos, states, limits, true);  // and start pondering
              }
          }
      }
  }
  else if(token == GOTMOVE)
      ponderMove = "";
  else if (token == "protover")

This has done away completely with the 'moveAfterSearch' signalling that SF originally used; the decision for whether a move will be output by the engine will be purely taken on the basis of whether there is a ponderMove specified (which would indicate we are pondering on it), and only happen at the moment the engine receives (through the GUI) a confirmation that a search ended (through "rejected GOTMOVE=1"). So that a move is indeed available, and no spurious moves can be sent. The ponder search (which starts after outputting the move) will thus also only be started after all commands associated with terminating the previous search have been received, so that no 'surprise command' will be able to disturb it.

A ponder search can only be terminated by a usermove (as a hit or a miss), or a "force" command; the code for handling these commands was already such that it takes care of initiating the search abort and retracting the ponder move when necessary. This leaves ponderMove non-empty, though, so that the GOTMOVE generated by terminating the ponder search will know that it was a ponder search, and reset ponderMove without emitting a move and starting a new ponder search.
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 30 guests