Skip to content

Conversation

@shnarazk
Copy link
Owner

@shnarazk shnarazk commented May 12, 2025

No description provided.

shnarazk added 4 commits May 12, 2025 12:50
-	modified:   src/assign/propagate.rs
-	modified:   src/assign/stack.rs
-	modified:   src/solver/conflict.rs
Change default c_cbt_thr from 100 to 4
Force chronobt to true when chrono_BT feature is enabled by removing
original conditional check
@shnarazk shnarazk self-assigned this May 12, 2025
@shnarazk shnarazk linked an issue May 12, 2025 that may be closed by this pull request
@shnarazk shnarazk requested a review from Copilot May 12, 2025 13:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the conflict handling logic, configuration thresholds, and refactors field access patterns while removing several debug assertions. Key changes include:

  • Changing the conflict condition in the chrono_BT block by hardcoding the 'chronobt' flag.
  • Refactoring field access in conflict resolution, assignment stack, and propagation modules.
  • Adjusting configuration parameters (e.g., reducing c_cbt_thr) and commenting out debug assertions.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/solver/conflict.rs Updated chrono_BT logic, removed match panic branch, and changed conflict handling.
src/config.rs Lowered the c_cbt_thr configuration value.
src/cdb/vivify.rs Commented out several debug assertions.
src/assign/stack.rs Refactored field access from separate arrays to the Var struct.
src/assign/propagate.rs Updated field access and commented out additional debug assertions.
Comments suppressed due to low confidence (4)

src/solver/conflict.rs:45

  • Hardcoding 'chronobt' to true bypasses the intended conflict threshold condition; consider restoring the original logic or documenting why this change is necessary.
let chronobt = true;

src/solver/conflict.rs:70

  • Changing the return value from Ok(()) to Ok(c.rank) alters the function's output and may impact downstream logic; please confirm that this change aligns with the overall API design.
return Ok(c.rank);

src/config.rs:95

  • Reducing the configuration value for 'c_cbt_thr' from 100 to 4 significantly alters conflict handling thresholds; ensure that this change is intentional and supported by test cases.
c_cbt_thr: 4, // 100,

src/assign/propagate.rs:644

  • [nitpick] Ensure that removing this debug assertion does not let invariant violations go unnoticed during propagation; consider implementing alternative safeguards if necessary.
// debug_assert!(!self.var[cached.vi()].is(FlagVar::ELIMINATED));

shnarazk added 16 commits May 13, 2025 00:57
Match on AssignReason to handle BinaryLink and Implication cases
separately. Introduce a `chbt` flag to track chrono_BT cancellation
logic and enhance debug assertions for the l0 assignment.
Comment out conflicting_level assignment and cancel_until call in handle_conflict,
using a direct assert for level equality. In conflict_analyze, filter out
assigned literals when inspecting clauses, simplify the validate_vi! invocation,
and clarify the panic println message.
Remove redundant conflicting_level reset and adjust its assignment in
BinaryLink and Implication to use the higher decision level.
Comment out stale debug asserts in conflict_analyze, add doc comments
for macros, and simplify literal mapping by dropping unused fields.
Comment out the assert_eq! comparing decision levels and add a note
to align with the Implication case logic
handle cases on biclause.
Add debug logs and ANSI color constants
Ensure that during conflict analysis for chronological
backtracking, the negated literal (!l) is pushed to the learnt clause rather than l
Clear magic var-index filters to suppress conditional debug
prints in propagation. Comment out leftover printlns in
handle_conflict and add panic with debug output on unexpected
assignment.
@shnarazk shnarazk added bug Something isn't working enhancement New feature or request labels May 18, 2025
shnarazk added 4 commits May 19, 2025 23:14
Remove chronobt definitions and the assert in handle_conflict,
using compile-time cfg!(feature = "chrono_BT") checks instead.
Inline conditional in cancel_until call to choose the rollback
level and remove the chbt flag and its associated debug assertion.
shnarazk added 5 commits May 21, 2025 19:19
Replace the exploration rate metric with chronological backtrack
percentage (cbt%) in the status output.
Compute cbt% as 100 * num_chrono_bt / num_conflicts and add a new
LogF64Id::ChronologicalBacktrackPercentage variant.
Add a tb_lits_ema field to State and initialize it in Default. In
handle_conflict compute num_bt_lits as the difference in assigned
literals, update the EMA, and replace the old chrono_BT threshold
check with a condition comparing num_bt_lits against 3×tb_lits_ema.
Compute stage_counter as the difference between total learnt and
chronological backtracks, and use it for stage_ended and
prepare_new_stage calls to ensure correct stage management.
Import cdb and compute cfl_lvl_lits via asg.stack_len(). Update
chrono_BT backtracking to use CDB entanglement EMA and c_lvl, and
enforce assign_level+8 < conflicting_level. Simplify stage_counter by
removing subtraction of num_chrono_bt.
@shnarazk
Copy link
Owner Author

