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

Improvements and Bug Fixes #21

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d1d5a06
Lock crates used for testing
zgrannan Mar 13, 2025
6ea610a
remove build.rs
zgrannan Mar 13, 2025
6287c21
WIP
zgrannan Mar 14, 2025
ca685aa
Two-phase borrows
zgrannan Mar 14, 2025
0f878d3
Appease clippy
zgrannan Mar 14, 2025
4c0b1d5
Polonius fixes
zgrannan Mar 14, 2025
1a841ce
No capabilities on region projections
zgrannan Mar 14, 2025
208f559
Use dyn
zgrannan Mar 15, 2025
8ce9e46
Fix liveness computation for RP graph
zgrannan Mar 15, 2025
35adcbf
Support for havocing of nested references in fn calls
zgrannan Mar 16, 2025
21741af
Render alias edges
zgrannan Mar 16, 2025
8fc8ceb
Graph rendering improvements
zgrannan Mar 16, 2025
5893e62
Support an additional case
zgrannan Mar 17, 2025
22f37ae
another case
zgrannan Mar 17, 2025
efc4768
Fix dotgraph tooltip
zgrannan Mar 17, 2025
acd5185
Small stuff
zgrannan Mar 17, 2025
9546516
Fix visualization
zgrannan Mar 17, 2025
7d5cf5d
add additional test
zgrannan Mar 19, 2025
34e5e5a
cleanup
zgrannan Mar 20, 2025
54fd516
Add a fix for loops
zgrannan Mar 21, 2025
b6769d8
Fix for polonius
zgrannan Mar 21, 2025
8b93951
loop fixes
zgrannan Mar 22, 2025
8775218
update benchmarks
zgrannan Mar 22, 2025
0024efa
typecheck only version for comparison
zgrannan Mar 23, 2025
4f0873b
Save cached lockfiles
zgrannan Mar 23, 2025
c933b13
Add all the lockfiles
zgrannan Mar 23, 2025
80f53cf
WIP
zgrannan Mar 24, 2025
e874765
Try not merging sccs
zgrannan Mar 24, 2025
3bb36f9
Try not merging sccs
zgrannan Mar 24, 2025
34b0f16
ignore crate
zgrannan Mar 24, 2025
ee65309
loop fix
zgrannan Mar 24, 2025
f5cc50a
WIP
zgrannan Mar 24, 2025
f2ebbfa
CI fixes
zgrannan Mar 24, 2025
301920e
CI fixes
zgrannan Mar 24, 2025
bb043aa
Disable validity checks on this crate for now
zgrannan Mar 24, 2025
429cc28
WIP
zgrannan Mar 24, 2025
749e576
Fix Jonas's example
zgrannan Mar 24, 2025
372c278
Mostly fix visualization
zgrannan Mar 24, 2025
e5d2063
Maybe improvements for rpa construction
zgrannan Mar 25, 2025
1c3d5d7
Fix issues Jasper identified
zgrannan Mar 25, 2025
80989cd
Performance improvements for serde_derive
zgrannan Mar 25, 2025
f869106
Fix stupid weaken issue
zgrannan Mar 25, 2025
2f0a3e4
Fix itertools and regex-syntax
zgrannan Mar 25, 2025
ce37652
update benchmark results
zgrannan Mar 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix dotgraph tooltip
  • Loading branch information
zgrannan committed Mar 21, 2025
commit efc4768cd4f19c510e19ec598e2ba41e01d5aa65
35 changes: 12 additions & 23 deletions src/visualization/dot_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ impl DotGraph {
}
}

pub struct DotSubgraph {
pub id: String,
pub label: String,
pub nodes: Vec<DotNode>,
pub rank_annotations: Vec<RankAnnotation>,
}

pub struct RankAnnotation {
pub rank_type: String,
pub nodes: BTreeSet<NodeId>,
Expand All @@ -90,20 +83,6 @@ impl Display for RankAnnotation {
}
}

