Book and Training modes

211 views
Skip to first unread message

Shivkumar Shivaji

unread,
Oct 4, 2012, 4:39:32 PM10/4/12
to pico...@googlegroups.com
I now have book and training modes working locally. Will work to push these back into Picochess soon. A summary follows:

1. Book Mode
This will return the top N book moves for a given position sorted by the "score" of the move in the book. Currently N is set to 3. For example, after I make the move 1.e4, the moves c5, e5, e6 are displayed meaning that ..c5 scored the best, ..e5 the 2nd best, and ..e6 the worst. There is a one second delay before the display of every move. With book mode, one can keep making book moves and when one is out of book, pico chess will play against you!

2. Engine Analysis Mode
Book mode + pico chess won't play against you.

This will not be the same as playing against Picochess. Instead when a position is out of book, pico chess will return the top move followed by the score in centipawns or in mate in x format e.g. 150 (meaning up 1.5 pawns) or m 1, meaning mate in 1. The move however is not executed in the game, the player can choose to make a different move. Picochess will keep giving the best move and the score.

3. Training mode
Engine Analysis mode without the display of the best move but will still display the score.

I am testing the above modes to see how useful they are for general usage. I like book mode personally as I can get book moves and can play a certain opening against Pico chess. Trying to see how useful training/analysis mode can be in practice when replaying top level games. If anyone has a suggestion, let me know.

Shiv

javieros

unread,
Oct 5, 2012, 6:42:44 AM10/5/12
to pico...@googlegroups.com
I consider very interesting these modes.

In the training mode, Can you play with Picochess normally?

If not, it would be desirable to add another mode: play with extra info, evaluation and best move so far, or only evaluation.

Javier

Shivkumar Shivaji

unread,
Oct 5, 2012, 11:05:06 AM10/5/12
to pico...@googlegroups.com
Thanks. 

In analysis mode, Picochess returns a move, you can always play it on the board and treat it like a game. However, this is returned for both colors (white and black). Maybe you want a mode that plays moves and returns a score on its turn, but does not suggest anything on your turn? Currently, moves and scores are done for both sides. What kind of extra info do you expect to see? 

Currently training mode returns a score (for both sides) but not a move.

Shiv


--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group, send email to picochess+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

javieros

unread,
Oct 5, 2012, 1:31:10 PM10/5/12
to pico...@googlegroups.com
I was thinking in the normal play mode chosing book and control time, with permanent brain also , that shows evaluation and best move while the computer is thinking. With the normal clock during my turn. Peharps the free square f4 can be used to switch on or off this extra info

Javier

Shivkumar Shivaji

unread,
Oct 5, 2012, 2:57:05 PM10/5/12
to pico...@googlegroups.com
Interesting. I did not think about this mode too much as I thought it would be cheating if I played against an engine like this :) However, this mode is useful if you are playing picochess against other devices, e.g. the Novag or an iPhone/android engine. Can probably think about sending one message a second or so, with best move, and evaluation in this new mode.

I have liberally used the fifth rank (with the white queen) for these modes. I hope that's fine! Jeff can advise as well when he merges my changes after the ponder bug is resolved.

I personally find myself motivated to study chess and play games again due to this project! I lost a lot of motivation when I was forced to look at a 2D screen.

I think further refining the new modes after feedback from users can help make it a full desktop replacement :)

Shiv

On Oct 5, 2012, at 10:31 AM, javieros <javi...@us.es> wrote:

> I was thinking in the normal play mode chosing book and control time, with permanent brain also , that shows evaluation and best move while the computer is thinking. With the normal clock during my turn. Peharps the free square f4 can be used to switch on or off this extra info
>
> Javier
>

Jean-Francois Romang

unread,
Oct 5, 2012, 3:43:06 PM10/5/12
to pico...@googlegroups.com
This would help to make a full desktop replacement :
http://www.matrixorbital.com/External-LCDs-External-Character-LCDs/c53_52/p1324/ELK204-7T-USB-WB-PL/product_info.html
It would be possible to display the PV. :-)


