UCI wrapper?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

KLc
Posts: 140
Joined: Wed Jun 03, 2020 6:46 am
Full name: Kurt Lanc

UCI wrapper?

Post by KLc »

I want to start a UCI engine with parameters set to certain values, e.g. read from a "profile file". I don't want to leave this to a GUI. The reason is that I'm using several different systems and it's annoying integrating all the options again and again and again. Is there anything like that? Maybe one could pipe options on start via a bash script? I could also imagine writing a Python wrapper for this but I would like to save some time. Anyone any ideas? I'm on macOS/Linux.
Ras
Posts: 2488
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: UCI wrapper?

Post by Ras »

One of the reasons why UCI took off back then was the INI file hell that Winboard engines suffered from. The usual use case is that the user has one system and several engines, and then it's pretty bad to fudge around with all of them.
Rasmus Althoff
https://www.ct800.net
KLc
Posts: 140
Joined: Wed Jun 03, 2020 6:46 am
Full name: Kurt Lanc

Re: UCI wrapper?

Post by KLc »

Sure, but I mean this scenario certainly exists, just think of fixing an engine state for research and verifiability. I could definitely write a Python wrapper using python-chess but it will take a few days of work. So, I'm wondering whether anyone has done this already or has another—maybe simpler—solution.
OfekShochat
Posts: 50
Joined: Thu Oct 15, 2020 10:19 am
Full name: ghostway

Re: UCI wrapper?

Post by OfekShochat »

I write an mcts python-c chess engine. so I have written a uci wrapper for it. there are parameters like a book, network type and more. I can give you the code or if you want to I can modify it for you. its in python. and a bash or batch code is really a thing of a day of work. (or you can make the script run the python one)
Ras
Posts: 2488
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: UCI wrapper?

Post by Ras »

KLc wrote: Fri Nov 13, 2020 8:08 amjust think of fixing an engine state for research and verifiability.
I'm using c-chess-cli for engine testing, so no GUI at all. I write up the program call including the engine config (via CLI arguments) one time, store that in a text file, and copy/paste it into the terminal as command. Works under Linux and macOS: https://github.com/lucasart/c-chess-cli/
Rasmus Althoff
https://www.ct800.net
OfekShochat
Posts: 50
Joined: Thu Oct 15, 2020 10:19 am
Full name: ghostway

Re: UCI wrapper?

Post by OfekShochat »

Ras wrote: Fri Nov 13, 2020 9:32 am
KLc wrote: Fri Nov 13, 2020 8:08 amjust think of fixing an engine state for research and verifiability.
I'm using c-chess-cli for engine testing, so no GUI at all. I write up the program call including the engine config (via CLI arguments) one time, store that in a text file, and copy/paste it into the terminal as command. Works under Linux and macOS: https://github.com/lucasart/c-chess-cli/
oh cutechess-cli is a good idea! and with unix-like system its also easy to setup. not like windows
Ras
Posts: 2488
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: UCI wrapper?

Post by Ras »

OfekShochat wrote: Fri Nov 13, 2020 9:34 amoh cutechess-cli is a good idea!
Yeah, cutechess-cli is also popular, though I like c-chess-cli because it doesn't have dependencies.
and with unix-like system its also easy to setup. not like windows
Exactly. Both cutechess-cli and c-chess-cli wrap the engine options and forward them to the engine.
Rasmus Althoff
https://www.ct800.net
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI wrapper?

Post by hgm »

KLc wrote: Fri Nov 13, 2020 7:45 am I want to start a UCI engine with parameters set to certain values, e.g. read from a "profile file". I don't want to leave this to a GUI. The reason is that I'm using several different systems and it's annoying integrating all the options again and again and again. Is there anything like that? Maybe one could pipe options on start via a bash script? I could also imagine writing a Python wrapper for this but I would like to save some time. Anyone any ideas? I'm on macOS/Linux.
Isn't this exactly what Polyglot does? When called without arguments it would read the engine filename, and the settings for all te parameters from a polyglot.ini file in the current directory, and start the engine with those parameters.
KLc
Posts: 140
Joined: Wed Jun 03, 2020 6:46 am
Full name: Kurt Lanc

Re: UCI wrapper?

Post by KLc »

Thanks for the replies. I had a look at cutechess-cli and c-chess-cli. They basically do what I want but they require two engines and are designed to start a match. That's not what I want. I just want one engine and this should wait for input—like if I would just start the engine from the command line.

I'm not sure about Polyglot. This is an xboard/winboard wrapper to UCI if I understand correctly. But I already have UCI engines. I just want to conveniently supply them with the options.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI wrapper?

Post by hgm »

Polyglot is a wrapper for UCI engines, which can either make them look like an XBoard engine or a UCI engine with altered default settings and an opening book.