All posts by msoos

On research in general

I am not sure I am qualified to talk about research in general, but I will try to do my best.

To me, it seems that the research community of any given topic is pretty small. The reason for this is many-fold. Firstly, I suspect that the number of qualified individuals willing to work for a relatively small pay (but with many benefits, like flexible schedule, less stress, etc.) is relatively small. Secondly, any given topic usually reaches a maturity level where the subdomains are very clear, and it is very difficult to say anything reasonably good about a subdomain that one is not acquainted with. For instance, Knuth’s books are brilliant, but even he (someone who is like a semi-god in computer science) acknowledges that he simply cannot be an authority on all the topics covered in the 4th volume of his series. (BTW I just bought Vol4F0 and Vol4F1, wainting for amazon to ship now).

Since the research community is small, everyone gets to know one another. This is great since it helps collaboration, but it also might backlash against newcomers (PhD students), and against people generally not well-acquainted with the field, but who genuinely have good ideas that they wish to publish. I guess it’s a difficult integration process, that gets all the more difficult because it rarely happens that someone can simply stay in the same specific subfield for his entire research career. And even if someone stays in the same field, the field may change so much over time, attracting researchers from many distinct research domains, that even an “oldboy” can feel detached from his/her own topic after a while.

Research that deals with practical things is even more fast-moving than other kinds of research. Just a couple of years ago, research on botnets didn’t exist, yet now it seems it is a very rapidly evolving research domain. SAT solvers – I believe – also fall into the category of practical research. Year after year the solvers evolve so much that trying to compare two solvers with only 1-2 years of difference in their release dates seems nonsensical. This is great because there is a lot of “buzz” going on, but at the same time, it feels like a race against time: inspiring at first, but tiring at the end.

Very theoretical domains rarely have this speed of change. For instance, last year at the SAT’09 conference, I saw Stephen Cook, the person who basically invented the notion of NP completeness (I felt honoured just to be in the same room with him, I must say). Although SAT has changed a lot in the past years (many new applications, e.g. cryptography), but the fundamental problem didn’t change – therefore, he never had the ground taken from under him. The ground sure moved, but he still masters it, I am sure.

Oh well, legends. I met Shamir twice. Very kind person. Also, I met Daniel J. Bernstein at EUROCRYPT’09. He looked somewhat shorter and younger than I imagined, and I liked his openness. I met Lenstra at CCC’08. I was so shocked it was him, I couldn’t even say hello – very embarrassing. He was very friendly, and seemed much younger than his official age would suggest. I really want to meet Knuth, but I guess that might have to wait… forever, maybe. Unless I somehow manage to visit Stanford one day, in which case I will definitely show up at one of his classes. They say he is a terrific speaker.

Why CryptoMiniSat can’t use MATLAB to do Gaussian elimination

Some people, who may not have thought through the problem of implementing Gaussian elimination into SAT solvers, seem to think that it’s just a matter of pulling a matlab function into a solver, and the job is done. Let met explain why I think this is not the case.

Firstly, we don’t wish to execute Gaussian elimination simply before the solving, instead, we wish to execute it during the solving. This means the matrix’s columns need to be changed often, since as we move down the search tree, some variables will be fixed, thus the columns need to be cleared, and the augmented column needs to be updated. But how would a matlab function know which column was changed? These functions are made to work on any given matrix, churn through it, and finish with a result. However, in many cases, the change (=delta) between two matrixes is minimal (i.e. 3rd column from right was changed). In this case, the matlab routine will nevertheless start updating the matrix from the leftmost column, essentially taking far more time than an algorithm that knows that the delta was small.

Secondly, let’s assume that a value like “x1=true” has been found by the matlab function. Since we don’t know where this information came from, there is only one way of adding it: put it into the propagation queue. This, however, would be a grave mistake. By not giving the solver a hint where this propagation came from, the solver cannot use this information during conflict generation, and we will loose most of the benefits. In case a conflict is found by our matlab function, the problem is even worse. What caused the conflict? We simply don’t know. We can send the solver back one decision level, and hope for the best, but non-historical backjumping is one of the main reason SAT solvers perform so well. On the other hand, if we keep another matrix, not assigned with the current assignements but updated with all row-xor and row-swap operations (as in CryptoMiniSat2), then we will have all these informations at our disposal, and the integration of Gaussian elimination into the SAT solving process will be correct.

