Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 267504

Summary: [planner] Encoding stability
Product: [Eclipse Project] Equinox Reporter: Pascal Rapicault <pascal>
Component: p2Assignee: Daniel Le Berre <leberre>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, leberre
Version: 3.5   
Target Milestone: 3.5 M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Pascal Rapicault CLA 2009-03-07 11:07:27 EST
The order of the constraints in the SAT encoding depends on the VM. In order to help us benchmark better we need to ensure stability in the order of the constraints.
Comment 1 Pascal Rapicault CLA 2009-03-07 11:25:28 EST
We have code in the Projector (~ line 147) that sorts the IUs when in debug mode. I have commented out this code and run again with this and see even worst number because we now have to sort...
I'm currently not comfortable releasing this because everyone takes a hit.

Daniel, could you describe how much time does the solver spend finding that there is a conflict, over the time spent computing the explanation. I think this would help shed some lights.
Comment 2 Daniel Le Berre CLA 2009-03-07 13:45:00 EST
Detection that there is a conflict is immediate (it is done without search in those examples, just by unit propagation).

The time spent is on applying the explanation algorithm:

Real explanation time:800
Time to compute conflict: 1329

Real explanation time:2343
Time to compute conflict: 2874

Real explanation time:1217
Time to compute conflict: 1691

Real explanation time:13908
Time to compute conflict: 14387

It takes roughly 500ms to translate the computed explanation into Status, etc.

I agree that sorting the IUs might not be the right solution.

What is important in the explanation algorithm is the order of the extra variables used for the explanation computation. I will investigate tonight if there is a way to have a better order than what we have now.

BTW, I will need for that purpose an order on the possible explanations.
(that way, I could for the order of the explanation analysis, independently of the constraints order).

There are only two reasons for a conflict:
- I ) a missing requirement
- II) a violated singleton constraint

For the second case, there are two possible situations:
- II.1) it appears between one already installed IU and one that the user would like to install
- II.2) it appears between two IU to install

In case I and II.1, it means that the IU to install involved in the conflict cannot be installed while in II.2 one of the two IU cannot be installed.

So I consider that the preferences in the explanations should be:
I/II.1/II.2

I prefer to gather first the missing requirements because the explanation is often simple.
Then I prefer the singleton violation between an installed IU and an IU to install because I know that the IU cannot be installed.

Finally, I am interested in top conflicting IUs, but I cannot decide which one should be dropped.

Does it makes sense?
Comment 3 Pascal Rapicault CLA 2009-03-08 00:13:39 EST
With the new set of SAT4J jars (v20090308) I have the following results:
Time to compute conflict: 888
Time to compute conflict: 1009
Time to compute conflict: 6815
Time to compute conflict: 4087
Comment 4 Pascal Rapicault CLA 2009-04-08 22:19:08 EDT
I don't think we have more to do on this. Do you agree Daniel? If so, please close.
Comment 5 Daniel Le Berre CLA 2009-04-09 02:58:58 EDT
The current behavior has been stabilized on SAT4J side.