Skip to content

Commit

Permalink
Rename option to ReducedMemoryMode and expose in UCI options.
Browse files Browse the repository at this point in the history
  • Loading branch information
dje-dev committed Sep 26, 2021
1 parent 8de4e51 commit 629e4e2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Ceres.Chess/UserSettings/CeresUserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public record CeresUserSettings
/// If data structures and algorithms should favor low
/// memory consumption (at a cost of modest performance reduction).
/// </summary>
public bool MemoryReducedMode { get; set; } = false;
public bool ReducedMemoryMode { get; set; } = false;


#endregion
Expand Down
9 changes: 7 additions & 2 deletions src/Ceres.Features/UCI/UCIManager.SetOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ void ProcessSetOption(string command)
SetBool(value, ref showWDL);
break;

case "reducedmemorymode":
bool reducedMemory = false;
SetBool(value, ref reducedMemory);
CeresUserSettingsManager.Settings.ReducedMemoryMode = reducedMemory;
break;

case "syzygypath":
if (!Directory.Exists(value))
{
Expand Down Expand Up @@ -411,12 +417,11 @@ void SetFloat(string floatStr, float minValue, float maxValue, ref float value)
option name SearchLimitMultiplier type string default 1.00
option name MaxTreeVisits type string default
option name MaxTreeNodes type string default
option name ReducedMemoryMode type check default false
");
/*
option name ConfigFile type string default lc0.config
option name HistoryFill type combo default fen_only var no var fen_only var always
option name RamLimitMb type spin default 0 min 0 max 100000000
option name MoveOverheadMs type spin default 200 min 0 max 100000000
";
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Ceres.MCTS/Iteration/Params/ParamsSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public enum BestMoveModeEnum
/// rather than rewriting entire tree. This can consume additional memory
/// but reduce time spent preparing tree for reuse.
/// </summary>
public bool TreeReuseSwapRootEnabled = !CeresUserSettingsManager.Settings.MemoryReducedMode;
public bool TreeReuseSwapRootEnabled = !CeresUserSettingsManager.Settings.ReducedMemoryMode;

// SLOW AND BUGGY ***
// Also we find that only about 2% of positions saved are actually subsequently used,
Expand Down
2 changes: 1 addition & 1 deletion src/Ceres.MCTS/Iteration/Params/ParamsSearchExecution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public record ParamsSearchExecution
/// Size of the cache used to store miscellaneous supplemental
/// information (such as the actual Position) relating to recently visited nodes.
/// </summary>
public int NodeAnnotationCacheSize = CeresUserSettingsManager.Settings.MemoryReducedMode ? 250_000 : 750_000;
public int NodeAnnotationCacheSize = CeresUserSettingsManager.Settings.ReducedMemoryMode ? 250_000 : 750_000;


internal const bool DEFAULT_USE_SMART_SIZE_BATCHES = true;
Expand Down

0 comments on commit 629e4e2

Please sign in to comment.