dje-dev / Ceres

Ceres - an MCTS chess engine for research and recreation
GNU General Public License v3.0
153 stars 23 forks source link

Setoption works only before first search #42

Closed jkormu closed 3 years ago

jkormu commented 3 years ago

Reproduction steps:

  1. Start Ceres 0.89 in UCI mode
  2. setoption name FPU value 1
  3. go nodes 800
  4. dump-params
  5. setoption name FPU value 2
  6. dump-params

Result: After step 4. FPUValue is correctly set as 1. After step 6. FPUValue is still 1.

Expected result: FPU should be 2 after step 6

Note that this is not bug in dump-params as it is also clear from search tree that parameter is not changed.

Changing

        case "fpu":
          SetFloat(value, 0, float.MaxValue, ref fpu);
          break;

to

        case "fpu":
          SetFloat(value, 0, float.MaxValue, ref (CeresEngine is not null ? ref CeresEngine.ChildSelectParams.FPUValue :  ref fpu));
          break;

seems to fix the issue.