2012/10/5 Shivkumar Shivaji <sshi...@gmail.com>:

Shivkumar Shivaji

unread,
Oct 5, 2012, 3:49:35 PM10/5/12
to pico...@googlegroups.com
Interesting!

Also note that it is possible to display PV information on the DGT XL clock, you just have to tolerate a refresh delay (say half a second or less) as each move in the PV is displayed on the clock. This is what I did to get multiple book moves for a given position. Same strategy can work for say the first 3-4 moves in the PV. It may not be user friendly, and might even be annoying. However, it is not impossible :)

Shiv

javieros

unread,
Oct 5, 2012, 4:21:16 PM10/5/12
to pico...@googlegroups.com
If you are thinking in implement Picochess using this device, I will buy right now!

Javier

Jean-Francois Romang

unread,
Oct 5, 2012, 4:56:34 PM10/5/12
to pico...@googlegroups.com
This is just an idea, don't buy it ;-)

2012/10/5 javieros <javi...@us.es>:

Shivkumar Shivaji

unread,
Oct 5, 2012, 5:06:47 PM10/5/12
to pico...@googlegroups.com
Yes, also I am not a USB device person as much as Jeff. I am more inclined to support the iPhone or Android devices for this kind of output via the network. If Jeff starts supporting this device, then I can also help code against it :) I note that Jeff has put in support for this device on the issue tracker.

Shiv

Shivkumar Shivaji

unread,
Oct 5, 2012, 5:35:51 PM10/5/12
to pico...@googlegroups.com
It should also be made clear that supporting a new device like that with the right C++ calls requires a lot of hard work and talent. Definitely not something I have :) Easier for me to made modifications after someone has already done the hard work!

Also, even though the device support is on the issue tracker, lets not assume it will be supported soon!

Shiv

javieros

unread,
Dec 2, 2012, 12:11:16 PM12/2/12
to pico...@googlegroups.com
Wonderful new features book and training working in Picochess!!!

I have updated Picochess (please update the manual with "git stash" before  "git pull")

The version says 0.14 but really is the 0.15 :)

You are right, it seems necessary to wait until the list of opening book moves is finished before enter another move.

In the training mode when Picochess moves, first it displays the move and then the evaluation. There is no time between them and most times you only see the evaluation unless you have a computer conected to Picochess, so perhaps the order of displaying should be changed to avoid miss a move.

It is better a evaluation from white point of view as you said, in order to avoid confusion.

In the training mode, Picochess moves following the corresponding time control of the game and can not be interrupted when you want.

This is perfect for training, but not for analysis, so I suggest to program a third "analysis mode" with the following features:

You enter moves for both sides and Picochess analyse the current position without stop until the next move is entered.
During the search, Picochess displays alternately (for example during two seconds every item) the best move and the evaluacion in centipawns from white point of view.

One idea is that you can follow the book lines like in training mode and you can start the thinking process, taking the white king and putting again in its square.

If the implementation of above is too complicated then the search process should start from the beginning of the game without displaying book moves.

One important thing for theses modes is the possibility of take back more than one move, I have tried it and it doesn't work.

Best regards

Shivkumar Shivaji

unread,
Dec 2, 2012, 12:53:12 PM12/2/12
to pico...@googlegroups.com
Comments inline..

On Dec 2, 2012, at 9:11 AM, javieros <javi...@us.es> wrote:

Wonderful new features book and training working in Picochess!!!

Glad that you like it!

I have updated Picochess (please update the manual with "git stash" before  "git pull")

This is really a problem only if you used the o-droidx image posted a while back by Jean. I will update the manual to mention this though. I am surprised you had to do it again.

The version says 0.14 but really is the 0.15 :)

When Jean confirms, I can create a new image. I think he wanted to add in something else perhaps. He usually sets the version numbers in code.


