Page 14 of 19

Re: perft

Posted: Thu Jan 13, 2011 7:11 pm
by hgm
You have switched legality Testing off?

Hooray!!

Posted: Thu Jan 13, 2011 7:15 pm
by Daniel Shawul
It works! Right until where a double move had to be made ! There one of the Nebiyus hanged. Ofcourse I didn't start sending multiple moves . Ok that one will be tested after lunch :)

Re: Hooray!!

Posted: Thu Jan 13, 2011 7:19 pm
by hgm
I guess WB thinks you are checkmated all the time, because you have no Kings. It does print the # sign after every SAN move. But you would need to have legality testing off anyway,or you could not capture.

Re: Hooray!!

Posted: Thu Jan 13, 2011 8:07 pm
by hgm
I must have miscounted, because the multi-moves sent to the engine do not have any hyphens in them. (When I enter a multi-move for the user.)From the viewpoint of compactness, this is of course just as well. Problem is theremight be ambiguity:

Does a1b2c3f3 mean a1b2-c3d4 or a1b2-b2b3-b3b4? We could of course provide a rule for disambiguation, like: "if the next square contains an own piece, it is a new from-square, otherwise, it is a new to-square". This does make the system less general, though.

Perhaps the packing is not worth it. Without it, you would need no hyphens, so it saves only 1 char per move. Problem is that in multi-move Chess variants some of the moves might be promotions, so you cannot just slice up in chunks of 4 characters. So the hyphens might actually be desirable.

I have posted a new version, that does not do any packing, but always gives a full long-algebraic move for each leg, separated by hyphens. As the move buffer is 32 bytes long, this should allow up to 6 steps in 1 move. I guess I will settle on this format.

Re: Hooray!!

Posted: Thu Jan 13, 2011 8:29 pm
by Daniel Shawul
I agree with keeping it simple. It is possible to compact it a lot by storing only squares to resolve the ambiguity but plain concatenated coordinate notation should be fine! I am using an int to store the "from" square and directions of movement (2bits for each direction) in the rest of the bits. This sounded smart at first but I am having a hard time extracting the "to" bit in many places. I guess I should have spent 8 bits for it but was afraid the bits I have left for multi-moves would be too short (which btw would have been 7 :) ).

EDIT: Also extracting the "to" bit requires looking at the board , so I am more and more convinced it is a stupid decision. I will remove it and save the to square. 7 moves should be enough.

I will do the plain concatenation (with no promotion piece at the end since it is obvious) and test it out with the new one.

Re: Hooray!!

Posted: Thu Jan 13, 2011 8:33 pm
by hgm
I noticed that this version still says 'Unknown Command',rather than 'llegal move'. That causes the hanging. After 'Illegal move' WB knows it has to take action (either take back the move or forfeit the engine).

It would also be good to send the setup command; having to paste the initial position all the time is a pain. I don'tknow what board sizes you support, but if 10x0 is amongst them you could also put 10x10+0_checkers amongst the variants.

Note that in WB promotion defaults to Queen. So it is important that the Queen is indeed defined, if you don't give an explicit promotion character. WB will always give a promotion character with the move. With legality checking off, it will acceptpromotion ofany piece, btw.

Re: Hooray!!

Posted: Thu Jan 13, 2011 8:50 pm
by Daniel Shawul
Ok i corrected the "illegal move" bug. But how is "setup" implemented ? It doesn't seem to be a command in the Winboard engines comm. protocol.

Re: Hooray!!

Posted: Thu Jan 13, 2011 9:39 pm
by hgm
Indeed, it is an undocumented command, that I added very recently to WB 4.5.0, which is not officially released yet. For the format, look 12 and 24 postings back.

Re: Hooray!!

Posted: Thu Jan 13, 2011 10:40 pm
by Daniel Shawul
Ok multi block format is done. It can read and write moves concatenated by '-' in coordinate notation. No promotion piece tag. I downloaded the new one but it doesn't seem to understand as it rejects them as illegal. I have changed "unknown command" to "illegal move" so I thought maybe Nebiyu can't read multi block format but it can from the console.

[FEN "1p1p1p1p/2p3p1/7p/8/8/p5P1/1P1P3P/P3P1P1 b - - 0 1 "]
[D]1p1p1p1p/2p3p1/7p/8/8/p5P1/1P1P3P/P3P1P1 b - - 0 1[/D]

1.a1b2 f6e5 2.c3d4 e5c3 3.b2d4 d6e5 4.d4f6 e7g5 5.e3f4 g5e3 6.f2d4 b6c5 7.d4b6 a7c5 8.a3b4 c5a3
9.c1b2 a3c1 10.g1f2


As you can see black just promoted by 9...a3c1, and then white offered it a double capture on its turn g1f2, then black tried to double capture with its king which got rejected. Btw winboard promotes the black pawns to white pawns not black king. Legality is off btw.

Re: Hooray!!

Posted: Thu Jan 13, 2011 10:55 pm
by hgm
Difficult to guess what is wrong if I can't see what you sent to the GUI, and how you set the pieceToCharTable. Promotion to white Pawn is bad;it is a sign that the promotion character you sent indicates an undefined piece. Which can also be caused by nomittng the promotion character, (defaulting to Queen), while the Queen is not defined in the pieceToCharTable. You talk about 'Kings', but I suppose you represent them as Queens in the display, right?

If you promote to white Pawn, the next move is of course rejected: even with legality testing off Black is not allowed to move white pieces. So that is no mystery.