h1me01 / Astra

UCI chess engine
GNU General Public License v3.0
2 stars 0 forks source link

Remove 'min' and 'max' from UCI options #3

Closed tissatussa closed 1 month ago

tissatussa commented 1 month ago

i managed to compiled your v3.1 code on Linux, but after the 'uci' command some 'min' and 'max' options are shown for 'SyzygyPath' and 'EvalFile', which are redundant (although CuteChess accepts them) :

id name Astra
id author Semih Oezalp
option name SyzygyPath type string default <empty> min 0 max 0
option name EvalFile type string default nn-768-2x256-1.nnue min 0 max 0
option name Hash type spin default 64 min 1 max 2048
uciok

this was easy to solve. The file 'uci.cpp' contains this part :

std::cout << "option name " << elem.first
  << " type " << option.getType()
  << " default " << (value.empty() ? "<empty>" : value)
  << " min " << option.getMin()
  << " max " << option.getMax() << std::endl;

which i changed into :

std::cout << "option name ";
std::cout << elem.first;
std::cout << " type ";
std::cout << option.getType();
std::cout << " default ";
std::cout << (value.empty() ? "<empty>" : value);
if (elem.first == "Hash") {
    std::cout << " min ";
    std::cout << option.getMin();
    std::cout << " max ";
    std::cout << option.getMax();
}
std::cout << std::endl;

Now after the 'uci' command this correct output is shown :

id name Astra
id author Semih Oezalp
option name SyzygyPath type string default <empty>
option name EvalFile type string default nn-768-2x256-1.nnue
option name Hash type spin default 64 min 1 max 2048
uciok

You can solve this in other ways, but anyhow : you should. This concerns v3.0 and v3.1.

btw. you also could add a version number like "id name Astra v3.1".

[ i'm on Xubuntu 22.04 ]

h1me01 commented 1 month ago

Hi, Thanks for letting me know! I will add this to my code and also note that I deleted the 3.1 version because I discovered a major bug in my search. I will probably upload the corrected 3.1 version in an hour or so.

tissatussa commented 1 month ago

..note that I deleted the 3.1 version..

i saw you also deleted the v2 versions .. it's not common to fully remove previous versions, better in README let the user know about such bugs and just point to a newer version. But it's up to you - just saying.

h1me01 commented 1 month ago

Yeah, the v2 versions where fine but where build inefficiently, so no reason to keep them, the bug/logic isnt going to make it crash or play illegal moves. The search was not done correctly (e. g. pv collection and some pruning stuff).