-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Change flattened dependency graph from DiGraph<NodeId>
to DiGraph<SystemKey>
#20172
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
base: main
Are you sure you want to change the base?
Conversation
Thoughts on EDIT: Since it's only a 16 line file now, I could also co-locate it in the same file as |
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 appreciate the explictness about systems vs system sets. I think this is a net improvement as a result.
|
||
impl From<CompactNodeIdPair> for (NodeId, NodeId) { | ||
fn from(value: CompactNodeIdPair) -> Self { | ||
let a = match value.is_system_a { |
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.
Oh, I didn't notice the match bool
before. It was like that before, and it does seem reasonable here for symmetry with the reverse impl, but ... but ... if
!
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.
match
on bool good! if
bad!
Objective
Semantically, the fully flattened dependency graph never contains
SystemSetKey
s, so lets encode that into its type.Solution
GraphNodeId
trait and its related traitsGraphNodeIdPair
andDirectedGraphNodeId
.CompactNodeIdAndDirection
andCompactNodeIdPair
.DiGraph
andUnGraph
with a newGraphNodeId
N
type parameter.DiGraph
/UnGraph
to take aGraphNodeId
type parameter.Graph::try_into
function to help us convert fromDiGraph<NodeId>
toDiGraph<SystemKey>
. Does it look a bit gnarly? Yea.Testing
Re-using current tests.