nnue-pytorch icon indicating copy to clipboard operation
nnue-pytorch copied to clipboard

small syntax change in c-chess-cli

Open lucasart opened this issue 4 years ago • 5 comments

You just need to correct this line: https://github.com/glinscott/nnue-pytorch/blob/master/run_games.py#L76

  • old syntax: -resign 3 700 -draw 8 10
  • new syntax: -resign count=3 score=700 -draw count=8 score=10

Note that you can use number=N in both resign and draw adjudication rules. For example -draw number=40 count=8 score=10 adds the additional constraint that draw adjudication can't be declared before 40 moves were played. Replicates cute-chess-cli behavior (extending it to -resign while there).

lucasart avatar Apr 16 '21 23:04 lucasart

when did that syntax change and how can we check programmatically for which one to use? Could we just use both at the same time and only one will be used?

Sopel97 avatar Apr 17 '21 08:04 Sopel97

when did that syntax change?

20-mar: https://github.com/lucasart/c-chess-cli/commit/4e8ec07e60cc1a8316145fb89c234d30f5e08d77

Now, be careful, because a critical bug was introduced on 20-Mar as well, which was reverted in 27-Mar. So 20-27 mar is a no go zone. I also extended testing coverage in my test suite, so this kind of bug doesn't pass the test anymore, and won't be commited.

how can we check programmatically for which one to use?

I think what you're looking to do is overkill. Realistically, you have probably 5 users for this, and all of them are skilled programmers, who can easily update by pulling the latest version from github.

Here's what happens:

$ ./c-chess-cli -each cmd=./test/engine depth=1 -engine name=e1 -engine name=e2 -resign count=3 score=700 -draw count=8 score=10
[1] Started game 1 of 1 (e1 vs e2)
[1] Finished game 1 (e1 vs e2): 0-1 {adjudication}
Score of e1 vs e2: 0 - 1 - 0  [0.000] 1
$ ./c-chess-cli -each cmd=./test/engine depth=1 -engine name=e1 -engine name=e2 -resign 3 700 -draw 8 10
Illegal token in -resign: '3'

In the second run c-chess-cli called exit(EXIT_FAILURE), so you could check the return value of the program. However, exit(EXIT_FAILURE) is also called for any fatal error (eg. wrong engine path). So you would have to check 2 things: 1/ non-zero error code returned 2/ parsing output contains 'Illegal token'.

Could we just use both at the same time and only one will be used?

No.

lucasart avatar Apr 18 '21 00:04 lucasart

I think it is generally useful if a binary would give version output. I've put that as a suggestion as an issue https://github.com/lucasart/c-chess-cli/issues/43

apart from that, I guess we can adapt the code.

vondele avatar Apr 18 '21 14:04 vondele

@Sopel97 What help is wanted here ? It's trivial to change this line: https://github.com/glinscott/nnue-pytorch/blob/master/run_games.py#L75. As for the version programmatic test, you can forget about it, because the c-chess-cli -version was introduced after (you can also do this to make things future-proof, but that's orthogonal to the syntax change).

lucasart avatar Jun 14 '21 00:06 lucasart

So the best way we can proceed for now is to break backward compatibility in this script it seems

Sopel97 avatar Jun 14 '21 07:06 Sopel97