Arena "sd=9999"

Discussion of chess software programming and technical issues.

Moderator: Ras

Richard Allbert
Posts: 794
Joined: Wed Jul 19, 2006 9:58 am

Arena "sd=9999"

Post by Richard Allbert »

Hi,

I was putting in winboard support today for the version of Lime that played in the CPT two weeks ago, and used Arena due to it's plus point of having a live debug window...

I was shocked to see it send "sd 9999", followed by "level 0 10 0" for a 10 minute all moves game..... naturally frustration number #1000 today :) as Lime set off merrily on a maxdepth search.....

Is this normal?

Thanks for any answers.

Regarding Arena, the debug window is about the only thing that is useful.... in CPT i used it for the first five games, and in each one it crashed - always for a different reason. Vanishing pieces, GUI freeze, adjusting clocks.. :evil: :evil:

For round 6 SMK was nice enough to look up my Shredder serial no. so I could install and use that.... :D

Richard
Laurens Winkelhagen

Re: Arena "sd=9999"

Post by Laurens Winkelhagen »

as far as I know you should implement the "sd" command as a limit, not as an order: I mean, the engine should not think deeper than 9999 ply, but it's very much allowed to think less:-)
Christopher Conkie
Posts: 6074
Joined: Sat Apr 01, 2006 9:34 pm
Location: Scotland

Re: Arena "sd=9999"

Post by Christopher Conkie »

Richard Allbert wrote:Hi,

I was putting in winboard support today for the version of Lime that played in the CPT two weeks ago, and used Arena due to it's plus point of having a live debug window...

I was shocked to see it send "sd 9999", followed by "level 0 10 0" for a 10 minute all moves game..... naturally frustration number #1000 today :) as Lime set off merrily on a maxdepth search.....

Is this normal?
No

Code: Select all

738.166*1*-----------------------Starting engine 1 Lime 66 x32------------------------
738.216*1*Configured Engine 1 Type:   WB2
738.415*1*Engine 1 dir: C:\Program Files (x86)\Arena\Engines\Lime 66 x32
738.463*1*Engine 1 commandline: "C:\Program Files (x86)\Arena\Engines\Lime 66 x32\Lime_v66.exe" 
738.507*1*Engine 1 ProcessID: 6004
738.527<--1:elem size = 24
738.548<--1:numelem = 1333333
738.548-->1:xboard
738.548-->1:protover 2
739.311<--1:Hash size 32000 kB
739.312<--1:white book size = 2041416 bytes, with 85059 entries
739.312<--1:numelem set to 64
739.314<--1:elem size = 24
739.314<--1:numelem = 2666666
739.314<--1:Hash size 64000 kB
739.317<--1:feature usermove=1
739.318-->1:accepted usermove
739.326<--1:feature ping=1
739.328-->1:accepted ping
739.329<--1:feature setboard=1
739.329-->1:accepted setboard
739.329<--1:feature reuse=1
739.329-->1:accepted reuse
739.350<--1:feature colors=0
739.350-->1:accepted colors
739.351<--1:feature name=0
739.351-->1:accepted name
739.370<--1:feature done=1
739.370-->1:accepted done
739.392<--1:feature ics=1
739.392-->1:accepted ics
739.592-->1:new
739.594-->1:random
739.595-->1:ics -
739.595-->1:level 0 10 0
739.656-->1:post
739.657-->1:hard
739.657-->1:easy
739.657-->1:ping 4
739.676<--1:pong 4
739.737-->1:ics -
775.085*1*Start calc, move no: 1
775.301-->1:level 0 10 0
775.303-->1:new
775.307-->1:random
775.309-->1:ics -
775.310-->1:level 0 10 0
775.372-->1:post
775.373-->1:hard
775.375-->1:easy
775.376-->1:ping 8
775.398<--1:pong 8
775.501-->1:time 60000
775.507-->1:otim 60000
775.513-->1:usermove g1f3
775.523<--1:book hit, freq 397 position 1
775.527<--1:tellothers Book move d7d5
775.530<--1:masdemove, fifty = 0
775.534<--1:move d7d5
775.538*1*Found move:d7-d5
792.282*1*Start calc, move no: 3
792.523-->1:time 59999
792.526-->1:otim 58353
792.528-->1:usermove h2h3
792.595<--1:4 -2 0 2004 g8f6 b1c3 b8c6 d2d4
792.621<--1:5 31 1 5504 g8f6 b1c3 b8c6 d2d4 c8f5
792.625<--1:6 -3 3 24479 g8f6 b1c3 b8c6 d2d4 c8f5 c1f4
792.629<--1:7 3 7 49973 g8f6 b1c3 b8d7 d2d4 e7e6 c1f4 f8d6
793.019<--1:tellothers depth 8 score(cp) -1 time(s*100) 48 nodes 319048 pv =  g8f6 b1c3 b8d7 d2d4 e7e6 c1g5 f8b4 g5f4
793.022<--1:8 -1 48 319048 g8f6 b1c3 b8d7 d2d4 e7e6 c1g5 f8b4 g5f4
794.342<--1:tellothers depth 9 score(cp) 9 time(s*100) 181 nodes 1179417 pv =  b8c6 b1c3 d5d4 c3e4 f7f5 e4g3 g8f6 e2e3 e7e5 e3d4 e5d4
794.343<--1:9 9 181 1179417 b8c6 b1c3 d5d4 c3e4 f7f5 e4g3 g8f6 e2e3 e7e5 e3d4 e5d4
802.574<--1:tellothers depth 10 score(cp) 2 time(s*100) 1004 nodes 6629722 pv =  g8f6 b1c3 e7e6 d2d4 b8d7 c1f4 f8d6 f4d6 c7d6 e2e3
802.589<--1:10 2 1004 6629722 g8f6 b1c3 e7e6 d2d4 b8d7 c1f4 f8d6 f4d6 c7d6 e2e3
802.619<--1:masdemove, fifty = 1
802.633<--1:move g8f6
802.644*1*Found move:Ng8-f6
Regarding Arena, the debug window is about the only thing that is useful.... in CPT i used it for the first five games, and in each one it crashed - always for a different reason. Vanishing pieces, GUI freeze, adjusting clocks.. :evil: :evil:
What version of Arena are you using and what are you doing to it Richard? It does not work on Windows 3.1 you know.....

