MCPcopy Create free account
hub / github.com/dds-bridge/dds / configure_tt

Method configure_tt

library/src/solver_context/solver_context.cpp:290–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290auto SolverContext::configure_tt(TTKind kind, int defMB, int maxMB) -> void
291{
292 // Apply environment limit if present to preserve existing behavior.
293 if (const char* s = std::getenv("DDS_TT_LIMIT_MB")) {
294 int v = std::atoi(s);
295 if (v > 0) maxMB = std::min(maxMB, v);
296 }
297 if (maxMB < defMB) maxMB = defMB;
298
299 // Persist configuration for future TT creations.
300 cfg_.tt_kind_ = kind;
301 cfg_.tt_mem_default_mb_ = defMB;
302 cfg_.tt_mem_maximum_mb_ = maxMB;
303
304 auto* tt = search_.maybe_trans_table();
305 if (!tt) return; // Nothing to apply now; will take effect on lazy creation.
306
307 // If kind changes, dispose and recreate now to ensure effect is applied.
308 bool is_small = (dynamic_cast<TransTableS*>(tt) != nullptr);
309 TTKind current_kind = is_small ? TTKind::Small : TTKind::Large;
310 if (current_kind != kind) {
311 dispose_trans_table();
312 // Force immediate creation with new config to keep behavior explicit.
313 (void)trans_table();
314 return;
315 }
316
317 // Same kind: resize in-place.
318 resize_tt(defMB, maxMB);
319}
320
321// Lightweight reset matching legacy ResetBestMoves semantics.
322auto SolverContext::reset_best_moves_lite() const -> void

Callers 1

TESTFunction · 0.80

Calls 1

maybe_trans_tableMethod · 0.80

Tested by 1

TESTFunction · 0.64