Page 1 of 6

Phalanx source code

Posted: Fri Feb 10, 2012 12:28 am
by Elorejano
Hi!
I need a "workable" Phalanx source code.
Im reffering this because theres not source of Phalanx Reborn from Jim Abblet (this freezes alyway)
Nor works 100% the version of ScidvsPC, but seems that are mainly for analisys.
Dann CorbittĀ“s are no longer available.
Any ideas?
Thanks in advance

Re: Phalanx source code

Posted: Fri Feb 10, 2012 12:31 am
by JuLieN
Yes, I compiled the latest one for MacOSX. You can download it here:
http://julien.marcel.free.fr/macchess/phalanx-XXIII.zip
(Sources included). :)

Re: Phalanx source code

Posted: Fri Feb 10, 2012 2:08 am
by Elorejano
Thanks!
Is this "ScidvsPC" version?
Thx

Re: Phalanx source code

Posted: Fri Feb 10, 2012 7:12 am
by Jim Ablett
Elorejano wrote:Hi!
I need a "workable" Phalanx source code.
Im reffering this because theres not source of Phalanx Reborn from Jim Abblet (this freezes alyway)
Nor works 100% the version of ScidvsPC, but seems that are mainly for analisys.
Dann CorbittĀ“s are no longer available.
Any ideas?
Thanks in advance
If you are running Phalanx on Windows you need to disable polling with a command line switch (or change in src before compiling) otherwise engine will not work correctly. You can also compile with Cygwin which will use the Unix polling correctly.

Code: Select all

Phalanx XXII

Usage&#58;    phalanx &#91;options&#93; &#91;<moves> <minutes> &#91;<increment in seconds>&#93;&#93;
          phalanx &#91;options&#93; &#91;<seconds per move>&#93;
          phalanx bench
          phalanx bcreate &#91;options&#93;
Options&#58;  -t <transposition table size in kilobytes>
          -f <fixed search time in seconds>
          -x <+/->  xboard mode on/off        default&#58; on
          -p <+/->  permanent brain on/off    default&#58; off
          -s <+/->  show thinking on/off      default&#58; off
           -c <+/->  cpu time                  default&#58; off
          -o <+/->  polling input             default&#58; on
          -b <+/->  opening book              default&#58; on
          -r <resign value in centipawns>     default&#58; 0 &#40;no resigning&#41;
          -e <easy level 0...100>             default&#58; 0 &#40;best play&#41;
          -l <+/->  learning on/off           default&#58; on
          -v        print version and exit
          -P <primary book directory>
          -S <secondary book directory>
          -L <learning file directory>
          -g <log file name>
Examples&#58; phalanx -c+ -s+ -o - -x- -f 60 -t4000
          xboard -fcp "phalanx -l+ -r800"
Jim.

Re: Phalanx source code

Posted: Fri Feb 10, 2012 8:15 am
by stevenaaus
Jim is right. Moreover, i spent hours looking for win32 polling code on the web, and it doesn't seem to exist (apart from compiling with cygwin.)
To disable polling the command is "phalanx.exe -o -"

The relevant code is in evaluate.c:

Code: Select all

if&#40;Flag.polling&#41;
&#123;
  static fd_set readfds;
  static struct timeval tv;
  int data;

  FD_ZERO (&readfds&#41;;
  FD_SET &#40;fileno&#40;stdin&#41;, &readfds&#41;;
  tv.tv_sec=0;
  tv.tv_usec=0;
  select&#40;16, &readfds, 0, 0, &tv&#41;;
  data=FD_ISSET&#40;fileno&#40;stdin&#41;, &readfds&#41;;
  if&#40;data&#41; interrupt&#40;0&#41;;
&#125;
The FD_SET (etc) procs don't exist for Win32 except through cygwin, (which i don't have installed).

The best code is definitely in Scid vs. PC source, where a few bugs were fixed last year (including correctly parsing enpassent from FEN.)

Sorry for being so slack about keeping the sourceforge phalanx page up to date. I'll update it now with a note about the win32 issues.

Re: Phalanx source code

Posted: Sat Feb 11, 2012 12:21 am
by Elorejano
Thank, masters!
I will try..

Re: Phalanx source code

Posted: Sat Feb 11, 2012 12:32 pm
by stevenaaus
Jim has sent me polling code for win32 (from Olithink) and it is in Scid vs. PC svn :)

After a quick test - it doesn't seem to update properly after a move, (when Scid sends)

Code: Select all

exit
force
setboard rn1qkb1r/1pp1pppp/p4n2/3p4/3P1Bb1/P6P/1PPNPPP1/R2QKBNR b KQkq - 0 5
analyze 
So this needs sorting out, but definitely a big improvement.

Re: Phalanx source code

Posted: Sat Feb 11, 2012 12:56 pm
by stevenaaus
Here is the source and Jim's binary.
http://scidvspc.sourceforge.net/tmp/pha ... n32-ja.zip

Re: Phalanx source code

Posted: Sat Feb 11, 2012 2:08 pm
by Jim Ablett
stevenaaus wrote:Jim has sent me polling code for win32 (from Olithink) and it is in Scid vs. PC svn :)

After a quick test - it doesn't seem to update properly after a move, (when Scid sends)

Code: Select all

exit
force
setboard rn1qkb1r/1pp1pppp/p4n2/3p4/3P1Bb1/P6P/1PPNPPP1/R2QKBNR b KQkq - 0 5
analyze 
So this needs sorting out, but definitely a big improvement.
Fixed this issue now I think.

http://dl.dropbox.com/u/5047625/phalanx ... 0-rev2.zip

Jim.

Re: Phalanx source code

Posted: Sun Feb 12, 2012 6:06 pm
by Elorejano
Thanks Jim!
But seems that Phalanx have time management bug. When is outoff book, its think too much, made a move, another "eternity" and loses on time.
Im using winboard and Arena
I dont know if is related to polling issues but in my computer (AMD, 2 cores, windowaXP).
Tell me if a winboard or Arena debug are needed