-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add an optional Soufflé backend #179
base: master
Are you sure you want to change the base?
Conversation
b8d1f90
to
3f5f3d7
Compare
...instead of bare indexes. This makes some macros easier to write.
3f5f3d7
to
cbd8c78
Compare
be46dbd
to
dfbf34b
Compare
@lqd @nikomatsakis Ready for review 😟. It looks like there's a bug in the optimized variant of the datalog rules. I'll try to figure it out. |
a029ed5
to
adf933c
Compare
This breaks the cyclical dependency between `polonius-engine` and `polonius-souffle`.
adf933c
to
e77e9c9
Compare
It's starting to seem like there's a typo or a transcription error in the optimized rules. Both 🍮 and 🐸 compute the same number of Datafrog
Souffle
If the problem really is that they were written down incorrectly in |
There was this datafrog join using another join's intermediate relation, that I thought we may have commented incorrectly, but it seemed equivalent to the datalog rules, and unrelated to It's been so long that I don't remember if we actually tested these opt rules in soufflé (my recollection is: I probably only did use the Naive rules, but maybe Niko did use the Opt ones), and the old datalog version of the opt variant I have looks too old/incorrect (at some point there also were differences between Naive and Opt in some edge cases, and these bugs have since been fixed). I'll also try to look at these rules. |
I've noticed this:
Maybe this rule wasn't extracted because of the dying_can_reach_origins(origin, point1, point2) :-
dying_region_requires(origin, point1, point2, _loan). |
Ah, good find! I started looking for more missing rules and found that the base case for To extract the datalog, I just stripped everything that wasn't a comment from the relevant part of the |
29a8704
to
d8d4ec9
Compare
🎉 |
With the old (default) resolver, you need to pass the `polonius-souffle` feature to each workspace crate individually when compiling.
- Filter reflexive subset relations - Mark placeholder regions as live
d8d4ec9
to
2ce712d
Compare
This comment has been minimized.
This comment has been minimized.
11e1a00
to
11e25f5
Compare
11e25f5
to
d90fed1
Compare
Allows
polonius
to execute Datalog programs directly using Soufflé.In the long term, that means:
subset
.This PR binds to Soufflé's C++ interface using
cxx
. As a result, we can initialize relations and extract results entirely in memory; no need to write intermediate results to disk. If I were to start from scratch, I might choose generate Soufflé binaries instead of libraries and serialize everything ontmpfs
. It took a lot of work to getcxx
, Rust, and the generated C++ code to play nicely.This adds an
Engine
enum that can be used to select between the 🐸 and 🍮 (no "souffle" emoji unfortunately) backends.Algorithm
variants that are implemented in 🍮 take anEngine
field now, which can be changed to 🍮 by adding the-Souffle
suffix to the-A
command line argument or env variable. 🍮 is gated behind a feature flag (polonius-souffle
) and is off by default, since it requires a workingsouffle
installation. The frontend types will still be available when the feature is disabled, but trying tocompute
using them will cause a runtime panic. Both configurations (with and without the feature) are tested on CI.We do comparison tests on the output of the Souffle versions of
DatafrogOpt
andNaive
.LocationInsensitive
is a no-brainer, I just haven't copied those rules over yet.This is not the cleanest integration, and I wish I could share more code for dumping intermediate facts, checking results, etc. I think it's okay for an MVP though.