Phalanx source code

Discussion of anything and everything relating to chess playing software and machines.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Elorejano
Posts: 96
Joined: Sat Mar 20, 2010 2:31 am

Phalanx source code

Post by Elorejano » Thu Feb 09, 2012 11:28 pm

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

User avatar
JuLieN
Posts: 2948
Joined: Mon May 05, 2008 10:16 am
Location: Nantes (France)
Contact:

Re: Phalanx source code

Post by JuLieN » Thu Feb 09, 2012 11:31 pm

Yes, I compiled the latest one for MacOSX. You can download it here:
http://julien.marcel.free.fr/macchess/phalanx-XXIII.zip
(Sources included). :)
"The only good bug is a dead bug." (Don Dailey)
Image [Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]

Elorejano
Posts: 96
Joined: Sat Mar 20, 2010 2:31 am

Re: Phalanx source code

Post by Elorejano » Fri Feb 10, 2012 1:08 am

Thanks!
Is this "ScidvsPC" version?
Thx

User avatar
Jim Ablett
Posts: 1327
Joined: Fri Jul 14, 2006 5:56 am
Location: London, England
Contact:

Re: Phalanx source code

Post by Jim Ablett » Fri Feb 10, 2012 6:12 am

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.

stevenaaus
Posts: 602
Joined: Wed Oct 13, 2010 7:44 am
Location: Australia
Contact:

Re: Phalanx source code

Post by stevenaaus » Fri Feb 10, 2012 7:15 am

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.

Elorejano
Posts: 96
Joined: Sat Mar 20, 2010 2:31 am

Re: Phalanx source code

Post by Elorejano » Fri Feb 10, 2012 11:21 pm

Thank, masters!
I will try..

stevenaaus
Posts: 602
Joined: Wed Oct 13, 2010 7:44 am
Location: Australia
Contact:

Re: Phalanx source code

Post by stevenaaus » Sat Feb 11, 2012 11:32 am

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.

stevenaaus
Posts: 602
Joined: Wed Oct 13, 2010 7:44 am
Location: Australia
Contact:

Re: Phalanx source code

Post by stevenaaus » Sat Feb 11, 2012 11:56 am

Here is the source and Jim's binary.
http://scidvspc.sourceforge.net/tmp/pha ... n32-ja.zip

User avatar
Jim Ablett
Posts: 1327
Joined: Fri Jul 14, 2006 5:56 am
Location: London, England
Contact:

Re: Phalanx source code

Post by Jim Ablett » Sat Feb 11, 2012 1:08 pm

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.

Elorejano
Posts: 96
Joined: Sat Mar 20, 2010 2:31 am

Re: Phalanx source code

Post by Elorejano » Sun Feb 12, 2012 5:06 pm

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

Post Reply