impl Display for DotSubgraph {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "subgraph {} {{", self.id)?;
writeln!(f, "label=\"{}\";", self.label)?;
for node in &self.nodes {
writeln!(f, "{}", node)?;
}
for rank_annotation in &self.rank_annotations {
writeln!(f, "{}", rank_annotation)?;
}
writeln!(f, "}}")
}
}

impl Display for DotGraph {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "digraph {} {{", self.name)?;
Expand Down Expand Up @@ -151,7 +130,17 @@ pub struct DotStringAttr(pub String);

impl Display for DotStringAttr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "\"{}\"", self.0)
write!(f, "\"{}\"", self.0.replace("\"", "\\\""))
}
}
#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_dotstring_attr_escapes_quotes() {
let attr = DotStringAttr("extern \"RustCall\"".to_string());
assert_eq!(attr.to_string(), "\"extern \\\"RustCall\\\"\"");
}
}

Expand Down Expand Up @@ -276,7 +265,7 @@ impl Display for DotEdge {
let direction_part = match &self.options.direction {
Some(EdgeDirection::Backward) => ", dir=\"back\"",
Some(EdgeDirection::Forward) => "",
None => ", arrowhead=\"none\"",
None => "dir=\"none\", constraint=false",
};
let color_part = match &self.options.color {
Some(color) => format!(", color=\"{}\"", color),
Expand Down
4 changes: 4 additions & 0 deletions src/visualization/grapher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,20 +161,24 @@ pub(super) trait Grapher<'mir, 'tcx: 'mir> {
self.constructor().edges.insert(GraphEdge::Coupled {
source: input_nodes[i],
target: output_nodes[i],
directed: true,
});
let mut j = i + 1;
while j < edge.num_coupled_nodes() {
self.constructor().edges.insert(GraphEdge::Coupled {
source: input_nodes[i],
target: output_nodes[j],
directed: true,
});
self.constructor().edges.insert(GraphEdge::Coupled {
source: input_nodes[i],
target: input_nodes[j],
directed: false,
});
self.constructor().edges.insert(GraphEdge::Coupled {
source: output_nodes[i],
target: output_nodes[j],
directed: false,
});
j += 1;
}
Expand Down
30 changes: 21 additions & 9 deletions src/visualization/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ pub(crate) enum GraphEdge {
Coupled {
source: NodeId,
target: NodeId,
directed: bool,
},
}

Expand All @@ -200,7 +201,7 @@ impl GraphEdge {
GraphEdge::Projection { source, target } => DotEdge {
from: source.to_string(),
to: target.to_string(),
options: EdgeOptions::undirected(),
options: EdgeOptions::directed(EdgeDirection::Forward),
},
GraphEdge::Alias {
blocked_place,
Expand Down Expand Up @@ -238,7 +239,7 @@ impl GraphEdge {
} => DotEdge {
from: source.to_string(),
to: target.to_string(),
options: EdgeOptions::undirected()
options: EdgeOptions::directed(EdgeDirection::Forward)
.with_color("green".to_string())
.with_tooltip(path_conditions.clone()),
},
Expand All @@ -264,13 +265,24 @@ impl GraphEdge {
.with_label(kind.clone())
.with_color("purple".to_string()),
},
GraphEdge::Coupled { source, target } => DotEdge {
from: source.to_string(),
to: target.to_string(),
options: EdgeOptions::undirected()
.with_color("red".to_string())
.with_style("dashed".to_string()),
},
GraphEdge::Coupled {
source,
target,
directed,
} => {
let edge_options = if *directed {
EdgeOptions::directed(EdgeDirection::Forward)
} else {
EdgeOptions::undirected()
};
DotEdge {
from: source.to_string(),
to: target.to_string(),
options: edge_options
.with_color("red".to_string())
.with_style("dashed".to_string()),
}
}
}
}
}
Expand Down