MatPlus.Net

 Website founded by
Milan Velimirović
in 2006

19:20 UTC
ISC 2024
 
  Forum*
 
 
 
 

Username:

Password:

Remember me

 
Forgot your
password?
Click here!
SIGN IN
to create your account if you don't already have one.
CHESS
SOLVING

Tournaments
Rating lists
1-Oct-2024

B P C F





 
 
MatPlus.Net Forum General FEN Tool for chess composers and solvers
 
You can only view this page!
Page: [Previous] [Next] 1 2 3
(1) Posted by Mu-Tsun Tsai [Thursday, Aug 3, 2023 12:47]

FEN Tool for chess composers and solvers


In about the past two month I've been working hard to improve my FEN Tool (https://mutsuntsai.github.io/fen-tool/), and after today's work I think it's finally ready for everyone here. It's a tool packed with lots of utilites targeting chess composers and solvers, including:

1. Board editing (of course) with full FFEN syntax support (e.g. https://iili.io/HZmRV2I.png).
2. Popeye integration so that one may run Popeye on any devices and play its solution, with full support for fairy conditions/pieces.
3. Manual play mode that supports normal play, series play and retro play, for solving problems.
4. Database tools that can be used to search position or import positions etc., supports PDB and YACPDB.
5. APIs that can easily generate diagrams on your website with blazing fast performance.

Hope it helps!
 
(Read Only)pid=25007
(2) Posted by Nikola Petković [Thursday, Aug 3, 2023 23:46]

Great work Mu-Tsun! I tried Your FEN tool and liked it quite a lot. It will get only better over time!

Is it running the Popeye on the client side (in browser) without sending anything to the server?
 
 
(Read Only)pid=25010
(3) Posted by Mu-Tsun Tsai [Friday, Aug 4, 2023 01:26]

Yes, it's purely front-end and everything is running in browser only 🙂
It's hosted on GitHub pages and there's no backend server.

Feel free to let me know if there is any suggestions to the tool!
 
   
(Read Only)pid=25011
(4) Posted by Kevin Begley [Friday, Aug 4, 2023 04:51]

Nice work!
 
   
(Read Only)pid=25013
(5) Posted by shankar ram [Tuesday, Aug 8, 2023 19:03]

Mu-Tsun Tsai is doing great stuff with his fen-tool!
He's most responsive.
I was in touch since June and he instantly added some features I asked for.
The latest version with Popeye integration and solution animation is terrific.
Here's a video I made showing the animation of a familiar problem with a grasshopper:
https://www.youtube.com/shorts/_7PeUC9KgdM
 
   
(Read Only)pid=25044
(6) Posted by seetharaman kalyan [Wednesday, Aug 9, 2023 09:11]

Great work! Solving tool for Android is rare and this is an excellent tool for composers.
 
   
(Read Only)pid=25046
(7) Posted by Mu-Tsun Tsai [Friday, Aug 11, 2023 12:25]

Added Stockfish 16 to the tool, with a “study mode” targeting study problem composers!
 
   
(Read Only)pid=25053
(8) Posted by Thomas Maeder [Saturday, Aug 12, 2023 14:44]

Very cool!

And thanks for the fixes to Popeye that you found with this integration, I think.
 
(Read Only)pid=25058
(9) Posted by Viktoras Paliulionis [Wednesday, Aug 16, 2023 17:55]

Thank you for the nice tool.

I tried to solve several studies in "study mode". As far as I understand, in this mode the analyzer try to find the longest sequence of moves with unique white moves. As I noticed, it does not always work this way. For example, a study has a solution with 10 moves. All White's moves in the solution are unique. But the tool shows the main line with a different black defence, after which white's moves are not unique.

I think, there is no need to show defenses after which White's response is not unique. But if such defenses are nevertheless indicated, then it would be nice if the tool showed the number of unique white moves in the displayed main line.
 
   
(Read Only)pid=25078
(10) Posted by Mu-Tsun Tsai [Wednesday, Aug 16, 2023 18:12]

@(9)
Thanks for the feedback! Basically what it does is that it follows what Stockfish believes to be the best defense of Black (which could be incorrect, or it could randomly choose one defense out of several equally good ones). If you set a higher depth, it might give you the defense you're looking for, but not necessarily still.

What you've proposed makes quite a lot of sense. It would take much longer to run though, as it will have to try different defense by Black to see which leads to a unique White move (or it might even need to backtrack). The reason behind this is that, as a UCI engine, Stockfish doesn't give me the internal search tree directly, and I can only figure it out by trial-and-error. If I will implement such behavior, I'll probably make it an option.

It could be helpful if you show me an example with your expected output, and I'll see what I can do.
 
   
(Read Only)pid=25079
(11) Posted by Viktoras Paliulionis [Wednesday, Aug 16, 2023 18:59]

Example from World Chess Solving Championship, 2021:

https://www.yacpdb.org/#560696
Iriarte, Eduardo Manuel
Magyar Sakkélet, 1996-1997, 3rd HM
(= 5+8 )
=

1.f8=Q Bh7 2.Qh6+ Kd4 3.Qd2+ Sd3 4.Q×d3+! K×d3 5.b×c6+ Ke4 6.Bd3+! K×d3 7.c×d7 B×f5+ 8.K×f5 Se7+ 9.Ke6 Sc6 10.Kd5 Sd8 stalemate

FEN-Tool shows:
1.f8=Q! Nc4 2. Bxc8...

Very often chess studies end with a stalemate, but Stockfish does not show such lines.
 
 
(Read Only)pid=25080
(12) Posted by Kevin Begley [Wednesday, Aug 16, 2023 19:09]

It might be easier to start with studies which are fully covered by the EGTB.
If any black defense allows more than one satisfactory reply, sever that defense from the solution.
You would also need to immediately sever any line that results in a loop (where the same FEN is seen twice) -- this gets more tricky (sometimes you'll want to sever only the move which results in a loop, other times you'll want to sever to the root moves which lead only to a loop).

In principle, this can be extended to work with an engine (when the EGTB provides no answers), but the engine may require significantly more time to sever lines (depending on the problem).

You might want to offer two options:
1) the depth at which the engine is allowed to search (with an infinite depth setting), and
2) some threshold evaluation to quantitatively differentiate between a win/loss and a draw.