You are right, it seems necessary to wait until the list of opening book moves is finished before enter another move.

In the training mode when Picochess moves, first it displays the move and then the evaluation. There is no time between them and most times you only see the evaluation unless you have a computer conected to Picochess, so perhaps the order of displaying should be changed to avoid miss a move.

Will change the analysis mode to first evaluation and then move. The training mode does not display moves, only evaluation.

It is better a evaluation from white point of view as you said, in order to avoid confusion.

In the training mode, Picochess moves following the corresponding time control of the game and can not be interrupted when you want.

This is perfect for training, but not for analysis, so I suggest to program a third "analysis mode" with the following features:

You enter moves for both sides and Picochess analyse the current position without stop until the next move is entered.
During the search, Picochess displays alternately (for example during two seconds every item) the best move and the evaluacion in centipawns from white point of view.


This is like an infinite analysis mode with more information display. Come to think of it, this makes a lot of sense for analysis mode (not training mode). Definitely possible to consider. Requires supporting infinite analysis mode, displaying evaluation, depth, and the best move every 2 seconds. One benefit of this feature for a human chess player is that you can analyze a position for a while by yourself and then compare notes with the DGT XL clock when you are ready :) This might fit in well when solving hard tactical chess problems.

One idea is that you can follow the book lines like in training mode and you can start the thinking process, taking the white king and putting again in its square.

If the implementation of above is too complicated then the search process should start from the beginning of the game without displaying book moves.

May not be too complicated. I can have the new mode not display book moves at all. The easiest thing will be to have book mode be separately enabled. It will either work with analysis mode if selected or not if not selected.


One important thing for theses modes is the possibility of take back more than one move, I have tried it and it doesn't work.

Will look at this. I thought you can take back one move at a time. Would be a bug if not. I likely have to coordinate this feature with Jean's latest undo changes. I put in this feature before the new undo fix.

Did you have a chance to replicate the 3 fold draw score issue?

Shiv

javieros

unread,
Dec 2, 2012, 1:28:49 PM12/2/12
to pico...@googlegroups.com
Sshivaji   wrote      Did you have a chance to replicate the 3 fold draw score issue?

I will try to replicate it playing more test games, but it is not an easy task because the position must be imbalanced in the material but with draw score.

The most known examples are the fortresses but you must set the position and by now it is not possible in Picochess.

But I think it is a not very important issue because Picochess draw the game correctly and the evaluation comes from Stockfish, so the problem must be fixed in Stockfish.

Javier

Shivkumar Shivaji

unread,
Dec 2, 2012, 1:34:21 PM12/2/12
to pico...@googlegroups.com
I think its still important. That same game score you were showing, you can try to replicate. I will try to do the same when I get a chance.

We can submit patches to stockfish to fix this behavior if we can confirm a bug.

On my TODO list is position setup modes :)

Shiv

javieros

unread,
Dec 2, 2012, 2:34:13 PM12/2/12
to pico...@googlegroups.com
I didn't understand what you have said, I will try to replicate right it now.

Regarding the take back, I have checked it in normal play and in training mode and it works.

I have checked again the Analyse mode White queen on b5 as follows:

1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 then I take back Ba4b5 Undo a6a7 b5f1 Undo everything correct,

but after 1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 if you take back a7a6 Picochess says nothing and you can't play Nf6 instead a6, so the take back only works in one side.

Javier

Shivkumar Shivaji

unread,
Dec 2, 2012, 2:44:46 PM12/2/12
to pico...@googlegroups.com
Any issue with analysis mode should also have the same 'problem' in training mode. Training mode is really analysis mode + hiding the computer's best move.

The takeback issue is actually a limitation of training/analysis mode, you can only take back in this odd manner (ie 2 moves at a time). This happens because analysis/training mode does not add the last move directly to the game move list. However, this is not hard to fix.

Shiv

javieros