:)
For round 6 SMK was nice enough to look up my Shredder serial no. so I could install and use that.... :D

Richard
I should hope so, you did buy it after all.

Christopher
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Arena "sd=9999"

Post by bob »

Laurens Winkelhagen wrote:as far as I know you should implement the "sd" command as a limit, not as an order: I mean, the engine should not think deeper than 9999 ply, but it's very much allowed to think less:-)
I must say that if that is true, it is a truly stupid interpretation of that command, which several programs have been using for 20+ years. In Crafty, sd=n says to search N plies deep. Period...
Richard Allbert
Posts: 794
Joined: Wed Jul 19, 2006 9:58 am

Re: Arena "sd=9999"

Post by Richard Allbert »

Agreed...

My time allocation starts with "if max depth is set then allocate an infinite movetime" - this was the problem.

I'll change it to accomodate sd=9999

:D
Richard Allbert
Posts: 794
Joined: Wed Jul 19, 2006 9:58 am

Re: Arena "sd=9999"

Post by Richard Allbert »

Actually don't agree now....

Say I play a game with "sd 7" and the next game decide to play with movetime "st 15" - how do you know not to stay with maxdepth 7?

The way I do it is to say that if I receive an "st" or "level" command, I know depth is not limited.

But Arena sends sd=9999 for this... in the example below, I set max depth 8, then change to a blitz 2'6" TC....

Code: Select all

1.093**----------New game---2009-02-25 06:33:33,496 Wed -------------
9.314*1*-------------------------Starting engine 1 Lime_v69-------------------------
9.314*1*Configured Engine 1 Type:   WB2
9.500*1*Engine 1 dir: C:\Chess\Programming\Lime_v69\bin\Release
9.563*1*Engine 1 commandline: C:\Chess\Programming\Lime_v69\bin\Release\Lime_v69.exe 
9.625*1*Engine 1 ProcessID: 4044
9.657<--1:Table elem size = 24
9.657<--1:TT->elem = 32000000
9.688<--1:As element numbers :TT->elem = 1333333
9.688-->1:xboard
9.688-->1:protover 2
10.468<--1:Table memory occupation :TT->table = 31999 kB
10.468<--1:feature ping=1
10.468-->1:accepted ping
10.468<--1:feature setboard=1
10.468-->1:accepted setboard
10.468<--1:feature usermove=1
10.468-->1:accepted usermove
10.515<--1:feature time=1
10.515-->1:accepted time
10.515<--1:feature reuse=1
10.515-->1:accepted reuse
10.515<--1:feature analyze=0
10.515-->1:accepted analyze
10.515<--1:feature myname="Lime_v69"
10.546<--1:feature name=0
10.546-->1:accepted name
10.546<--1:feature pause=0
10.546-->1:accepted pause
10.546<--1:feature playother=1
10.546-->1:accepted playother
10.546<--1:feature done=1
10.546-->1:accepted done
10.811-->1:new
10.811-->1:random
10.811-->1:level 0 10 0
10.874-->1:post
10.874-->1:hard
10.874-->1:ping 1
10.904<--1:pong 1
22.371-->1:sd 8
27.752-->1:sd 9999
27.752-->1:level 0 2 6
:?:
Richard Allbert
Posts: 794
Joined: Wed Jul 19, 2006 9:58 am

Re: Arena "sd=9999"

Post by Richard Allbert »

Hi Chris,

I've posted the log in the reply to Bob.... Windows vista, latest arena.

Richard
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: Arena "sd=9999"