If infinite depth is set, you may want to update the solution when a greater level of depth is achieved.

One way to find the main line is to count how many nodes remain in the solution tree following each defense.
That might not always be what the composer intended as the main line -- study composers would need to provide a more detailed algorithm, if that's not satisfactory.

Of course, describing the algorithm doesn't compare to the challenge of implementing all this.
 
   
(Read Only)pid=25081
(13) Posted by Mu-Tsun Tsai [Thursday, Aug 17, 2023 02:52]

@(11)
This one is quite difficult. Stockfish lists 1...Bh7 as its fifth choice of defense. Actually, all the first 5 lines have score zero, so Stockfish did realize that they are equally good. The ordering seems to result from the fact that 1...Nc4 for example had a higher score in the earlier depth of the search.
In any case, this means that to find your desired continuation, it needs to search for at least 5 lines and try them out, which will be VERY slow. I can still try to implement that, perhaps somewhere in the near future, just to see how it goes.

@(12)
In fact the current build of Stockfish I use doesn't have EGTB, unfortunately. Whoever built it exclude all syzygy features somehow. I could try to build Stockfish myself to include syzygy, but that is much beyond my expertise and
would be a much long-term goal to do.
To allow infinite search, just put in some really big number like 1000. That practically is the same as infinite.
My current threshold for win vs draw is a score of 1.00. I did observe that sometimes 2.00 works better (especially for lower depth search), so yeah I might make that an option shortly.
And Stockfish won't tell me the number of nodes down the tree AFAIK. So I'm afraid that cannot be done.
 
   
(Read Only)pid=25083
(14) Posted by Joost de Heer [Thursday, Aug 17, 2023 07:43]