unread,
Dec 2, 2012, 5:26:55 PM12/2/12
to pico...@googlegroups.com
The first attempt to replicate the game has failed, because Picochess played 15..Nfd7 instead 15..Ncd7. 
Picochess and Fritz 13 were thinking during opponent's time, guessing some moves and other not, so it is difficult to exactly reproduce the time of every move.
Here it is the game with the times employed in every move and evaluations stored by Fritz 13.

I will try again simulating the times of the original game.

Javier


[Event "Blitz 10m"]
[Date "2012.11.11"]
[White "Fritz 13 K7 2.25 Ghz."]
[Black "Picochess v0.14, Odroid-X"]
[Result "1/2-1/2"]
[ECO "D00"]
[PlyCount "119"]
[TimeControl "600"]

{128MB, K2400} 1. d4 {0.39/19 24} Nf6 {23} 2. Nc3 {0.25/17 14} d5 {25} 3. Bf4 {
0.23/17 0} e6 {21 (g6)} 4. e3 {0.45/18 17} Bb4 {18 (Bd6)} 5. Bd3 {0.30/17 14}
c5 {6} 6. dxc5 {0.31/18 21} Nbd7 {25 (Nc6)} 7. Nge2 {0.25/17 11} Bxc5 {10} 8.
Bg3 {0.10/16 4} O-O {21} 9. h3 {0.01/16 0} Be7 {22} 10. O-O {0.04/17 0} Nc5 {0}
11. a3 {0.00/17 21} Bd7 {22 (Qb6)} 12. Be5 {0.01/15 11} Rc8 {19 (Qb6)} 13. Nd4
{0.00/15 13} Be8 {26 (g6)} 14. Rb1 {-0.03/15 13} a6 {22 (Bd6)} 15. Qe1 {-0.03/
14 13} Ncd7 {19 (Nfe4)} 16. Bg3 {0.00/17 10} Nb6 {6 (Nc5)} 17. Qd2 {0.12/17 13}
Bd6 {26 (Nc4)} 18. Bxd6 {0.02/16 11} Qxd6 {8} 19. f4 {0.00/17 2} Nc4 {29} 20.
Bxc4 {-0.13/18 5} Rxc4 {24} 21. Qd3 {-0.13/17 0} Qc7 {19} 22. Ra1 {-0.24/17 0}
Ba4 {20 (Bd7)} 23. Qd1 {-0.31/16 15} Rxc3 {21 (Bd7)} 24. bxc3 {-0.08/15 3} Ne4
{16} 25. c4 {-0.19/16 0} Qxc4 {19} 26. Qe2 {-0.35/16 0} Qc7 {21 (Qc5)} 27. Rfe1
{-0.47/14 8} Rc8 {24} 28. Rec1 {-0.47/16 0} Nc3 {15 (b5)} 29. Qd3 {-0.45/16 9}
Qe7 {21 (Qd6)} 30. Re1 {-0.64/17 14} Rc4 {19 (Ne4)} 31. Rec1 {-0.67/17 10} Qc7
{18 (Ne4)} 32. Qf1 {-0.68/17 8} h6 {32 (Ne4)} 33. Qd3 {-0.71/18 8} Ne4 {13} 34.
Qd1 {-0.91/17 0} Rc3 {15} 35. Qe2 {-0.79/19 0} b5 {14} 36. Qe1 {-0.79/19 4} Qc5
{7 (Qc4)} 37. Qe2 {-0.79/19 8} Qc7 {7 (Nd6)} 38. Qe1 {-0.40/20 9} Qc8 {6 (Qc4)}
39. Qe2 {-0.79/19 9} Qc5 {5} 40. Qe1 {-0.79/19 12} Qc7 {6 (Nd6)} 41. Qe2 {-0.
79/19 12} Rc4 {5 (Nd6)} 42. Qd3 {-0.79/17 5} Rc3 {16 (Nd6)} 43. Qe2 {-0.40/21
19} Qc5 {5 (Nd6)} 44. Qe1 {-0.40/19 8} Qc8 {16 (Nd6)} 45. Qe2 {-0.40/19 6} Rc4
{5 (Nd6)} 46. Qd3 {-0.79/17 5} Qc5 {22 (Nd6)} 47. Qd1 {-0.79/18 5} Qd6 {15 
(Nd6)} 48. Qe2 {-0.77/17 6} g6 {13 (Rc3)} 49. Kh2 {-0.75/15 7} Qc7 {14 (Rc3)}
50. Kg1 {-0.78/17 6} Qc5 {7} 51. Kh2 {-0.79/17 0} Qc7 {12 (Rc3)} 52. Kg1 {-0.
42/17 5} Qd6 {5 (h5)} 53. Kh2 {-0.41/17 4} Qc5 {12 (h5)} 54. Qe1 {-0.79/16 9}
Rc3 {9 (Kg7)} 55. Kg1 {-0.81/17 8} Qd6 {8 (h5)} 56. Qe2 {-0.75/17 5} Qc7 {11}
57. Rd1 {-0.80/17 3} Rc5 {12 (Bxc2)} 58. Rdc1 {-0.80/17 5} Rc3 {18 (Kg7)} 59.
Rd1 {-0.41/17 3} Rc4 {7 (Qc5)} 60. Rdc1 {0.00/22 4} 1/2-1/2

