GNU Shogi Windows port

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

GNU Shogi Windows port

Post by hgm »

I updated the WinBoard version of GNU Shogi, to become a true Windows port, which is no longer dependent on the Cygwin DLLs. The price is that the stand-alone modes are totally broken, so this version is only suitable for playing under WinBoard. I also fixed a few problems with the previous version:

* Pondering, which in the original version was dependent on SIGINT to get out of it, a feature that Windows does not support, now works through polling for input with PeekNamedPipe() during ponder.
* The "level" command now understands the full WinBoard syntax again, including the increment, so that incremental TC works. GNU Shogi seems to have dificulty with sudden-death, though.
* The PV is now printed in standard coordinates, in stead of Shogi coordinates.
* Thinking Output with ponder on is repaired.
* The "edit" command now should understand the standard coordinates WinBoard sends. (But no setting up with promoted pieces is possible yet, as WinBoard does not send the format GNU Shogi expects for this.)

The new (32bits) Windows binary, plus a diff file for the source, is available from:
http://hgm.nubati.net/gnushogi.zip

I put all Windows-specific changes in "#ifdef WIN32" conditional code, so in theory the source should still compile on Linux, to produce an XBoard-compatible version of GNU Shogi. I did not test this, however.
Dann Corbit
Posts: 12542
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: GNU Shogi Windows port

Post by Dann Corbit »

hgm wrote:I updated the WinBoard version of GNU Shogi, to become a true Windows port, which is no longer dependent on the Cygwin DLLs. The price is that the stand-alone modes are totally broken, so this version is only suitable for playing under WinBoard. I also fixed a few problems with the previous version:

* Pondering, which in the original version was dependent on SIGINT to get out of it, a feature that Windows does not support, now works through polling for input with PeekNamedPipe() during ponder.
* The "level" command now understands the full WinBoard syntax again, including the increment, so that incremental TC works. GNU Shogi seems to have dificulty with sudden-death, though.
* The PV is now printed in standard coordinates, in stead of Shogi coordinates.
* Thinking Output with ponder on is repaired.
* The "edit" command now should understand the standard coordinates WinBoard sends. (But no setting up with promoted pieces is possible yet, as WinBoard does not send the format GNU Shogi expects for this.)

The new (32bits) Windows binary, plus a diff file for the source, is available from:
http://hgm.nubati.net/gnushogi.zip

I put all Windows-specific changes in "#ifdef WIN32" conditional code, so in theory the source should still compile on Linux, to produce an XBoard-compatible version of GNU Shogi. I did not test this, however.
Is your modified shource available?

I have lots of Windows shogi programs. Unfortunately, most are not USI compliant. It might be interesting to try a tournament of those that are.