Post by jwes »

bob wrote:
Laurens Winkelhagen wrote:as far as I know you should implement the "sd" command as a limit, not as an order: I mean, the engine should not think deeper than 9999 ply, but it's very much allowed to think less:-)
I must say that if that is true, it is a truly stupid interpretation of that command, which several programs have been using for 20+ years. In Crafty, sd=n says to search N plies deep. Period...
When i try it, is seems to stop searching when either the allotted time or depth is reached.

Code: Select all

Crafty v22.8 (1 cpus)

White(1): sd 16
search depth set to 16.
White(1): time 40/1
40 moves/1 minutes primary time control
40 moves/1 minutes secondary time control
White(1): e4
              time used:  25.50
              time surplus   0.00  time limit 1.50 (+0.00) (10.50)
              depth   time  score   variation (1)
               11     0.46   0.17   1. ... Nc6 2. Nc3 Nf6 3. Nf3 e6 4.
                                    d4 Bb4 5. Bd3 Bxc3+ 6. bxc3 d5 7. exd5
                                    exd5
               11->   0.62   0.17   1. ... Nc6 2. Nc3 Nf6 3. Nf3 e6 4.
                                    d4 Bb4 5. Bd3 Bxc3+ 6. bxc3 d5 7. exd5
                                    exd5
               12     0.98   0.27   1. ... Nc6 2. Nc3 Nf6 3. Nf3 e5 4.
                                    d4 exd4 5. Nxd4 Bb4 6. Nxc6 Bxc3+ 7.
                                    bxc3 dxc6 8. Qxd8+ Kxd8
              time=1.50  mat=0  n=823434  fh=87%  nps=548K
              ext-> check=7K qcheck=13K reduce=408K/87K
              predicted=0  evals=627K  50move=0  EGTBprobes=0  hits=0
              SMP->  splits=0  aborts=0  data=0/64  elap=1.50

Black(1): Nc6 
              time used:   1.50
User avatar
hgm
Posts: 28321
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Arena "sd=9999"

Post by hgm »

bob wrote:
Laurens Winkelhagen wrote:as far as I know you should implement the "sd" command as a limit, not as an order: I mean, the engine should not think deeper than 9999 ply, but it's very much allowed to think less:-)
I must say that if that is true, it is a truly stupid interpretation of that command, which several programs have been using for 20+ years. In Crafty, sd=n says to search N plies deep. Period...
From the defintion of WB protocol v2 on Tim Mann's web page
Chess Engine Communication Protocol wrote:sd DEPTH
The engine should limit its thinking to DEPTH ply.
WinBoard Manual wrote:/depth or /searchDepth number

Tells the chess engine to look ahead at most the given number of moves when searching for a move to make. Without this option, the engine chooses its search depth based on the number of moves and amount of time remaining until the next time control. With the option, the engine will cut off its search early if it reaches the specified depth.
Seems to me the words 'limit' or 'at most' (underlining is mine) are quite unambiguous. For those still in doubt, we can see how Tim Mann's WinBoard / XBoard implements it, and it always sends both the level command and the sd command (when non-zero argument was requested). The code for this in WB 4.2.7b goes accompanied by the comment:

Code: Select all

    /* Orthogonally, limit search to given depth */
Also here, 'orthogonally' leaves little doubt.

So it seems Crafty (and perhaps several other programs that have been using the sd command for 20+ years :lol: ) have a faulty, or at least non-compliant implmentation of sd.

I can add tha both my engines implement sd correctly, i.e. as a limit, that should be obeyed in addition to the time limits specifid by the st or level commands.
User avatar
hgm
Posts: 28321
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Arena "sd=9999"

Post by hgm »

Richard Allbert wrote:Say I play a game with "sd 7" and the next game decide to play with movetime "st 15" - how do you know not to stay with maxdepth 7?

The way I do it is to say that if I receive an "st" or "level" command, I know depth is not limited.
From Tim Mann's description of the new command:
Chess Engine Communication Protocol wrote:new
Reset the board to the standard chess starting position. Set White on move. Leave force mode and set the engine to play Black. Associate the engine's clock with Black and the opponent's clock with White. Reset clocks and time controls to the start of a new game. Stop clocks. Do not ponder on this move, even if pondering is on. Remove any search depth limit previously set by the sd command.
(Underlining mine).

When all else fails, read the manual! :lol: :lol: :lol:

In defense of the silly behavior of Arena I should say that WinBoard actually can never get into a situation where the depth limit is altered, as this limit can only be set by a command-line option, where t would remain in force for the entire duration of the session, and not interactively through any menu. If I were to implement setting the depth limit through a menu in a future Winboard version (which does seem a good idea, e.g. in the tim-control dialog), I would preceed the sending of new TC parameters by a new command, rather than sending a new level command and trying to countermand any depth or time limit by a second sd or st command.
Last edited by hgm on Wed Feb 25, 2009 8:34 am, edited 1 time in total.