These two reasons should be sufficient to see that matlab, or really any mathematical package that implements Gaussian elimination is not useful for CryptoMiniSat. Yes, some of their “tricks” could be used, and I think are already being used.

PS: As a side-note, many have told me that the matrixes are sparse, and so I should use a sparse matrix data structure. Although the matrixes are indeed sparse, they are also miniscule. On very small matrixes (<200-300 columns) there is simply no point in doing sparse matrix elimination. Not to mention, that since two different matrixes need to be stored and handled, it is impossible to find a pivot that is optimal for both, thus the density of at least one of the matrixes must evolve faster than optimal, leading to an early switch to a dense matrix representation.

Could monomials be handled natively from SAT solvers?

I recently got a question that intrigued me:

I am new to this SAT solving world but I was wondering whether you thought considerable speedups were possible for crypto type problems (multivariate polys over GF(2)) by simply never converting the problem to cnf at all and thereby avoiding the combinatorial explosion that results in the conversion process. That is using the original xor formulation.

First of all, the question is a follow-up to xor-clauses: they implement XOR-s natively. Using them avoids a number of problems relating to the increase of variables. Why not implement monomials (i.e. “a*b” or “a*b*c”, where “*” is binary AND and variables are binary) natively? They are the only thing left to do. Personally, I am not overly optimistic about them, though. Let me got through some of my reasons here.

Firstly, the “exponential explosion” expressed in the question is in fact much less existent than people tend to think. The reason is that the intelligent variable activity heuristics, unit propagation, and conflict generation tend to take care of a lot of potential problems. Since the propagation of a variable will entail the propagation of many others (it depends, for crypto, around ~100), there is no real explosion, since there is not really 2^n, but more like 2^(n/100) combinations that need to be explored. This argumentation takes away some of the potential benefits that native monomials could bring.

The real problem, though, is the following. By moving monomials into cryptominisat and thus potentially speeding up the solving, conflict generation could become much more complex. So, if moving to an internal monomial representation entails making a mess of conflict generation, then using monomials internally may only make the solving slower.

Another reason that native monomials may not speed up solving so much, is that a lot of clauses inserted when converting monomials are binary clauses, which are extremely well dealt with in the CNF world — it would be hard to do it any better.

As a last, but very minor point, using monomials would increase the complexity of the program, which would mean not only a lot of man-hours lost debugging it, but also a loss of performance due to a (probably non-negligible) increase of instruction cache misses.

Oh well, so those are my reasons. I would be interested if someone has some comments on these, though.

CryptoMiniSat v2

Lately, I have been working a lot with CryptoMiniSat, to get it up and running for the 2010 SAT Race, held by Carsten Sinz. Getting CryptoMiniSat fast and bug-free has been a long and winding road. I can now understand the difficulty of choosing magic parameters that these SAT solvers make use of regularly. As I have added ~6000 lines of code to a codebase of ~1500, you can probably imagine the number of magic constants that I had to come up with. Worst of all, these constants interact in non-intuitive and sometimes in a fully “magical” manner.

To test my choice of magic constants, I have been running experiments on the Gird5000 project of French universities. It is quite easy to get access to Grid5000 if you work in a French university, and it is surprisingly easy to run experiments. On the other hand, interpreting the results of such experiments is not so easy :) However, CryptoMiniSat is coming along. On crypto examples I think we are unbeatable. When it comes to other examples, we are good, but we will see how the new MiniSat (yes, it’s coming!) and precosat will do. Apparently, the GLUCOSE people are also planning to enter the competition, so the race will be very interesting. Fingers are crossed that CryptoMiniSat will finish somewhere in the top 3 :)

There are some “secret” improvements that I have made the past couple of months, and there are some open secrets. I tried to incorporate the GLUCOSE restart heuristic, and XORs are automatically detected (XOR clauses are no longer neccessary, but they are of course supported!). This means that CryptoMiniSat is now a plug-and-play experience for all the crypto-folks. I have tested the solver with a good number of crypto problems, and the speedup relative to MiniSat is on the order of 2-50x, depending on the problem.