Shivkumar Shivaji

unread,
Dec 2, 2012, 5:36:43 PM12/2/12
to pico...@googlegroups.com
I think you can simply replay in analysis mode and replay the exact moves for both sides and check if Picochess wants to draw. Just use the same time control that you previously used.

Shiv

Sent from my iPhone

javieros

unread,
Dec 3, 2012, 6:33:29 PM12/3/12
to pico...@googlegroups.com
Very good idea! Shiv

I have replaced the game but I went wrong with the sequence of moves and I reached the 3-fold repetition several moves before than in the original game, but again Picochess claimed draw with evaluation +1.29 Pawns,
so the behaviour has been the same as in the original game and this proves that it was not an isolated fact.

I still think that the evaluation comes from Stockfish and the error (if any) is in Stockfish and not in Picochess.

Javier

info depth 22 seldepth 20 score cp 129 nodes 2995701 nps 1028037 time 2914 multipv 1 pv c8c5 e2e1 g7g6 e1e2 e4d6 e2e1 d6e4 e1e2 e4d6 e2e1 d6e4
bestmove c8c5 ponder e2e1
dgtnix-debug:Received _DGTNIX_BWTIME from the board
dgtnix-debug:(no clock found)
stopped with move c8c5
Sending message:   129
dgtnix-debug:Sending message to clock
dgtnix-debug:Received _DGTNIX_BWTIME from the board
dgtnix-debug:clock ACK received
dgtnix-debug:Received _DGTNIX_BWTIME from the board
dgtnix-debug:(no clock found)
dgtnix-debug:Received _DGTNIX_FIELD_UPDATE from the board
dgtnix-debug:q removed from F1 on the board
dgtnix-debug:Sending DGTNIX_MSG_MV_REMOVE (q on C8) to the engine 
6k1/5pp1/p3p2p/1p1p4/b2NnP2/P1r1P2P/2P1Q1P1/R1R3K1 w KQkq - 0 1
-------------------------Move:0
dgtnix-debug:Received _DGTNIX_FIELD_UPDATE from the board
dgtnix-debug:q added on F2 on the board
dgtnix-debug:Sending DGTNIX_MSG_MV_ADD (q on C7) to the engine 
6k1/2q2pp1/p3p2p/1p1p4/b2NnP2/P1r1P2P/2P1Q1P1/R1R3K1 w KQkq - 0 1
-------------------------Move:3762
Sending message:  draw

Shivkumar Shivaji

