Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more refactoring #164

Merged
merged 20 commits into from
Mar 8, 2022
Merged

more refactoring #164

merged 20 commits into from
Mar 8, 2022

Conversation

shnarazk
Copy link
Owner

@shnarazk shnarazk commented Mar 6, 2022

Merged into #163 .
In this branch, we

  • change the definition of ProgressASG. It counts the number of literals after restart.
  • change the definition of lbd_of_dp and rename it to literal block entanglement.

@shnarazk shnarazk self-assigned this Mar 6, 2022
@shnarazk shnarazk added the invalid This doesn't seem right label Mar 6, 2022
// self.current_span() - self.scale / 2
// self.current_span().saturating_sub(100)
let num_keep = 2 * (self.current_span() as f64).sqrt() as usize;
self.current_span() - num_keep
Copy link
Owner Author

Choose a reason for hiding this comment

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

This is crucial!!

@shnarazk
Copy link
Owner Author

shnarazk commented Mar 6, 2022

  • Use LBD EMA for clause reduction threshold, instead of lbd_of_dp.
solver,       num,                       target,     time
"splr",         1,                 "UF250(100)",   55.686
"splr",         2,                "UUF250(100)",  179.352
"splr",         3,   "3SAT/360  S144043535-002",  155.951
"splr",         4,   "3SAT/360  S722433227-030",   85.320
"splr",         5,   "3SAT/360 S1459690542-033",    2.738
"splr",         6,   "3SAT/360 S2032263657-035",    3.802
"splr",         7,   "3SAT/360 S1293537826-039",  463.743
"splr",         8,   "3SAT/360  S368632549-051",  457.692
"splr",         9,   "3SAT/360 S1448866403-060", 1023.404
"splr",        10,   "3SAT/360 S1684547485-073",   12.535
"splr",        11,   "3SAT/360 S1826927554-087",    9.427
"splr",        12,   "3SAT/360 S1711406314-093",   94.447
"splr",        13,   "3UNS/360  S404185236-001",  319.707
"splr",        14,   "3UNS/360 S1369720750-015",  260.545
"splr",        15,   "3UNS/360   S23373420-028",  273.857
"splr",        16,   "3UNS/360  S367138237-029",  841.169
"splr",        17,   "3UNS/360  S305156909-031",  226.040
"splr",        18,   "3UNS/360  S680239195-053",  220.256
"splr",        19,   "3UNS/360 S2025517367-061",  723.859
"splr",        20,   "3UNS/360  S253750560-086",  247.073
"splr",        21,   "3UNS/360 S1906521511-089",  417.883
"splr",        22,   "3UNS/360 S1028159446-096",  195.781
"splr",        23,                "SR2015/itox",    4.785
"splr",        24,                "SR2015/m283",  163.800
"splr",        25,                 "SR2015/38b",   19.622
"splr",        26,                 "SR2015/44b",  163.800
median,   187.567,                        total, 6622.274

@shnarazk
Copy link
Owner Author

shnarazk commented Mar 7, 2022

  • disable dynamic_restart_threshold
# ~/.cargo/bin/splr (0.15.0-alpha1) @ 2022-03-07T08:54:40
solver,       num,                       target,     time
"splr",         1,                 "UF250(100)",   60.031
"splr",         2,                "UUF250(100)",  169.467
"splr",         3,   "3SAT/360  S144043535-002",  203.852
"splr",         4,   "3SAT/360  S722433227-030",   30.209
"splr",         5,   "3SAT/360 S1459690542-033",    2.856
"splr",         6,   "3SAT/360 S2032263657-035",    0.838
"splr",         7,   "3SAT/360 S1293537826-039",   41.287
"splr",         8,   "3SAT/360  S368632549-051",  490.787
"splr",         9,   "3SAT/360 S1448866403-060",  604.485
"splr",        10,   "3SAT/360 S1684547485-073",  396.592
"splr",        11,   "3SAT/360 S1826927554-087",   27.314
"splr",        12,   "3SAT/360 S1711406314-093",   36.536
"splr",        13,   "3UNS/360  S404185236-001",  392.439
"splr",        14,   "3UNS/360 S1369720750-015",  159.654
"splr",        15,   "3UNS/360   S23373420-028",  383.166
"splr",        16,   "3UNS/360  S367138237-029",  655.768
"splr",        17,   "3UNS/360  S305156909-031",  193.234
"splr",        18,   "3UNS/360  S680239195-053",  492.061
"splr",        19,   "3UNS/360 S2025517367-061",  818.503
"splr",        20,   "3UNS/360  S253750560-086",  227.351
"splr",        21,   "3UNS/360 S1906521511-089",  281.028
"splr",        22,   "3UNS/360 S1028159446-096",  187.874
"splr",        23,                "SR2015/itox",    4.527
"splr",        24,                "SR2015/m283",   60.068
"splr",        25,                 "SR2015/38b",   60.068
"splr",        26,                 "SR2015/44b",  120.381
median,   178.671,                        total, 6100.376
  • activate
