rust-lang / rust-lang/polonius
experiment with bespoke graph representation
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.7k
- Forks
- 86
- PR merge metrics
- No merged PRs in 30d
Description
Copying some comments from NLL dropbox paper document for now:
Current analysis is slow primarily because it is computing the full transitive closure of the subset and requires relations at each program point. These are represented as tuples. This is O(N^2) storage and very inefficient.
The reason we do this is because of the way that we want to kill constraints when we find that regions are dead. The trick is that we want to preserve their transitive effects. So for example:
- If you have
subset(Ra, Rb)andsubset(Rb, Rc)at some program pointP:- then we can also conclude (by transitivity) that
subset(Ra, Rc)
- then we can also conclude (by transitivity) that
- If
Rbis dead at the successor point Q (butRaandRcare still live):- we still want
subset(Ra, Rc)to be known at Q.
- we still want
We currently handle this by generating everything and filtering. But you could imagine instead not using differential-dataflow and instead representing graphs as a set of edges (perhaps built using some persistent vectors, a la the graph impl in rustc). When we remove the edges for a given node, we would "reconnect" the incoming/outgoing edges. We can do this with varying degrees of efficiency.
The reason I mentioned using a persistent graph is that most nodes just clone the set of edges from the point before, and a persistent implementation would make that cheap. But there are lots of knobs to consider turning here.
(Ok, this issue is a bit vague, but I'm trying to capture and brainstorm here.)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing representation of the subset and requires relations and the transitive-closure computation described in the issue. Compare the current differential-dataflow approach with the proposed persistent graph alternatives. Done would require a defined representation and evidence that it improves storage or analysis performance without losing transitive effects when regions are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100