So called backward analysis

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
User avatar
xr_a_y
Posts: 764
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

So called backward analysis

Post by xr_a_y » Tue Jul 23, 2019 11:46 am

Trying to make Minic for user friendly I will focus on feature for some time :
- pondering
- analysis
- level
- syzygy TB
- style

I'm now confronted to analysis mode. Using xboard protocol, what are the involved command to allow the user to make backward analysis ? Is it UNDO and REMOVE ? If so, is the engine suppose to remember played moves to implement them ?

User avatar
hgm
Posts: 23718
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: So called backward analysis

Post by hgm » Tue Jul 23, 2019 12:55 pm

Indeed, the engine will have to remember the moves and start FEN (which might be received from a 'setboard'. What I usually do on reception of an 'undo' is set up the board from that FEN, and replay all the moves minus one (or two, for 'remove').

D Sceviour
Posts: 458
Joined: Mon Jul 20, 2015 3:06 pm
Contact:

Re: So called backward analysis

Post by D Sceviour » Tue Jul 23, 2019 1:12 pm

The usual Winboard command for taking back a move is "undo". The "remove" command is documented for xboard protocol but I was never able to find an occurance of it ever sent by Winboard. Instead, an undocumented "back [n]" command may be sent by Winboard, Arena or other GUI. Winboard will remember the moves in an internal pgn buffer, but you should at least track the current move number.

Set up Schooner in debug mode and analyze back and forth a few moves. The debug code will show you all the commands your engine should expect to receive and respond to in Winboard. Also, try debugging with different GUI's to test the continuity for analyzing.

User avatar
xr_a_y
Posts: 764
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: So called backward analysis

Post by xr_a_y » Tue Jul 23, 2019 2:07 pm

hgm wrote:
Tue Jul 23, 2019 12:55 pm
Indeed, the engine will have to remember the moves and start FEN (which might be received from a 'setboard'. What I usually do on reception of an 'undo' is set up the board from that FEN, and replay all the moves minus one (or two, for 'remove').
Ok thanks, even that BACK [n] command shall be treated this way. I'll implement that soon.

User avatar
hgm
Posts: 23718
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: So called backward analysis

Post by hgm » Tue Jul 23, 2019 3:18 pm

I have never seen a BACK [n] command. The 'remove' command is sent by WinBoard/XBoard when you exercise the Engine -> Retract Move menu item. I guess GNU Chess supported it in addition to 'undo', because when the engine is playing white or black, and you take back only a single ply, the engine will be on move again, and re-make the play before you can undo a second one. So then you would have to switch to force mode first, before you can undo, and then set the engine playing again. This is of course no problem if a GUI controls the engine, but GNU Chess was designed for typing the commands by hand...

Typically people want to retract because they blundered, and only realize it when they see the engine's refutation of their move. Then they want to take back bot the engine's move and their own, to play an alternative to the latter for continuing the game.

User avatar
xr_a_y
Posts: 764
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: So called backward analysis

Post by xr_a_y » Tue Jul 23, 2019 4:13 pm

ok, thanks again.

Post Reply