Stockfish is a study aid, not a study solving tool. it has no concept of 'artistic variation'.
 
   
(Read Only)pid=25084
(15) Posted by Mu-Tsun Tsai [Thursday, Aug 17, 2023 08:56]

@(14)
Exactly. Unless I modify Stockfish itself, it would be unlikely that I can make it fully satisfying for the need of study composers.
BTW, I must thank you and Janko for Retro Corner; it was the very website that brought me into the world of compositions a decade ago.
 
   
(Read Only)pid=25085
(16) Posted by Viktoras Paliulionis [Thursday, Aug 17, 2023 10:30]

It would be very nice to have an additional EGTB tool (without integration with Stockfish) for studies with a small number of pieces. It could be similar to other EGTB online tools, but with the additional feature of finding the longest sequence (or several sequences) with unique white's moves. The algorithm is quite simple, @Kevin described it.
 
   
(Read Only)pid=25086
(17) Posted by Jacques Rotenberg [Thursday, Aug 17, 2023 10:57]

"...This one is quite difficult. Stockfish lists 1...Bh7 as its fifth choice of defense. Actually, all the first 5 lines have score zero, so Stockfish did realize that they are equally good...."

After a black move, if you look only for a second white continuation, and stockfish finds one, if you discard this black move, it may be enough to find the main line(s) in most of the studies
 
   
(Read Only)pid=25087
(18) Posted by Jacques Rotenberg [Thursday, Aug 17, 2023 12:50]

btw, it would be a very good option for the other programs too (popeye, gustav, winchloe...) to be able to ask to show the non-dualistic variations only
 
 
(Read Only)pid=25088
(19) Posted by Mu-Tsun Tsai [Thursday, Aug 17, 2023 17:42]

@(16)
I agree that having EGTB will be great, only that for the moment there are a few obstacles. First of all, the total file size of the tablebase can be quite huge. For syzygy tablebase, all positions with up to 5 pieces takes about 1G size already, which is very impractical for a purely front-end tool like FEN Tool (the other online tools obviously have a backend for running huge tablebases, but FEN Tool does not). I was planning to incorporate only the syzygy tablebase with up to 4 pieces only (which is about 4MB total), if I ever will do that. But that probably won't be very helpful for you guys, especially if it's just the tablebase without the engine.
Secondly, I have no knowledge about how to parse the tablebase files yet. It might take a while before I can fully understand the file format, and I'm currently tied to other tasks for the moment.
If any of the online EGTB tools provide public API that I can access, I can perhaps incorporate that quickly, but I will need to find out if that's the case.

Update: actually syzygy does have public API (which is hosted by lichess)! I can definitely work on incorporating that in near future.

@(17)
Yes, that's exactly the basic idea if I will implement the feature. There are a few other things that could speed things up, for example, abandon a certain branch earlier if the result is simply too unpromising. I think I will look into this direction once I'm done with the tasks at hand.
 
   
(Read Only)pid=25090
(20) Posted by Kevin Begley [Thursday, Aug 17, 2023 19:20]

Yes, lichess has an excellent EGTB API.

Speaking of which, the EGTB might require the addition of another option for wins which can not be converted without overstepping the 50-move rule (also known as a "blessed loss" or a "cursed win").

You could offer an option:
1) convert those cases to a drawn evaluation (0.00), or
2) convert those cases to a win/loss evalutaion (plus or minus 99).

Also, the EGTB API could help you detect the end of the problem/game.
Does Stockfish detect when the game is over (or will it, in some cases, show solutions which extend beyond the legal game)?
With the EGTB API, you could terminate solutions once you reach the point where all legal replies result in "insufficient material".

If you really want to get fancy, use Popeye to reckon when a position is dead. :)

Once again, you might want to offer this as an option.
Some problems (particularly older problems) may intend that their solution extend slightly beyond a position that can be reckoned dead (for thematic purposes).

I think that probably covers all the solution options you need to consider providing, until your tool is ready to cover fairy chess and retros. :)
 
   
(Read Only)pid=25091

Read more...
Page: [Previous] [Next] 1 2 3

MatPlus.Net Forum General FEN Tool for chess composers and solvers