From 17de82a963f5eaeba4db903fc912b83ba963cead Mon Sep 17 00:00:00 2001 From: Lev Nachmanson Date: Fri, 19 Jun 2026 07:43:36 -0700 Subject: [PATCH] lp: rename cut_period_random to random_period The toggle also gates the cube heuristics (find_cube, lcube), not just cuts, so 'cut' in the name was misleading. random_period covers all the periodic integer heuristic gates (find_cube, lcube, hnf, gomory, dio). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/math/lp/int_solver.cpp | 12 ++++++------ src/math/lp/lp_params_helper.pyg | 2 +- src/math/lp/lp_settings.cpp | 2 +- src/math/lp/lp_settings.h | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/math/lp/int_solver.cpp b/src/math/lp/int_solver.cpp index 4f5ad1887..b67a15e90 100644 --- a/src/math/lp/int_solver.cpp +++ b/src/math/lp/int_solver.cpp @@ -195,15 +195,15 @@ namespace lp { lp_settings& settings() { return lra.settings(); } // Decide whether a periodic heuristic fires on this call. When - // cut_period_random is enabled the gate is drawn at random with the - // same 1/period expected rate instead of a deterministic "every k-th - // call" modulus: a deterministic period can phase-lock with the search - // on some families and drown the solver in conflicts while another - // handler is starved; randomizing the gate breaks that resonance. + // random_period is enabled the gate is drawn at random with the same + // 1/period expected rate instead of a deterministic "every k-th call" + // modulus: a deterministic period can phase-lock with the search on + // some families and drown the solver in conflicts while another handler + // is starved; randomizing the gate breaks that resonance. bool hit_period(unsigned period) { if (period <= 1) return true; - if (settings().cut_period_random()) + if (settings().random_period()) return settings().random_next(period) == 0; return m_number_of_calls % period == 0; } diff --git a/src/math/lp/lp_params_helper.pyg b/src/math/lp/lp_params_helper.pyg index 4bb2eff4d..86accb367 100644 --- a/src/math/lp/lp_params_helper.pyg +++ b/src/math/lp/lp_params_helper.pyg @@ -12,6 +12,6 @@ def_module_params(module_name='lp', ('lcube', BOOL, True, 'use the largest cube test for integer feasibility'), ('lcube_flips', UINT, 16, 'maximal number of coordinate flips when repairing the rounded largest cube center, only relevant when lcube is true'), ('cut_period', UINT, 4, 'period (in final_check calls) for the integer cut/cube heuristics (find_cube, hnf, gomory); a smaller value calls them more often'), - ('cut_period_random', BOOL, True, 'draw the integer cut/cube heuristic gates (find_cube, lcube, hnf, gomory, dio) at random with the same 1/period rate instead of a deterministic every-k-th-call modulus'), + ('random_period', BOOL, True, 'draw the periodic integer heuristic gates (find_cube, lcube, hnf, gomory, dio) at random with the same 1/period rate instead of a deterministic every-k-th-call modulus'), )) diff --git a/src/math/lp/lp_settings.cpp b/src/math/lp/lp_settings.cpp index 1238bc3d4..5d537e1fd 100644 --- a/src/math/lp/lp_settings.cpp +++ b/src/math/lp/lp_settings.cpp @@ -43,7 +43,7 @@ void lp::lp_settings::updt_params(params_ref const& _p) { m_dio_ignore_big_nums = lp_p.dio_ignore_big_nums(); m_dio_calls_period = lp_p.dio_calls_period(); m_dio_run_gcd = lp_p.dio_run_gcd(); - m_cut_period_random = lp_p.cut_period_random(); + m_random_period = lp_p.random_period(); m_lcube = lp_p.lcube(); m_lcube_flips = lp_p.lcube_flips(); unsigned cut_period = lp_p.cut_period(); diff --git a/src/math/lp/lp_settings.h b/src/math/lp/lp_settings.h index eb27819e8..548d3b3f3 100644 --- a/src/math/lp/lp_settings.h +++ b/src/math/lp/lp_settings.h @@ -264,7 +264,7 @@ private: bool m_dio_ignore_big_nums = false; unsigned m_dio_calls_period = 4; bool m_dio_run_gcd = true; - bool m_cut_period_random = true; + bool m_random_period = true; bool m_lcube = true; unsigned m_lcube_flips = 16; public: @@ -272,8 +272,8 @@ public: unsigned lcube_flips() const { return m_lcube_flips; } unsigned dio_calls_period() const { return m_dio_calls_period; } unsigned & dio_calls_period() { return m_dio_calls_period; } - bool cut_period_random() const { return m_cut_period_random; } - bool & cut_period_random() { return m_cut_period_random; } + bool random_period() const { return m_random_period; } + bool & random_period() { return m_random_period; } bool print_external_var_name() const { return m_print_external_var_name; } bool propagate_eqs() const { return m_propagate_eqs;} unsigned hnf_cut_period() const { return m_hnf_cut_period; }