unread,
Dec 3, 2012, 6:40:05 PM12/3/12
to pico...@googlegroups.com
Thanks for the information and testing it.

Given that our correct 3-fold detection logic contribution is now part of the official Stockfish, this bug is something that we should be concerned about. Will look into this when I get a chance. Stockfish should now correctly understand that repetition is 0.0 and continuing differently is +1.29.

Shiv

javieros

unread,
Dec 3, 2012, 7:17:32 PM12/3/12
to pico...@googlegroups.com
Ok, you are right.

Javier

Shivkumar Shivaji

unread,
Dec 10, 2012, 1:26:15 PM12/10/12
to pico...@googlegroups.com
Javier,

I have this all working locally now. I now have move, score, and depth displayed on the DGT XL clock. I might even add in nodes per second (to test out power consumption especially on the o-droidx).

Will fine-tune this and then submit my change. I am trying to make this useful for both computer - computer games and also when playing over top grandmaster games. There are a couple of great games from the just concluded tournament in London which are worth playing on the DGT board :)

Shiv

On Dec 2, 2012, at 9:11 AM, javieros <javi...@us.es> wrote:

javieros

unread,
Dec 10, 2012, 2:46:32 PM12/10/12
to pico...@googlegroups.com
Great news!

move, score, and depth are very useful and they are displayed in most dedicated chess computers, I don't worry about nodes per second because from the point of view of chess is not very useful. Ok, it is useful from the point of view of the development of Picochess, but we can see this value using the network conexion.

Javier

Shivkumar Shivaji

unread,
Dec 14, 2012, 6:01:04 PM12/14/12
to pico...@googlegroups.com
I have got this all to work. However, I also want to be able to setup a custom position with pico chess (not just start position). That is noted at issue #1 on the github page. Will submit a pull request to Jean after I am done with this. I can also create a new beta image with these changes in place if that helps speed up testing.

Shiv

javieros

unread,
Dec 15, 2012, 4:07:38 AM12/15/12
to pico...@googlegroups.com
Wonderful, thank you very much for all your efforts

Javier

Henk Van Weersel

unread,
Dec 16, 2012, 6:25:28 PM12/16/12
to pico...@googlegroups.com
Hello guys, Keep up the good work. Impressive. I bought the rikomagic ii. Hope to get it tomorrow. What sort of sd card do i must have. a class 4 ore even a class 10. I hope when i set it up i can do some testing. Positition setup will be very useful. Don.t know if  printing a game is possoble?
Hope i get it to work. Greets.
 
Op donderdag 4 oktober 2012 22:39:34 UTC+2 schreef sshivaji het volgende:

Michael

unread,
Dec 17, 2012, 12:16:50 AM12/17/12
to pico...@googlegroups.com
Hi all,

I'm a little bit confused: The manual says "Book/Training Modes (in picochess 0.15 and higher)", but where can I find the v0.15 image? On the PicoChess page there's only v0.13 available? Is v0.15 hidden somewhere in the blog?

Regards, Michael

Shivkumar Shivaji

unread,
Dec 17, 2012, 12:24:35 AM12/17/12
to pico...@googlegroups.com
0.15 is not yet 'officially' released. Javier has manually updated picochess using the git instructions. It should be soon.

Shiv

Shivkumar Shivaji

unread,
Dec 17, 2012, 12:28:35 AM12/17/12
to pico...@googlegroups.com
Class 4 or 10 are both fine. It will take longer to write the image if you use class 4, >= 4MB/s for class 4 >= 10MB/s for class 10.

If printing means seeing the games moves', the wiki has a way of SSHing to the machine to view output when picochess is playing. Hopefully that is enough. That is all we currently have :)

I have the position setup locally working now. I have not extensively tested this mode, for example, it assumes that castling is always possible in any position. The mode is handy when playing over tactical positions or endgames from books. Will submit this code and will mention more comments soon.

Shiv


Reply all
Reply to author
Forward
0 new messages