For my normal testing setup I tend to run matches from a Perl script using XBoard. I specify the starting position from a set of opening positions with the -lpf/-lpi commandline options. This works great, but of course I get new XBoard window on my current desktop whenever a new game starts, which is annoying.
It seems that the easiest alternative would be cutechess-cli, but it seems not to have the option of starting from a particular FEN (either specified directly as a string on the commandline or from a file). Looking at the source, my impression is that it wouldn't actually be hard to add this functionality, but before I invest the time to do that I'd like to ask whether someone else has perhaps already done that or knows of some caveats that I might have overlooked?
Suggestions for alternative tools are also welcome, but I don't have the impression there is much choice here.
Note that I'm aware of the option to specify a PGN/EPD opening book. This works, of course, but I would prefer to use the starting positions that I had been using because that way I know that I can compare the new test results with the old (in an ideal world it shouldn't matter, of course, but I'd like to test that first).
cutechess-cli: starting from FEN
Moderators: hgm, Rebel, chrisw
-
- Posts: 2929
- Joined: Sat Jan 22, 2011 12:42 am
- Location: NL
-
- Posts: 6995
- Joined: Thu Aug 18, 2011 12:04 pm
Re: cutechess-cli: starting from FEN
Arena converts EPD to PGN.
-
- Posts: 3232
- Joined: Mon May 31, 2010 1:29 pm
- Full name: lucasart
Re: cutechess-cli: starting from FEN
Ilari has implemented this in the latest git source code. But you'll have to compile it. It allows to use an EPD file as input (ie. text file which is just 1 FEN per line)Evert wrote:For my normal testing setup I tend to run matches from a Perl script using XBoard. I specify the starting position from a set of opening positions with the -lpf/-lpi commandline options. This works great, but of course I get new XBoard window on my current desktop whenever a new game starts, which is annoying.
It seems that the easiest alternative would be cutechess-cli, but it seems not to have the option of starting from a particular FEN (either specified directly as a string on the commandline or from a file). Looking at the source, my impression is that it wouldn't actually be hard to add this functionality, but before I invest the time to do that I'd like to ask whether someone else has perhaps already done that or knows of some caveats that I might have overlooked?
Suggestions for alternative tools are also welcome, but I don't have the impression there is much choice here.
Note that I'm aware of the option to specify a PGN/EPD opening book. This works, of course, but I would prefer to use the starting positions that I had been using because that way I know that I can compare the new test results with the old (in an ideal world it shouldn't matter, of course, but I'd like to test that first).
-
- Posts: 2929
- Joined: Sat Jan 22, 2011 12:42 am
- Location: NL
Re: cutechess-cli: starting from FEN
I did look at the latest source to see whether the option had already been added. I guess it's the "-epdin" option? The documentation provided for it isn't very clear ("use <file> as the opening book in EPD format") which to me suggested that it expected a list of EPD positions from which it would build an opening book (somehow; it would also need some sort of suggestion for a move of course).lucasart wrote:Ilari has implemented this in the latest git source code. But you'll have to compile it. It allows to use an EPD file as input (ie. text file which is just 1 FEN per line)
I'm going to try it out, thanks!
-
- Posts: 2929
- Joined: Sat Jan 22, 2011 12:42 am
- Location: NL
Re: cutechess-cli: starting from FEN
Wouldn't help in this case, unfortunately, since the set of starting positions are all at the same depth (ie, you can't construct a full line from the starting position using them).Rebel wrote:Arena converts EPD to PGN.
Plus I'd need Windows. (I guess Wine would work, but I'd prefer not to).
-
- Posts: 6401
- Joined: Thu Mar 09, 2006 8:30 pm
- Location: Chicago, Illinois, USA
Re: cutechess-cli: starting from FEN
If you have ruby installed in your systemEvert wrote:Wouldn't help in this case, unfortunately, since the set of starting positions are all at the same depth (ie, you can't construct a full line from the starting position using them).Rebel wrote:Arena converts EPD to PGN.
Plus I'd need Windows. (I guess Wine would work, but I'd prefer not to).
save this as fen2pgn.rb
Code: Select all
File.open ARGV[0], "r" do |f|
lines = f.readlines
lines.each do |li|
puts '[Event "?"]'
puts '[Site "?"]'
puts '[Date "????.??.??"]'
puts '[Round "?"]'
puts '[White "?"]'
puts '[Black "?"]'
puts '[Result "*"]'
puts '[Fen "' +li.strip+ '"]'
puts
end
end
ruby fen2pgn.rb file.fen > file.pgn
You can use the file.pgn as starter positions.
A C version in this thread
http://www.open-aurec.com/wbforum/viewt ... 27#p192626
Miguel
-
- Posts: 750
- Joined: Mon Mar 27, 2006 7:45 pm
- Location: Finland
Re: cutechess-cli: starting from FEN
The PGN standard does have the FEN tag, so you can easily put your FENs in a PGN file, see this post for clarification.Evert wrote:Wouldn't help in this case, unfortunately, since the set of starting positions are all at the same depth (ie, you can't construct a full line from the starting position using them).Rebel wrote:Arena converts EPD to PGN.
Plus I'd need Windows. (I guess Wine would work, but I'd prefer not to).
-
- Posts: 750
- Joined: Mon Mar 27, 2006 7:45 pm
- Location: Finland
Re: cutechess-cli: starting from FEN
You forgot that the "FEN" tag should be in uppercase, and a termination marker (eg. "*") is needed at the end.michiguel wrote:If you have ruby installed in your systemEvert wrote:Wouldn't help in this case, unfortunately, since the set of starting positions are all at the same depth (ie, you can't construct a full line from the starting position using them).Rebel wrote:Arena converts EPD to PGN.
Plus I'd need Windows. (I guess Wine would work, but I'd prefer not to).
save this as fen2pgn.rb
and then run it withCode: Select all
File.open ARGV[0], "r" do |f| lines = f.readlines lines.each do |li| puts '[Event "?"]' puts '[Site "?"]' puts '[Date "????.??.??"]' puts '[Round "?"]' puts '[White "?"]' puts '[Black "?"]' puts '[Result "*"]' puts '[Fen "' +li.strip+ '"]' puts end end
ruby fen2pgn.rb file.fen > file.pgn
You can use the file.pgn as starter positions.
A C version in this thread
http://www.open-aurec.com/wbforum/viewt ... 27#p192626
Miguel
-
- Posts: 2929
- Joined: Sat Jan 22, 2011 12:42 am
- Location: NL
Re: cutechess-cli: starting from FEN
Interesting.ilari wrote: The PGN standard does have the FEN tag, so you can easily put your FENs in a PGN file, see this post for clarification.
I (clearly!) wouldn't have thought of using the FEN tag in that way. I'll remember it as a possibility for future reference. Does feel like a bit of a hack though.
-
- Posts: 6995
- Joined: Thu Aug 18, 2011 12:04 pm
Re: cutechess-cli: starting from FEN
It's how I got cutechess-cli to work for endgame testing, EPD to PGN resulting in something like:Evert wrote:Interesting.ilari wrote: The PGN standard does have the FEN tag, so you can easily put your FENs in a PGN file, see this post for clarification.
I (clearly!) wouldn't have thought of using the FEN tag in that way. I'll remember it as a possibility for future reference. Does feel like a bit of a hack though.
[Event "?"]
[Site "?"]
[Date "?"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "*"]
[SetUp "1"]
[FEN "1N2k3/5p2/p2P2p1/3Pp3/pP3b2/5P1r/P7/1K4R1 b - - 0 1 "]
*