Only about half of these binaries are actually Shogi programs:
01-03-11
2chkifu.exe
2fu.exe
??.exe
_ISDEL.EXE
Alldump.exe
alltokif.exe
Amazon.exe
Aya.exe
b.exe
BanGet24.exe
BCMShogi-old.exe
BCMShogi.exe
BCMShogi.vshost.exe
BCMShogi_1.exe
BCMShogi_2.exe
BlunderUSI.exe
bonanza.exe
bonanza_feliz_csa_lan32r.exe
bonanza_feliz_csa_lan64r.exe
bonanza_feliz_csa_mnj_lan32r.exe
bonanza_feliz_csa_mnj_lan64r.exe
bonanza_feliz_csashogi32r.exe
bonanza_feliz_csashogi64r.exe
bonanza_feliz_dekunobou32r.exe
bonanza_feliz_dekunobou64r.exe
bonanza_feliz_mnj_lan32r.exe
bonanza_feliz_mnj_lan64r.exe
Bonanza_MPV.exe
bonapipe.exe
bonasse.exe
bonasse64.exe
bonno.exe
bonta.exe
book.exe
booze.exe
CFEDIT.EXE
cgfgoban.exe
CPW.exe
CSA.EXE
csa2bin.exe
Csa_1.exe
Csa_2.exe
csa_win.exe
CsaBona.exe
CsaBona05.exe
CSATOK.EXE
Dai.exe
Dek.exe
DOSShogi.exe
Echo.exe
epuninst.exe
ETOK.EXE
ETOKALL.EXE
floodgate46.exe
floodgate46.vshost.exe
fly.exe
FM.EXE
fmax.exe
FME.EXE
fme267c.exe
fme267c_98.exe
FMEV.EXE
FMVIEW.EXE
fmvw290.exe
fmvw290_98.exe
FM‚O‚O‚V￾«Šû.exe
FMƒAƒ_ƒ‹ƒg￾«Šû.exe
FMƒAƒ_ƒ‹ƒg’†￾«Šû.exe
FMˆÚ“®￾«Šû.exe
FM￾d—Í￾«Šû.exe
FM”š”­￾«Šû.exe
FMŽµ￾‘￾«Šû.exe
fview.exe
GEKI101.EXE
geki7up+3.EXE
GEKI8UP2.EXE
gnushogi.exe
gpsshogi.exe
gpsusi.exe
gtest_color_test_.exe
gtest_env_var_test_.exe
gtest_environment_test.exe
gtest_output_test_.exe
gtest_prod_test.exe
gtest_uninitialized_test_.exe
gtest_unittest.exe
gunjin.exe
Gws1.exe
HASAMI.EXE
hsptmp.exe
husyougi.exe
IDEAEasyTournament.exe
IDEARoomMapper.exe
IkawOne.exe
japanesechess.vshost.exe
Jyuryo.exe
K-Shogi.exe
k2tokif.exe
K814.EXE
Kani.exe
katamawari12.exe
KB604_10.EXE
KB604_20.EXE
KCHANGI.EXE
KCHESS.EXE
KCHESSW.EXE
Ki2Shiro.exe
kifconv.exe
KIFU.EXE
KifuBase.exe
Kifuexpl.exe
KifuRead24.exe
KifuSave24.exe
Kifuw.exe
KISEKAKI.EXE
kjupdate.EXE
KOUGUN30.EXE
ks6tokif.exe
KShogi8.EXE
KSProject.exe
KTOSHIRO.EXE
kusuta2.21b.exe
KView.exe
kw2fm.exe
KXIAN.EXE
LaramieV1.exe
LaramieV2.exe
LaramieV3.exe
Lesserkai.exe
Lightning.exe
LightningUSI.exe
M2TOK.EXE
makuri3.exe
MemSea24.exe
MyBona.exe
MyBona.vshost.exe
myousyu.exe
Nanashi.exe
nanasi.exe
NARITYE.EXE
nsshogi5.exe
nunit-agent.exe
nunit-console-x86.exe
nunit-console.exe
nunit-x86.exe
nunit.exe
nvshogi.exe
PDFDown.exe
PetitShogi.exe
PetitShogi.vshost.exe
pnunit-agent.exe
pnunit-launcher.exe
polyglot.exe
PonanzaQuartette.exe
PSPShogi.exe
PSWBTM.exe
Puzzle16.exe
Rakusho.exe
Reverse.exe
RPrep.exe
runFile.exe
SaveTDSReg.exe
setup.exe
sgen.exe
SHO.EXE
Shogi
shogi.exe
Shogi.vshost.exe
shogi2.10.exe
Shogidokoro.exe
Shogidokoro.vshost.exe
ShogiMeijin.exe
ShogiVar.exe
slitherLink.exe
sntokif.exe
sp2html.exe
SPAR.EXE
spara.exe
SpearShogidokoro.exe
SpearShogidokoro2009.exe
SPRR.EXE
SPRTG.EXE
ss2004.exe
ssp.exe
Step2.exe
Susie.exe
System36.exe
TB304.EXE
TBtoK32.exe
Test56.exe
Test56_1.exe
theory.exe
timeseal.exe
timestamp.exe
TJchess0121R.exe
TJchess0121U.exe
TJchess10x8.exe
TJshogi.exe
TJxiangqi.exe
TOBI.EXE
u2b.exe
u2b.vshost.exe
unins000.exe
Unix2Src.exe
up1_100_131.exe
up2_100_113.exe
up2l2_100_101.exe
up3_100_113.exe
up3l1_100_101.exe
up3l3_100_101.exe
up4l2_100_102.exe
Update.exe
ups_100_111.exe
UsaCsa.exe
usapyon.exe
USI2WB.exe
winboard.exe
WINSHO~1.EXE
worst.exe
Worst1.exe
YaneLisp.exe
Youbi.exe
YS.EXE
yss_u2.exe
ZENP.EXE
ztest42496.exe
ztest48552.exe
‚¨￾é￾«Šû.EXE
‚¨￾é￾«Šû_1.exe
‚¨￾é￾«Šû_2.exe
‰BŠò.exe
‰BŠò_1.exe
‰BŠò_2.exe
‰BŠò_3.exe
‰BŠò_4.exe
‹î‰¹.EXE
￾«ŠûŠO“`.exe
￾Ÿ—¦ŒvŽZ‹@.exe
‘æ‚P‚P‰ñ.exe
“®•¨￾«Šû.exe
—z‰Š.exe
—´”n￾«Šûver1.03.exe
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: GNU Shogi Windows port

Post by hgm »

I did not include the complete source, just a diff file with my modifications. With "patch -p0 < dif.txt" you should be able to generate my source from the official GNU Shogi 1.3.2 sources. If that does not work: I will probably check in the GNU Shogi sources in my git repository on hgm.nubati.net, so you could load a snapshot from there. But that will have to wait to tomorrow.

Indeed, a Shogi tourney would be interesting. (It would be even more interesting if the games could be followed on-line. But the Javascript viewer page I use to do this for Chess games does not work for Shogi yet, as it does not implement holdings or drops. My ICS fully supports Shogi now, though, so perhaps that could somehow be used.)

I have 10 Shogi engines that support WB protocol or a USI dialect. From strongest to weakest they are:

GPS-Shogi
Bonanza
Blunder
Spear
Laramie
Shokidoki
PetitShogi
TJshogi
GNU Shogi
Lesserkai

I am currently trying to find a common ground for them to play each other. This is not trivial, as some of the so-called USI engines turn out not to be fully USI compliant, and do not understand all time controls. This applies to PetitShogi and Spear. (I dd not test GPS and Bonanza yet.) Spear is not able to ponder. (But we could do ponder off.) Laramie refuses to use its initial time in incremental TC, and plays from the increment only, which is a large handicap in TCs like 5+2, where most of the time comes from the base time rather than the increment. Lesserkai seems not to have time control at all, but to be fixed for 4 ply search depth. (It is open source, though, so perhaps this limitation could be removed.)

The disparity in playing strength is HUGE, as much as between Stockfish and Numpty. In Shogi there are interesting handicap systems, though. We could create more players by also entering versions that face Lance odds and Rook odds. I still have to experiment some with that. (I am not sure if all engines support setting up a position.)
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: GNU Shogi Windows port

Post by hgm »

I now put the modified source of GNU Shogi in my git repository on hgm.nubati.net . As I tugged away all modifications for the Windows port as #ifdef WIN32 conditional code, it still will compile for Linux as well, to give a version that can run under XBoard. I tested this now, and it seemed to work flawlessly.
Dann Corbit
Posts: 12542
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: GNU Shogi Windows port

Post by Dann Corbit »

hgm wrote:I now put the modified source of GNU Shogi in my git repository on hgm.nubati.net . As I tugged away all modifications for the Windows port as #ifdef WIN32 conditional code, it still will compile for Linux as well, to give a version that can run under XBoard. I tested this now, and it seemed to work flawlessly.
Thanks. I pulled a copy.
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: GNU Shogi Windows port

Post by hgm »

Note that in compiling on Ubuntu Hardy, I get one very suspect warning:

Code: Select all

search.c&#58; In function ‘search’&#58;
search.c&#58;896&#58; warning&#58; overflow in implicit constant conversion
Line 896 looks like this:

Code: Select all

            CptrFlag&#91;ply&#93; = &#40;node->flags & capture&#41;;
where capture is #defined as 512, node->flags should be a short int, which is still OK, but CptrFlag is declared as small_short, which is #defined to signed char. So this indeed seems just to be an expensive way of generating a zero...

So this seems a genuine bug. It is not my intention to debug GNU Shogi, though. (I have my own Shogi engine for that, and happily leave debugging GNU Shogi to the compettion... :wink: ) I just want it to play under XBoard, buggy as it may be.

Note that I now also ported UCI2WB to Linux, and that I put the sources of that also in my on-line git repository. With the aid of it, I could play a Linux compile of Lesserkai against GNU Shogi under XBoard, with the command

xboard -variant shogi -size 49 -fcp "./UCI2WB -s ./Lesserkai LesserkaiSrc/Lesserkai" scp gnushogi -sd "gnushogi-1.3.2/gnushogi"