solver,       num,                       target,     time
"splr",         1,                 "UF250(100)",   50.808
"splr",         2,                "UUF250(100)",  172.136
"splr",         3,   "3SAT/360  S144043535-002",  369.158
"splr",         4,   "3SAT/360  S722433227-030",  482.165
"splr",         5,   "3SAT/360 S1459690542-033",   55.599
"splr",         6,   "3SAT/360 S2032263657-035",   19.353
"splr",         7,   "3SAT/360 S1293537826-039",    7.709
"splr",         8,   "3SAT/360  S368632549-051",   67.869
"splr",         9,   "3SAT/360 S1448866403-060",  784.430
"splr",        10,   "3SAT/360 S1684547485-073",  787.418
"splr",        11,   "3SAT/360 S1826927554-087",   13.165
"splr",        12,   "3SAT/360 S1711406314-093",    0.992
"splr",        13,   "3UNS/360  S404185236-001",  770.219
"splr",        14,   "3UNS/360 S1369720750-015",  248.357
"splr",        15,   "3UNS/360   S23373420-028",  739.260
"splr",        16,   "3UNS/360  S367138237-029",  844.280
"splr",        17,   "3UNS/360  S305156909-031",  598.314
"splr",        18,   "3UNS/360  S680239195-053",  444.475
"splr",        19,   "3UNS/360 S2025517367-061", 1162.425
"splr",        20,   "3UNS/360  S253750560-086",  396.732
"splr",        21,   "3UNS/360 S1906521511-089",  488.221
"splr",        22,   "3UNS/360 S1028159446-096",  325.477
"splr",        23,                "SR2015/itox",    4.508
"splr",        24,                "SR2015/m283",   58.068
"splr",        25,                 "SR2015/38b",    4.190
"splr",        26,                 "SR2015/44b",   88.212
median,   286.917,                        total, 8983.540

@shnarazk
Copy link
Owner Author

shnarazk commented Mar 7, 2022

based on 424c803

rst_lbd_thr median total note
1.20 244.450 12200.595
1.25 254.426 11045.300
1.30 247.413 9782.259
1.35 245.250 10903.818
1.40 182.010 6469.939 1 timeout
1.45 175.161 7374.295
1.50 182.832 7050.374
1.55 180.762 7470.484
1.60 204.000 6797.014
1.65 166.834 5684.388
1.70 152.919 6844.662

