-
Notifications
You must be signed in to change notification settings - Fork 151
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
KCFG optimisation-on-creation #4710
Conversation
@PetarMax this needs to be a new |
This works perfectly across threads. Understood re signature of |
Also, I am not sure that we can do anything beyond this edge subsumption in the context of branch parallelisation. The leaf node identifiers do get preserved, though... |
@ehildenb Is it looking better now? |
I can confirm that this change decreases the running time of our longest, most intensive engagement test by ~20%. |
20% is pretty significant, and it indicates that somehow maintaining a proof becomes more and more expensive as the number of nodes (or the depth of the tree) grows. What operation could be the cause of this? |
It could be the KCFG traversal, understanding pending nodes, understanding next steps, and then doing all this in parallel for a number of threads... |
It would be worth it to profile it and see where the expensive routines are. I bet we can get a lot of that 20% shaved off with some targeted optimizations.
We still need to be able to maintain the old behavior for Simbolik, which relies on being able to see every node that is stored for opcode cuts. Minimization basically doesn't play nicely with cut-rules. |
Yes, this is what we're doing :) and yes, this behaviour wouldn't be forced, it would be non-default and activated with a switch. Hmm, could we have a |
depth += in_edge.depth | ||
rule_labels = list(in_edge.rules) + rule_labels | ||
next_node_logs = logs[node.id] + next_node_logs if node.id in logs else next_node_logs | ||
self.remove_node(node.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may cause problems in the future if the same node is referenced by a merged edge somewhere, for example. Maybe best to just keep the node? But that also could cause problems with how we display the KCFG....
So maybe best to just note that this could be a source of issues if the nodes is already referred to somewhere else. It may also warrant making a safe_remove_node
option, which checks that there aren't any references to the node before removing it. Can you make an issue about that and link it back to this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this final version was tested downstream to work with the examples we care about. Looks good.
This PR introduces an optional optimisation that performs, as the KCFG is created, the already implemented edge minimisation procedure, in which two consecutive edges are subsumed into one.
In this way, we generate much smaller KCFGs, speeding up very large proofs.