Skip to content

Commit

Permalink
switch to WDL_mu as ScoreType. Also, allow some options to be sent re…
Browse files Browse the repository at this point in the history
…gardless of whether the engine knows about them, and others not.
  • Loading branch information
rooklift committed Apr 25, 2024
1 parent df7f2cf commit 80da95c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
13 changes: 10 additions & 3 deletions files/src/renderer/10_globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,24 @@ if (images.validate_folder(config.override_piece_directory)) {
// Standard options, for either type of engine......................
// Note that UCI_Chess960 is handled specially by engine.js

const standard_lc0_options = {
"LogLiveStats": true,
const forced_lc0_options = { // These are sent without checking if they are known by the engine.
"LogLiveStats": true, // Nevertheless, the user can still override them in engines.js.
"MoveOverheadMs": 0,
"MultiPV": 500,
"ScoreType": "centipawn",
"ScoreType": "WDL_mu",
"SmartPruningFactor": 0,
"UCI_ShowWDL": true,
"VerboseMoveStats": true,
};

const standard_lc0_options = { // These are only sent if known by the engine.
"ContemptMode": "disable",
"Contempt": 0,
"WDLCalibrationElo": 0,
};

const forced_ab_options = {};

const standard_ab_options = {
"Contempt": 0,
"Move Overhead": 0,
Expand Down
23 changes: 12 additions & 11 deletions files/src/renderer/95_hub.js
Original file line number Diff line number Diff line change
Expand Up @@ -1413,24 +1413,25 @@ let hub_props = {
return true;
},

engine_send_all_options: function() {
engine_send_all_options: function() { // The engine should never have been given a "go" before this.

// The engine should never have been given a "go" before this.
// Options that are sent regardless of whether the engine seems to know about them...

let standard_engine_options = this.engine.leelaish ? standard_lc0_options : standard_ab_options;
let forced_engine_options = this.engine.leelaish ? forced_lc0_options : forced_ab_options;
for (let [key, value] of Object.entries(forced_engine_options)) {
this.engine.setoption(key, value);
}

// Note: for each key, we could check if the option is known, but that
// would be sketchy because we use secret stuff like "LogLiveStats".
// But we can do it for non-Leelaish engines...
// Standard options... only sent if the engine has said it knows them...

for (let key of Object.keys(standard_engine_options)) {
if (this.engine.leelaish || this.engine.known(key)) {
this.engine.setoption(key, standard_engine_options[key]);
let standard_engine_options = this.engine.leelaish ? standard_lc0_options : standard_ab_options;
for (let [key, value] of Object.entries(standard_engine_options)) {
if (this.engine.known(key)) {
this.engine.setoption(key, value);
}
}

// Now send user-selected options. One might argue we should do this first,
// so that our standard options prevail in the event of a conflict. Hmm.
// Now send user-selected options. Thus, the user can override anything above.

let options = engineconfig[this.engine.filepath].options;
let keys = Object.keys(options);
Expand Down

0 comments on commit 80da95c

Please sign in to comment.