On-line engine blitz tourney February

Discussion of chess software programming and technical issues.

Moderator: Ras

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

Re: On-line engine blitz tourney February

Post by hgm »

A full-blown server is an extremely complex piece of software, perhaps 10 times more complex than a GUI. FICS takes not only care of mediating games, but also of a user administration, game database, inter-user messaging, broadcasting games to observers, e-mailing...

Of course for a monthly tournament we could leave out a lot of that. E.g. people can record their own games, user verification could be based on paswords e-mailed to the server operator, people could chat through an unrelated chat server...
Joost Buijs
Posts: 1687
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: On-line engine blitz tourney February

Post by Joost Buijs »

Of course it's compicated, and basically a lot of work. If I remember well the first version of the Lasker server was written in just a couple of weeks, so it's certainly doable.

The current version (v2.2.3) of the Lasker/Capablanca server is very buggy, it uses dynamic memory allocation everywhere without checking whether the allocation failed or not, it uses fscanf() and sscanf() throughout without checking the size of the destination buffers, several uninitialized local variables, some memory leaks, and the serialization/marshalling code is completely broken too.

I could be that the database got corrupted somewhere, to check this I have to write a piece of software to scan the whole database for validity. I really don't know if it's worth the effort to fix all these things for just one tournament per month.
mar
Posts: 2678
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: On-line engine blitz tourney February

Post by mar »

hgm wrote: Thu Feb 26, 2026 8:49 pm A full-blown server is an extremely complex piece of software, perhaps 10 times more complex than a GUI. FICS takes not only care of mediating games, but also of a user administration, game database, inter-user messaging, broadcasting games to observers, e-mailing...
really though?

in terms of lines of code, comparing the capablanca server to cutechess gives 26k sloc for Lasker and 55k for cutechess,
while C is typically more verbose than C++ in this regard
also since cutechess is built on top Qt, that doesn't even include the low level GUI part
User avatar
hgm
Posts: 28470
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: On-line engine blitz tourney February

Post by hgm »

I can do an engine in 200 lines, and I would be disappointed if I could not do a GUI in 2000 lines.
User avatar
flok
Posts: 614
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: On-line engine blitz tourney February

Post by flok »

hgm wrote: Mon Mar 09, 2026 7:06 am I can do an engine in 200 lines, and I would be disappointed if I could not do a GUI in 2000 lines.
Preferably new code is written in a style readable by others as well :P
mar
Posts: 2678
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: On-line engine blitz tourney February

Post by mar »

hgm wrote: Mon Mar 09, 2026 7:06 am I can do an engine in 200 lines, and I would be disappointed if I could not do a GUI in 2000 lines.
why not simply admit that your guess was off, there's no shame in that and it's much less work
you don't have to prove anything to anyone, that was not my point

of course there are many ways to cheat, from grabbing existing tournament managers and board renderers and gluing something crude,
obfuscating and fitting lots of code on humongous lines to simply spawning existing GUI process or downloading source
and spawning make or even redefining what is still considered a GUI
the complexity still has to exist somewhere