diff --git a/PARALLEL_PROJECT_NOTES.md b/PARALLEL_PROJECT_NOTES.md index 25116ac1e..e232ff78d 100644 --- a/PARALLEL_PROJECT_NOTES.md +++ b/PARALLEL_PROJECT_NOTES.md @@ -255,17 +255,21 @@ threads-4-none threads-4-shareunits -T:30 smt.threads=4 tactic.default_tactic=smt smt_parallel.never_cube=true smt_parallel.share_conflicts=false smt_parallel.share_units=true -threads-4-shareconflicts --T:30 smt.threads=4 tactic.default_tactic=smt smt_parallel.never_cube=true smt_parallel.share_conflicts=true smt_parallel.share_units=false - threads-4-cube-frugal -T:30 smt.threads=4 tactic.default_tactic=smt smt_parallel.never_cube=false smt_parallel.frugal_cube_only=true smt_parallel.share_conflicts=false smt_parallel.share_units=false +threads-4-cube-frugal-shareconflicts +-T:30 smt.threads=4 tactic.default_tactic=smt smt_parallel.never_cube=false smt_parallel.frugal_cube_only=true smt_parallel.share_conflicts=true smt_parallel.share_units=false + threads-4-shareunits-nonrelevant -T:30 smt.threads=4 tactic.default_tactic=smt smt_parallel.never_cube=true smt_parallel.share_conflicts=true smt_parallel.share_units=false smt_parallel.relevant_units_only=false threads-4-cube -T:30 smt.threads=4 tactic.default_tactic=smt smt_parallel.never_cube=false smt_parallel.frugal_cube_only=false smt_parallel.share_conflicts=false smt_parallel.share_units=false + +threads-4-cube-shareconflicts +-T:30 smt.threads=4 tactic.default_tactic=smt smt_parallel.never_cube=false smt_parallel.frugal_cube_only=false smt_parallel.share_conflicts=true smt_parallel.share_units=false + Ideas for other knobs that can be added: diff --git a/src/smt/smt_parallel.cpp b/src/smt/smt_parallel.cpp index df0f23f4d..2a0963e7c 100644 --- a/src/smt/smt_parallel.cpp +++ b/src/smt/smt_parallel.cpp @@ -157,6 +157,42 @@ namespace smt { m_num_shared_units = sz; } + void parallel::batch_manager::init_parameters_state() { + auto& smt_params = p.ctx.get_fparams(); + std::function(unsigned&)> inc = [](unsigned& v) { std::function clo = [&]() { ++v; }; return clo; }; + std::function(unsigned&)> dec = [](unsigned& v) { std::function clo = [&]() { if (v > 0) --v; }; return clo; }; + std::function(bool&)> incb = [](bool& v) { std::function clo = [&]() { v = true; }; return clo; }; + std::function(bool&)> decb = [](bool& v) { std::function clo = [&]() { v = false; }; return clo; }; + std::function unsigned_parameter = [&](unsigned& p) -> parameter_state { + return { { { p , 1.0}}, + { { 1.0, inc(p) }, { 1.0, dec(p) }} + }; + }; + std::function bool_parameter = [&](bool& p) -> parameter_state { + return { { { p , 1.0}}, + { { 1.0, incb(p) }, { 1.0, decb(p) }} + }; + }; + + + parameter_state s1 = unsigned_parameter(smt_params.m_arith_branch_cut_ratio); + parameter_state s2 = bool_parameter(smt_params.m_arith_eager_eq_axioms); + + + // arith.enable_hnf(bool) (default: true) + // arith.greatest_error_pivot(bool) (default: false) + // arith.int_eq_branch(bool) (default: false) + // arith.min(bool) (default: false) + // arith.nl.branching(bool) (default: true) + // arith.nl.cross_nested(bool) (default: true) + // arith.nl.delay(unsigned int) (default: 10) + // arith.nl.expensive_patching(bool) (default: false) + // arith.nl.expp(bool) (default: false) + // arith.nl.gr_q(unsigned int) (default: 10) + // arith.nl.grobner(bool) (default: true) + // arith.nl.grobner_cnfl_to_report(unsigned int) (default: 1) }; + } + void parallel::batch_manager::collect_clause(ast_translation& l2g, unsigned source_worker_id, expr* clause) { std::scoped_lock lock(mux); expr* g_clause = l2g(clause); diff --git a/src/smt/smt_parallel.h b/src/smt/smt_parallel.h index e6abc05ce..1cbdb5ebe 100644 --- a/src/smt/smt_parallel.h +++ b/src/smt/smt_parallel.h @@ -32,6 +32,11 @@ namespace smt { expr_ref clause; }; + struct parameter_state { + std::vector> m_value_scores; // bounded number of values with scores. + std::vector>> m_weighted_moves; // possible moves weighted by how well they did + }; + class batch_manager { enum state { is_running, @@ -52,6 +57,7 @@ namespace smt { std::string m_exception_msg; vector shared_clause_trail; // store all shared clauses with worker IDs obj_hashtable shared_clause_set; // for duplicate filtering on per-thread clause expressions + vector m_parameters_state; // called from batch manager to cancel other workers if we've reached a verdict void cancel_workers() { @@ -60,6 +66,8 @@ namespace smt { w->cancel(); } + void init_parameters_state(); + public: batch_manager(ast_manager& m, parallel& p) : m(m), p(p), m_split_atoms(m) { }