Repository navigation
Add search command (bestmove plus root score) - #13
abstratovcm wants to merge 1 commit into
Conversation
Prints `move;score;pvlen`, where score is the root value from the side to move's perspective (empty for strategies without one, e.g. random/mcts, and after a RandomOpening move) and pvlen the length of the principal variation. Accepts the same limits as bestmove (depth, time, seconds, depthorseconds). Motivation: generating training positions for a learned evaluation needs the search score, and bestmove only returns the move.
|
Is this something that needs to go in the UHP extension, or can this just be a command line subcommand that does a search from a position and outputs the score? |
|
Thanks for taking a look! I went with UHP because I use it while playing out whole games: one engine process stays open, and at every move I get both the move and the score, with the options set once. A subcommand would also work, it would just mean starting a new process for every position, which would make my runs around 33% slower. I can change it to a subcommand if you prefer though. |
|
That seems like a reasonable reason to put this in a uhp extension over a command line subcommand. Since this seems a little duplicative of the various bestmove options, maybe we could make this a separate command that returns the score of the last bestmove, similar to how |
Adds a
searchcommand, same args asbestmove, outputmove;score;pvlen.What changed:
uhp_server.rs: limit parsing moved out ofbest_moveintoconfigure_search, shared by both commands.bestmoveoutput unchanged.player.rs:ScoredStrategytrait (Strategy +root_value()), implemented for IterativeSearch and ParallelSearch, None for random/mcts.Player::root_value()returns None when the last move came from RandomOpening instead of a search.Use case: self play → one score per position → training data for a learned eval. Needed the root value, bestmove only gives the move.
Checked: cargo test (both feature sets), uhp-debug self test, clippy, fmt, wasm lib check.