The new CryptoMiniSat will be released when the SAT Race starts and everyone’s executables have been freezed. I will then detail all the new features. Until then, let me just run a couple of more experiments on that cluster :)

Why do I use Linux?

I used to be quite an expert on Windows, I even used to hang out on the #windows-help IRC channel. So why do I use Linux uniquely nowadays?

First, I tried Linux out of curiosity. What made me interested initially is that I am a control freak: I like to know what happens with my computer. With windows there were always a billion things running in the background, and I had no clue what they were doing. With linux you always know what does what. “man programname” and you have a complete documentation. This was a real kick for me. I could read these manuals for days, literally. I hate when things “just work” – I want to know *why?*. Simple curiosity. However, this doesn’t explain why I have stuck with Linux for such a long time.

The reasons I have stuck with GNU/Linux are the following:

  • No adware/spyware/viruses since all programs in all Linux distributions are installed from signed packages
  • Huge amount of available documentation and a howto for everything. Got stuck? Just read up
  • No vendor lock-in. Wanna change from KDE to GNOME? From KOffice to OpenOffice? No problem.
  • Faster than Windows and accompanying proprietary software (Office, MSN messenger, Adobe PDF reader, etc.)
  • More customisable than Windows. Proprietary applications mean that if you change your colorscheme in Windows, almost none of your applications will have that colorscheme. If you do something different than most people (e.g. keycombinations), in Linux, you can easily change the program to suit your needs.
  • Installing applications is fast and easy: Tired of answering the 20 questions that all installers ask you in Windows? So am I. In Linux, just launch Synaptics, type in what you want to do, e.g. “instant messaging”, and you are presented with all applications offering that service. Double-click on any and you are done (this is not a joke, it’s really that simple) It’s safe, fast, and there are no questions asked.
  • Uninstalling is fast and efficient. Uninstalling AOL messenger is not only terribly difficult, but also leaves a lot of stuff behind. AOL browser? AOL as default webpage? And this not only applies to AOL. Windows messenger will change your default webpage when installed. Uninstalling it doesn’t reverse that.
  • No junk software. Are you, too, tired of all the popups that “The full version of this software offers this-and-that, buy it now!” ?
  • Software upgrades are seamless. One interface for all upgrades. You don’t need 20 upgrade programs running non-stop (Java nags you non-stop? Adobe PDF Reader naggings? Windows upgrade naggings?)
  • Does all that is possible, not all that vendors want to be possible. Print to PDF? No problem. Backup your DVD? No problem.
  • Cheap, or even free. Tired of all the money you have to pay, and still it doesn’t work? Well, in Linux it might not work, either, but if you payed a little bit, you can call the service desk (and they are helpful), or you can ask you local linux geek (he will be all too helpful), or you can just read up on the documentation (it’s good and well-written)
  • If you have found a problem in the program, there are always helpful developers to correct the problem. They listen to what you have to say, and personally thank you for your comments. Try to do that with any proprietary software: they will send you a pre-written “thank you” notice, and promptly ignore you.

Of course there are many other, less practical and more theoretical reasons for why I like linux: Free as in not locked-in, total control, possiblity of tweaking things, the availability of developer discussions through open mailinglists, the number of programs to do the same thing (i.e. choice), and many others.

To use Linux day-to-day takes a bit of courage. Your friends will be annoyed that they can’t use the ultra-cool (but ultra-useless) features of their newest MSN messenger when they talk to you. And there will be other problems. You might be forced to use Windows at work, or you might need to use a software that doesn’t run under the free windows emulator, wine (though most software does), and you will have to find a replacement. And you won’t be able to play the newest game out there (but you can play World of Warcraft, and most other big games, like Diablo, on Linux).

The advantages are huge, however. You simply won’t understand how can your friends get a malware infection every day, why their bankaccounts get overtaken once a year, and why on Earth does it take their computer 5 minutes to boot up. You will sleep tight, knowing full well that your computer is safe from all people who might do you harm, be them malicious (malware writers), or be them proprietary companies restricting the use of the music or video you just bought. And you will know that if some problem comes up, there will be tons and tons of free tools and lots and lots of developers ready and willing to help you out just for the kicks. You are not alone.