From bc26be7a4cd716ae9b3d9701d74ff14a47604048 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 12 Sep 2023 06:59:40 -0400 Subject: [PATCH] Bugfix cross-engine play test mode selection If you attempt to set a test mode for the dev engine, which the base engine does not have, we produce errors. The only reason we need to check the base engine's understanding of the test mode is to set Base Options. We can fall back to the STC settings, since we already copy the Threads= and Hash= portion from the Dev options --- OpenBench/static/create_test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenBench/static/create_test.js b/OpenBench/static/create_test.js index f39637a..f1c4b3b 100644 --- a/OpenBench/static/create_test.js +++ b/OpenBench/static/create_test.js @@ -110,9 +110,13 @@ function set_test_type() { function set_engine_options(mode_str, target) { + // Fall back to STC, which tends to exist. Needed for cross-engine play + var dev_mode = extract_mode_config(mode_str, 'dev' ) || extract_mode_config('STC', 'dev' ); + var base_mode = extract_mode_config(mode_str, 'base') || extract_mode_config('STC', 'base'); + // Extract UCI options for both the Dev and Base engines - var dev_options = extract_mode_config(mode_str, 'dev' )['options'] || 'Threads=1 Hash=8'; - var base_options = extract_mode_config(mode_str, 'base')['options'] || 'Threads=1 Hash=8'; + var dev_options = dev_mode ? dev_mode['options'] : 'Threads=1 Hash=8'; + var base_options = base_mode ? base_mode['options'] : 'Threads=1 Hash=8'; // Simple case, where we are not updating a base that is cross-engine if (target == 'dev' || dev_options == base_options)