01:04:43$ sat-bench -B splr
# 0.16.1, timeout:2000 on iMac @ 2025-05-23T01:04:53
# ~/.cargo/bin/splr (0.18.0-dev1) @ 2025-05-23T01:04:43
solver,       num,                       target,     time
"splr",         1,                 "UF250(100)",   46.244
"splr",         2,                "UUF250(100)",  125.534
"splr",         3,   "3SAT/360  S722433227-030",  144.119
"splr",         4,   "3SAT/360 S2032263657-035",    0.425
"splr",         5,   "3SAT/360  S368632549-051",   32.345
"splr",         6,   "3SAT/360 S1684547485-073",    1.154
"splr",         7,   "3SAT/360 S1711406314-093",   31.368
"splr",         8,   "3UNS/360 S1369720750-015",   66.457
"splr",         9,   "3UNS/360  S367138237-029",  192.003
"splr",        10,   "3UNS/360  S680239195-053",  111.053
"splr",        11,   "3UNS/360  S253750560-086",   71.979
"splr",        12,   "3UNS/360 S1028159446-096",  103.756
"splr",        13,   "[SAT] SR2015/m283,  3553",   24.113
"splr",        14,   "[SAT] SR2015/38b,    448",    2.603
"splr",        15,   "[SAT] SR2015/44b,    609",   40.933
"splr",        16,   "[SAT] SC21/b04_s_unknown",   41.250
"splr",        17,   "[SAT] SC21/quad_r21_m22 ",   25.889
"splr",        18,   "[SAT] SC21/toughsat_895s",   91.464
"splr",        19,   "[UNS] SC21/assoc_mult_e3",   58.917
"splr",        20,   "[UNS] SC21/dist4.c      ",  100.584
"splr",        21,   "[UNS] SC21/p01_lb_05    ",   14.410
"splr",        22,   "[UNS] SC21/shift1add    ",   16.451
med:    43.747, max:   192.003,           total: 1343.051
[I] ~/R/splr (chrono-BT-20250512|✔)
01:13:10$ git log -1
commit b01252d28ef8ff324c4cde79a70bf48a3ee9ca91 (HEAD -> chrono-BT-20250512, origin/chrono-BT-20250512)
Date:   Thu May 22 21:15:49 2025 +0900

@shnarazk
Copy link
Owner Author

21:32:15$ sat-bench -B splr                              
# 0.16.1, timeout:2000 on iMac @ 2025-05-23T21:32:47     
# ~/.cargo/bin/splr (0.18.0-dev1) @ 2025-05-23T21:05:42  
solver,       num,                       target,     time
"splr",         1,                 "UF250(100)",   42.591
"splr",         2,                "UUF250(100)",  123.666
"splr",         3,   "3SAT/360  S722433227-030",  183.421
"splr",         4,   "3SAT/360 S2032263657-035",    1.867
"splr",         5,   "3SAT/360  S368632549-051",   11.289
"splr",         6,   "3SAT/360 S1684547485-073",    4.258
"splr",         7,   "3SAT/360 S1711406314-093",   15.181
"splr",         8,   "3UNS/360 S1369720750-015",   64.948
"splr",         9,   "3UNS/360  S367138237-029",  181.833
"splr",        10,   "3UNS/360  S680239195-053",   98.303
"splr",        11,   "3UNS/360  S253750560-086",   85.860
"splr",        12,   "3UNS/360 S1028159446-096",   82.395
"splr",        13,   "[SAT] SR2015/m283,  3553",   25.338
"splr",        14,   "[SAT] SR2015/38b,    448",   11.255
"splr",        15,   "[SAT] SR2015/44b,    609",   10.565
"splr",        16,   "[SAT] SC21/b04_s_unknown",   68.175
"splr",        17,   "[SAT] SC21/quad_r21_m22 ",   16.420
"splr",        18,   "[SAT] SC21/toughsat_895s",   66.478
"splr",        19,   "[UNS] SC21/assoc_mult_e3",   66.558
"splr",        20,   "[UNS] SC21/dist4.c      ",   94.578
"splr",        21,   "[UNS] SC21/p01_lb_05    ",   20.277
"splr",        22,   "[UNS] SC21/shift1add    ",   10.147
med:    53.769, max:   183.421,           total: 1285.403

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reactivate chrono_BT

2 participants