@shnarazk shnarazk marked this pull request as ready for review March 8, 2022 08:43
@shnarazk shnarazk added type system Changes on types for safety or generality and removed invalid This doesn't seem right labels Mar 8, 2022
@shnarazk shnarazk changed the title Why did it become a bad-branch-20220306 ? more refactoring Mar 8, 2022
@shnarazk shnarazk merged commit ec7f4c0 into periodical-purge-20220228 Mar 8, 2022
shnarazk added a commit that referenced this pull request Mar 12, 2022
…saving and vivification (#163)

* (reduce) implement dynamic reduction rate

* tweak processor parameters

* +Luby reduction

* keep very small learnt clauses after clause reduction

* (search) rename local variables

* the best

* probably better setting

* refactored and tweak parameters

* add splr-luby

* use splr_luby

* ditto

* select reduction targets based on Luby stabilization span; very fast against problems with small N

* new file:   src/solver/stage.rs; introduce StageManager

* splr-luby/src/lib.rs: add more methods

* refactor StageManager and State

* (reduce) revert some changes

* (RestartIF) s/set_stabilization/set_sensibility/

* tiny refactor

* (search) tiny changes

* (search) StageManager controls simplify invocation directly

* types.rs export SolverEvent; implement Instantiate for StageManager

* (StageManager) s/threshold/end_of_stage/

* (StageManager) reorganize local names

* more refactoring (#164)

* Cargo.toml: disable "dynamci_restart_threshold" temporally

* All generated clauses are supposed to be killed unless ...

* splr-ema: version 0.1.1; add `EmaIF::set_value` and `Ema::with_value`

* (search) fix type

* (trail_saving.rs) parameter tuning

* a bad direction

* quick fix

* (Eliminator::eliminate_combination_limit) delete and define as a local constant

* renamed:    src/processor/eliminator.rs -> src/processor/simplify.rs

* rename 'lbd of dp' to 'literal block entanglement'

* move Restarter::lbd to ClauseDB

* move Restarter::asg to AssignStack as `assign_rate`

* splr-ema::Ewa2: add a cache field to hold `1.0 - decay`

* restart.rs: reorganize `cfg(feature = "Luby_restart")`

* remove meaningless dereference of `as_view`

* tweak the initial values of `AssignStack::level` to set valid values to given clauses

* increase `ClauseDB:;lbd` when a new assignment is found

* update the initial value of `rst_lbd_thr` based on experimentation

* increase `ClauseDB:;lbd` when a new assignment is found (part 2)

* cargo test

* parameter tuning; use cfg! macro instead of cfg attribute

* rename 'depG' label to 'entg'

* (num_reducible) parameter tuning

* (num_reducible) tiny parameter change

* AssignStack: add stage_scale

* implement stage-controlled trail-saving

* implement stage-controlled var activity rescaling

* renamed:    misc/search.tex -> misc/algorithm.tex
shnarazk added a commit that referenced this pull request Apr 2, 2022
* a new branch ditch-fast-EMA-20220226

* (types.rs) add `EEA`

* silly typo

* rename EWA to Ewa

* (types.rs) add `Ewa2`

* add splr-ema crate

* tiny change; ready to comparison

* tweak history lengths; comment out fast EMA settings

* Stages that control activity, elimination, reduction, restart, trail-saving and vivification (#163)

* (reduce) implement dynamic reduction rate

* tweak processor parameters

* +Luby reduction

* keep very small learnt clauses after clause reduction

* (search) rename local variables

* the best

* probably better setting

* refactored and tweak parameters

* add splr-luby

* use splr_luby

* ditto

* select reduction targets based on Luby stabilization span; very fast against problems with small N

* new file:   src/solver/stage.rs; introduce StageManager

* splr-luby/src/lib.rs: add more methods

* refactor StageManager and State

* (reduce) revert some changes

* (RestartIF) s/set_stabilization/set_sensibility/

* tiny refactor

* (search) tiny changes

* (search) StageManager controls simplify invocation directly

* types.rs export SolverEvent; implement Instantiate for StageManager

* (StageManager) s/threshold/end_of_stage/

* (StageManager) reorganize local names

* more refactoring (#164)

* Cargo.toml: disable "dynamci_restart_threshold" temporally

* All generated clauses are supposed to be killed unless ...

* splr-ema: version 0.1.1; add `EmaIF::set_value` and `Ema::with_value`

* (search) fix type

* (trail_saving.rs) parameter tuning

* a bad direction

* quick fix

* (Eliminator::eliminate_combination_limit) delete and define as a local constant

* renamed:    src/processor/eliminator.rs -> src/processor/simplify.rs

* rename 'lbd of dp' to 'literal block entanglement'

* move Restarter::lbd to ClauseDB

* move Restarter::asg to AssignStack as `assign_rate`

* splr-ema::Ewa2: add a cache field to hold `1.0 - decay`

* restart.rs: reorganize `cfg(feature = "Luby_restart")`

* remove meaningless dereference of `as_view`

* tweak the initial values of `AssignStack::level` to set valid values to given clauses

* increase `ClauseDB:;lbd` when a new assignment is found

* update the initial value of `rst_lbd_thr` based on experimentation

* increase `ClauseDB:;lbd` when a new assignment is found (part 2)

* cargo test

* parameter tuning; use cfg! macro instead of cfg attribute

* rename 'depG' label to 'entg'

* (num_reducible) parameter tuning

* (num_reducible) tiny parameter change

* AssignStack: add stage_scale

* implement stage-controlled trail-saving

* implement stage-controlled var activity rescaling

* renamed:    misc/search.tex -> misc/algorithm.tex

* bump version up to 0.15.0-alpha2
shnarazk added a commit that referenced this pull request Apr 3, 2022
- Add `RestartManager` and Remove `GeometricStabilizer` #161
- Switch from a decision-making model to a simple dynamics model for restart #164 
- `RestartManager` is stored in `State`.
- revise the definition of 'literal block entanglement' to accumulate only inter-block clauses (1 < LBD).
- Move some EMAs in `rst` to `asg' and `cdb`. #164 
- Rescale var activity after the end of the 2nd-level cycle of the Luby series. #163 
- Restart stages change the trail-saving setting. #163 
- The pre/in processor was demoted as an on-the-fly module.
- Add `StageManager`, which compresses var activity after the end of each 2nd-level Luby cycle in order to diversify the direction of search. #161 
- Drop refinement on trail_saving; restarts reset dependency. It's enough. 
- Change the definition of `ProgressASG`. It counts the number of assigned literals after restarts instead of unassigned ones.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental project type system Changes on types for safety or generality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant