Open dpaleka opened 1 year ago
There is "texelutil proofgame -f ..." which provides a more automatic way of finding proof games for possibly large number of positions. It is optimized for random positions though. For example, assuming bash shell:
$ echo "r6r/pp3pk1/5Rp1/n2pP1Q1/2pPp3/2P1P2q/PP1B3P/R5K1 w - - 0 1" | texelutil proofgame -f -o result 2>debug | tee status
legal: 0 path: 0 kernel: 1 fail: 0 illegal: 0 time: 10.443
legal: 0 path: 1 kernel: 0 fail: 0 illegal: 0 time: 10.951
legal: 1 path: 0 kernel: 0 fail: 0 illegal: 0 time: 11.005
$ cat result02
r6r/pp3pk1/5Rp1/n2pP1Q1/2pPp3/2P1P2q/PP1B3P/R5K1 w - - 0 1 legal: proof: g4 d5 f4 h5 gxh5 e5 Nh3 Bxh3 Bxh3 e4 Bd7+ Nxd7 h6 Ne5 fxe5 Rxh6 Nc3 Be7 Na4 Bc5 Nxc5 Rh8 Ne6 Qc8 Nd8 Qxd8 Kf1 Kf8 d4 c5 c3 g6 e3 c4 Bd2 Kg7 Qh5 Qd7 Qg5 Ne7 Kg1 Nc6 Rf1 Qe6 Rf6 Qh3 Kf2 Rh7 Ra1 Rhh8 Kg1 Na5
If you don't use "-f", there is no way to automatically stop after the first solution is found.
Aha, so if I specify -o result
, it will create files result00
, result01
, ..., and if it finds something, the last one will be resultXY
, containing the proof. Thanks, this clarifies how to extract the list of moves for a single game.
Is there a performance gain in running proofgame on a file of positions, as opposed to running multiple jobs? I do not understand how to generalize the above if there are multiple games in the input file; but if there aren't any significant performance gains, maybe I can just run many proofgame instances in parallel.
If there are multiple positions in the input file there will be multiple lines in the result files. One line for each position.
An advantage of running a single texelutil proofgame instance is that it is easier to control the amount of parallelism and hence the amount of required memory. By default texelutil uses as many threads as there are "hardware threads" in the computer, which typically includes hyperthreads. You can override this using "-j", e.g.:
texelutil -j 4 proofgame -f -o ...
to force using 4 threads.
Is there an option for
telexutil proofgame
to say whether it found a list of moves leading to a given position?For example, when I run
I get some log like this:
The last line I included seems to be a solution; but the output does not indicate that in a way I understand. For my use case, it seems I have to parse the output and check whether any list of moves in the output is a solution. Note that I am not interested in the number of moves reaching a given position; that's why I put
0 1
, as in the example in proofgame.md.